uiua-lang / uiua

A stack-based array programming language
https://www.uiua.org
MIT License
1.59k stars 116 forks source link

Did anyone manage to use it with Emacs? #13

Closed bortzmeyer closed 8 months ago

bortzmeyer commented 1 year ago

I try to use Emacs as an editor. To have Emacs automatically reload the file, I add:

(global-auto-revert-mode t)

When Emacs saves the file, it actually creates a new file which makes uiua miss it and display "failed to load /home/stephane/tmp/uiua/main.ua: No such file or directory (os error 2)". So, I tell Emacs not to make backup files, thus overwriting the file instead of creating a new one:

(setq make-backup-files '())

Now, uiua no longer complains, Emacs reloads the file if it is changed by an external program (I tested with vi and with uiua fmt) but not when it was changed by used uiua interactively: Emacs continues to display the old file, even when uiua changed it.

bortzmeyer commented 1 year ago

In the mean time, calling uiua fmt main.ua and uiua run main.ua from inside Emacs produces the expected result and may form the basis of a simple "uiua mode".

crmsnbleyd commented 1 year ago

thanks! jumping off this, would anyone like to start working on a uiua-mode? I'd be happy to help.

emiflake commented 1 year ago

I'd love to help here too. Facilities such as running the line you're on and displaying it would be great, especially with image support.

kaikalii commented 1 year ago

I use VSCode, so that is what I test the language server with. Unfortunately, I can't get VSCode to request stuff like semantic tokens or inlay values from the server, so I'm unable to test it there.

crmsnbleyd commented 1 year ago

https://github.com/crmsnbleyd/uiua-mode, initiated a repository, I'll start hacking. I'm on the uiua discord as well, under @crmsnbleyd if anyone wants to collaborate there

crmsnbleyd commented 11 months ago

uiua-ts-mode is now on melpa, if you all are interested.

cc @emiflake @bortzmeyer

kaikalii commented 8 months ago

https://github.com/crmsnbleyd/uiua-mode, initiated a repository, I'll start hacking. I'm on the uiua discord as well, under @crmsnbleyd if anyone wants to collaborate there

I've linked to this on the install page.