Rails in the Large: How Agility Allows Us to Build One Of the World's Biggest Rails Apps
Neal Ford shows what ThoughtWorks learned from scaling Rails development: infrastructure, testing, messaging, optimization, performance.
Tracking change and innovation in the enterprise software development community
Posted by Werner Schuster on Sep 30, 2009
Despite Javascript's ubiquity, it's a hard language to like. Until the advent of VMs like Google's V8, Apple/WebKit's Nitro/SquirrelFish Extreme and Firefox' TraceMonkey, Javascript's performance was abysmal.
Incompatible implementations across browser make development painful as well. Libraries like jQuery and many others offer convenient abstractions and allow to program to one API and even out the incompatibilities.
Another approach to solving the problems is to hide Javascript completely and use it as a compilation target. Google's GWT is a mature example that takes Java code, written to a subset of the Java API, and compiles it into browser specific Javascript. One example of a real world application of GWT is the Google Wave client. Recently, a few more language implementations have joined the trend.
Avi Bryant, creator of the Smalltalk Seaside web framework, has created Clamato, a Smalltalk dialect that compiles to idiomatic Javascript. Avi described the design principles of Clamato in the InfoQ interview with him taped at FutureRuby.
The tutorial page for Clamato allows to open a Clamato (Smalltalk) class browser in the web browser and inspect and edit the Clamato source code. To look for classes, use the text field in the left upper corner of the browser. Interesting bits are the selfhosting PEG-based Clamato parser (enter "PP" in the textfield to see the classes for the parser and the various combinators).
A certain Seaside influence is visible in the Seaside-style HTML builder (the HTMLCanvas class in the Clamato browser). Visual components can use it to build their GUIs, for instance, the counter component from the tutorial:
renderOn: html
html h3 with: @counter.
html button
with: '+';
onClick: [@counter := @counter + 1. self reload].
html button
with: '-';
onClick: [@counter := @counter - 1. self reload].
The renderOn: html line defines a new method and the rest of the sample is the method body, which builds the HTML with a header and two buttons, which are set up with event handlers.
As it happens, another browser-based Smalltalk has appeared recently: GWT Smalltalk. The creator Peter Fisk has previously created the .NET and alternatively ActionScript-based Vista Smalltalk. GWTSmalltalk is written using GWT which generates Javascript that runs in the browser.
GWT Smalltalk is in an early stage right now but progresses quickly. It has support for using XMPP, which puts it in a good place to interact with with Google Wave (XMPP is an essential part of Google Wave). More details are available in the Industry Misinterpretations podcast interview with Peter Fisk and on the GWT Smalltalk blog.
Stepping outside the Smalltalk sphere, Python also has its Javascript compiler in pyjamas:
pyjamas is a stand-alone python to javascript compiler, an AJAX framework / library and a Widget set API
The best place to start is the online pyjamas book.
Another language that compiles to Javascript is Moby Scheme. What makes Moby-Scheme stand out is the way it's targeting mobile devices, for the moment Android, by compiling to Javascript instead. This is possible because of PhoneGap and because Android ships an efficient Javascript VM with its WebKit based browser. PhoneGap is a library that allows Javascript to access native device functionality, such as accelerometers, GPS, cameras, as well as other features such as address books. The creators of PhoneGap built it to bridge all the disparate smartphone devices which have very different programming environments, yet share one thing: WebKit and fast Javascript VMs. By giving Javascript access to device features, cross platform apps are possible for smartphones. See InfoQ's interview with the PhoneGap creators for a thorough overview of PhoneGap.
Technical Debt and Design Death
Free $40 SOA Demystified Book Offer
Learning to be a Good Product Owner: Foundation Skills
haxe.org/ Haxe also has had Javascript as a compilation target for a few years. It is a nice looking language but has sadly remained on the fringe for a long while.
GWT Smalltalk looks promising: I really like the idea of using a language other than java to write GWT-Apps. Alas, Smalltalk wouldn't have been the first language to come to mind: A Scala-Version would be nice and would maybe reduce much of the bloat that currently comes with using Java for setting up widgets...
And aside: cappuccino.org/ certainly belongs in this list: It uses ObjectiveJ, which is a variant of ObjectiveC. It takes some time to get used to it, but the language is a rather good fit for gui-work and it also comes with a complete framework to build browser-based apps. They built 280 Slides with it, on of the best looking browser-based app around...
Neal Ford shows what ThoughtWorks learned from scaling Rails development: infrastructure, testing, messaging, optimization, performance.
Stuart Halloway discusses Clojure and functional programing on the JVM in depth, and touches on the uses of a number of other modern JVM languages including JRuby, Groovy, Scala and Haskell.
Orion Henry and Blake Mizerany talk about the technology behind Heroku and the benefits of the new add-on system.
Chris Riley presents security issues threatening service based systems, examining security threats, presenting measures to reduce the risks, and mentioning available security frameworks.
This talk investigates technical issues encountered when moving to an Agile process.
Don Box and Amanda Laucher present “M”, a declarative language for building data models, domain models or external DSLs. Don Box's demos show some of M’s features and latest changes of the language.
It is four months since the SOA manifesto was announced; InfoQ interviewed the original author’s to get insight into the motivations and the process behind the initiative.
This article explains the impact memory barriers, or fences, have on the determinism of multi-threaded programs.
2 comments
Watch Thread Reply