CoffeeScript Lightning Talk

8,794 views
8,715 views

Published on

Mark Wunsch gives a lightning talk about CoffeeScript

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
8,794
On SlideShare
0
From Embeds
0
Number of Embeds
7,459
Actions
Shares
0
Downloads
6
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

CoffeeScript Lightning Talk

  1. 1.             {"          } } {"         { { } }"          } }{ {"         { }{ } } _____ __ __"        ( }{ }{ { ) / ____| / _|/ _|"      .- { { } { }} -. | | ___ | |_| |_ ___ ___"     ( ( } { } { } } ) | | / _ | _| _/ _ / _ "     |`-..________ ..-| | |___| (_) | | | || __/ __/"     | | ________/|_| |_| ___|___|"     | ;--."     | (__ _____ _ _"     | | ) ) / ____| (_) | |"     | |/ / | (___ ___ _ __ _ _ __ | |_"     | ( / ___ / __| __| | _ | __|"     | |/ ____) | (__| | | | |_) | |_"     | | |_____/ ___|_| |_| .__/ __|"      `-.._________..- | |"                                                         |_|" " .oooooo. ooooo ooooo ooooooooooooo ! d8P `Y8b `888 `888 8 888 `8 !Mark Wunsch @markwunsch! 888 888 888 ooooo 888 888 888 888 888 888 888 888 888 ! ! !Exotic Programming Languages and the Web! `88. .88 `Y8bood8P 888 o888o 888 o o888ooood8 888 o888o ! !
  2. 2. var pg = require(pg); !//or native libpq bindings!//var pg = require(pg).native!!var conString = "tcp://postgres:1234@localhost/postgres";!!// error handling omitted!pg.connect(conString, function(err, client) {! client.query("SELECT NOW() as when", function(err, result) {! console.log("Row count: %d",result.rows.length); // 1! console.log("Current year: %d", result.rows[0].when.getYear());! });!});!
  3. 3. •  compiles into JavaScript!•  JavaScript s object model!•  the good parts !•  It s just JavaScript. !
  4. 4. fling = (img) ->! $(body).append img! img.show()! img.css! -webkit-transform: "rotate(#{rando()}deg)"! top: root.parseInt(img.css(top), 10) - rando 45! left: root.parseInt(img.css(left), 10) - rando 45! opacity: 0! root.setTimeout (-> img.hide().remove()), 5000!rando = (multiplier = 10) ->! num = Math.ceil Math.random() * multiplier! if num % 2 then -num else num!skus = (sku for id, sku of order.skus)!
  5. 5. if pin.properties.count isnt 1! for order, index in pin.properties.orders when (Date.now() - ! » Date.parse order?.submission_date) > (config.expiration ? 180000)!class Mob! constructor: (@name) ->! ! move: (meters) ->! alert @name + " moved #{meters}m."!!name = person.name!{name} = person!{name, age} = person!!tag = "<impossible>"![open, contents..., close] = tag.split("")!
  6. 6. But what about my debugger? Common concerns Compiled?
  7. 7. Thanks. Here are some links!•  http://coffeescript.org!•  https://github.com/jash kenas/coffee-script/wiki/List-of-languages-that-compile-to-JS!•  Line Number Mapping: https://github.com/jashkenas/coffee-script/ issues/558!•  Hello World in Dart: https://gist.github.com/1277224!•  Smooth CoffeeScript: http://autotelicum.github.com/Smooth- CoffeeScript/!•  The Little Book on CoffeeScript: http://arcturo.github.c om/library/coffeescript/! Mark Wunsch @markwunsch!

×