SkillAgentSearch skills...

Gxjs

A JavaScript based Scheme runtime for Gambit and Gerbil.

Install / Use

/learn @drewc/Gxjs
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

#+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

View on GitHub
GitHub Stars16
CategoryDevelopment
Updated6mo ago
Forks1

Languages

JavaScript

Security Score

82/100

Audited on Sep 19, 2025

No findings