Hacker News new | ask | show | jobs
by lukasm 4370 days ago
Planning to build NodeJS like env in Dart?

I'd like to Dart to happen. What worries my is that Dart has Java EE mentality. Hipster programmers won't touch it and lack of traction may kill the project. What's the solution? Performance may be a great USP. Rewrite Gmail in Dart, so tools like Streak, Rapportive and other extensions won't kill the performance.

4 comments

> Planning to build NodeJS like env in Dart?

We aren't planning it, we've already done it. Dart comes with a command-line VM with a full-featured (IO, networking, etc.) set of libraries[1].

The performance is quite good and getting better[2], from what I understand.

[1]: https://api.dartlang.org/apidocs/channels/stable/dartdoc-vie... [2]: https://www.dartlang.org/performance/io/

Hi! The Dart VM does run on the command line, and can access files, directories, sockets, HTTP, web sockets, and more. The Dart VM is an asynchronous light-weight server. I don't think Dart has a Java EE mentality. Far from it. :)

[disclaimer: I work on the Dart team.]

The SDK is shipped with a standalone version of the VM which can do I/O (via the 'dart:io' package). You can use it to write command line applications and web servers. Basically, it's like Node right off the bat.

I/O performance increased drastically with 1.3. The performance is tracked over here:

https://www.dartlang.org/performance/io/

1.4 added experimental support for ServerSocket references, which allow you to share a socket across isolates (~"workers"):

https://groups.google.com/a/dartlang.org/forum/#!topic/misc/...

The round-9 techempower benchmark shows Dart as very impressive in its "Multiple Queries" runs. However, the json serialization not so much. Is there something in the works to speed this up or technical reasons it does not shine here? Also, what are the plans for speeding up regular expresssions?
With Dart 1.5 announced, I am interested in ensuring that Round 10 includes 1.5. I just posted a question [1] to our most active Dart test contributor: does the >= 1.3.0 specified in the pubspec.yaml ensure that we'll be testing on 1.5 in Round 10 or should we be more explicit about 1.5.0? If anyone else knows the answer I'd appreciate the feedback.

[1] https://github.com/TechEmpower/FrameworkBenchmarks/pull/864

It will just cause a `pub get` fail (Package foo requires SDK version >=1.5.0 but the current SDK is x.x.x), but it won't prevent the application from running. Only `pub` cares about that pubspec.yaml file.
There's a bunch of web frameworks that already as well:

Redstone is becoming increasingly popular: http://luizmineo.github.io/redstone.dart/

Whilst I've built a simple Express-like API: https://github.com/dartist/express

Which also includes a complete port of node's popular jade view engine: https://github.com/dartist/jaded