ton 80!
October 11, 2011 3:45 PM   Subscribe

Google has introduced Dart "a new class-based programming language for creating structured web applications"

So far, Dart has garnered criticism and praise with some calling it a disappointment.

According to Google, There are three ways to use Dart today:
  • Translate Dart code to JavaScript that can run in any modern browser: Chrome, Safari 5+, and Firefox 4+ (more browser support coming shortly).
  • Execute Dart code directly in a VM on the server side
  • Use Dartboard to write, modify, and execute small Dart programs within any browser window
posted by Ad hominem (108 comments total) 16 users marked this as a favorite
 
The side effect of hiring nearly all the programming language designers in the world is that they tend to design new programming languages.
posted by GuyZero at 3:47 PM on October 11, 2011 [44 favorites]


As a JS developer I look at it and say "task, another one of *those*". I mean, I'm sure it does fine and solves the problems it sets out to solve, but I'm suspicious that one of those problems is "JavaScript isn't Java", which isn't really a problem at all.
posted by Artw at 3:49 PM on October 11, 2011 [5 favorites]


True, I wonder when somebody will address Google's seeming monoploy on new programming languages. The rest of the industry is facing a serious new language gap to overcome.
posted by Ad hominem at 3:49 PM on October 11, 2011


ready... set.... Go!
posted by BigHeartedGuy at 3:50 PM on October 11, 2011 [1 favorite]


For those that missed it, here's a rather cool comment about JavaScript that got sidebarred a while ago: "it took many years before people started to figure out that Brendan's language was wrapped in an elaborate disguise and that it was actually cool."
posted by Artw at 3:52 PM on October 11, 2011 [4 favorites]


CoffeeScript. That is all
posted by crayz at 3:53 PM on October 11, 2011 [9 favorites]


I like that the "Why Dart is not the language of the future" article is on a Perl blog.
posted by Artw at 3:53 PM on October 11, 2011 [17 favorites]


Dunno if this is accurate, but it is mildly amusing.
posted by stavrosthewonderchicken at 3:54 PM on October 11, 2011 [2 favorites]


Dunno if this is accurate, but it is mildly amusing.

Hmm...

main() {
print('Hello, Dart!');
}

posted by Artw at 3:56 PM on October 11, 2011 [2 favorites]


You appear to be advocating a new programming language. Your language will not work. Here is why it will not work.

Also, why doesn't Google just put all of their energy into Python -- or, rather, a well-defined subset of Python which can be unambiguously statically analyzed and elaborated into efficient, type-safe C/C++? Then they can use the same language front-end to accomplish whatever they're trying to accomplish with Dart.
posted by spiderskull at 3:57 PM on October 11, 2011 [20 favorites]


I think they meant compiled to javascript. here is helloworld compiled. Almost linked to it but it seemed like editorializing.
posted by Ad hominem at 3:58 PM on October 11, 2011 [6 favorites]


Heh. Guess not then.
posted by stavrosthewonderchicken at 3:59 PM on October 11, 2011


You appear to be advocating a new programming language. Your language will not work. Here is why it will not work.

Aw, man, I was just filling that out to post here.
posted by grouse at 3:59 PM on October 11, 2011


It's pretty unfair to judge the quality of the language & tool based on the number of generated lines of code at this stage, since it's obviously a prototype and in very early development. By the looks of it, they're following the mantra of getting a working implementation first, then optimizing second (otherwise how do you know if the implied semantics of the language cover enough reasonably complex problems?). I imagine they will be able to dramatically optimize it once they start statically analyzing variables.
posted by spiderskull at 4:03 PM on October 11, 2011


I think they meant compiled to javascript. here is helloworld compiled. Almost linked to it but it seemed like editorializing.

Heh. That appears to be the Dart engine. That's sort of like looking at page taht uses jQuery and doing a line count of jQuery.js.
posted by Artw at 4:04 PM on October 11, 2011 [2 favorites]


I imagine they will be able to dramatically optimize it once they start statically analyzing variables.

I imagine the core of it will be an unrecognisable squish of minified CDNed JS that you never have to worry about.
posted by Artw at 4:06 PM on October 11, 2011


i think they did a good job with the logo. although it takes a minute to fully process what's going on there, and then the "clever" kicks in, but after all that, i think good decisions were made.
posted by rude.boy at 4:08 PM on October 11, 2011


Heh. That appears to be the Dart engine. That's sort of like looking at page taht uses jQuery and doing a line count of jQuery.js.

Yeah, I thought it was misleading so I didn't add it to the post, even though it is funny.
posted by Ad hominem at 4:08 PM on October 11, 2011


It's clearly addressing an engineering problem. JavaScript is dynamically typed. While that's great for small projects and prototyping, it's very easy to write code that's syntactically correct but semantically not what you want. Static typing helps a great deal in this regard.
posted by CheeseDigestsAll at 4:09 PM on October 11, 2011


The tutorial:

Step 1: Hello World!
Step 2: Classes

and forward-thinking CS instructors around the globe roll their eyes in unison.
posted by GuyZero at 4:09 PM on October 11, 2011


of course, if you're already a developer, this is the proper tutorial ordering.
posted by GuyZero at 4:10 PM on October 11, 2011 [2 favorites]


Looking further, this seems to be the bit that's unique to Hello World:


function unnamedcac5e9$HelloDartTest$Dart(){
}

unnamedcac5e9$HelloDartTest$Dart.$lookupRTT = function(){
return RTT.create($cls('unnamedcac5e9$HelloDartTest$Dart'));
}
;
unnamedcac5e9$HelloDartTest$Dart.$addTo = function(target){
var rtt = unnamedcac5e9$HelloDartTest$Dart.$lookupRTT();
target.implementedTypes[rtt.classKey] = rtt;
}
;
unnamedcac5e9$HelloDartTest$Dart.prototype.$implements$unnamedcac5e9$HelloDartTest$Dart = 1;
unnamedcac5e9$HelloDartTest$Dart.prototype.$implements$Object$Dart = 1;
unnamedcac5e9$HelloDartTest$Dart.testMain$member = function(){
print$getter()(1, $noargs, 'Hello, Darter!');
}
;
unnamedcac5e9$HelloDartTest$Dart.testMain$named = function($n, $o){
var seen = 0;
var def = 0;
if (seen != $o.count || seen + def + $n != 0)
$nsme();
return unnamedcac5e9$HelloDartTest$Dart.testMain$member();
}
;
unnamedcac5e9$HelloDartTest$Dart.testMain$getter = function testMain$getter(){
return unnamedcac5e9$HelloDartTest$Dart.testMain$named;
}
;
unnamedcac5e9$HelloDartTest$Dart.$Constructor = function(){
Object.$Constructor.call(this);
}
;
unnamedcac5e9$HelloDartTest$Dart.$Initializer = function(){
Object.$Initializer.call(this);
}
;
unnamedcac5e9$HelloDartTest$Dart.HelloDartTest$$Factory = function(){
var tmp$0 = new unnamedcac5e9$HelloDartTest$Dart;
tmp$0.$typeInfo = unnamedcac5e9$HelloDartTest$Dart.$lookupRTT();
unnamedcac5e9$HelloDartTest$Dart.$Initializer.call(tmp$0);
unnamedcac5e9$HelloDartTest$Dart.$Constructor.call(tmp$0);
return tmp$0;
}
;
function unnamedcac5e9$main$member(){
unnamedcac5e9$HelloDartTest$Dart.testMain$member();
}

function unnamedcac5e9$main$named($n, $o){
var seen = 0;
var def = 0;
if (seen != $o.count || seen + def + $n != 0)
$nsme();
return unnamedcac5e9$main$member();
}


So it'd be that and a 160K file you never have to worry much about. Though TBH it's not like this is the prettiest code in the world.
posted by Artw at 4:12 PM on October 11, 2011 [2 favorites]


Hello World
...is it me you're looking for?
posted by 2bucksplus at 4:12 PM on October 11, 2011 [4 favorites]


Brendan Eich on Dart. Tip: he disapproves.
posted by ardgedee at 4:14 PM on October 11, 2011 [5 favorites]


The side effect of hiring nearly all the programming language designers in the world is that they tend to design new programming languages.

Hi there. I'm a programming language designer, and I recently started working for Google. I'm not actually working on a language project here, but of course I'm still developing a language on the side, because that's what people who are interested in programming languages do with their free time.

Languages, inside Google, are not really that big a deal: Google builds lots and lots of internal tools, and some of them happen to be custom programming languages intended for specific tasks. Googlers appear to see nothing remarkable about the idea of solving a class of problems by inventing a language to express the work, or about learning such a language in order to get a job done.

As far as Dart goes, I'm not connected to that team, and all I know about their project is what I've read on public blogs, but my guess would be that they don't really care whether Dart takes a place among the Great Languages Of The World. They probably just needed a tool, and thought other people would like to have the same tool, and built it, and here we are.
posted by Mars Saxman at 4:14 PM on October 11, 2011 [25 favorites]


Eich's most salient complaint is that Chrome is highly likely to be the only browser to embed a native interpreter.
posted by ardgedee at 4:15 PM on October 11, 2011


XKCD: standards
posted by modernserf at 4:15 PM on October 11, 2011 [1 favorite]


The fact that Google Chrome may support Dart natively is the reason this is both interesting, and possibly a threat. There's so much overhead to yet another programming language, there really needs to be significant benefit for something new before it's worth the cost to the world of people trying it. Go at least adds co-routines to the mix, an interesting idea. Sawzall added tight marriage to the map reduce computing system. It's not clear what Dart really adds. (Static typing? Um, no thanks.)

I've just finally learned Javascript pretty well in the last year. It's a remarkably interesting and productive language. Turns out Lisp is a good basis for a language, even if you end up dressing it up in });}))};);
posted by Nelson at 4:20 PM on October 11, 2011


I tried an experimental project in GWT, the Google Web Toolkit, where you write in Java and out comes Javascript that is built for a particular browser's quirks. It was a very bad experience, that ended up being much more effort than using something like jQuery.

Dart is the result of looking at the failure of GWT, and saying, "hey, wouldn't it be great of Javascript was more like Java?" Which is a recipe for compounding the failures.

Building a programming language is a social thing, and the social side of managing expectations and announcements indicate that Dart will be a failure. Dart's current state is not interesting, but it may be much better in the end. Announcing at the uninteresting state means a ton of bad first impressions. So I'm guessing they don't have anything planned. I.e., if current project management was clever enough to pull off the popularization of an interesting new programming language, they wouldn't have made an announcement at this stage.
posted by Llama-Lime at 4:20 PM on October 11, 2011 [2 favorites]


I don't mean to be dense, but I think it's kind of cool that the server and the client are running the same language.

I mean, I'm sure for established web devs, it's second nature to shift from PHP/Python/whatever to Javascript, but I find it kind of jarring. Then again, I am also a noob who uses jQuery for everything instead of native commands except when necessary. I'm more hobbyist than real programmer, though, and I tend to consider JS something I learn as needed, so that's my problem.

And yes, I know java can do it if the client has it installed, but this is cool as it translates itself to Javascript if the client doesn't have a Dart VM if I understand correctly.
posted by mccarty.tim at 4:20 PM on October 11, 2011


I tried an experimental project in GWT, the Google Web Toolkit, where you write in Java and out comes Javascript that is built for a particular browser's quirks.

I just use the .soy templates, and they're actually kind of cool. On the other hand I really wouldn't want to go further than that or look under the hood too much.
posted by Artw at 4:25 PM on October 11, 2011


Does the world actually need another programming language? Is there something that's difficult or impossible to express in one or more of the 15 widely known languages that this makes easier?

Maybe I should just think of it as a Javascript preprocessor so my head doesn't explode.
posted by wierdo at 4:29 PM on October 11, 2011


Hey, mccarty.tim, have you heard about node.js? Server-side Javascript.
posted by Mister Cheese at 4:29 PM on October 11, 2011


> I don't mean to be dense, but I think it's kind of cool that the server and the client are running the same language.

See also: server side JavaScript.

I can't criticize ssjs, but I can say that after considering the different needs of scripting on the browser and on the server, having a common language on both sides is less interesting than it sounds.
posted by ardgedee at 4:30 PM on October 11, 2011 [1 favorite]


Node.js has come under fire recently as well.
posted by Ad hominem at 4:33 PM on October 11, 2011 [1 favorite]


Building a programming language is a social thing, and the social side of managing expectations and announcements indicate that Dart will be a failure.
This may be some sort of record for completely changing one's mind and retracting a comment, but it's a fool's game to predict which languages will become popular and in which domains. (Perl and R, two languages which I really enjoy using, probably should never have been used at all if you listen to most people.) So I'll keep my mouth shut.
posted by Llama-Lime at 4:34 PM on October 11, 2011


ardgedee wrote: I can't criticize ssjs, but I can say that after considering the different needs of scripting on the browser and on the server, having a common language on both sides is less interesting than it sounds.

A good RPC interface makes the difference in languages pretty much irrelevant. Of course, some jackass inevitably misunderstands the standard and takes away the possibility of transparency. (I'm looking at you Magento)
posted by wierdo at 4:34 PM on October 11, 2011 [1 favorite]


Eich's most salient complaint is that Chrome is highly likely to be the only browser to embed a native interpreter.

ActiveX 2.0
posted by Blazecock Pileon at 4:34 PM on October 11, 2011 [2 favorites]


Who says R shouldn't be used?
posted by sien at 4:35 PM on October 11, 2011


ActiveX was simply a gateway to the native Win32 API - at least Dart presents a closed library that primarily interfaces with a browser DOM.

Which isn't to say it's great or even necessary - but it certainly doesn't repeat ActiveX's biggest mistakes.
posted by GuyZero at 4:39 PM on October 11, 2011 [2 favorites]


Google is good at (a) search engine. Oh and a webmail client. Shopping, video, "waving" and the like they seem to suck at. And programming languages. I keep hearing about them and then...nothing.
posted by DU at 4:57 PM on October 11, 2011 [1 favorite]


They really should have bought Sun so they'd have Java to play with.
posted by Artw at 4:59 PM on October 11, 2011


I keep hearing about them and then...nothing.

There isn't a huge group of people doing critical writing about programming languages and then there's not really much to say.

Go has a reasonable sized team gophering away on it.
posted by GuyZero at 4:59 PM on October 11, 2011


why doesn't Google just put all of their energy into Python -- or, rather, a well-defined subset of Python which can be unambiguously statically analyzed and elaborated into efficient, type-safe C/C++

They don't even need all that, just fix the UI component and I'd be happy. Python is a fantastic language. I mean, the stuff you can do with it is just so fundamentally wrong it's awesome. Like swapping function definitions at run-time. Hate Java's lack of multiple inheritance? No problemo says Python. It's got all the cool of Javascript while running natively at the speed of C. It's got shit-tons of libraries available. It enforces clean source. The problems you might typically encounter have beautiful, elegant solutions.

The single biggest gripe I have with Python is that wxPython sucks donkey nuts, but even as such it's leaps and bounds ahead of, say, Swing.

Dart makes me physically ill.
posted by Civil_Disobedient at 5:16 PM on October 11, 2011 [3 favorites]


They really should have bought Sun so they could behead, burn and scatter the ashes of Java like the memetic virus laden shambling corpse it is.
posted by seanmpuckett at 5:17 PM on October 11, 2011 [2 favorites]


Can I get it with the Slant 6?
posted by spitbull at 5:18 PM on October 11, 2011 [3 favorites]


The single biggest gripe I have with Python is that wxPython sucks donkey nuts, but even as such it's leaps and bounds ahead of, say, Swing.

OK, Swing was not perfect, but no. Just no. wxPython is terrible. Poor Python gets to have everyone else's GUI frameworks grafted on top of it an they all feel that way. At least Swing expressed native java idioms.
posted by GuyZero at 5:19 PM on October 11, 2011 [1 favorite]


It's got all the cool of Javascript while running natively at the speed of C.

I ported a Pythonic(*) script over to C and got incredible speed-ups. System I/O and string handling is notoriously slow with Python.

It's a good language for mock-ups but I wouldn't call it a replacement for well-written, tight C and C++.

(*: That is, a Python script that uses a lot of Python tricks to get performance enhancements.)
posted by Blazecock Pileon at 5:22 PM on October 11, 2011


Dart is the result of looking at the failure of GWT, and saying, "hey, wouldn't it be great of Javascript was more like Java?" Which is a recipe for compounding the failures.

Javascript is a nice language, but it was designed for a different world and different use case. You see that in how the big libraries keep needing to provide features like modules and object-orientation that would usually be considered the domain of the language. In addition, as Mars Saxman indicated, Google's web developers have different needs than most web developers- in particular, they need support for larger and more complicated client-side applications. My past two jobs have been at Ruby and Python shops, and I use Python for most of my personal projects, but I don't mind saying that Java is in many ways easier to work with for large codebases, just because static type checking is a HUGE help when it comes to refactoring. So I don't think Dart is intended to help people add client-side form validation to their ecommerce site. It's intended to help people create something like Google Docs.
posted by gsteff at 5:27 PM on October 11, 2011 [2 favorites]


It's got all the cool of Javascript while running natively at the speed of C.

Um, well I can't talk about 'cool', but I do know it's not as fast as C. Python is quite a bit slower. Even C# and Java are much faster.

Most of the time, this doesn't particularly matter; it's much more common to be I/O bound than CPU-bound these days. But if you're able to arrange things so that you've got a lot of data to chew on, without having to wait for anything else, Python code typically chews a fair bit slower than a number of other options. It is faster than perl or Ruby, though, at least when I last looked.

In my own use (just personal), I also dislike the lack of static variable typing, because if I'm writing anything that's exposed to the Net, I have to write a ton of extra code to be sure I'm being safe when opening files and writing to the filesystem. If I could have a Python where variables could be (optionally) strongly typed, and objects could have protected properties, I'd be very happy with it.
posted by Malor at 5:29 PM on October 11, 2011 [1 favorite]


Google only do, and have only ever done, one thing well. Search. For the love of Christ I wish they'd stop trying to reinvent the wheel. Dart? Fart more like.
posted by dougrayrankin at 5:31 PM on October 11, 2011


You see that in how the big libraries keep needing to provide features like modules and object-orientation that would usually be considered the domain of the language.

My experience with JS improved immensely when I learned to use closures to create namespaces and modules.
posted by Artw at 5:32 PM on October 11, 2011 [4 favorites]


I'm not connected to that team, and all I know about their project is what I've read on public blogs, but my guess would be that they don't really care whether Dart takes a place among the Great Languages Of The World. They probably just needed a tool, and thought other people would like to have the same tool, and built it, and here we are.

Well you clearly haven't been reading enough blogs:
a number of Google teams representing a variety of viewpoints on client-side languages met to agree on a common vision for the future of Javascript... The goal of the Dash effort is ultimately to replace JavaScript as the lingua franca of web development on the open web platform.
Which is what led Brendan Eich to say:
What's wrong with playing hardball to advance the web, you say? As my blog tries to explain, the standards process requires good social relations and philosophical balance among the participating competitors.

Google's approach with Dart is thus pretty much all wrong and doomed to leave Dart in excellent yet non-standardized and non-interoperable implementation status. Dart is GBScript to NaCl/Pepper's ActiveG.
Comparing any technology company's actions to what Microsoft tried to do to the web in the 90s is basically like shouting "HITLER" in a synagogue, so when the guy who wrote Javascript says this, maybe you should start listening to how your company is being perceived by the rest of the industry
posted by crayz at 5:39 PM on October 11, 2011 [2 favorites]


Civil_Disobedient wrote: The single biggest gripe I have with Python is that wxPython sucks donkey nuts, but even as such it's leaps and bounds ahead of, say, Swing.

I hate to say it, because it's not very Pythonic, but PyQt easily wins here. I was writing a replacement for HyperPin the other day, and found that with PyQt I was able to define a clone in about 200 lines of QML, and I don't even know QML. It even has a bunch of eye candy that comes pretty much for free.

As far as data crunching goes, many modules have versions available that are implemented in C rather than Python, making for much faster execution, at the expense of easy use of a debugger.
posted by wierdo at 5:46 PM on October 11, 2011


What's wrong with playing hardball to advance the web, you say?

TBH I don't see it as all that different from what the webkit/mozilla guys are doing with "HTML 5". Not that I don't have a good old gripe about that once in a while.
posted by Artw at 5:47 PM on October 11, 2011 [1 favorite]


Comparing any technology company's actions to what Microsoft tried to do to the web in the 90s is basically like shouting "HITLER" in a synagogue, so when the guy who wrote Javascript says this, maybe you should start listening to how your company is being perceived by the rest of the industry

It's also about the same level of argumentative sophistication.

He's right that GOOG is going to have to go to standards bodies to make anything that will really ever get adopted, but going to a standards body with a v0.5 release isn't going to do anyone any favours either.
posted by GuyZero at 5:49 PM on October 11, 2011


How's it compare to the last language to come out of Google?
posted by kenko at 5:51 PM on October 11, 2011




You see that in how the big libraries keep needing to provide features like modules and object-orientation that would usually be considered the domain of the language.

Nobody needs further OO features in JavaScript. Some libraries keep providing what you're talking about because some developers don't want to learn to do things directly with the features JS provides. That's their privilege, but whatever warts JS has, missing OO features is not one of them.
posted by weston at 5:54 PM on October 11, 2011


JavaScript is dynamically typed. While that's great for small projects and prototyping, it's very easy to write code that's syntactically correct but semantically not what you want. Static typing helps a great deal in this regard.

This argument strikes me as more or less equivalent to the assertion that if your units are correct when you've finished a physics problems, your answer will be too.
posted by weston at 5:56 PM on October 11, 2011 [1 favorite]


He's right that GOOG is going to have to go to standards bodies to make anything that will really ever get adopted, but going to a standards body with a v0.5 release isn't going to do anyone any favours either.

No the problem is because of Google's ownership of major web properties (search, G+, youtube, adwords) plus Chrome and Android, they can shove whatever they want down people's throats just like MS could in the 90s and fragment the web for their own benefit (in this case driving ever more users into their heavily data-mined ecosystem)

Add in the fact that it took an internal leak to even reveal that replacing JS was Dart's raison d'etre and Google looks like they're are acting in extremely bad faith here
posted by crayz at 6:00 PM on October 11, 2011 [1 favorite]


I still haven't forgiven Google for the feculent horrorshow that is GWT.
posted by Afroblanco at 6:05 PM on October 11, 2011 [2 favorites]


when the guy who wrote Javascript says this,

Javascript is the programming language world's biggest accidental success. Its popularity is a consequence, not a cause, of its omnipresence. Brendan Eich is entitled to his opinions but being "the guy who wrote Javascript" does not make him an authority on anything much beyond the history of Javascript.

maybe you should start listening to how your company is being perceived by the rest of the industry

If that were going to bother me, I wouldn't have gone to work there in the first place. Of course the rest of the industry is raising an eyebrow; Google is happily pouring its trillions of advertising dollars into pushing the state of the computing art in every direction it can, simultaneously. Of course most of those attempts will probably fail, but the successes will be awesome, and that makes Google the most interesting place in the computer industry.
posted by Mars Saxman at 6:10 PM on October 11, 2011 [2 favorites]


I'm mainly a JS dev these days... and yeah, I dunno.

I worry about this new class of languages which compile to JS, if only because it gives you a whole new range of browser-specific problems that you might need to debug. What do you do if you can't tweak the compiled output? You're kinda screwed...

That said, I love this whole library revolution that's come along with jQuery and whatnot. mccarty.tim -- you SHOULD be using jQuery for lots of stuff, because it smooths out a lot of the issues between browsers. When possible, it's just an alias to the native features, so you're not really losing much in terms of performance. It also means a whole lotta weird little plugins and tools of varying quality are instantly available to you, a huge help if you're trying to build stuff quickly...
posted by ph00dz at 6:13 PM on October 11, 2011 [1 favorite]


So it's basically flapjax, but without the intermezzos (intermezzi?) in the documentation?
posted by Monday, stony Monday at 6:14 PM on October 11, 2011


Needs a more appropriate acronym.

Dead In The Water? Designed by Corporate Committee? Maybe DART stands for something like Douse And Run Trembling?
posted by Twang at 6:17 PM on October 11, 2011


JQuery is getting a bit of a bad name these days because of some of the careless stuff people do with it, but it really is a powerful tool and the reason I do next to no browser specific debugging these days. Used carefully in combination with an understanding of JS it's very powerful.
posted by Artw at 6:20 PM on October 11, 2011


Add in the fact that it took an internal leak to even reveal that replacing JS was Dart's raison d'etre

The language in this memo is interesting, particularly if the goal is to make iOS web apps dependent on Google.
posted by Blazecock Pileon at 6:40 PM on October 11, 2011 [1 favorite]


Static typing helps a great deal in this regard.

This argument strikes me as more or less equivalent to the assertion that if your units are correct when you've finished a physics problems, your answer will be too.

CheeseDigestsAll wrote that static typing helps, not that it prevents all problems. And no type proponent would give the argument you describe; they would give the inverse, which is uncontroversial: if your units are incorrect, your answer will be too. So why not check your units?

(I personally find test-driven development about ten thousand times better at bug prevention. But I've never used Haskell, and until I do, I won't think I've given type a fair shake. And besides that, de gustibus non disputandum, chacun à son goût, different strokes for different folks, Gilgamesh and Enkidu at Uruk...)
posted by stebulus at 6:57 PM on October 11, 2011 [1 favorite]


Looks like google is also getting into the game framework thing. They've released PlayN, which allows you to write the game in Java and it converts that code into JS, Flash, Or Javascript.

Looks...okay I guess?
posted by hellojed at 7:23 PM on October 11, 2011 [1 favorite]


Has anyone seen a well-reasoned argument in favor of Dart as a language? I've been looking for one, but the 'praise' link led to basically a Java fan cheerleading similarities to Java, and throwing out sillies like trashing prototypical languages.
posted by tmcw at 7:31 PM on October 11, 2011




In practice, the only use that RPython gets is to write the PyPy Python interpreter.

That was all it was ever intended for, though; RPython isn't supposed to be a general-purpose language that you might ever use in real life.

What the PyPy project "does" is take that restricted interpreter and compile it, and then does a whole lot of JIT optimizations/compilations when it's interpreting your plain-jane Python.
posted by kenko at 7:50 PM on October 11, 2011


Yes but can it do Fibonacci?
posted by schwa at 7:53 PM on October 11, 2011


Pfft. While you are all having fun with your "we can even compile it down to C!" web languages, C++11 was officially approved and published by ISO on Monday.

ISO/IEC 14882:2011. Lamda functions. Variadic templates. Standardized threads, conditions, and mutexes; standardized concurrency. Old school.
posted by ceribus peribus at 8:05 PM on October 11, 2011 [1 favorite]


Isn't the main point of this to have the same language spoken on the server and the client and to have better, more consistent ways of communicating between end points than json and xml?
posted by empath at 8:05 PM on October 11, 2011


empath wrote: Isn't the main point of this to have the same language spoken on the server and the client and to have better, more consistent ways of communicating between end points than json and xml

What I was getting at with my comment about good RPC support is that, when done correctly, XML-RPC and SOAP are perfectly fine ways to communicate. Admittedly, they does get stupid when your language of choice has a bad library or code monkeys don't RTFM. Done right, it's just like making a local call. Done wrong, one has to resort to gymnastics. If you control both endpoints, don't do it wrong and it'll be great.
posted by wierdo at 8:16 PM on October 11, 2011


Yeah, but it's all kind of ugly hacks grafted onto a language that was never intended to support stuff like that.
posted by empath at 8:23 PM on October 11, 2011


This argument strikes me as more or less equivalent to the assertion that if your units are correct when you've finished a physics problems, your answer will be too.

Not at all. But it does eliminate all the potential errors in which the units are wrong.
posted by CheeseDigestsAll at 8:35 PM on October 11, 2011


Not at all. But it does eliminate all the potential errors in which the units are wrong.

Yeah, I was going to say that correct units aren't a guarantee of a correct result, but they are a prerequisite.
posted by Malor at 8:40 PM on October 11, 2011


I don't mean to be dense, but I think it's kind of cool that the server and the client are running the same language.

I have a dream that I can use the same programming language from end to end, and the most likely candidate seems to be JavaScript. Front end is obvious, middle tier on Node.js and persistence with MongoDB.

Having never tried this in a production environment, I'm not sure if it's a dream or a nightmare.
posted by ryoshu at 8:42 PM on October 11, 2011


Due to the nature of the web and the need to render dynamic data, a statically typed client-side scripting language will never gain traction. The language design nerds will never understand this, but it's the truth - dynamic typing is the very reason Javascript works.

Case in point - I recently tried to convert a fairly basic HTML/Javascript data grid to Silverlight. As it stands right now, I have one Javascript class that can render a data grid with fixed headers/columns, each row in the grid can be expanded to show a set of tabs, and each one of those tabs can render any kind of HTML control (data form, another grid, rich text control, anything). The outer grid can have whatever damn number of columns it wants, and those columns can contain anything they damn well want. We use this control to render over 50 different data grids across our app. The "correct" way to do this with static typing is to create 50 different controls. The way everyone who actually uses Silverlight does it to jump through an insane number of hoops to get around the static typing.

Yeah, yeah, Microsoft, Silverlight, Satan, blah blah. Dart is exactly the same thing - a misguided attempt to fuck up what makes client-side scripting awesome.
posted by dvdgee at 9:04 PM on October 11, 2011 [2 favorites]


Huh? With silverlight just set the ItemaSource property on the grid to any collection that implements IEnumerable and set AutoGenerateColumns to true. If you want to define your own columns it isn't much harder. Unless you are doing something strange you don't need 50 different controls or have to get around static typing.

The trick with Microsofts controls is to just do it their way. Don't fight the control.
posted by Ad hominem at 9:12 PM on October 11, 2011 [1 favorite]


@Ad Hominem: That works until you start introducing radio buttons, checkboxes, drop-downs, buttons, and all the other various widgets that make up the HTML grid. That's not even starting to take into account the expanded sub-row contents. Or, another way of putting it, the collections that natively implement IEnumerable are not the ones you're interested in using.
posted by dvdgee at 9:48 PM on October 11, 2011


when done correctly, XML-RPC and SOAP are perfectly fine ways to communicate.

The fact that there are environments with sufficient library support to render SOAP relatively painless should not be taken as evidence that SOAP is a sane design.
posted by brennen at 10:00 PM on October 11, 2011 [4 favorites]


Yeah silverlight is kinda outside the scope of the threes but:

If you are dead set on using the DataGrid control, there are is a native ButtonColumn and CheckBoxColumn. For DropDownLists you need to use a TemplateColumn, set up the binding to the TemplateColumn with a ValueConverter

You can cast an array to a generic list and bind it to a datagrid no problem, If you are working with a two dimensional array it is a bit tougher, but it is still doable.

I have datagrids with all of the above in them, and with user controls in the row details.
posted by Ad hominem at 10:04 PM on October 11, 2011 [1 favorite]


*sigh* All these new web languages when I can't even find a nice, compiled language that is like C or C++, but without the stupid pointer syntax, a bit higher level and without all the weird crufty bits.
posted by Canageek at 10:04 PM on October 11, 2011


You see that in how the big libraries keep needing to provide features like modules and object-orientation that would usually be considered the domain of the language.

This reminds me that I recently discovered Moose. I'm simultaneously very happy that it exists and very sad that it has to.
posted by asterix at 10:26 PM on October 11, 2011


Umm, how does dartlang.org crash Safari even after I javascript blacklist it?

You should show more respect for the portability that C's pointers brought us, Canageek. There is however a safe mode in D that eliminates pointers.

I'm happy that C++0x added lambda expressions and eliminated much stupidity around iterators. I'm unhappy that stupid Apple doesn't use gcc 4.6 like grownups.

I'm exceedingly happy that Haskell has vastly improved performance by switching to the LLVM. I'm unhappy that nobody uses Haskell commercially yet though.
posted by jeffburdges at 10:36 PM on October 11, 2011


Bank of America and Barclays both use Haskell. Wall Street seems to have embraced both Haskell and Ocaml. I am in the process of rolling out a distributed financial data analysis tool written partly in Erlang.
posted by Ad hominem at 11:23 PM on October 11, 2011 [1 favorite]


Its kind of ironic how the only place where functional languages have really caught on is the financial sector, because most of the FP geeks I know of are die-hard left-wing liberal socialist commie hippies and all.

[disclaimer: I'm a left-wing liberal socialist commie hippie FP geek.]
posted by destrius at 11:35 PM on October 11, 2011 [2 favorites]


This argument strikes me as more or less equivalent to the assertion that if your units are correct when you've finished a physics problems, your answer will be too.

Wow, this is brilliant: Extend the concept of a physical quantity with aditional, type-like attributes so you can immediately tell when a calculation is incorrect using a formal system. Then again, most physicists can't do simple vector calculus without violating all that is good and holy so I don't think it would have much success.
posted by Dr Dracator at 2:22 AM on October 12, 2011


Its kind of ironic how the only place where functional languages have really caught on is the financial sector

That's because there are a TON of math geeks in finance, and functional languages (especially Haskell) map extremely well to math problems. All programming is math, but Haskell, at least, makes it glaringly obvious, instead of hiding it like most languages do.

It's also fast as heck... not as fast as C, but very close.
posted by Malor at 3:38 AM on October 12, 2011




The language in this memo is interesting, particularly if the goal is to make iOS web apps dependent on Google.

I thought the most interesting thing in that memo is that Google wants to make Go their standard language for backend systems.
posted by gsteff at 8:20 AM on October 12, 2011


I wouldn't take that memo to speak for all of Google.
posted by Nelson at 8:41 AM on October 12, 2011 [2 favorites]


For those that missed it, here's a rather cool comment about JavaScript that got sidebarred a while ago...

Artw, while certainly relevant (and I'd already enjoyed the piece, so I'm glad you linked it), "sidebarred" has the odd property of sounding like it's own antonym: it was highlighted with extra longevity in the sidebar, not relegated to the side.
posted by IAmBroom at 8:57 AM on October 12, 2011


I thought the most interesting thing in that memo is that Google wants to make Go their standard language for backend systems.

This makes complete sense, though. They have a massively concurrent computation farm, so a language that they designed specifically to aid concurrency is a natural choice.
posted by spiderskull at 9:59 AM on October 12, 2011


After initially holding his nose up at it on Twitter John Resig of jQuery was quite approving of what they've done with the DOM... Hiding the DOM being of course the number one thing that frameworks do.
posted by Artw at 10:08 AM on October 12, 2011


PPK weighs in.
posted by weston at 10:30 AM on October 12, 2011 [2 favorites]


brennen wrote: The fact that there are environments with sufficient library support to render SOAP relatively painless should not be taken as evidence that SOAP is a sane design.

SOAP has ridiculous overhead that would leave me not using it if I were ever in any question about available bandwidth, but it's not that awful. There are many widely used legacy systems that are far, far, far worse.
posted by wierdo at 3:55 PM on October 12, 2011


SOAP: it's not quite as bad as CORBA.™
posted by Nelson at 5:41 PM on October 12, 2011 [7 favorites]


@jeffburdges It isn't the pointers I have a problem with; it is how you use them. reusing * is just a bad idea for one, there are a lot of other, unused, symbols on the keyboard. Also the synatax is confusing is heck, and I don't see any reason it has to be.

That said, for all the stuff I have to do, I don't really have to use them for anything other then passing by reference (Which seems a very silly way to doing things, instead of just allowing you to pass multiple values)
To be honest though, other then memory related things (Like creating an array of pointers to structures, then allocating memory for the structures as you need them) I've never really seen the point of pointers. Then again, I think of programming as a tool to solve problems and make my life as a scientist-in-training easier, not as a way to build programs, so I could be biased by the lens I'm looking at it through.

Also; stuff like the fact variable sizes don't have hard definitions makes things a pain, so I know scientists who work in Fortran, which is even crazier.

On the other hand, at least C is consistent; C++, which I am in a class on now, is just crazy. Some things are functions like in C, but then you have cout which passes via a stream, and new, which works like a function, but doesn't have {} for some reason....
posted by Canageek at 9:02 PM on October 12, 2011 [1 favorite]


There is considerable complexity in C++, enough so that I've called it a research language, but streams aren't hard : cout << x means operator<<(cout,x) which acts like fprintf(stdout,fmt,x) where fmt is determined by the type of x through the overloading of operator<<. It'll all become infinitely more clear once you learn about overloading, hell skip ahead and read that section now if you want to understand now.

I'm happy that C++ now suppose lambda expressions and closures, like :

int sum(std::vector<int> &v) {
  int total = 0;
  std::for_each(v.begin(), v.end(), [&total](int x) { total += x;} );
  return total;
}

You will not see that code in your class however. ;)
posted by jeffburdges at 9:24 PM on October 12, 2011


I ported a Pythonic(*) script over to C and got incredible speed-ups. System I/O and string handling is notoriously slow with Python.

Right you are... I think the standard practice is to take that slowest 5% and throw it in an external C call (or use a library that does basically the same thing).

but PyQt easily wins here

Hmm. I'm not too sure about that, but I admit a great deal of ignorance on this point so I'll take a closer look.
posted by Civil_Disobedient at 1:59 AM on October 13, 2011


This argument strikes me as more or less equivalent to the assertion that if your units are correct when you've finished a physics problems, your answer will be too.

I always used to do dimensional analysis to figure out half-remembered formulas during exams.
posted by atrazine at 6:32 AM on October 13, 2011 [1 favorite]


Who says R shouldn't be used?

I know this is from way up-thread, but when I was trying to learn to do stats on the computer, the answer to this question was "everyone who doesn't already know it."
posted by snuffleupagus at 7:33 PM on October 13, 2011


@jeffburdges: It isn't that I can't figure them out, it is that all of a sudden the style changes, and I can't figure out why. Everything in C was foo{}, now all of a sudden C++...mostly uses that. Except for here, there and there.
posted by Canageek at 5:13 PM on October 14, 2011


« Older An extended fugue state ramble about the shape of...   |   Michael Cuddyer: OF/IF/Photography Newer »


This thread has been archived and is closed to new comments