Simple Dart + WebSocket demo
[EDIT: Updated on 2013-03-05] I just posted a simple demo of Dart with WebSockets . Not only does it show how to connect to a WebSocket server and send messages, it also shows off a few neat features of the Dart language . (The code follows below, or check out the full open source project .) Look mom, no classes! Dart is a class-based object oriented language, but that doesn't mean you are required to wrap everything in a class. No sir, this is Dart, not Java. In Dart, you can use top level functions and top level variables. Libraries for modularity Dart organizes code into libraries for modularity. For example, this code uses the dart:html library for the WebSocket code. Concerned about bloat here? Don't be! Thanks to tree-shaking, the code that you don't use is eliminated during a (optional) compile step. The Dart to JavaScript compiler uses tree shaking to help generate minimal JavaScript code (still more work to do here). An upcoming Dart to Dart script wi