9 ms·
From whatever little I see, I am already hating it :-) This looks like Java for Javascript, if that makes any kind of sense. We are in the year 2011, PL design
by zohebv 15y ago
From whatever little I see, I am already hating it :-) This looks like Java for Javascript, if that makes any kind of sense. We are in the year 2011, PL design has progressed so much since 1990 that such an anachronism is unpardonable. I sincerely wish that companies like Google focus on hiring the right kind of person for designing programming languages.
What is frustrating is that there are so many people who can do this job right, yet we are stuck with amateurish programming languages designed by companies like Google. Please try and hire people like Oleg Kiselyov, Simon Marlow, Erik Meijer or some one from the possible hundreds who have worked deep in PL theory for literally decades. On the face of it Gilad Bracha has great credentials, credentials that would make the HR folk happy but one look at some of the stuff he writes and we know things are not going to be good.
http://gbracha.blogspot.com/2011/06/types-are-anti-modular.html http://gbracha.blogspot.com/2011/06/types-are-anti-modular.h...
I think Phil Wadler gave him more respect than was due in the comments :-) Microsoft hired Anders Hejlsberg for .Net which I don't think was a good idea, he is a great engineer but not a PL theory expert. They however "rectified" the situation by hiring Erik Meijer later and his impact via LINQ and F# and improvements in C# is obvious. Not to say that Hejlsberg is not good, but Meijer is better. Getting back on track, I may be wrong but Dart makes me groan. It is one thing to design such a language in 1990, but quite another thing to do it in 2011.
- masklinn 15y ago> This looks like Java for Javascript, if that makes any kind of sense. It completely does. And I love that it manages to be completely incoherent with Go, the other "Google Language". That's so symptomatic of what google does on that front.
- clownz0r 15y agoWeird that a systems language and a web language are different, huh?
- cromwellian 15y agoOne has pointers and no security model and produces binary processor-dependent artifacts, the other has to support untrusted code, mobile code that runs on any device.
- sipefree 15y agoGo doesn't really have pointers in the same manner as C, though, does it? As was as I was aware, you can only have a pointer to an actual object.
- enneff 15y agoGo allows you to take the address of any value. You just can't do pointer arithmetic like you can in C. That is, you can't address uninitialized memory.
- ootachi 15y agoI assume you mean "any lvalue"? You can't take the address of rvalues, can you?
- deleted 15y ago[deleted]
- SteveMcQwark 15y agoEssentially, you are correct. Lvalues can have their address taken while rvalues cannot. However, the Go spec doesn't speak in terms of lvalue vs rvalue, it speaks in terms of the addressability of different kinds of expressions.
- enneff 15y agoGo doesn't define "lvalues," in the spec, but it does define "addressability." My comment would be more accurate if I had said "Go lets you take the address of any value in memory." (stack or heap)
- masklinn 15y agoI said "coherent" not "identical". They could be coherent on shared features, such as type specifications or variable declarations, which have little to do with the "class" of the language. They're not.
- thirsteh 15y agoOne of the design goals: "Ensure that Dart delivers high performance on all modern web browsers and environments ranging from small handheld devices to server-side execution." Server-side execution...
- rdtsc 15y agoI don't see any reason why the syntax of a systems language couldn't be the same as the syntax of a web language. They can have different libraries available to them for example but syntax doesn't have to be different.
- sambeau 15y agoIf they had taken Javascript (or if you prefer a more coffee-script like syntax) and added Go's best features: interfaces-as-duck-typing, channels as fundamental types, string iteration over runes rather than bytes then they would have had a nice little language. The only thing I like is underscore for private variables. Go does the opposite (which I think is a safer approach): anything you want public has to start with a capital. It really works—it is both easy to do and easy to read.
- pacala 15y agoSystems language: move data from point A to point B. Web language: move data from point A to point B.
- dextorious 15y agoAirplane: move people from point A to point B. Boat: move people from point A to point B.
- pacala 15y agoVoiture: transport des personnes du point A au point B Car : move people from point A to point B
- dextorious 15y agoYeah, you didn't really get the point. Again. Systems language and web language are not just a different name for the same thing --like Voiture and Car. And, no, that their function defined in abstract and in totally generic terms is the same, doesn't make them the same thing. "move data from point A to point B" can be said for any programming language. As such, it's not particularly enlightening when comparing a language's suitability to a specific task. Turing-completeness aside, your argument misses the point that a particular language's design, compiler, library, toolset, (heck, even a particular language's community) can make it better suited for system programming or for web programming or for some other field.
- pacala 15y agoAvion: transport des personnes du point A au point B Boot: Menschen bewegen von Punkt A nach Punkt B We are talking past each other :) Here is your first comment interpreted through your second one. There is no reason to have different languages, but it's OK to have different jargon.
- dextorious 15y ago
- cromwellian 15y agoGo is a systems programming language, not a web programming language. It's like saying Javascript is incoherent with C.
- masklinn 15y agoYes, science forbid they be coherent on the exact same feature such as a type specification. Do you even read what you write?
- thirsteh 15y agoOne of the design goals: "Ensure that Dart delivers high performance on all modern web browsers and environments ranging from small handheld devices to server-side execution." Server-side execution...
- marssaxman 15y agoWhy should they resemble each other? They are unrelated languages produced by unrelated teams for unrelated purposes.
- moomin 15y agoI've got to say, I'm looking at it and thinking "That's it?". It looks embarrassingly like C# to me. Other than that: it's got coffeescript's fast initializer syntax, but it's not as concise. It's got types but AFAICT no type inference. No destructuring either. Only thing I can see it's really got going for it is some basic types which could have been provided as a standard Javascript library (and probably will become one...)
- munificent 15y ago> AFAICT no type inference. Not yet. > No destructuring either. There's a proposal floating around for pattern-matching that would address that too. This is still early days for the language, so there's a lot left to be done.
- moomin 15y agoI've thought about this, and I don't really think the "early days" defence is really acceptable in this case. If Dart isn't better in some appreciable way than Javascript, it has no reason to exist whatsoever. Equally, why not just adopt C# wholesale (it's even registered with the same standards body as Javascript) and give it a new library suitable for web programming?
- ayanb 15y agoOleg Kiselyov works for the U.S Navy. Don't think he was available. His essays on programming and computation are examples of an astounding mind - http://okmij.org/ftp/Computation/ http://okmij.org/ftp/Computation/
- mda 15y agoCould you enumerate what actually made you hate it? Familiarity is not necessarily a bad thing, and it seems it was one of the main goals of the language.
- zohebv 15y agoThis http://www.dartlang.org/docs/technical-overview/index.html http://www.dartlang.org/docs/technical-overview/index.html A delightfully blank page :-) Yes it mentions classes, interfaces, optional types, libraries, tools, structured yet flexible language. But all of these are a given. Is there nothing else? What about Generics, Covariance/Contravariance ? Type inference? Odersky thinks type inference in the presence of subtyping is untenable. Is it the same here? Are interfaces linearized as in Scala? What about immutability? It might be too much to ask for rank-2 polymorphism and Haskellish Type Classes but what about support for delimited continuations? Let me guess, these aren't "design goals". All I am saying is this isn't 1990 either.
- mda 15y agoI guess you should have a look at the language spec, there are answers to some of your questions and concerns. (http://www.dartlang.org/docs/spec/dartLangSpec.pdf http://www.dartlang.org/docs/spec/dartLangSpec.pdf) For example: " Dart supports optional typing based on interface types. The type system is unsound, due to the covariance of generic types. This is a deliberate choice (and undoubtedly controversial). Experience has shown that sound type rules for generics fly in the face of programmer intuition. It is easy for tools to provide a sound type analysis if they choose, which may be useful for tasks like refactoring."
- rayiner 15y agoAlmost none of those things are relevant to a dynamically-typed language. If you want a statically-typed language use a statically-typed language. What Dart brings to the table is a dynamic web language that's somewhat more structured than Javascript by using a class mechanism and optional typing. This is a great region of the design space, inhabited by languages like Common Lisp and Dylan.
- Dn_Ab 15y agoThe language does look less cumbersome than Java though. In terms of how interesting I find it, I would place it between Java and Haxe. While I cannot see what it buys you that CoffeeScript or even JavaScript do not, I do not have Google's vantage point to be able to adequately judge. I am only at the foot of the mountain they already scaled. And then tunnelled. Not only did they create V8, they write many boat loads of JavaScript so they are well placed to address both the technical and human pain points of scaling JavaScript. And in introducing a new language they can't stray too far from the mainstream if they wish large adoption. All that said, I am not moved. Also, F# is Don Syme's work not Erik Meijer's. Although F# probably gained from some Haskell people in Cambridge (the original one).
- ot 15y agoSorry man, accidental downvote. It was actually a +1. I agree with you, the first impact with the language is terrible, the syntax is too reminiscent of Java. It seems that at Google Java is popular for web apps (GWT, Closure, ...). This must have had an influence. I still fail to see what are the improvements over Javascript (while they managed to get the syntax worse). I guess a concurrency model, optional static typing, interfaces. Did I miss anything?
- tomp 15y agoAs I'm reading through the tutorial, it seems to me that it doesn't even have optional static typing. The tutorial claims: > Types can help you write and maintain your code, but they don't change how Dart programs behave. That, in my opinion, is not a type system, it's a documentation system. Writing String a = 1; should crash the program/produce a runtime error in a language with (optional) static type system. In Dart, in only produces a compile time warning.
- StuffMaster 15y agoI like it. It still gives dynamic types like Javascript, but catches a huge class of errors immediately upon compilation. It's exactly what I wish Javascript had.
- sid0 15y agoYeah, those aren't types, they're merely annotations.
- ajanuary 15y agovoid doSomething(String a) { // Do something 1 } void doSomething(Integer a) { // Do something 2 } doSomething("1"); doSomething(1); That's the sort of thing they mean by types don't change how programs behave. You can't easily change or remove the type system because it's tightly coupled with method resolution. If you have an optional type system, the evaluation semantics of the language cannot depend on the type system because you don't want the program to do something different if you are/are not using the type system. The fact that type errors are only manifested as warnings is a (perhaps odd) design decision, but it doesn't stop them being type errors. They could just as easily made them errors, and String a = 1 would give a compile time error. Hopefully they'll be a 'warnings as errors' flag for those of us more used to type errors being compile errors.
- munificent 15y ago> Please try and hire people like Oleg Kiselyov, Simon Marlow, Erik Meijer All brilliant people, but you have to remember that not everyone thinks types are all that matters. I like type systems, but the majority of the world's shipped code was written in languages with unsound type systems.
- kunley 15y agoThen what about "hire people like the creators of PLT Scheme / Racket" - they have extraordinary strong scientific background too.
- nzonbi 15y agoAgree with parent comment. My opinion, so far: Overall: uninspired. Below what I was expecting. Probably good for Google goals (tooling, migrating developers, etc) The language is somewhat interesting, but unfortunately saddened by an incredibly boring syntax. At this point, I am thinking that they would have been better off just going with the Go language for this. Looks like something good to migrate fleets of java engineers to, but not something that would inspire "hackers". Now I feel like it is not worth to create any "brigthly" IDE whatsoever. Just go with eclipse. I was planning to immediately rush to the language. But changed to wait and see now. Misses: - Incredibly uninspired, boring Java-like syntax. - Not everything is an expression. - Java-like classes, instead of anything more interesting. - Lacks simplicity, symmetry and beauty. - Semicolons. Some notes: In Dart, you can often create objects directly from an interface, instead of having to find a class that implements that interface What?? Why to blur the concepts of classes with interfaces and introduce a quirk? Beauty comes from simplicity and symmetry. named constructors: var greeter = new Greeter.withPrefix('Howdy,'); Mildly interesting. Every type in Dart is public unless its name starts with an underscore ("_") I laughed at this. I always have hated the practice to start with "_" for supposed private variables, in languages without true private. I like it this way in Dart. My little favorite syntax feature until now.
- haasted 15y agoIn Dart, you can often create objects directly from an interface, instead of having to find a class that implements that interface What?? Why to blur the concepts of classes with interfaces and introduce a quirk? Beauty comes from simplicity and symmetry Sounds like Java's anonymous classes. Quite a useful feature, actually.
- calebmpeterson 15y agoSounds like Java's anonymous classes. Quite a useful feature, actually. It's only useful because Java lacks first class functions and syntax for lambdas. This is the single most irritating thing about Java to me. When this is fixed with the release of 8, the only thing Java will be missing is a really good implementation of persistent data structures a la Clojure.
- BobTurbo 15y agoI have little knowledge of the latest trends in programming languages, but if your example of a good PL theorist is someone who designed LINQ, then I am going to have to take your opinion with a grain.OfType(Salt).Where(m => m.Value.Contains(nothing)).ToList<Salt>().OrderBy(m => m.irrelevance).FirstOrDefault<Salt>();
- olavk 15y agoDo you have a specific criticism of Linq, or suggestions to how it could have been designed better?
- BobTurbo 15y agoYes, it requires a wide-screen monitor. I don't think I can answer the other question as I don't see any value in it. Turning loops and so on into a giant, inflexible (unless you want two wide-screen monitors) daisy-chain of methods does not improve the readability or maintainability of code. It also encourages programmers to perform actions that should otherwise be in "repository" classes, in inappropriate places. The from item in blah syntax is just SQL rearranged, and SQL isn't as expressive as programming language constructs, so why try to emulate it? It encourages you to write the grain of salt statement I mentioned earlier, which requires programmers to read through and understand the implementation of what you are doing, instead of it being embodied in a meaningful method and called. Of course you could just wrap that in a method, and slowly grow the line to 2-3 wide-screen monitors as you add more conditions. The more tools you add to the core of a language, the more of a monstrosity of a kitchen sink it becomes (c#/.NET). Now you can loop over a list in 6 different ways! Hooray! That is why Dart looks good - a few basic concepts that can be used to build things suited to a particular problem.
- olavk 15y agoWell, if your example were meant seriously, it is needlessly verbose. ToList is not necessary in this context, and the type arguments to ToList and FirstOrDefault are not necessary since they can be inferred. And anyway, you can just insert line breaks if you think the chain is too long. So: grain.OfType<Salt>() .Where(m => m.Value.Contains(nothing)) .OrderBy(m => m.irrelevance) .FirstOrDefault(); I don't really get your verbosity criticism, sine any alternative I can think of (eg. using for loops) is much more verbose.
- discreteevent 15y agoI'm in two minds about it. Firstly I was hoping for something like a simplified Scala or a slightly extended Go. Its not either. On the other hand the surprise of seeing it coming out looking so mainstream (i.e. its a mix of javascript and java) is a reminder that really the language doesn't matter that much. The blub paradox is not half as important as one intuitively gives it credit for. See Peter Norvig's comments about how C++ programmers can be as productive as Lispers. Look at something like the iphone. The implementation behind the shiny interface is boringly mainstream, C, objective-C with standard OO GUI framework. Like it or not Google and Apple are about engineering and getting things done. From that point of view something like Haskell might improve things slightly but not half enough to make a significant difference to the end product. i.e. it just doesn't matter. In summary when I saw the language this morning my first thought was: "Nothing to see here". But as a result my second was: "Get back to work". Maybe that's not so bad.
- jronkone 15y agoAFAICT, Google is a lost cause when it comes to PLs.
- barrkel 15y agoType are indeed anti-modular - types create huge amounts of coupling across multiple module boundaries in ways that are not easy to wrap up, to componentize, if you will. If you create a module A, but the interface of that module (functions, classes, whatever you might have put in it) uses types from modules B and C, is it not anti-modular?
- pacala 15y agoDesigns are anti-modular. Types are descriptions of the design. They document the (anti-)modularity. Take the types away and you have the exact same anti-modular design as before.
- barrkel 15y agoIn so far as (a) the language has a static nominative type system and (b) these types describe values that pass between modules, all modules that work with types defined outside the module will require other modules that use the module to also include (implicitly if not explicitly) the module dependencies. You can get away from this by having a structural type system, or by being dynamically typed (duck typing ultimately being another form of structural typing). But within the constraints of the type system, you can't get away from this by merely changing the design - unless you put everything into a single module, which is the ultimate in anti-modularity.
- bane 15y agoIn my opinion, Go is an anomaly in a company dominated by Java developers. I mean, this is a company that has gone so far as to write what is essentially a Java to Javascript compiler. http://code.google.com/webtoolkit/ http://code.google.com/webtoolkit/ I wouldn't be surprised if "performance" of the language meant "able to get our vast fleets of mediocre Java developers to write web apps faster" rather than "able to execute faster".
- dextorious 15y ago"I wouldn't be surprised if "performance" of the language meant "able to get our vast fleets of mediocre Java developers to write web apps faster" rather than "able to execute faster"." Yes, because Google is notorious for hiring "mediocre developers". Or are Java developers especially considered "mediocre" by definition? Or does dabbling in Ruby/Python/Lisp/Closure/Scala/Haskell make you "non mediocre" by definition? It's the skills, it's not the language. I would like to see something with the scope, ecosystem and functionality of, say, Eclipse, written in one of the non-mediocre languages (no, Emacs doesn't come close).
- bane 15y agoAgain this is my opinion, and I say this as a very mediocre developer in a past life and having managed many developers, both mediocre and ninja awesome. I agree that there are some amazing Java devs out there. Most Java devs are not amazing (and heck most devs aren't amazing). But Java devs are not amazing with a frequency and depth that both boggles the mind and is entirely expected as that's the point of the language -- accommodate mediocre developers in a large shop producing boring enterprise code. If you look where it's publicly known that Google uses Java, it's pretty much in Ads. The most boring, enterprisy kind of dev job Google has, but it's the money maker so it has to work despite having unmotivated "I'm just here for the paycheck" developers hacking on it. Yeah, I know, it was used on the backend of Wave, and via GWT for the Wave web client (which was dog slow btw, I loved Wave, but have yet to encounter a web app as slow). And look where that got us. As an aside, here's an interesting little writeup about why GWT is bad (with bonus example by pg of all people) http://ryandoherty.net/2007/04/29/why-google-web-toolkit-rots-your-brain/ http://ryandoherty.net/2007/04/29/why-google-web-toolkit-rot... And, at least publicly that's about it. If a dev can't be bothered to just learn the syntax of another language in a couple of weeks in order to properly support their target platform, they are a mediocre developer almost by definition.
- dextorious 15y ago"Microsoft hired Anders Hejlsberg for .Net which I don't think was a good idea, he is a great engineer but not a PL theory expert." Wow. And I thought nobody in their right minds would question Hejlsberg's chops or the work he did for .Net. He is "not a PL theory expert"? Great. We need less of them in mainstream language design and more pragmatism.
- masklinn 15y ago> And I thought nobody in their right minds would question Hejlsberg's chops or the work he did for .Net. Why not? C# 1.0 was terrible and most of the version since have been exercises in trying to fix it by piling more stuff on, in order to replace previous tentative fixes which did not work for any value of "work" worth using because they lacked generality. > We need less of them in mainstream language design and more pragmatism. I hope that's a joke, PL theory experts are nowhere to be seen in mainstream language designs (some have managed to get a claw or two into C# to add actually useful features like... lambdas...), and the "pragmatists" have a field days reinventing problems (not solutions) instead (hello, Go)
- WayneDB 15y agoC# 1.0 was "terrible" for the reasons of being practical. You can design the most beautiful language in the world, but if all of the features you designed into it add exponential degrees of complexity to the rest of the system (parser, compiler, runtime, base framework, etc) then you're never going to release. What language do you think was perfect at it's first release?
- masklinn 15y ago> C# 1.0 was "terrible" for the reasons of being practical. No, C# 1.0 was terrible for the reasons of being a slightly improved Java, without some of the baggage (before it created its own, because you can't be a good java descendent without building a pile of legacy garbage) and nothing more. Fucking hell, I loathe this bullshit about "pratical", it's the most meaningless term since "strongly typed". You know what else is practical? Computed gotos, FORTRAN IV, Superzap, front-panel switches, punch-cards, tape decks and magnetic-core memory. Releasing C# without generics and half-deprecating all of the collection hierarchy (but leaving it in an undead state by not actually migrating users of old collections) a version and 2 years later was not "practical", it was a lack of foresight. Not having iterables was not "practical" it was "a pain", taking 2 releases to get properties (in the first place, and not so verbose you wanted to stab your eyes out) was not "practical" it was "whelp let's get this shit out now, who cares", having nullable references still isn't practical to this day. > What language do you think was perfect at it's first release? None, I've yet to see a perfect language at all. But there's a gap between a terrible language and a good language, or even an interesting language. C# 1.0 was nowhere near a good language. It wasn't even interesting. And it's not like this shit's new, most of it is multiple decades old at this point (the only language aiming at mainstream I've seen do anything even remotely novel as of late is Rust and its typestates). We're talking about making mistakes which have been solved for 20 years.
- 6ren 15y agoIt sounds like there's a lot of PL innovators† here on HN, who value new technology for its intrinsic value, rather than for its benefits. I would expect PL theory to deliver great benefits at about the same rate as for other fields, e.g. that pure mathematics does for physics - some of it does; though it's common for it to be reinvented independently by people trying to solve specific problems. BTW: Notwithstanding the over-general flame-bait title, I think his "types are anti-modular" is really just making the point that, while interfaces reduce your dependence on implementation, now you depend on interfaces. i.e. The problem with using types to hide decisions that you think will change is if your prediction about what will change is wrong. "On the Criteria to Be Used in Decomposing Systems Into Modules" http://www.cs.umd.edu/class/spring2003/cmsc838p/Design/criteria.pdf http://www.cs.umd.edu/class/spring2003/cmsc838p/Design/crite... Perhaps one solution is to specify all the types you use in a module, internally; and provide a mechanism for converting between equivalent types at the boundary, to remove the dependency while facilitating interoperation. This mechanism acts as a buffer or glue (or middleware) - a kind of interface between interfaces if you will. † Although the technology adoption lifecycle gives the impression that a new technology with interesting properties is just the beginning of great things, the vast majority of new things do not become massively successful - it's just that the lifecycle is based on those that were. http://en.wikipedia.org/wiki/Technology_adoption_lifecycle http://en.wikipedia.org/wiki/Technology_adoption_lifecycle
- dingfeng_quek 15y agoIt is easy to agree that there MUST be essential dependencies between modules in a system designed separated in a certain way. (Ignoring some philo arguments on identity, separation and reference point...) The issue is whether the interfacing technique adds in non-essential coupling. A technique that has at least the constraints of another technique will also have trivially have at least the non-essential coupling of the other technique. Types add constraints, thus increasing coupling (and decreasing modularity). Although types have benefits. And direct modularity is seldom the only concern. I.e. Correctness and reliability also enhances modularity in an indirect way - an erroneous module definitely decreases modularity.
- 15y ago
- bad_user 15y agoOn Anders - you're not giving him enough credit. C# had a hard constraint to start with - it was supposed to be an easy replacement for Java, it actually started from Microsoft's own Java implementation and it had to ship as fast as possible. Even so, the language evolved nicely as they left room for improvement in a forward-thinking manner. Also, C# 1.1 did have 5 things which I terribly miss from Java - delegates, P/Invoke, stack-allocated types without "special" exceptions, object properties and the GAC. From a theory-standpoint, none of them are groundbreaking, but we are talking about a language that's supposed to be grounded in real-world constraints.
- justncase80 15y agoword. Anders is awesome.
- artsrc 15y agoI know that you were not trying to praise Gilad, but I found that article really insightful and it gelled with my experience with CoffeeScript. In CoffeeScript compilation is entirely local and highly modular.