Live data from Hacker News

Google introduces Dart, a new programming language for web applications

googlecode.blogspot.com

51–60 of 70 posts

Re: Google introduces Dart, a new programming language for web applications

#51
post #44
post #36

Earlier quoted context omitted.

Unfortunately, there is no type inference system (that I know of) that can handle types that programmers use in dynamically typed languages on a daily basis. For example, consider the Django admin property 'list_filter' [1] or the Clojure metaprogramming functions 'proxy' [2] and 'defrecord' [3]. [1] https://docs.djangoproject.com/en/dev/ref/contrib/admin/#dja... [2] http://clojure.github.com/clojure/clojure.core-api…

list_filter seems to be a closed sum type -- why do you think it's not simple to encode or infer as a static type? I'm not sure what Proxy is used for -- but it sounds like Template Haskell can probably implement it? defrecord seems like it refers to defining new types at runtime -- which is also possible via either late type-check or Template Haskell.

Actually, I didn't mean to type the whole function, but only the parameters... One would require something like union types, e.g. list_filter has type

  String | `a 
Now, this type is certainly encodable in a modern advanced type system (although most statically typed languages utilize type erasure for compilation, so you would need tagged unions (Algebraic Data Types) for this), but I cannot imagine that any language is capable of inferring such a type. Maybe OCaml, but again, we would need polymorphic variants for that.

Re: Google introduces Dart, a new programming language for web applications

#52

Earlier quoted context omitted.

I have no idea why people keep suggesting this. There isn't a single precedent for a "universal IL" that isn't somehow tightly bound to one implied runtime model, type system, etc., and yet people keep calling for something like this for the web. Look at the "bag on the side" that is the DLR, look at the attempts at making Jython run quickly, look at the failed attempts over the years at providing a common IL for UNI…

I agree with most of what you're saying, but I think an indirect counter-example is C. It's not technically a universal intermediate language, but it's widely considered to be a "portable assembly language"; which many vastly more dynamic languages compile down to. I think the web could use it's own version of something like C -- that is, a low level, no-frills language that maps closer to how hardware works. I imagi…

You're assuming that all code found on the web is well-written, without bugs and with no malicious intents. Both Java and CLR bytecodes are designed specifically in a way so that they are verifiable, so that the compiler can be sure that the code doesn't do anything it's not supposed to do (e.g. access IO functions, write to unallocated memory, spawn new threads, ...). Also, a browser has to be able to ensure that untrusted code can only use a limited amount of resources, that is why we have garbage collection, and VMs (interpreted/JIT compiled code can be controlled and interrupted more easily than native code).

Higher level constructs carry more semantics, that is why they are easier to verify/sandbox.

Re: Google introduces Dart, a new programming language for web applications

#53
post #51
post #44

Earlier quoted context omitted.

list_filter seems to be a closed sum type -- why do you think it's not simple to encode or infer as a static type? I'm not sure what Proxy is used for -- but it sounds like Template Haskell can probably implement it? defrecord seems like it refers to defining new types at runtime -- which is also possible via either late type-check or Template Haskell.

Actually, I didn't mean to type the whole function, but only the parameters... One would require something like union types, e.g. list_filter has type String | `a Now, this type is certainly encodable in a modern advanced type system (although most statically typed languages utilize type erasure for compilation, so you would need tagged unions (Algebraic Data Types) for this), but I cannot imagine that any language i…

Instead of (a < SimpleListFilter) you can use a type-class constraint and an existential, or an explicit record of methods. In Haskell, anything you use will basically be inferred, and Haskell can encode that, though you would have to choose different primitives to encode that relationship than subtypes.

Re: Google introduces Dart, a new programming language for web applications

#54
post #37

Earlier quoted context omitted.

You cannot add "full-type inference" on top of a language with a dynamic type system. You also cannot add such type inference to an object-oriented language, like Scala (it may be possible, but very hard and nobody did it). the main benefit is catching errors early Dynamic typing isn't about not specifying types. Dynamic typing is about creating types at runtime. This enables certain techniques that are very producti…

There's an real conflict between static typing and eval() or reflection. eval() is shown to be usable in a static typing environment by some of Don Stewart's papers, though it does take more effort on the language implementors' side. Reflection is achieved in Haskell, for example, using reflective type-classes (such as Typeable and Data).

Doh, too late to edit.

Above should read: "There's no real conflict"

Re: Google introduces Dart, a new programming language for web applications

#55
post #52

Earlier quoted context omitted.

I agree with most of what you're saying, but I think an indirect counter-example is C. It's not technically a universal intermediate language, but it's widely considered to be a "portable assembly language"; which many vastly more dynamic languages compile down to. I think the web could use it's own version of something like C -- that is, a low level, no-frills language that maps closer to how hardware works. I imagi…

You're assuming that all code found on the web is well-written, without bugs and with no malicious intents. Both Java and CLR bytecodes are designed specifically in a way so that they are verifiable , so that the compiler can be sure that the code doesn't do anything it's not supposed to do (e.g. access IO functions, write to unallocated memory, spawn new threads, ...). Also, a browser has to be able to ensure that u…

I am assuming no such thing, that's why I suggested pointers and such should be left out. I'm not actually literally suggesting that we put C in a browser, I'm using it as a design metaphor. You can do fast and low level without C style pointers (for example, fortran* .. not that I'm advocating fortran either )

Sidenote: GC wouldn't prevent anyone from stealing a lot of resources. Either way you can ask for a lot of resources and not give them back.

* Yes I know fortran has a thing called a pointer, but it's a lot different.

Re: Google introduces Dart, a new programming language for web applications

#56

Earlier quoted context omitted.

I have no idea why people keep suggesting this. There isn't a single precedent for a "universal IL" that isn't somehow tightly bound to one implied runtime model, type system, etc., and yet people keep calling for something like this for the web. Look at the "bag on the side" that is the DLR, look at the attempts at making Jython run quickly, look at the failed attempts over the years at providing a common IL for UNI…

I agree with most of what you're saying, but I think an indirect counter-example is C. It's not technically a universal intermediate language, but it's widely considered to be a "portable assembly language"; which many vastly more dynamic languages compile down to. I think the web could use it's own version of something like C -- that is, a low level, no-frills language that maps closer to how hardware works. I imagi…

How about using ordinary machine code and making the browser behave like VMWare? Such an approach would be good for both speed and safety, no? Yeah, that would require webapp authors to make separate binaries for different architectures, but if they're writing some monstrosity like a web version of Photoshop, they want that level of control anyway! Meanwhile the rest of us can keep on using HTML and hop off the standards treadmill.

Re: Google introduces Dart, a new programming language for web applications

#57
post #46

Earlier quoted context omitted.

Yes. And since Javascript is so popular, we should base the name of this IL on it- I suggest Java.

I'd rather avoid Carpal Tunnel Syndrome, thanks.

I'd suggest not typing out IL by hand then.

Re: Google introduces Dart, a new programming language for web applications

#58
post #10

That page crashed MobileSafari on iPad and continues to after a reboot. Is it just me?

Crashing Safari on OS X, too. Or rather, the tab hangs. It produces an "TypeError: 'undefined' is not an object (evaluating 'a[Ra]')" and "TypeError: 'undefined' is not an object (evaluating 'b.count')". The console was a bit hard to get to with webkit2 taking up 100% of a cpu and all that.

Safari 5.1 on Snow Leopard. No crashes. Works without any issues.

Re: Google introduces Dart, a new programming language for web applications

#59
post #18
post #11

Earlier quoted context omitted.

It's sending me back to Hacker News after it completely loads on my Blackberry.

Just go to Dartlang.org it's crashing in safari.

Safari 5.1 on Snow Leopard, no crashes here.
Post reply on HN