Fork me on GitHub
#core-typed
<
2020-11-17
>
ambrosebs01:11:31

Early days, but I've been working on a reader based on tools.reader. Still brainstorming what to use it for related to type checking, but some interplay with the analyzer could give more precise error messages https://www.patreon.com/posts/refactoring-43799339

borkdude10:11:00

@ambrosebs I've also been doing something like this in edamame (also based on tools.reader), which is powering sci. Although it doesn't output an AST, it can include the original source string, so you can match on this in grasp: https://github.com/borkdude/grasp#matching-on-source-string It's basically read+string but also for all the inner nodes

borkdude10:11:32

I've been considering outputting an AST, which could be useful for sci, but currently it doesn't need one really. And whitespace hasn't really been a concern.

borkdude10:11:12

Someone commented at the sci repo that with a tools.analyzer-like AST there could be some optimizations but I currently don't see how an AST instead of sexpr adds more information to do optimizations. I'll be keeping an eye on this to learn more. Thanks!

borkdude10:11:53

Currently you can output as AST-like thing with edamame using the :postprocess hook which allows you to wrap the node (and source string and location) into a container to preserve more info (like saving locations for keywords)

borkdude10:11:37

Another interesting rewrite-clj alternative is https://github.com/carocad/parcera which is based on ANTLR