People, please learn from mistakes of the past. Using less-than and greater-than as template parameters was a horrible idea by Stroustroup, but was copied by Java and C#. Although C# and Java do not suffer from the craziness that is C++, by virtue of requiring a class name, e.g. template void myclass() { ... code ...}; ... myclass 4>(); /* myclass ? or syntax error? */ is unique to C++ - but still, all lexing/parsing…
I suggest the ' operator as in let sum (x:'T) (y:'T) = x + y I have no idea why you even have to specify that a method is generic shouldn't it be generic by inference?
Red Hat's top secret Java Killer/Successor: The Ceylon Project
21–30 of 89 posts
Re: Red Hat's top secret Java Killer/Successor: The Ceylon Project
#22Re: Red Hat's top secret Java Killer/Successor: The Ceylon Project
#23In my opinion basic type inference, name parameters, better support for immutability* and multiline strings represent the majority of the deficit in terms of making java more expressive and convenient. Other things such as higher order functions (would require an extension of the type system) raise issues that make the benefits less clear cut.
* my view on immutability is that it should be possible to 'bake' a class or an interface. So it can be manipulated before being made immutable.
(Apparently something like this is possible in Java 6 using annotations and compiler plugin extensions, but apparently it is not straight forwards to get working with IDEs (and as such, given the importance of IDEs one may as well change language).
Re: Red Hat's top secret Java Killer/Successor: The Ceylon Project
#24Earlier quoted context omitted.
I suggest the ' operator as in let sum (x:'T) (y:'T) = x + y I have no idea why you even have to specify that a method is generic shouldn't it be generic by inference?
If quotes are used for grouping characters (as they are in C, Java, C#, Python etc.) then this is just as bad as using . How can you tell if it is a character literal or a type?
I'm guessing that it uses a context sensitive grammar that doesn't allow you to use string literals for variable names.
Re: Red Hat's top secret Java Killer/Successor: The Ceylon Project
#25Re: Red Hat's top secret Java Killer/Successor: The Ceylon Project
#26Re: Red Hat's top secret Java Killer/Successor: The Ceylon Project
#27The article says it draws inspiration from younger languages, and mentions Python as an example. This is false, Python is four years older than Java.
Re: Red Hat's top secret Java Killer/Successor: The Ceylon Project
#28I find it entertaining that Java's apparent successor will be, in many ways, a copy-cat of modern C#. It wasn't long ago that C# was created in Java's image. If this language is not continually enhanced, then it will fall behind. Java has always had trouble with this because of committees and fear of actually saying "no" (real deprecation). I swear "it'll be in Java 7" has nearly become a tag-line this year.
There's lots of things wrong with Java, but I think a worthy successor should at least keep that 'less is more' mentality.
If you want a feature-rich Java though, you can always try the KSL: http://openjdk.java.net/groups/compiler/ksl.html
edit: by the way, I'm not saying Java > Python, just that I prefer clean languages. Just wanted to get that out of the way before I get flamed to death :3
Re: Red Hat's top secret Java Killer/Successor: The Ceylon Project
#29Is it 'easy to read' as in let sum x y = x + y Or 'easy to read' as in public final class Summer { public static T Sum (T x, T y) { return x.add(y); } } Because I don't think that dreck in the bottom is 'readable', it's like giving construction workers a Fischer Price My First Hammer and expecting them to be able to build a house with it. If you're going to make a language like Java at least let programmers take the…
Literally everyone would just write z = x + y; inline
Why parameterize needlessly?
If you're saying that list comprehensions are clearer in functional form, I would suggest a more appropriate comparison.
How about:
* drawing some text on a bitmap in lines
* building a list of nodes and doing a Minimal-Spanning-Tree
I don't think they'd be much clearer.
Re: Red Hat's top secret Java Killer/Successor: The Ceylon Project
#30Earlier quoted context omitted.
If quotes are used for grouping characters (as they are in C, Java, C#, Python etc.) then this is just as bad as using . How can you tell if it is a character literal or a type?
I have no idea but F# does exactly that. I'm guessing that it uses a context sensitive grammar that doesn't allow you to use string literals for variable names.