Evaluate J through emacs dynamic modules and libj.so.
I wrote this for fun and because I was getting fed up with how j-mode and org-babel interact.
NB. golfed abelian sandpiles A =: -[:+/@(-"2((,-)=/~i.2)|.!.0])3&< viewmat (A^:_) 12000*((>:*[:<.-:)N)=i.,~ N=:101
If you’re adventurous or curious enough to try this out:
- run make setting the appropriate variables
j-bin,include, andout. - ensure you have the
docs/helpaddon installed and customize thej-docs-help-indexvariable to point to where to find theaddons/docs/help/index.htmfile. - customize the
j-profile-ijsvariable to point to yours.
- J->emacs & emacs->J: marshall data between J and emacs.
- calculator: access J prompt in the mini bar through key binding <kbd>M-j</kbd>.
- viewmat: if the
viewmat.pngfile changes from executing some J, a buffer pops up to display it inside emacs. - plot: if the
plot.pdffile changes from executing some J, the buffer is opened and viewed throughpdf-tools. - ob-jpl: facilities for using
jpl-modein org mode. - joogle: emacs procedure that prompts for a J token and opens the corresponding NuVoc page in a browser.
- font lock: correctly classifies J tokens by verb, adverb,
conjunction, and so on (j-mode misidentifies things like
:and a few others) and adds a colors for nouns and names. Basically, withfor_a. i. 10 do.font-lock will recognize thatais a binding and color it, bindings such as\'a b\'=. ydon’t get highlighted as strings, and things likea:anda.get their own color. - pretty symbols: approximate J in APL glyphs through <kbd>M-p</kbd> and pretty symbol mode.
- Using J in this way can cause segfaults (wip)!
