“One lang to rule them all and in parens let bind them.”
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 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 agerbil-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 ofgxc
andgsc
and requires thegxjs
runtime. gerbil-scheme
- A runtime for the 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 thegxjs-loader
. - ~gambit-scheme
- A runtime generated by the 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 thegxjs-loader
.
The “stable” packages are all available to load via npm
or yarn
.
yarn add gxjs
yarn add gxjs-loader gerbil-loader gambit-loader --dev
yarn add gerbil-scheme
yarn add gambit-scheme
(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!