DEV Community

Discussion on: try Scheme instead of JavaScript for UI

Collapse
 
jcubic profile image
Jakub T. Jankiewicz • Edited

You should look at LIPS my Scheme written in JavaScript, I'm close to releasing version 1.0 need to find more time and some motivation to work on it.

When version 1.0 will be ready I will create proper intro article that showcase all the features.
What's cool is that you don't need to rely on eval and bunch of functions written in JavaScript like in BiwaScheme.

Version 1.0 that I have already on devel branch (will release some beta version soon) have syntax like this (document.querySelector "div"). My scheme also have hygienic macros that still need to some work.

Some comparison between current version that is not master and npm:

(--> document (querySelector ".terminal") 'style (setProperty "--color" "red"))
Enter fullscreen mode Exit fullscreen mode

version 1.0

(--> (document.querySelector ".terminal") (style.setProperty "--color" "red"))
Enter fullscreen mode Exit fullscreen mode

and all that is just --> macro and basic syntax. The rest are standard JavaScript functions in the browser.

LIPS can work with any library and have only one small dependency which is bn.js that is needed if you want to have big number support.

Did I say that even that is custom lisp it's almost 100% compatible with R5RS specification? I hope it will also be more compatible with R7RS that I've started implementing.

BiwaScheme was great but because of it's implementation (byte code) it's hard to fix bug and adding new features.

And one more thing one of the demos is Preact (slim React) app written in LISP.

I have lot to do before and after version 1.0. Like I'm in process of creating Dev tools extension that will give REPL to LIPS apps. Will also create a blog on GitHub pages, where I will write tutorials that will explain how to actually write stuff. I was also thinking about helping people learn Scheme by adding Bookmarklet that add REPL to any website that have Scheme tutorial. But first I need to release version 1.0. I think that blog with RSS will be much sooner.