Friday, December 29, 2006

110 Yaws-powered web sites

The latest Netcraft WebServer Survey reports that 110 sites are powered by Yaws. Last year, there were only 65 (as reported on Mickael Raymond's blog). So it seems Erlang/Yaws is gaining in popularity.

Thursday, December 28, 2006

Going back to mainstream languages...

I have been very busy lately on a new project at work. This project involves the rewriting of a DSL compiler/interpreter in Java. Of course, we will enhance the language, make it more intuitive, clarify its semantics, etc. So it's not a simple rewrite.

But the most important thing is that we decided to implement it in Java. This decision was not made based on the language merits, far from it. We expect our system to be used outside of the company, and a Scheme-based DSL may not be a wise choice for large governmental organizations or public services companies.

Now after having worked in Scheme/Lisp 95% of the time for the past 5 years or so, it is a real PITA to go back working in Java full time. Trivial things in Scheme become so verbose in Java! And my mind got used to the Scheme way of doing things...

Wish me good luck!

syntax-case emulation in SchemeScrip

I took some time to change the way Scheme definitions are scanned in SchemeScript to extract exact location information. This was initially done by reading source files with the Kawa read function, but Kawa only attaches the line number to pair objects. So when you press F12 to go to the definition of a globally defined symbol (like a procedure or a variable), SchemeScript puts the cursor at the start of the line containing the definition.

SchemeScript can now track the exact location information. When you press F12, SchemeScript now selects the symbol being defined.

To do this, SchemeScript don't use the Kawa read function anymore. I have implemented a simplified read function using the SchemeScript's Scheme lexer. And instead of returning an S-expression, it returns a syntax object that contains location information. These syntax objects are very similar to the ones provided by the syntax-case implementations. I have also implemented a very naive, simple-minded pattern matcher for syntax objects, called stx-match.

So here is the function that processes a define-macro or defmacro form:


(define-code-walker '(define-macro defmacro)
(lambda (stx resource recurse)
(stx-match stx
((_ (,name . ,args) . ,body)
(when (stx-symbol? name)
(new-dictionary-entry resource name 'user-syntax (callable-description name 'user-syntax))))
((_ ,name . ,body)
(when (stx-symbol? name)
(new-dictionary-entry resource name 'user-syntax (symbol-description name 'user-syntax)))))))


Looks like a syntax-case form, isn't it?

The syntax objects can hold various annotations. I'm sure they can used to implement all sorts of structured program manipulations.

Saturday, December 23, 2006

Yariv Sadan at the MSLUG

Next month, Yariv Sadan, a well-known Erlang blogger, will give a talk at the MSLUG. He will talk about ErlyWeb, his Erlang web framework.

Thursday, December 14, 2006

Yesterday's talk at the MSLUG

Guillaume Cartier, from MetaScoop, gave an overview of JazzScheme at the MSLUG last night. JazzScheme is the result of 10 years of development and the language itself is still in constant evolution (the next generation will be called Fusion and will run on top of the main Scheme systems, although only Gambit is supported right now).

JazzScheme is a Lisp language that tries to combine the best of Scheme (as a functional language), and Java (as an object-oriented language) with the concept of classes and interfaces. On the OO side, it introduces a number of very interesting concepts:

  • The syntax to access a field of an object is [obj x] and you call a method on an object using the syntax [obj (method arg1 arg2 ... argn)]. This syntax is composable, in the sense that the Java expression obj.f(1).g(2).h(3) can be written in JazzScheme as [obj (f1) (g 2) (h 3)].
  • A method can be closed on an object and produce a closure using [obj method], so one can write (map [obj method] lst). You then have the equivalence [obj (f x)] = ([obj f] x).
  • Overrideable configurations for (but not limited) to GUI components. Using this syntax, one can define the structure of a GUI widget (geometry, structure of children, etc.) and inherit/customize this structure in subclasses. This greatly simplifies the development of GUI.
The JazzScheme environment is a very sophisticated, dynamic development environment, with a lot of handy features. A very interesting one is the Debug View. When you press F8, you can select any widget/view in the IDE and inspect its properties/fields. You can even change its properties dynamically and test them interactively. This reminds me of the best Smalltalk environments.

Unfortunately, even if it is going open-source, JazzScheme will eventually die. The good news is that it will be replaced by Fusion, a new language incorporating all the nice features of JazzScheme but will also feature generic functions and will be implemented directly on top of Scheme.

Monday, December 04, 2006

Annoying syntax highlighting in SchemeScript

An experimental feature made its way to the latest SchemeScript release (damn!). Whenever you save a Scheme file, the source code is analyzed and variables are underlined and put in italic. This can be really annoying.

If you want to disable the feature, start the embedded Kawa interpreter and type the evaluate the following expression:
(remove-save-hook 'check-buffer-syntax)


Categories: schemescript.

Bug fix in lalr-scm

Julian Graham reported a bug in lalr-scm that occurs when there is no error recovery rule in the grammar and a syntax error is detected. I have just fixed it and packaged a new distribution. The official release is now lalr-scm 2.1.4.

Thanks Julian!

Categories: lalr-scm.

Friday, December 01, 2006

Scheme/Lisp in Montreal

Montreal is decidedly a nice place for Scheme/Lisp programmers. Take a look at the front page of the MSLUG and see by yourself. I have added a section listing companies where Scheme or Lisp is used. And I'm sure a lot of companies are missing from this list.

Del.icio.us: scheme, montreal.

Let it Snow!

It seems that a new Scheme project is underway. It is called Scheme Now! and is hosted at the University of Montreal, home of the Gambit-C Scheme system. I'm sure Marc Feeley backs this effort.

Any guess on what this is all about?

Update: I just saw a reference to Scheme Now! on the Gambit-C web page. So I'll guess that it is related to the upcoming Gambit-C code distribution infrastructure. This would explain the Marc's quote: "Scheme is like a ball of snow. You can add any amount of snow to it and it still looks like a ball of snow. Moreover, snow is cleaner than mud." Gambit-C can get a bigger and bigger user community if it can offer a module/code sharing infrastructure, much like PLT's PLaneT.

Del.icio.us: scheme.