4 ms·
> Rust has a unique design that would be rather difficult to map other languages efficiently to... With regards to efficiency, a "unique design" is of little d
by solidsnack9000 10y ago
> Rust has a unique design that would be rather difficult to map other languages efficiently to...
With regards to efficiency, a "unique design" is of little direct consequence; we are always mapping from one very different language to another, since assembly bears ultimately little resemblance to Java or Ruby or Haskell.
A language can be a bad compile target but that has more to do with runtime restrictions. For example, it's hard to build command line tools that start quickly if you target the JVM. Compacting GC can make interop with other languages hard (since objects get moved around). But Rust doesn't come with abstractions or an execution model that are any more heavy weight than C++ (which is no way a bad language for implementing interpreters or compilers, and has even served as a compile target on occasion); in fact it is a more conservative extension of C than C++ is.
Rust does impose a burden that is kind of like saying, your compiler/interpreter has to pass Valgrind+Coverity; but this is perhaps more of a help than a hindrance -- and it doesn't limit the kind of language you can write.
- pjmlp 10y ago> For example, it's hard to build command line tools that start quickly if you target the JVM. Only for those that don't know what they are doing. There are plenty of JDKs that AOT compile to native code.
- groovy2shoes 10y agoIncluding the freely-available GCJ, a part of GCC that's not often included by default anymore.
- rzhikharevich 10y agoIsn't GCJ obsolete and dead?
- pjmlp 10y agoIt is obsolete as most of its devs moved on to other stuff. But the gcc folks keep it alive, because many of the gcj unit tests stress parts of the toolchain that other languages don't use. So I imagine that for quick command line scripts that can live with an aged Java 1.4 API it might still work.
- solidsnack9000 10y agoOkay, so how do I do this? Because if I write a simple Scala program that prints "Hello World" it can take like three seconds to start.
- premium-concern 10y agoI think that's pretty much untrue. That program is 0.x seconds on Scala-JVM and 0.0x seconds on Scala-Native.
- solidsnack9000 10y agoWell, Scala-Native should of course be much faster. The last time I looked at this was a awhile back; maybe it was 0.3 seconds and I misremembered it.
- mike_hearn 10y agoThat sounds more like a Scala issue than anything else. A Java Hello World app runs in about 50 msec.