Fork me on GitHub
#clojure
<
2023-09-10
>
Ingy döt Net22:09:18

Say I have a language that compiles to Clojure code or directly to a Clojure AST and the compiler keeps track of the position/line/column/file of nodes for error messaging. Is there a way to convey that info to Clojure as metadata (or even a source map) to Clojure to report that info in error messages? Also wondering for SCI (<- @borkdude).

Alex Miller (Clojure team)22:09:37

Some errors leverage form metadata, but compiler stuff uses dynamic vars

Ingy döt Net22:09:37

is this stuff documented or explained anywhere?

Alex Miller (Clojure team)23:09:07

It is not really designed for extension tbh

Ingy döt Net23:09:06

Yeah, well of course. I wouldn't ask here if I'd read and could understand all the code 🙂 But I can play with things, and see what my needs are. Honestly I'm mainly targeting SCI which might be different altogether. I really don't know enough yet. I'll wait to see what @borkdude has to say tomorrow.

Ingy döt Net23:09:40

btw @U064X3EF3 I've read a bit about libjvm.so shared library. Is that a thing you know about? If so does it still get used and maintained? I can't find much info so far.

Ingy döt Net23:09:14

Also back to compiling to clojure I guess I could catch errors and rewrite them using my own generated source map files...

Alex Miller (Clojure team)23:09:03

No, I don’t know about libjvm