@PaniczGodek@aartaka@jack I am working in a toy PL (Garden) in this space, but details like go-to-def logic become more complicated when you allow redefinition.
Wilfred Hughes
5 Comments
@wilfredh @PaniczGodek @aartaka Are you assuming that the editor will be connected to a live system that can show you the source code of a given function when it was last compiled? In that scenario, the only tricky bit is the UX to show the difference between what’s in the file/on-disk and what has been compiled in the running image…
Jack Rusher@jack@berlin.social
@jack @PaniczGodek @aartaka Yeah, exactly.
The devil's in the details though. If the loaded function was on line 20, do you try to find the current version on line 25, or just pop up a buffer of the loaded version? Where does the user then edit?
One idea I've been thinking about is making the interpreter session speak LSP. That way you'd have go-to-def and completion based on loaded definitions, but it's unconventional.
Wilfred Hughes
@wilfredh but wait, isn’t LSP file-oriented? Clojure one is, and it sucks.
@jack @PaniczGodek
Artyom Bologov@aartaka@merveilles.town
@aartaka @jack @PaniczGodek Well, LSP reflects the state of the editor: the editor sends didOpen at the start, then didChange on every edit. So the server knows the editor state even without saving.
Sounds like you have a different model in mind though?
Wilfred Hughes
@wilfredh no, I simply didn’t know about it! Thanks for the details!
@jack @PaniczGodek
I'm working on arity errors in Garden, my toy programming language.
Rather than just saying "expected 3, got 4 arguments", I'm trying to report where the extra argument is, or what extra argument was expected.
Creating a new PL is so different from changing an existing one.
You need to worry about syntax, locals, scope, error checking, conditionals, interpreter loop, stdlib etc. You can work on these in isolation once you have a working implementation.
(My toy PL now does fizzbuzz!)
Creating a new PL is so different from changing an existing one.
You need to worry about syntax, locals, scope, error checking, conditionals, interpreter loop, stdlib etc. You can work on these in isolation once you have a working implementation.
(My toy PL now does fizzbuzz!)