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 13, 2010

Лисп семинары в Северной Америке

2010 семинар Scheme и функционального программирования состоится в Монреале 21-22 августа. Коллеги будут вести презентацию доклада о JazzScheme. Планирую присутствовать, и выставить впечатления здесь.

2010 международная Лисп конференция будет в Рино, США 19-21 октября. В этом году не собираюсь.

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.

July 1, 2010

Новый Лисп стартап

Недавно Канадский Лисп-программист Уоррен Уилкинсон объявил о своем новом проекте - FormLis. FormLis состоит из комбинации вики и системы генерации веб-форм из простейшей разметки (пример), а так же безсхемной базы данных поддерживающей генерированные формы.

Уоррен решил описать конструкцию и использование встроенного Форт (Forth) компилятора в Лиспе (англ.). Интересно что Дуг Хойт посвятил главу своей книги Let Over Lambda конструкции встроенного Форт компилятора, но увидеть такое в веб-приложении неожиданно и оригинально.