libera/#commonlisp - IRC Chatlog
Search
11:54:01
beach
phae9: I don't really understand the code, but how do you handle custom reader macros?
12:08:59
jackdaniel
if you are willing to load whole software before editing it, then your parser may be the common lisp implementation itself ranging from a subset to a superset of the language itself ,)
12:10:12
jackdaniel
having that in mind a tree sitter is known to be very performant and flexible as far as static parsing goes
12:13:26
phae9
i was fed up with the default tree-sitter-commonlisp so I just went and made my own, its generally more accurate WRT symbol parsing and dosent rely on clojures grammar
12:14:45
jackdaniel
I think that technically slime could query the implementation about the indentation and other runtime things (because it is a langauge server)
12:14:56
phae9
emacs+slime is a different thing altogether, tree-sitter just reads a file and spits out a tree that editors (and other things like diffing algorithms) can use for different purposes
13:02:28
phae9
im sure you could hook up other applications to it for other features (difftastic for example) because thats one of treesitters good qualities, its quite composable
13:04:58
phae9
I know neovim can use treesitter for some other stuff e.g. (tree-sitter-textojects uses the `d-a-f` & `d-i-f` chords for "delete around/inside function")
13:18:13
beach
I guess I haven't kept up because of the limited usefulness in the presence of reader macros, so I read up on the Wikipedia article, and apparently, tree-sitter grammars are specifically designed for incremental parsing like in editors.
14:24:14
Bubblegumdrop
well, that's a question whether the cave empty of dragons is the same thing as the cave empty of knights <= how poetic
14:45:29
phae9
e.g. its designed to gracefully fail, be quite fast etc etc, more technical things that often require actually executing some model of the code are left to the likes of LSP's or something else like slime :)
15:25:40
phae9
np, i might add some reader macros from certain CL implementations (I already have special syntax for sbcl's package::(foo bar baz) syntax), but thats a bit more work and I'd like to get the current stuff working even better before I do that
15:48:04
beach
phae9: Are you aware that we have a working incremental parser for Common Lisp that uses Eclector to read the contents of an editor buffer with Common Lisp code? Since it uses the Common Lisp reader, it can handle custom reader macros.
15:54:16
beach
It is based on this: https://hal.science/hal-01887230v1/file/5-incremental-parsing.pdf work, but scymtym has since improved it quite a lot so that it handles changed reader states like input base etc.
17:39:57
jackdaniel
what would be an example of a reader macro that requires special handling by tge parser in the code editor?
17:44:14
jackdaniel
beach and scymtym work on a common lisp editor. one of its selling points is that it truly understands the code that is parsed
17:44:58
jackdaniel
scymtym linked a few nice demos in the past; see discussion from today (immedietely above)
19:14:38
random-nick
smlckz-: there are public logs for this channel https://irclog.tymoon.eu/libera/%23commonlisp?around=1730828397#1730828397
19:15:31
random-nick
the editor in question is called second climacs, but afaik it is not in a usable state yet