Posts

Showing posts from July, 2012

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...

How we built the new Dart homepage

Image
I work with the Dart team, and we needed to update our dartlang.org site. It was a fun project to rebuild dartlang.org , so I wanted to give a shout-out to some of the libraries and tools that we used. The new dartlang.org Requirements for the new dartlang.org included: work on multiple screen sizes display more obvious calls to action load faster clean up CSS display more info on the home page To achieve these goals, we used the following tools: Bootstrap  CSS and widgets Jekyll  (and plugins) site generator Markdown with kramdown  text file formatting Pygments syntax highlighter Compass CSS framework Bootstrap + Compass for SCSS Font Awesome for sprite icons Make build tool optipng image shrinker App Engine hosting Bootstrap , from Twitter, is a slick set of CSS styles and simple JavaScript plugins. Bootstrap has a grid system, pre-defined styles, and most importantly a sane set of defaults for adaptive layouts. Jekyll is a st...