Gxjs
A JavaScript based Scheme runtime for Gambit and Gerbil.
Install / Use
/learn @drewc/GxjsREADME
#+TITLE: GxJS: (G)erbil E(x)tended (J)avaScript (S)cheme*
"One lang to rule them all and in parens let bind them."
- Introduction
I tend to forget the differing syntax and semantics amoung the billions[fn:1] of programming languages I need to read or write overy month.
Sometimes a meta-layer on top is just the thing I find very sexp. Thus, GxJS: A Meta-Scheme runtime for JavaScript.
This is a [[https://en.wikipedia.org/wiki/Monorepo][Monorepo]] for a few packages in a few languages that all come together.
-
Gerbil package: ~:js~ :: For some syntax to make JS FFI easier.
-
~gxjs~ :: An ~npm~ package that has a ~gerbil-scheme~ runtime and some nice extensions for working with JavaScript from gerbil, a scheme dialect.
-
~gxjs-loader~ :: A loader for ~webpack~ that converts Gerbil files to JavaScript using a local install of ~gxc~ and ~gsc~ and requires the ~gxjs~ runtime.
-
~gerbil-scheme~ :: A runtime for the [[https://cons.io/][Gerbil Scheme]] meta-dialect. Will including loading of Gerbil modules at runtime just like ~gxi~, the interpreter, allows.
-
~gerbil-loader~ :: A loader which uses the ~gerbil-scheme~ runtime and calls the ~gxjs-loader~.
-
~gambit-scheme :: A runtime generated by the [[http://gambitscheme.org/][Gambit Scheme]] environment that allows running of Gambit modules. Gerbil runs on top of Gambit and eventually transpiles to code which Gambit then transpiles to javascript. This run time runs that code.
-
~gambit-loader~ :: A loader which uses the ~gambit-scheme~ runtime and calls the ~gxjs-loader~.
- Installation
The "stable" packages are all available to load via ~npm~ or ~yarn~.
#+begin_src shell yarn add gxjs yarn add gxjs-loader gerbil-loader gambit-loader --dev yarn add gerbil-scheme yarn add gambit-scheme #+end_src
- Emacs Indentation and Highlighting
#+begin_src emacs-lisp (defun js-gerbil-syntax () (interactive)
;;(gerbil-put-indent '(.begin .or .any) 0)
(gerbil-put-indent '(js\#function) 1)
(gerbil-put-indent '({) 2)
;;(gerbil-fontlock-add
;;(cons
;;(concat
;;"(" (regexp-opt '(".let*" ".begin" ".begin0" ".or" ".any" ".not")
;; t)
;;"\\>")
;;;'(1 'font-lock-keyword-face )))
)
(add-hook 'gerbil-mode-hook 'js-gerbil-syntax)
- Footnotes
[fn:1] Ok, likely under 15 or so. But still!
Related Skills
node-connect
337.3kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
83.2kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
337.3kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
83.2kCommit, push, and open a PR
