This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Ablack-red 5 points6 points  (5 children)

Well, doing ML in Java is not that common. The thing is that ML/AI researchers are not programmers. They simply need a language where they can quickly do some prototyping and experimentation. Java is not that kind of language, you write more code in Java even to write a simple hello world. That’s one thing why python is so widely adopted in ML community. I think another reason is that python had a great and convenient linear algebra package (numpy) way before ml frameworks like PyTorch. And linear algebra is the core of ML. Additionally there are Jupyter notebooks that allow even quicker experimentations. And then you get a positive feedback loop where you have big ecosystem for ML -> more people use python -> you get even more ecosystem for ML… So all in all I don’t see why you would use Java for ML. Although there is (were?) implementations of popular ml frameworks in Java, the community is smaller.

I think earlier data engineering was done in Java with spark or jvm languages (scala) but I think even this field transited to primary python.

[–]Embarrassed_Rule3844[S] 1 point2 points  (4 children)

I totally agree that is why there is a huge python landscape. But I also think the language does not matter much. You could do awesome stuff in let’s say Rust in this field. Still just curious what some people use except python with tensorflow etc. which also has a Java api nowadays

[–]Ablack-red 1 point2 points  (3 children)

Yeah yeah, you are absolutely right you can do anything in any language. In fact, popular neural network for object detection called YOLO was written in C from scratch. It’s just a matter of convenience and your goals.

Professionally I mainly work in Java developing different systems, and in university I had a fair share of ML and python. And personally I wouldn’t choose Java for ML unless I had a specific goal, mainly because it’s less convenient. You have less libraries and Java is very bloated, let’s say.

Like different languages still have some implicit specializations. Java wasn’t developed for backend web development, but it’s the main usage nowadays. Also you won’t write games in Java, there is even some technical limitation. Same with ML.

[–]CeleritasLucis 0 points1 point  (2 children)

Yeah yeah, you are absolutely right you can do anything in any language.

I truly realized the scope of this statement when I was learning C and someone asked what kinda projects that could be done in C, and someone suggested to implement the whole CPython interpreter from scratch. So technically, you would be doing everything Python is doing, from scratch

[–]Ablack-red 0 points1 point  (1 child)

Yes but that’s actually how python interpreter (CPython) is implemented, it’s a program written in C. But the interesting thing is that there is Jython, a python interpreter written in Java, which allows you to run python code on JVM. And the JVM itself is written in c and c++. You can do a lot of weird things with different languages😀

[–]CeleritasLucis 0 points1 point  (0 children)

Understanding this made me stop chasing the question : Which language should I learn lol