Re: Aspects of JavaScript Schemes Jakub T. Jankiewicz 29 Dec 2020 16:36 UTC

> BiwaScheme seems to have only define-macro. Lips seems to have a
> syntax-rules implementation, but (define-syntax) and (syntax-rules) do
> not work in the REPL at <https://lips.js.org>.

LIPS have syntax-rules but the main page is really outdated the current
stable is 0.20.1 and few months ago I've attempted to implement full R5RS and
later R7RS Scheme including hygienic macro and full numerical tower. But there
was so many changes (including breaking) that I didn't created 0.21.0 but give
it name beta 1.0, so latest changes are in https://lips.js.org/beta.html.

I'm working right now on making beta version on home page, maybe I just
replace 0.20.1 it should be simple before I will have fully working new
website including blog.

There is quite a bit of unit tests for syntax-rules but it's not 100% correct
because when I started implementing it I've make naive symbol replacing
approach so it fail if you do some funky things with scope.
Failed test can be found in unit tests:

https://github.com/jcubic/lips/blob/master/tests/syntax.scm they are named
test_ so they are disabled. Basic usage will probably work fine.

Since syntax-rules (now I know) should properly handle lambda na let. I need
to refactor whole code into expansion time, because right now macros and
syntax-rules are evaluated at runtime (they are like procedures but do extra
stuff of evaluating the result code). That's why you can execute:

(define λ lambda)
(λ (x) (* x x))

I'm not sure if it will still work when there would be expansion time, but
it's nice that you can do that.

But the most important thing is how you interact with JavaScript, LIPS works
with any JavaScript library.

--
Jakub T. Jankiewicz, Web Developer
https://jcubic.pl/me