Earlier quoted context omitted.
Depending on why you're restarting your VM, you may want to check out the DCEVM: http://java.net/projects/dcevm It lets you do arbitrary hotswapping of code, rather than only swapping method bodies. Not appropriate for production at this point, but you can install it on top of any Java 6 version prior to update 26 (not sure about Java 7); it's pretty useful for doing rapid iterations during development of large-scale…
Does anyone have the documentation or tutorial for DCEVM? I've looked at it from time to time but never able to figure out how to use it. There's no doc beside the jar file.
Eclipse launches new language to cut down Java boilerplate - Extend
221–229 of 229 posts
Re: Eclipse launches new language to cut down Java boilerplate - Extend
#222Meh. I don't understand what is so bad about Java. Yes, there's boilerplate, which can addressed with the right development tools. New languages are a good thing. But a language whose sole purpose is to remove boilerplate from Java, does not really get us anywhere.
Much of the time, I'd agree. But working on a large system in Java, I repeatedly see a few places where Java's boilerplate overwhelms the code I actually care about. Operations on collections: List result = new ArrayList (); for (String word : words) { result.add(word.toUpperCase()); } return result; Accessor methods: private String name; public String getName() { return name; } public void setName(String name) { thi…
public interface Functor {
T apply(T v);
}
public class Util {
public static List collect(List l, Functor f) {
List result = new ArrayList();
for (T v : l) {
result.add(f.apply(v));
}
return result;
}
}
You can write: List l = ...;
Util.collect(l, new Functor() {public String apply(String v) {return v.toUpperCase();}});
Not as concise, but not that horrible either. :)I never quite liked operator overloading, because of infix notation all operators need to retain their precedence.
Re: Eclipse launches new language to cut down Java boilerplate - Extend
#223Earlier quoted context omitted.
At least then vim would understand it and you wouldn't have to deindent every 'end' yourself. It would be nice to be able to use % and some other stuff that you get with most other languages. The fact is that the visual style of a language is trivial to get used to. Breaking my text editor is a real issue though.
vim does understand Ruby. As soon as I type end, it automatically de-indents the line 2 spaces. Put this in your ~/.vimrc: filetype plugin indent on
Re: Eclipse launches new language to cut down Java boilerplate - Extend
#224Meh. I don't understand what is so bad about Java. Yes, there's boilerplate, which can addressed with the right development tools. New languages are a good thing. But a language whose sole purpose is to remove boilerplate from Java, does not really get us anywhere.
Re: Eclipse launches new language to cut down Java boilerplate - Extend
#225Earlier quoted context omitted.
Actually, I really am sure Clojure will fit in all of those problem domains. Indeed, I'm pretty sure that if you experienced a well-written Clojure accounting app, you'd wonder why people bothered with Java.
Would like to see the code if you have the example. Would be a very interesting case-study as to why Functional fits such problem domain as opposed to OOP because this would open a new perspective. Please share more. I'm interested. (Let me know if you can only share your experience via private channels).
Second, as Carl pointed out, Clojure does have state, it's just tightly controlled. So tightly controlled that multi-threaded programming is much easier. There's some things that I'd like on top of what it does, but it's very powerful and useful.
Thirdly, I'm not denying that thinking functionally takes a while, but as you develop the skill, it's amazing how many things actually look pretty stateless. I've met actuaries who use F# for all of their calculations. Equally, converting game state to a 3d scene graph is a pretty stateless process (although I've yet to meet anyone who's actually getting paid to do functional game programming).
Hope that is interesting. Will be glad to share more.
Re: Eclipse launches new language to cut down Java boilerplate - Extend
#226Earlier quoted context omitted.
Sorry for not understanding, but can you explain what the ambiguity is here?
A C-like parser will keep parsing an expression as long as it's legal. Take: foo("bar") * a It will parse the call to 'foo', then see the '*' which is an infix operator and parse the whole thing as a multiplication expression. In most C-like languages, '(' is both a prefix operator (for grouping) and an infix operator (for function calls). So: foo("bar") (a + b) Is ambiguous if you don't require semicolons to separat…
Re: Eclipse launches new language to cut down Java boilerplate - Extend
#227I don't know, but, often get irriated by the usage of "closures" when it means "anonymous function/expression". > The term closure is often mistakenly used to mean anonymous function. This is probably because most languages implementing anonymous functions allow them to form closures and programmers are usually introduced to both concepts at the same time. An anonymous function can be seen as a function literal, whil…
You don't have to assume that they actually mean anonymous functions. There's no real reason why the Xtend compiler couldn't translate closures to Java objects.
>> a closure is a collection of closed-over variables retained by a function.
I don't really dig deep for what the constructs would produce in memory, but they should be some lambda expression.Re: Eclipse launches new language to cut down Java boilerplate - Extend
#228Earlier quoted context omitted.
> The fact that Xtend can be easily translated to Java source code is a big sign that it probably won't have any dramatic impact on your productivity. It appears to be common Hackernewserthink that "productivity" equals "the ability to write code as fast as possible". Beyond the first few weeks of coding, you'll spend much more time reading code and refactoring it. What Xtend offers is an object model and type system…
> It appears to be common Hackernewserthink that "productivity" equals "the ability to write code as fast as possible". Beyond the first few weeks of coding, you'll spend much more time reading code and refactoring it. And even more time thinking . This is one of the reasons I never understood the obsession many people have with vim/emacs/whatever shortcuts and the like, for me they are distractions from what is real…
I'm not a vim/emacs shortcut freak, but I do appreciate environments that don't make me use a mouse.
Re: Eclipse launches new language to cut down Java boilerplate - Extend
#229I'm pretty disappointed in the discussion that has gone here. There's been so much argument over things that don't matter much in the end, like whether or not optional semicolons and parenthesis are a good thing. These things are so superficial! It makes me believe that few people appreciate what actually makes a language good or bad. The fact that Xtend can be easily translated to Java source code is a big sign that…
The fact that Xtend can be easily translated to Java source code is a big sign that it probably won't have any dramatic impact on your productivity I do not believe that there is any evidence for this statement. Translating ARM assembly language into opcodes is orders of magnitudes easier than translating Xtend into Java, yet I would argue that even that had a dramatic impact on my productivity back when I was doing…