dart vs php

1,423 views
Skip to first unread message

droidguy

unread,
Oct 21, 2011, 3:13:39 AM10/21/11
to General Dart Discussion
What is the advantage of using dart over php? It should be something
significant in order to justify creating yet another language in the
same space.

Pimm Hogeling

unread,
Oct 21, 2011, 4:35:49 AM10/21/11
to General Dart Discussion
Hey Stan,

I would like to point out that Dart is not entirely "in the same space" as PHP: Dart is intended to be ran both inside the browser and on the server. For as far as I know, PHP has only been used for the latter.

To me, that's the main advantage right there. Instead of writing PHP to be ran on the server and an other language (probably JavaScript) to be ran in the browser, you're using the same language. Imagine you have some code on your server that converts JSON to HTML. If you'd want to make your webapp AJAX-ish (or AJAJ-ish in this case), you could have the client make additional requests to the server and have the server send the JSON back. The client can then convert that JSON to HTML using the exact same code as the code that does this on the server.

2011/10/21 droidguy <stan....@gmail.com>

Quildreen Motta

unread,
Oct 21, 2011, 6:16:08 AM10/21/11
to droidguy, General Dart Discussion
Being a sane language, for starters. Also, quoting The Sussman:

In our study of program design, we have seen that expert programmers control the complexity of their designs with the same general techniques used by designers of all complex systems. They combine primitive elements to form compound objects, they abstract compound objects to form higher-level building blocks, and they preserve modularity by adopting appropriate large-scale views of system structure. In illustrating these techniques, we have used Lisp as a language for describing processes and for constructing computational data objects and processes to model complex phenomena in the real world. However, as we confront increasingly complex problems, we will find that Lisp, or indeed any fixed programming language, is not sufficient for our needs. We must constantly turn to new languages in order to express our ideas more effectively. Establishing new languages is a powerful strategy for controlling complexity in engineering design; we can often enhance our ability to deal with a complex problem by adopting a new language that enables us to describe (and hence to think about) the problem in a different way, using primitives, means of combination, and means of abstraction that are particularly well suited to the problem at hand.

Also, Dart and PHP are entirely different languages, both in syntax and semantics. I don't get the "creating yet another language in the same space" part.
 
2011/10/21 droidguy <stan....@gmail.com>

Fabio Kaminski

unread,
Oct 21, 2011, 11:07:29 AM10/21/11
to Quildreen Motta, droidguy, General Dart Discussion
for what i´ve understand until now hacking dart (started yesterday ..
so maybe im not accurate)..

* first the language design is beautiful and by itself worth to look
at (at least for my personal taste)..
* it can potencially substitute (the hackish, acidentally designed,
and all in the heap) javascript in the browser with nice language
idioms for bigger client software (its where oop is good at)

from "technical" point of view:

the Dart -> JS compiler backend is borrowed from GWT .. so you have a
state-of-the-art javascript source-to-source translator (PHP being a
server only solution)

the Dart VM is created by the same people who created the V8 , so the
VM backend compiles directly to native code.. (and its very
optimized.. since it came from V8).. also note that PHP is bad at
this (VM´s with very low performance, and the language design dont
help)

The language is created with more machine-awareness.. so it will beat
V8 performance very soon(in javascript you end allocating to much in
the heap.. because its more a runtime language), and the language can
have the same(and even better) performance as now state-of-the-art
java.. that can be said by looking at language and VM design ..

non-technical:

you have to two well-know and experienced language and VM designers
genius on the team.. (with V8 team helping)
its supported by a wealthy company, so it can advance without
community support..

you should be aware that pop stuff its not synonym of good stuff..

for a good example look what facebook has ended doing because of theyr
php code base..

the madness called hiphop.. a PHP to C++ translator.. so im sure they
regreat a lot about they technological initial path (that was
timid(php + mysql)) and now they have to stick to it..

Quildreen Motta

unread,
Oct 21, 2011, 11:32:27 AM10/21/11
to Fabio Kaminski, droidguy, General Dart Discussion
2011/10/21 Fabio Kaminski <fabiok...@gmail.com>

* first the language design is beautiful and by itself worth to look
at (at least for my personal taste)..

The language is okay, there are lots of points where I have a small pet-peeve with the syntax (type annotations being one of them), but then, I'm a Lisp programmer, so people tend to not take my opinions on "nice syntax" and "beautifully designed language" too serious =/
 
* it can potencially substitute (the hackish, acidentally designed,
and all in the heap) javascript in the browser with nice language
idioms for bigger client software (its where oop is good at)

I'd argue prototypical OOP is plenty better than classical OOP -- also, let's remember here that classes in Dart are not first-class. The real problem with ECMAScript is that it only got a tolerable API for dealing with OOP with ES5, and even so, no built-in construct to handle traits or mixins out of the box, the alternatives ranging from slightly expensive to very expensive overhead. Self made it quite awesome (I still have to look at Ioke, but it apparently gets it in a nicer way), I wonder how much they've optimised it on the Self VM...

I agree with all your other points. Dart has got a nice core, and I hope the feedbacks are useful to them to decide what they should invest their time designing from there :3
Reply all
Reply to author
Forward
0 new messages