Instant JavaScript Apps


This past summer I swung by Y Combinator a couple times to scope out the new startups. (Fun fact! I was in Y Combinator during the Summer of 2006.) Out of all the startups there one really caught my eye: AppJet.

They were setting out to build a quick-and-easy way to construct web applications using, their language of choice, JavaScript. They were doing all of this using Rhino, giving each application its own instance to play with. I met up with them to discuss things, how apps were going to be built, what standard libraries to provide; they were on a good track, and by the look of today’s launch, they were quite successful.

Just to list some really-cool things that they’ve done:

Just to give you a taste, here’s the full source code to a “shoutbox” application. (Remember, this is server-side/client-side mixed!)

  1. import("storage");
  2.  
  3. var historySize = 20;
  4.  
  5. if (! storage.msgs) {
  6.     storage.msgs = new StorableObject();
  7.     storage.start = 0; // first msg
  8.     storage.end = 0; // index after last msg
  9. }
  10.  
  11. if (request.isPost) {
  12.     var newText = request.params.newText;
  13.     storage.msgs[storage.end++] = request.params.newText;
  14.     while (storage.end - storage.start > historySize) {
  15.         delete storage.msgs[storage.start++];
  16.     }
  17.     response.redirect("/");
  18. } else {
  19.     print(FORM({id:"shoutform",action:"/", method:"post"},
  20.           INPUT({type:"text", name:"newText", size:40}),
  21.           INPUT({type:"submit", value:"shout!"})));
  22.     var messageDiv = DIV({id:"msgs"});
  23.     for(var i=storage.end-1; i >= storage.start; i--) {
  24.         messageDiv.push(P(storage.msgs[i]));
  25.     }
  26.     print(messageDiv);
  27. }

I’m very impressed: Congrats David, Aaron, and J.D.!

Posted: December 13th, 2007


If you particularly enjoy my work, I appreciate donations given with Gittip.

5 Comments (Show Comments)



Comments are closed.
Comments are automatically turned off two weeks after the original post. If you have a question concerning the content of this post, please feel free to contact me.


Secrets of the JavaScript Ninja

Secrets of the JS Ninja

Secret techniques of top JavaScript programmers. Published by Manning.

Ukiyo-e Database and Search

Ukiyo-e.org

Japanese woodblock print database and search engine.


John Resig Twitter Updates

@jeresig

Infrequent, short, updates and links.