Archive for the ‘javascript’ Category

A leisurely read through ECMAScript v4

Tuesday, March 4th, 2008
“like”
The special type operator like is used to test whether an object “looks like” a particular type even without being of that type. For example,
var v: like { x: int, y: int }
will accept both of these values:
{ x:3, y:3 } : Point
{ x:3, y:3 }

Advice to language designers: If you ever get to the point where it feels logical and appropriate to add a language feature such as like, please, just give up.

The future will thank you.

Plenty more from where that came from.

Mmm… Prototype…

Sunday, November 20th, 2005

I love latest Prototype. It’s so rubyesque. For example, executing Rico.Corner.round function on each element in a document with the class section is now a one-liner:

Element.childrenWithClassName(document, “section”).each(Rico.Corner.round.bind(Rico.Corner));

Mmmmm…

Funny anecdote: the guy behind Prototype, Sam Stephenson (an obvious genius) was just on this RubyConf told by Obie what “conio” (his domain name) actually means. He had no idea! Here we had been thinking all along that it was a joke.

Don’t know what it means? Ask your closest latin american, but be prepared for him/her to blush.

JS/UIX

Friday, November 18th, 2005

You thought the Rails clone in JavaScript was crazy? Brace yourself…

This… is… a… port of Unix to JavaScript!!

Waaaaa!

Ruby on Rails in uhhh… JavaScript!?

Thursday, November 17th, 2005

Ok, I don’t know if this is completely insane or bloody cool. Probably a bit of both.

It’s a Ruby on Rails clone written completely in JavaScript that runs completely within one web page including a complete development environment! Play around with this demo
then click “show me the code” and you can actually see and edit the code right there!

Mind numbing.