SD4J – Stable Diffusion pipeline in Java using ONNX Runtime
github.com
github.com
For writing ONNX models from Java we added an ONNX export system to Tribuo in 2022 which can be used by anything on the JVM to export ONNX models in an easier way than writing a protobuf directly. Tribuo doesn't have full coverage of the ONNX spec, but we're happy to accept PRs to expand it, otherwise it'll fill out as we need it.
edit: Someone should really take the time to highlight all the innovative machine learning research happening in Java. The original implementation of t-SNE [1] was written in Java. Most NLP researchers have heard of CoreNLP [2], also Java. One of the earliest ML libraries, Weka [3], was written in Java and is still actively developed at the University of Waikato. Noteworthy research on ML4Code specifically targets the Java language [4]. There's a bunch of published sketching algorithms for Java (e.g., DataSketches [5], t-digests, ddsketch et al.), featured in an invited talk [6] to NeurIPS this year. Just to name a few off the top of my head.
[1]: https://github.com/lejon/T-SNE-Java
[2]: https://github.com/stanfordnlp/CoreNLP
[3]: https://www.cs.waikato.ac.nz/ml/weka/
[4]: https://openreview.net/pdf?id=bUDmRzeh3PT
I remember being taught using 6 in high school around 2009.
There were very many important changes in the meantime over that timeframe, but generics and lambdas fundamentally changed how you use the language - Java 4 is not the same language as 5, same between 7 and 8. This is not the case for the 6 and 7 releases.
Therefore its popularity stands in the way of buzzier languages. Gotta point out Java's warts to shoehorn in discussion of your pet language.
Personally, I think Java is very poor language. I wish I could program in something like Common Lisp or even Clojure. And yet every single corporate Clojure project I have seen was a total disaster.
I think what happens is for new developers, Java does not come as just language. It comes with a huge ecosystem including books, Stack Exchange/Overflow posts, frameworks, certifications, etc. All of this gives developers a basic template for how an application should look like.
And, paradoxically, all of this is aided by Java which is a poor, repetitive language.
When I open a new Java project, I can easily identify all of the parts. Enough of the structure is a simple copy and paste of another project, that whatever is different must still follow certain rules.
Project that do not follow this blueprint tend to be flops and huge maintenance problem.
So why is that? I think most developer underestimate that structuring an application is a skill in itself. When given a preexisting structure to fill in with functionality, they are following good, established structural patterns that are instantly recognizable and understandable by the community of Java developers. This makes it easy for new people to not get completely lost in even a large application.
When the same Java developers decide to make something in Clojure, they are now responsible for structuring their application without any clear guidelines or established patterns on how to do it. And for some reason they tend to not understand is that their existing experience has not taught them what to do in this situation.
All Kotlin code I have seen in the past (and I saw a lot of it) is line by line transposable to Java. It is Java written in Kotlin by Java developers. If there are Kotlin features that really make it unique -- I have never seen any of the put to good use other than a tiny bit of syntactic sugar.
I definitely have seen no productivity or quality of results increase of any kind.
You can fuck up an application in any language. And you can write clean code in any language except the most hostile. No programming language has ability to make the programmer write clean code. I can write nice object oriented code in ANSI C. It is all in our heads.
The single biggest problem with Kotlin is that, to be able to program Kotlin, you need to also know Java.
So now you need a candidate to know TWO languages to be productive. That really makes my hiring much easier...
Another problem is there are some Java devs pushing Kotlin aggresively. And I also have lots of developers who do not know Kotlin. So the equation is make a small portion of developers maybe a bit more happy (and I don't believe they will be more productive) and make the rest of developers much less productive.
It feels to me like all programming languages are starting to converge in many ways.