News for hackers. Stuff that matters.
Re:Java to Scala converter by lmm on Friday September 27, 2013 @12:26PM (#6457783)
Why would you want to? The JVM is pretty awesome. There's already a scala implementation for .net, so it's got at least some level of VM independence, but the JVM is the primary target and I'd expect it to remain so.

As well as the VM there's the runtime library to consider. There was a project recently here that compiled scala to javascript to use on web pages, but unfortunately it needed a 16mb standard library.

Re:Java to Scala converter by laureny on Friday September 27, 2013 @01:05PM (#6458027)
> There's already a scala implementation for .net,

Scala.net was abandoned a while ago. It's close to impossible to get it to run because .Net's generics are reified.

Re:Java to Scala converter by meddlepal on Friday September 27, 2013 @01:45PM (#6458354)
I've heard this before in the context of why .NET tends to have less alternate language implementations on it than the JVM. I don't understand why though. Why do reified generics make it near impossible?
Re:Java to Scala converter by eeperson on Friday September 27, 2013 @03:00PM (#6458833)
My understanding is that it gives you less flexibility in how your type system works. To a certain extant you are stuck with the C# type system no matter what the language is because it is baked in to the VM. I assume this doesn't apply as much to dynamic languages but still makes interoperability a pain.
Re:Java to Scala converter by dkhenry on Friday September 27, 2013 @01:00PM (#6457990)
Speed and size would be the two biggest.

The start up time of the JVM and the size of the generated executables ( jar files ) make scala not terribly useful for those small programming tasks ( scripting and such )

Re:Java to Scala converter by pjmlp on Friday September 27, 2013 @03:29PM (#6458980)
It is a matter of using the right JVM for the job.

Many do allow for AOT compilation, or caching the generated JIT code between invocations. IBM J9 is one of them, for example.

Re:Java to Scala converter by TylerE on Friday September 27, 2013 @03:38PM (#6459028)
My understanding is that the bulk of JVM startup time is NOT compiling or loading the actual application code, but loading the classpath.
Re:Java to Scala converter by pjmlp on Friday September 27, 2013 @04:03PM (#6459163)
As I said, not all JVMs are made alike, don't confuse Java virtual machines, with Oracle's or OpenJDK implementation.

JVMs that cache JITed code don't spend time loading the classpath if the cache is still valid.

Re:Java to Scala converter by TylerE on Friday September 27, 2013 @04:14PM (#6459223)
You misunderstand me...it has to read and decompress (jars are basically zip files) those 50MB are so (just for the system jars) on every startup before it can even think about validating the cache
Re:Java to Scala converter by pjmlp on Friday September 27, 2013 @04:39PM (#6459396)
Sure, however you are still speaking of a specific implementation.
Re:Java to Scala converter by TylerE on Friday September 27, 2013 @06:28PM (#6459970)
And which implementation that you seem to imply exists DOESN'T suffer from this seemingly fundamental issue? You built this strawman, now defend it or stop waving your hands.
Re:Java to Scala converter by pjmlp on Friday September 27, 2013 @06:42PM (#6460021)
Just read my OP carefully and you will find you answer.
Re:Java to Scala converter by TylerE on Friday September 27, 2013 @06:47PM (#6460033)
No, read MINE carefully. Even loading cached data isn't free.
Re:Java to Scala converter by pjmlp on Saturday September 28, 2013 @12:13AM (#6460908)
Of course not, all the code and data that go into the processor needs to go through the processor cache first.

My OP comment has an example of a JVM that doesn't read jar files as you mentioned, while executing native code stored in a JIT cache present in the hard disk, between invocations.

Google is your friend if you look for the respective documentation. Or, who knows, you could even download it and play around with it.

I'm out, please turn the lights off on the way out.