|
|
|
|
|
by soc88
5317 days ago
|
|
How about acting less aggressive?
It certainly dosen't help you to get your point across. > Here's some Ruby code for you You just tried very hard to not understand the problem at hand, right? Because the equivalent Scala code looks like this: Array(1,2,3).map(_*2).map(_.toString).toSet
> I can implement all of the above by my ownSure, if you OK with your code running magnitudes slower than the built-in stuff. That's probably the main difference between general purpose languages and scripting languages today: General-purpose languages allow you to implement the appropriate data structures yourself, while scripting languages force you to use the built-in stuff. |
|
You should also realize that the speed of the JVM has nothing to do with the static-ness of the language. The bytecode is in fact dynamic ... the only instances where certain assumptions where made based on Java (the language) being:
1) classes are immutable and can't be garbage collected unless you destroy the corresponding class loader
2) the method dispatching done cannot be overridden (so when calling a method on an implicit object, you also have to specify the interface where that method is defined) ... but this has nothing to do with the inner-workings of the JVM and is being addressed with the work done on InvokeDynamic
Really, if you're worrying about "scripting" specific behavior sneaking in on you, stealing away precious CPU cycles or RAM bytes, then you should stay away from the JVM.