4 ms·
It is pretty impressive as a project, but I am not sure I get the point. JVM already exists, so we can run Java programs. Go exists so we can compile Go program
by deitcher 12y ago
It is pretty impressive as a project, but I am not sure I get the point. JVM already exists, so we can run Java programs. Go exists so we can compile Go programs. What do I get from running a Java program in a Go-built JVM over a C-built JVM?
- jaytaylor 12y agoMinor note: go is now self-hosted which means it is no longer wrapped in c.
- Leon 12y agoThere aren't always great reasons behind great hacks. We can appreciate them for the ideas they present, the interesting implementation of features, and the what-if's that can come from expanding the hack further.
- i_s 12y agoDepending on how it is done, one benefit could be you'd be able to use java/clojure/scala to build command line tools, something few people do now because of the slow JVM startup time.
- sitkack 12y agoThe JVM isn't too slow for command line tools. What is too slow is the size of the executables and the amount of upfront work that secondary runtimes are doing. I can't say anything for Scala, but the startup time of Clojure has nothing to do with the JVM. Pure Java Hello World launches in 90ms on my machine. Jython Hello World takes 1.3 seconds. EDIT: to address all the comments. I am saying the JVM isn't _too_ slow for command line applications. Not ideal, but tolerable. I just tested the startup time of a robovm'ed Hello World: 23ms FWIW. And the resulting executable isn't exactly light weight. $ otool -L Main Main: /usr/lib/libSystem.B.dylib /usr/lib/libiconv.2.dylib /usr/lib/libsqlite3.dylib /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation /usr/lib/libstdc++.6.dylib $ du -sch Main 11M Main
- zorked 12y agoAll C implementations of languages that exist on the JVM start fast. All JVM implementations are slow. How is this not a JVM problem?
- pjmlp 12y agoHave you ever used Aonix, Websphere Real Time, JamaicaJVM, RoboVM, ExcelsiorJET, JikesRVM, OS/400 JVM, CodenameONE JVM,...? If not, then don't say "All JVM implementations are slow".
- saurik 12y agoA pipeline of Java hello worlds then might take half a second just to spawn the multiple JVMs. It is also important to note that the work a JVM does scales in the number of classes you load: running "saxonb-xslt" with no arguments (so as to get the usage block) takes 215ms "hot" (1485ms "cold") on my relatively beefy server. In comparison, running "xsltproc" with no arguments takes 7ms "hot" (113ms "cold", though my cold numbers for this may be artificially low as maybe the JVM warmed up some C library xsltproc also happens to be using; the number doesn't feel wrong, though, given the hot times, which are perfectly reproducible, btw, as nothing else is happening on this computer). If I actually tried to use Saxon (so it had to load and link even more classes related to the transformations) the slowness would just become more and more painful.
- sitkack 12y agoThose numbers seem totally plausible. I am not advocating for `ls` to implemented on the JVM. But for most usages, there is not a huge problem implementing CLI programs on the JVM, but some things like loading a huge AoP framework is out of the question.
- steveklabnik 12y ago> JVM already exists Actually there is no single "the JVM," even today. Various JVMs exist, commercial and free, that have their individual strengths.
- bratsche 12y agoSometimes we build things just for the experience, just to learn as we build.
- danellis 12y agoI've noticed from HN headlines that there's an odd focus on what programming language something is written in. Often they'll take the form of "A <thing that is already common> written in <recently popular language>", rather than a real USP. It's especially odd from a community that places so much emphasis on the importance of a good pitch.
- ovis 12y ago> a community that places so much emphasis on the importance of a good pitch A subset do, for sure. But some of us are just playing around.
- fnordsensei 12y agoI absolutely understand where you are coming from, but then again we are enthusiasts. It has some kind of relevance to us on the basis of being a novelty. Compare, "car engine runs on plant sap".
- Iftheshoefits 12y agoThink of it in terms of a typical 13 year old boy acting out, e.g. by climbing real high in a tree or doing tricks on his bike, to impress friends/girls. That's all this shit is, except it is targeted to a slightly different audience who will go out of their way to deny it. Not saying that applies to this particular project, just to your comment more generally. Sometimes it is done just to learn, but it seems a bit silly to do it in public as it were.
- mrits 12y agoI think it is closer to a 13 year old doing something that they have spent years practicing, such as a piano recital.
- Iftheshoefits 12y agoSure, sometimes it is, undeniably. But given how immature in general this industry is--and that means both in terms of the span of its existence and in terms of the age of practitioners--it sure is suspicious how often X-that-has-been-around-forever-implented-in-Y comes up. I mean how likely is it that "Hashtable/JS interpreter/JVM implemented in C" is going to be a big hit on HN? Not often. But since Go, JavaScript, and other insert new hotness language here are popular things somehow it's more interesting to retread old ideas with them. That's not the sign of a young master demonstrating his skill, it is the sign of an immature field that hasn't figured out how to distinguish what is new and important from what isn't. It's unfortunate in particular for the people who do do these projects for fun or learning. These people have their work hijacked for a showoff culture's mutual backpatting.
- jray319 12y agoThere have been many different VMs implemented on top of JavaScript VM, and it is to be able to run codes written in different languages on JavaScript VM without porting effort. It is useful since there are systems only running JavaScript programs, such as web browsers. I guess the purpose of this project may be justified similarly as Go started off from frustration with JavaScript and Go enthusiasts are dreaming that it would replace JavaScript (or get a spot in every browser) in the future.