New NSA-Funded Code Rolls All Programming Languages Into One 306
An anonymous reader writes "What's your favorite programming language? Is it CSS? Is it JavaScript? Is it PHP, HTML5, or something else? Why choose? A new programming language developed by researchers at Carnegie Mellon University is all of those and more — one of the world's first "polyglot" programming languages. Sound cool? It is, except its development is partially funded by the National Security Agency, so let's look at it with a skeptical eye. It's called Wyvern — named after a mythical dragon-like thing that only has two legs instead of four — and it's supposed to help programmers design apps and websites without having to rely on a whole bunch of different stylesheets and different amalgamations spread across different files.
Ridiculous Summary, Interesting Papers (Score:3, Informative)
As you'd expect from CMU, the papers themselves are pretty interesting. Just read the abstracts instead of trying to guess from the summary or vice article, which are both way off the mark.
http://www.cs.cmu.edu/~aldrich/papers/ecoop14-tsls.pdf
http://www.cs.cmu.edu/~aldrich/papers/maspeghi13.pdf
No, it doesn't "roll all languages into one" (Score:5, Informative)
No, it doesn't "roll all languages into one". It just allows embedding of the text of another language, such as HTML, into a Wyvern program. Variables can be substituted. Like this:
(except that the last 3 lines above should be indented, because this language uses Python-style block notation.)
Of course, everybody does that now, but the way they do it, especially in PHP, tends to lead to problems such as SQL injection attacks. The idea here is that Wyvern has modules for the inserted text which understand what kinds of quoting or escaping are required for the embedded language text.
I just glanced at the paper, but that seems to be the big new feature.
Re:why- just why? (Score:1, Informative)
Except it's not proprietary. It's GPLv2 and on Github [github.com].
Re:No, it doesn't "roll all languages into one" (Score:2, Informative)
It's not just about quoting or escaping. It actually builds an AST for each TSL expression (for example, an HTML expression), so they can tell if the expression is valid and how to combine the Wyvern expression with the TSL expression containing it. It looks like brain-dead string concatenation, which reduces clutter and improves readability, but it gives you all the benefits of using the type system.
Re:stupid argument (Score:2, Informative)
CSS & HTML5 ***are*** code languages for programming machine behavior
CSS & HTML5 are data that is interpreted by a computer program. They are not "code languages". The rule of thumb is that without some sort of control structure (if/then/else, loops, etc.), it's just data.
For HTML, this becomes obvious once you see how many real languages (JavaScript, PHP, ColdFusion, VisualBasic/ASP, etc.) have been created to overcome its lack of control structures.