4 ms·
Feels like it needs proper (reified/runtime) generics in order to be useful. Reified generics and value types would be a complete and long overdue break in back
by alkonaut 13y ago
Feels like it needs proper (reified/runtime) generics in order to be useful. Reified generics and value types would be a complete and long overdue break in backwards compatibility.
But
It's a bit sad how java struggles to become a C# from five years ago. Would make a lot more sense to leave java alone, add reified generics and value types at the bytecode/vm level and instead launch a new language that could use all of it.
Throw in pattern matching, algebraic data types and a bit more and I'm sold.
- ihnorton 13y agoYour comment made me wonder if there was an F# implementation for the JVM. This is the only one I could find, and it is still very young: https://github.com/penberg/fjord https://github.com/penberg/fjord
- Alphasite_ 13y agoI'vea heard that its on the cards for 9/10, isn't it? (reified generics)
- pjmlp 13y agoJava like most open standards suffers from design by committee, whereas C# so far had Microsoft alone dictating where to go. Add the Sun troubles into the mix, and slow the features go.
- jdonaldson 13y agoTry Haxe. http://haxe.org/ http://haxe.org/ You get pattern matching, algebraic data types, and much more. And you can also target Java or C#
- coldtea 13y agoHe meant a language with an actual ecosystem and hundrends of thousands of users, like Java. Haxe does not qualify at the moment...
- jdonaldson 13y agoYou can use java jars with the -java-lib flag. The whole library ecosystem is available. There's not as much IDE tooling for Haxe, but Haxe is a lot more succinct. I haven't needed that as much.
- bad_user 13y ago> Feels like it needs proper (reified/runtime) generics in order to be useful. Actually type-erasure is one of Java's best features, because it didn't cripple the runtime for other languages. For example Scala's type system is too expressive to be built on top of .NET's generics. First of all, reification only helps in terms of type-safety if you have a weak type system. The only value that reification, as implemented in .NET brings is specialization for value types. Second of all, specialization can be done by the compiler. That's how many languages have always done it. Scala for example has a @specialized annotation for specializing type parameters for primitives [1]. And because this functionality has some gotchas, there's also an up&coming project plugin that's meant to be a replacement in future versions of Scala and that works really well [2] I myself have used the @specialized annotation on many occasions and in general it does what it's supposed to do. And if that means I can develop in languages like Scala, Clojure and JRuby on top of the JVM, then I really, really love type-erasure. And oh, apparently one barrier for implementing type-classes in F# are the generics in .NET ;-) > It's a bit sad how java struggles to become a C# from five years ago What I find sad is grown men that can't see the forest from the trees. Java, the language, is totally irrelevant and uninteresting and I like it that way, because it's the kind of language you can rely on in case you want backwards-compatibility (yes, that's a feature). On the other hand, the JVM is light-years ahead of the CLR, because that's what the Sun, now Oracle engineers have been doing with all of their time. > pattern matching, algebraic data types See Scala. It also does type-classes and higher-kinded types, amongst others that F# is not capable of. [1] http://www.scala-lang.org/api/2.10.3/index.html#scala.specialized http://www.scala-lang.org/api/2.10.3/index.html#scala.specia... [2] http://scala-miniboxing.org/ http://scala-miniboxing.org/
- Locke1689 13y agoActually type-erasure is one of Java's best features, because it didn't cripple the runtime for other languages. For example Scala's type system is too expressive to be built on top of .NET's generics. ... People keep repeating this stuff and they're totally wrong. F* is dependently typed and is a CLR language. bad_user, have you ever actually attempted to write a type unsoundness proof for your claim or are you just repeating something you heard somewhere?