News for hackers. Stuff that matters.
Re:Do I Really Need a Programming Language? by barrkel on Sunday December 29, 2013 @02:43AM (#6978800)
Now show the same tree for a ruby block, a Java inner class, a C# lambda and how they're all the same.

Except they're not.

Only the simplest ASTs are directly translatable. Language semantics differ wildly when you get into higher level constructs. Not even Lisp is able to help you, as that just changes the problem from one of syntactic representation into one of library implementation.

Re:Do I Really Need a Programming Language? by gsg on Sunday December 29, 2013 @08:26AM (#6979468)
Language semantics differ, full stop. Say you have x = 2147483647:

    x + 1 => -2147483648 (Java)
    x + 1 => Undefined behaviour (C, assuming int32_t and various things about the implementation)
    (1+ x) => 2147483648.0 (Emacs Lisp)
    (1+ x) => 2147483648 (Common Lisp)
    x + 1 => x + 1 (Prolog, using some interpretive license)
Re:Do I Really Need a Programming Language? by theaeolist on Sunday December 29, 2013 @04:11AM (#6978959)
That's for syntax. Also, for semantics, how do you translate C's pointer arithmetic in Java?
Re:Do I Really Need a Programming Language? by jdiez17 on Sunday December 29, 2013 @09:40AM (#6979641)
All programming languages deal with pointers at some point or another, so it's just a matter of finding the GCD.

At least that's what I think this is about, and Lisp is a good GCD.

Re:Do I Really Need a Programming Language? by andrewflnr on Sunday December 29, 2013 @03:49PM (#6981308)
That's not really a critique of the author's main point, I think. Of course you can't directly translate between semantically different features, but the OP's point was about semantically identical programs, and how different syntaxes distract from that.

That said, I think it's possible to invent a language in which all the things you mention can be expressed and at least compared. I'll do my best to do it myself if no one beats me to it. Any language with closures is close. Java inner classes and (AFAIK) C# lambdas practically are clsoures. If the only thing ruby blocks add is that returns and similar statements affect the block-creating function, that can be simulated with exceptions.