News for hackers. Stuff that matters.
Re:Java Virtual Machine in pure Node.js by bane on Wednesday October 30, 2013 @03:50PM (#6642860)
Really cool hack, and yet I can't help but think that the mile-high software stack between the developer and the CPU continues to grow meaning we're stuck in a perpetual game of filling up spare CPU cycles with nothing in particular.

I'm sure I'll see a demo showing off something that barely runs on modern hardware that we were more than capable of running with good performance in 1990.

sigh I feel like I'm being such a Debbie-downer even if this is a really cool hack.

Re:Java Virtual Machine in pure Node.js by j_baker on Wednesday October 30, 2013 @06:49PM (#6644030)
Now we just need to wait for someone to run Rhino on this so we can have Javascript hosting a JVM which hosts Javascript.
Re:Java Virtual Machine in pure Node.js by kodablah on Wednesday October 30, 2013 @09:22PM (#6644694)
Nashorn would be more appropriate once it is released. It leverages the JVM dynamic invocation instructions better IIRC.
Re:Java Virtual Machine in pure Node.js by sitkack on Thursday October 31, 2013 @03:09AM (#6645598)
And Nashorn should jit to bytecodes, which should jit back to JS. Like realtime closure compiler.
Re:Java Virtual Machine in pure Node.js by noptic on Thursday October 31, 2013 @05:47AM (#6645932)
VMception?
Re:Java Virtual Machine in pure Node.js by retube on Thursday October 31, 2013 @06:14AM (#6645997)
That actually made me giggle
Re:Java Virtual Machine in pure Node.js by macspoofing on Wednesday October 30, 2013 @05:24PM (#6643507)
>we're stuck in a perpetual game of filling up spare CPU cycles with nothing in particular.

There are lots of CPU cycles, and plenty of cases where trading a few for increased flexibility makes a ton of sense.

Re:Java Virtual Machine in pure Node.js by EpicEng on Wednesday October 30, 2013 @11:31PM (#6645057)
Not to the users who sit around watching swirlies and beachballs. They don't care what rad, flavor of the month framework you used to build your software. Websites and desktop apps were more responsive in 1998 than they are today*

*In general and not supported by facts of any kind other than my own anecdotia.

Re:Java Virtual Machine in pure Node.js by noptic on Thursday October 31, 2013 @06:02AM (#6645970)
users do care about the tools they know. Our perl based webapp must interact with java, windows services, ... you name it.

You should not use virtual runtimes for everything your application does but using them in overnight cronjobs is ok.

Right now we are working on some middleware because the customers wants to use existing reporting tools(c#/windows only) with our product(perl/linux).

>Look how fast and simple this is! > >Yeah nice so how do I genearte my <wateva> reports? > >Well we can do the same with our <another> reporting service! > >No I want to keep my <goodOldstuff> based reports can you integrate those?

Re:Java Virtual Machine in pure Node.js by sitkack on Thursday October 31, 2013 @03:07AM (#6645596)
beachballs are for IO. You should have an SSD and banish the beachball.
Re:Java Virtual Machine in pure Node.js by reirob on Wednesday October 30, 2013 @06:28PM (#6643911)
I feel exactly the same. But there are some cool projects around that do thinner the layers between software and hardware. Look for example Extempore (http://extempore.moso.com.au/) or Hylas-Lisp (https://github.com/eudoxia0/Hylas-Lisp).
Re:Java Virtual Machine in pure Node.js by th3byrdm4n on Wednesday October 30, 2013 @05:21PM (#6643497)
The paradigm is that it's easier (cheaper) to have less performant code that takes less time to build for developers then it is to have maximum performant code...

This project at least provides the potential for people like myself who have existing Java projects with longstanding functioning methods that I don't want to rewrite in Node.js... Yes it's another layer, but for some functions that layer can be less complicated then reimplementation.

Re:Java Virtual Machine in pure Node.js by S4M on Wednesday October 30, 2013 @06:37PM (#6643975)
> This project at least provides the potential for people like myself who have existing Java projects with longstanding functioning methods that I don't want to rewrite in Node.js

In this case, wouldn't a java-to-js translator be more efficient than rewriting the whole jvm for Node.js?

Re:Java Virtual Machine in pure Node.js by haimez on Wednesday October 30, 2013 @08:16PM (#6644478)
Sometimes you just have to let people try to convince themselves that wildly impractical (but really neat) toys could have serious applications. <s>For example, Node.js.</s>
Re:Java Virtual Machine in pure Node.js by th3byrdm4n on Wednesday October 30, 2013 @11:57PM (#6645141)
There's only one way to find out ;)
Re:Java Virtual Machine in pure Node.js by TheZenPsycho on Wednesday October 30, 2013 @04:55PM (#6643322)
the differences are in how quickly the software can get written, and where that software can go to be run, and in how many different places.

It could be we haven't improved those either, but there's more to life than raw performance you see.

Re:Java Virtual Machine in pure Node.js by bane on Wednesday October 30, 2013 @11:50PM (#6645123)
I agree, but then again, I remember the days when any given piece of software was ported to a dozen competing home computing platforms with wildly different architectures and operating systems as a matter of course. These days we basically have 2 architectures and 3 or 4 different OSs and that's about it.

Looking at lots of "web-scale" technologies, I can't help but think that lots of what we're trying to solve with racks of computers could probably be handled with ease by a single modern machine if the software wasn't so inefficient.

Re:Java Virtual Machine in pure Node.js by TheZenPsycho on Thursday October 31, 2013 @12:19AM (#6645205)
You have a point. But then, what I remember about that software that was ported to all the different architectures was:

1. the software was an order of magnitude or two less complex- in terms of features and platform. That is, there was maybe a dozen different kinds of (highly predictable,testable) home computers instead of a combinatorial infinity of videocards/motherboards/soundcards/operating systems/etc.., plus, the GUI/Evented model is more conceptually difficult for programmers to cope with than straightforward "I own the machine" imperative blocking code. If we want to have guis, we need languages that either abtract away events, or at least provide tools to more easily handle events than C or assembler could provide. Such languages tend to be fairly complex (in implementation)/"inefficient"/garbage collected (since events link to memory/state that must be disposed of eventually,somehow, safely,without segfaulting). Failing that, we need programmers that are smart and capable enough to just plow through the complexity of events in plain C or C++. It's a different caliber of programmer than those who could singlehandedly make simple computer games on an 8-bit home microcomputer.

2. In cases of more complex software, ports were achieved by first designing and implementing a one off virtual machine, then simply porting the virtual machine to the different platforms. See ScummVM, Z-machine, Another World, etc. Surely that threw away some notion of efficiency. You made up for it by implementing the performance sensitive routines inside the VM itself.

3. The inefficiency of software is usually a tradeoff for development speed. To make a virtual platform work consistently across the many different real platforms they must run on, the efficiency of the virtual platform becomes (roughly) a function of ( platform implementors / platform count ) * time. We're only 5 years down the road of this round of serious javascript optimisation. At the end of the day, the curve of that function isn't that different from java, or C or C++ or anything else. those other things just have a huge head start.

Re:Java Virtual Machine in pure Node.js by AUmrysh on Thursday October 31, 2013 @10:40AM (#6647041)
Why can't this be used to replace all of the java applets or allow java back into the browser? I know there were security issues before with native Java, perhaps JS sandboxed Java could solve the security issues.
Re:Java Virtual Machine in pure Node.js by gsnedders on Thursday October 31, 2013 @12:13PM (#6647658)
Java applets are more powerful than any web browser API (you can't get at USB devices from the web browser except through a plugin, for example). BankID (used for banking and electronic payment in the Nordic countries by almost every bank) makes use of this to do validation with a USB device to authenticate based on bank card.
Re:Java Virtual Machine in pure Node.js by M2Ys4U on Thursday October 31, 2013 @06:01PM (#6650306)
>you can't get at USB devices from the web browser except through a plugin, for example

Not yet, we can't. Mozilla is working on the WebUSB[0] API that'll allow access to USB devices via javascript as part of their ongoing WebAPI effort. They need this for FirefoxOS at some point, and these APIs are being implemented in desktop Firefox as well.

[0] https://wiki.mozilla.org/WebAPI/WebUSB

Re:Java Virtual Machine in pure Node.js by malandrew on Friday November 01, 2013 @03:16PM (#6655665)
Interesting point. On that note, does a JVM exist that can run on bare metal?