Further evidence that Oracle wants people to use the JRE as application embedded solution: JEP 178: Statically-Linked JNI Libraries. Proposed in Feb of this year and already quite a bit of work as been done on implementing it.
John Rose is mocking me…basic support is being considered for: Tuples/structs, foreign data views & macros (templates in C++ speak).
Slides: http://cr.openjdk.java.net/~jrose/pres/201207-Arrays-2.pdf
Video: (I haven’t watched this) http://medianetwork.oracle.com/video/player/1785452137001
John Rose is mocking me…basic support is being considered for: Tuples/structs, foreign data views & macros (templates in C++ speak).
Slides: http://cr.openjdk.java.net/~jrose/pres/201207-Arrays-2.pdf
Video: (I haven’t watched this) http://medianetwork.oracle.com/video/player/1785452137001
I hope operator overloading is coming in the future. :point:
Me too, but I’m not even holding my breath for stuff their actually talking about.
Well I got too disappointed by how the java developers added features. Really. Probably they had no choice, but making it like that, but it’s still ugly. I hate the new Lambdas in JDK 8, for example. They’re nothing but little syntax sugar (+ clojures, but you can fake them very easy too).
So in JDK 8 it’s like that:
// main:
int result = 0;
new Thread(() -> {
result = 5;
}).start();
And in JDK 7 it could be translated like that:
class Closure {
int result = 0;
}
final Closure closure = new Closure();
new Thread(new Runnable() {
public void run() {
closure.result = 5;
}
}).start();
So I started switching to scala.
var result = 0
new Thread(() => result = 5).start();
Or much cooler stuff:
List("Hello", " ", "world").foreach(println)
// prints "Hello world"
"Hello world".split(" ").foreach(println(_ + " "))
// prints "Hello world "
Anyways, enough code rambling, also, lambdas aren’t the only thing which made me switch to java. Also, I started learning scala and scheme before trying out JDK 8 lambdas. And they pretty much disappointed me. They’re still explicit classes. Really?
One last thing I’d like to show, which is always handy for me
def time(thunk: => Unit) = {
val begin = System.currentTimeMillis()
thunk
System.currentTimeMillis()-begin
}
val timeInMillisceconds = time {
computePi()
}
// or:
val timeInMilliseconds = time(computePi)
So, KTHXBYE
I hope operator overloading is coming in the future. :point:
Me too, but I’m not even holding my breath for stuff their actually talking about.
Well I got too disappointed by how the java developers added features. Really. Probably they had no choice, but making it like that, but it’s still ugly. I hate the new Lambdas in JDK 8, for example. They’re nothing but little syntax sugar (+ clojures, but you can fake them very easy too).
So in JDK 8 it’s like that:
// main:
int result = 0;
new Thread(() -> {
result = 5;
}).start();
And in JDK 7 it could be translated like that:
class Closure {
int result = 0;
}
final Closure closure = new Closure();
new Thread(new Runnable() {
public void run() {
closure.result = 5;
}
}).start();
So I started switching to scala.
var result = 0
new Thread(() => result = 5).start();
Or much cooler stuff:
List("Hello", " ", "world").foreach(println)
// prints "Hello world"
"Hello world".split(" ").foreach(println(_ + " "))
// prints "Hello world "
Anyways, enough code rambling, also, lambdas aren’t the only thing which made me switch to java. Also, I started learning scala and scheme before trying out JDK 8 lambdas. And they pretty much disappointed me. They’re still explicit classes. Really?
One last thing I’d like to show, which is always handy for me
def time(thunk: => Unit) = {
val begin = System.currentTimeMillis()
thunk
System.currentTimeMillis()-begin
}
val timeInMillisceconds = time {
computePi()
}
// or:
val timeInMilliseconds = time(computePi)
So, KTHXBYE
JDK8 lambdas are not translated to inner classes. That they can be used as syntax sugar for some inner classes is just that, syntax sugar, but the implementation of lambdas is much more direct than that. And no, there’s still not first-class function types, don’t hold your breath for those in Java.
And BTW, it’s “closure”. The name of the Clojure language is a pun on the word.
JDK8 lambdas are not translated to inner classes. That they can be used as syntax sugar for some inner classes is just that, syntax sugar, but the implementation of lambdas is much more direct than that. And no, there’s still not first-class function types, don’t hold your breath for those in Java.
And BTW, it’s “closure”. The name of the Clojure language is a pun on the word.
It all looks great. Will be a while before we get it though.
Cas
Okey, so that sounds good, since then scala can make use of that too, probably.
Fixed
And so JDK8 is delayed anyhow…
It all looks great. Will be a while before we get it though.
Cas
Okey, so that sounds good, since then scala can make use of that too, probably.
Fixed
Apparently, it is already here:
http://blog.robovm.org/2013/05/javafx-openjfx-on-ios-using-robovm.html
And so JDK8 is delayed anyhow…
I haven’t thought this through, but you might be able to fake first class functions (to an extent) via java.lang.invoke. Ya know if you squint your left eye, grit your teeth and love boilerplate.
Apparently, it is already here:
http://blog.robovm.org/2013/05/javafx-openjfx-on-ios-using-robovm.html