Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
On reducing the size of compressed Javascript (timepedia.blogspot.com)
32 points by mark_h on Aug 18, 2009 | hide | past | favorite | 3 comments


Since Javascript VMs have been making such strides lately, I've been thinking of implementing a Smalltalk VM on top of Javascript. If you JIT bytecodes to Javascript source, you'll be running at the "native" speed of the Javascript, and Smalltalk without the source code is extraordinarily compact. (About 10X and sometimes 100X over the equivalent C++ code.) But bytecodes fully decompile into source, just without the temporary variable names. A dictionary of the temp names for each method can be dynamically loaded later in the background, or just applied to stack traces at a later time by devs to aid debugging. To get even more compression, you can replace the message symbols with integers.

This would be a relatively easy task. A Smalltalk bytecode VM is really just a loop with a size 256 case statement, plus garbage collection. The GC and object allocation could just use Javascript's. Likewise, the UI could just piggyback on top of Javascript and HTML.


I'm sure you've seen it, but just in case you haven't: http://research.sun.com/projects/lively/ (basically a smalltalk environment in javascript/DOM, rather than the VM in javascript). There's a good tech-talk by Dan Ingalls on it that's worth watching.


For those that haven't taken a serious look at why google have built a lot of their applications in gwt (wave, health, adwords etc), and require google-like ui's, I'd recommend learning. Keep an open mind (find out WHY java is used, and what benefits you gain from it).

GWT is amazing, and the engineers involved like Ray & Scott Blum are second to none.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: