Remix.run Logo
worthless-trash 6 days ago

In Emacs

  (add-hook 'janet-ts-mode-hook
          #'ajsc-interaction-mode)

  (add-hook 'janet-ts-mode-hook
          (lambda ()
            (local-set-key "\C-c\C-x" 'ajsc)))

  (add-hook 'janet-ts-mode-hook
          (lambda ()
            (local-set-key (kbd "C-x C-e") #'ajsc-send-expression-at-point)))

In the janet itself:

    (def repl-server
        (netrepl/server "127.0.0.1" "9365" (fiber/getenv (fiber/current))))
If you have tight main loop, make sure you have something like:

    (ev/sleep 0)             
To allow the netrepl server to take time.

Start janet (usually i do it via jpm)

  $ jpm -l janet -d main.janet
Then m-x ajsc and localhost:9365

This should be default.

If you dont start it in debug mode, you can't redefine functions as they are running.

I have an example using it for live web stuff here: https://github.com/wmealing/janet-joy-live