Skip to content

Instantly share code, notes, and snippets.

@ELLIOTTCABLE
Created August 21, 2009 05:20
Show Gist options
  • Select an option

  • Save ELLIOTTCABLE/171680 to your computer and use it in GitHub Desktop.

Select an option

Save ELLIOTTCABLE/171680 to your computer and use it in GitHub Desktop.
Puppy paws patter placidly through the pale passageways…
Paws
====
Take all the good bits of JavaScript. Leave out the ideological dependence on
the DOM, leave out the horrible insecurities regarding the prototyping system,
leave out the stupid psuedo–types–that–pretend–to–be–objects.
Now mix in a little Ruby: C extensions (speed when we need it, and the whole
ridiculous pile of C libraries at our disposal), intelligent handling of
nested scope and `self`, absolutely every thing in the system behaves properly
as is expected of a true thing (even if it’s implemented as a non–thing on the
backend, like Numeric).
Finally, garnish it with a few oddities from around the world: Io’s lobby
instead of any sort of global scope, Node.js’s obsession with eventual
programming and refusal to block for *anything*…
Wrap it up in a beautiful hybrid syntax, a bastardization of JavaScript’s
object notation, Io’s whitespace–based expressions, Python’s meaningful
indentation, and Ruby’s raw sex appeal.
Welcome to Paws.
Look & feel
-----------
Paws likes to feel pretty. Everybody knows that negative space is pretty.
a.thing = {widget: "foobar", whatsit: 2}
a.thing widget = "metasyntactic variable"
a.thing > another.thing
print( another.thing widget # metasyntactic variable
Unlike, well, every other language, we open up names to all sorts of stuff:
periods, apostrophes, even Unicode characters. Better yet, slots aren’t
restricted in the very few ways that names are; you can name a slot after
*any* string (even the empty string, `''`!) Of course, you can only
Prototypal inheritance
----------------------
A child of a thing is just an empty thing whose `isa` field points at the thing
it is a copy of. Missing slots are proxied to the parent thing.
foo = {} # <foo>
foo isa # <thing>
foo thing = 123 # 123
foo > bar # <bar>
bar isa # <foo>
bar thing # 123
bar thing = 456 # 456
bar > gaz # <gaz>
gaz isa # <bar>
gaz thing # 456
bar delete thing
gaz thing # 123
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment