r/web_design • u/[deleted] • Oct 10 '11
Dart - New web programming language from Google
http://dartlang.org/5
u/lowmonthlypayments Oct 10 '11
feels like java
interface Shape {
num perimeter();
}
class Rectangle implements Shape {
final num height, width;
Rectangle(num this.height, num this.width); // Compact constructor syntax.
num perimeter() => 2*height + 2*width; // Short function syntax.
}
class Square extends Rectangle {
Square(num size) : super(size, size);
}8
u/degoban Oct 10 '11
Javascript is EcmaScript, They are not supporting the Ecma standard that already has classes and strong typing and a better syntax than this c/java solution, to push their own way... not a good thing.
4
u/WalterGR Oct 10 '11
I've heard a lot less about respecting standards (and not just browser-related standards) since Firefox, Safari, and Chrome ate away fairly significant amounts of IE's market share.
1
u/onebit Oct 11 '11
If you're going to break all the browsers why not do something extreme like DART?
4
Oct 10 '11
This looks great for writing standalone programs, but the main() execution feels like a cumbersome requirement for scripting web pages.
3
u/wolfman863 Oct 10 '11
hehe...
1 main() {
2 print('Hello, Dart!');
3 }
4 goto 2
damn...that worked on my apple ii+
1
u/T-rex_with_a_gun Oct 10 '11
this should be interesting...is this client side or server side?
either way, they need to cozy up to firefox to get it going (im assuming they will auto- add to chrome)
3
u/Jwsonic Oct 10 '11
I would assume it's clientside as its intended to replace Javascript. One of the options for running Dart is compiling it to Javascript (similar to coffeescript). So unless Firefox stops supporting Javascript, it should work just fine.
-2
u/lucidguppy Oct 10 '11
They should have come out with two syntax options - one curly and one pythonic.
-3
u/motang Oct 10 '11
Looks very similar to Javascript.
5
Oct 10 '11 edited Oct 10 '11
This is a legitimate question: do you know any programming languages apart from JavaScript? Dart does not "look similar to JavaScript" in any way except that they are both based on the same very basic "C-style" syntax rules that are also shared by C, C++, Java, PHP, and, literally, dozens of other languages. I certainly wouldn't say it borrows that much from JavaScript, and in fact it seems to have many improvements over JavaScript.
-1
u/motang Oct 10 '11
Oh for sure, but Google has been a heavy user of JS so that's why I mentioned that. But yeah I do know other languages, C++, Java, PHP.
0
Oct 10 '11
[deleted]
24
u/onebit Oct 10 '11
Fun fact, Javascript was created in 1995 by Satan.
2
u/bluthru Oct 10 '11
You know the story. The creator at Mozilla only had 2 weeks to get it out because of idiot management.
3
u/axitanull Oct 10 '11 edited Oct 10 '11
I know that JavaScript is a pain in the ass, but why invent a new web programming language when they can use an existing language, for example, Python?
(Yeah, I know that Python is a general purpose language. But reading their technical overview gives me the impression that they can just reuse the existing scripting language, and limiting some of its functionality such as client's system file access.)
Edit: I search for previous discussions, and I'm not the first one to ask this question. But answers are lacking and not actually satisfying/assuring.
1
u/Xdes Oct 10 '11
Well they probably wanted to start from scratch and make a web specific language. It resembles python a lot and that's probably why it compiles to javascript using python. In a way they did use python.
0
Oct 10 '11
[deleted]
2
u/Plasmatica Oct 10 '11
Did you click the link at the top?
0
Oct 10 '11
[deleted]
1
u/YellowSnot Oct 10 '11
From the technical overview:
You will be able to run Dart code in several ways:
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
12
u/peacemaker99 Oct 10 '11
Why must I learn yet another damn language?! I fail to see the benefits of learning Dart over the 10 languages I've got many years of experience with so far.
Maybe I'm just in a foul mood but I saw nothing that made me stop and go, "Wow, I NEED to learn this". Would anyone care to explain how this is better than PHP/Ruby/JS/etc?