Showing posts with label javascript. Show all posts
Showing posts with label javascript. Show all posts

August 15, 2010

JavaScript и Лисп

Недавно появился целый ряд новых проектов обеспечивающих совместимость JavaScript c Common Lispом:

Ред Дэйли сделал Лисп байндинги для мозилловской SpiderMoney, CL-SpiderMonkey. Ещё у него есть форк SLIMEа который делает возможным вещи как автодополнение для Parenscript кода и тп. На данный момент возможности расширения сервисов SLIME под DSLы не очень хорошо поддержаны, но archimag обещал сделать все как надо.

Некий rb разработал SWANK прокси и форк Parenscriptа которые вместе позволяют подключить SLIME к браузеру (!) через web sockets. Так же он работает над компилятором с Лиспа на Флэш.

Marijn Haverbeke, Alan Pavičić, и Iva Jurišić решили реализовать JavaScript компилятор в Лиспе. Местами он уже более производителен чем SpiderMonkey.

July 18, 2010

Put JavaScript in your Lisp and Emacs in your JavaScript

This month, Red Daly announced cl-spidermonkey, a set of Common Lisp bindings to Mozilla's SpiderMonkey JavaScript implementation.

Not long after that, I learned about Marijn Haverbeke, Alan Pavičić, and Iva Jurišić's CL-JavaScript JS to CL compiler. Apparently it's already faster than SpiderMonkey.

Not content with just having JS in CL, Red Daly also has a version of SLIME that integrates Parenscript to provide things like symbol completion (get it on github: http://github.com/gonzojive/slime).

A little while later another surprising discovery occurred: a certain 3b hacked up a SLIME proxy and a fork of Parenscript that lets you run a SLIME/Parenscript REPL in a browser using WebSockets. Apparently this all happened in a couple of days as part of the The 2010 Lisp Game Design Challenge.

Unrelated but still cool, 3b also wrote a CL to Flash bytecode compiler.

July 14, 2010

Book review: Nicholas C. Zakas, High Performance JavaScript

Nicholas Zakas' High Performance JavaScript is a collection of tips and techniques for improving JavaScript web application performance. Although everything contained in the book has been published before, this is the first time the information has been compiled into one concise reference.

One of the highlights of the book is the discussion of reflows and interactions between JavaScript code and the browser UI. This area of JS-browser interaction is frequently overlooked by web developers, but is frequently responsible for perceived performance problems. Bringing this area of JS performance to popular attention may be book's most valuable contribution.

High Performance JavaScript is not a book to learn JavaScript from, and its weakest points are when it tries to review JS principles. The book attempts to provide explanations of JS semantics and implementation techniques, but the descriptions are inaccurate at best, wrong at worst. The explanation of JS scoping rules in particular is misleading and at times erroneous.

The book also includes dubious language-agnostic techniques like Duff's device and backward counting loops. Without guides to profiling, performance tuning principles, and an understanding of JS implementations, all of which the book lacks, this kind of advice will cause more harm than good in the hands of novice JS programmers, and its inclusion into an introductory book on JS performance tuning is questionable. The same can be said for the IE6-specific performance hacks mentioned throughout the book.

While the book has good coverage of contemporary JS profiling tools, it does not attempt to teach approaches to profiling and identifying bottlenecks. Also missing are tips on isolating sources of DOM access and reflow penalties.

Another thing High Performance JavaScript is not, is a guide to those working on JS implementations - there is no data on the JavaScript feature use and performance bottlenecks of contemporary JS web applications and libraries.

High Performance JavaScript is a concise collection of wide-ranging information on improving the performance of JavaScript web applications. However, it should be read with a solid understanding of JS and knowledge of general techniques for identifying and addressing performance problems. Recommended as a reference for anyone writing web applications.

July 5, 2010

Lisp and JS events

Heads-up on some upcoming Lisp and JavaScript events:

Tuesday July 13, the Montréal JavaScript User Group is having a meet-up. James Duncan of Joyent will talk about why software sucks and JavaScript is the end of programming language history. Laurent Villeneuve will demonstrate idiomatic use of closures.

The 2010 Workshop on Scheme and Functional Programming is taking place at the University of Montreal August 21-22.

ILC 2010 will be taking place October 19-21 in Reno, Nevada. Abstracts are due by August 1. I'm not planning on attending.

January 8, 2010

First Montreal JavaScript user's group meeting

The inaugural meeting of the Montreal JavaScript user's group will take place in two weeks, on January 21 (to coincide with CUSEC) at 7pm at the offices of Bloom Digital (481 Avenue Viger Ouest, Suite 202, right near Square-Victoria metro).

Laurent Villeneuve will present a talk about JavaScript domain-specific languages. You can follow announcements on Twitter (jsmontreal) and the mailing list.

March 15, 2009

Parenscript birthday present

A while ago I mentioned I was going to announce some exciting news about web development tools. Shortly thereafter my priorities changed, and I shelved the project with the intention of picking it up again in the future. Then I remembered about LispNYC's participation in the Google Summer of Code program - if I can't do the project now, why not try to get funding from Google to have a student work on it?

Here is what all this is about:

The PSDE project aims to develop an Emacs-based JavaScript programming and debugging tool for AJAX-based RIAs. The implementation will provide an unobtrusive client-side script that can be loaded alongside any JavaScript web application, and an Emacs interface (REPL) that will enable debugging of remote and mobile clients, including the possibility of no-reload drop-in for live user sessions.

Along with an interactive prompt/REPL, PSDE will provide a profiler, tracing and logging facilities, a DOM inspector, a completion and documentation system for DOM symbols, and other useful web programming tools, both by using the reflective capabilities of JavaScript, and by providing hooks (a la Open Implementation) into the Parenscript compiler to provide metaprogram information that cannot be gleamed using runtime techniques or analysis of JavaScript code.

In addition to providing a valuable tool to the web development community, the OI extensions to the Parenscript compiler included as part of the PSDE project will be useful in their own right to those wishing to create other web development tools based on Parenscript, or web developers using Parenscript and needing advanced JavaScript generation capabilities.


The project has its roots in the "browser Comet REPL" demo I gave during my talk about Parenscript at LispNYC in September 2007, but the idea of making a "browser SLIME" didn't occur to me until this past November, when Daniel Gackle told me: "Why don't you make a browser SLIME?"

If you are a student that might be interested in this project and qualify to participate in Google SoC, or know of such an individual, get in touch: vsedach@gmail.com. I'll be happy to answer any questions and help you with preparing an application. Google will start accepting student applications March 23rd, with the cut-off date being April 3rd.

UPDATE: LispNYC has not been selected as a mentoring organization for SOC 2009. I would like to fund this project myself, but currently cannot afford it.

February 2, 2009

Learn programming through JavaScript

I found a link to Eloquent JavaScript on some website shortly before posting the last blog entry about PCall, and just realized that it's written by the same Marijn Haverbeke. Interesting coincidence.

From a quick skimming, the book itself appears aimed at those new to programming. I like the style and the exercises used, and the coverage of JavaScript appears good without reading like a spec. The books also covers everything you need to know to get started building web applications. If someone wanted to learn programming by jumping straight into the web (a somewhat prudent thing to do in this day and age) I would recommend this book alongside SICP, it's certainly a lot better than most of the other JavaScript learning resources I've encountered.

In other Marijn Haverbeke-related JavaScript news, he also has Lisp implementations of a JavaScript parser and a JSON library. The former provides another way besides jwacs to get JavaScript code into Lisp, while the latter provides an alternative to CL-JSON.