atom / language-clojure

Clojure package for Atom
Other
49 stars 48 forks source link

Tree-Sitter Grammar #80

Closed pedrorgirardi closed 5 years ago

pedrorgirardi commented 5 years ago

Hi, I've recently watched the talk and read the blog post on Tree-Sitter and I wondered if there are plans to write a grammar for Clojure.

Is "migrating" the current grammar something that would make sense for a contribution? If so, is it possible to provide some guidance on how to approach it?

Thank you!

Aerijo commented 5 years ago

@pedrorgirardi I don't know of any plans besides what's listed here.

As for migration, I don't think that would be possible. The systems are very different, and there is little overlap. You might use the TextMate grammar as a guide, to ensure you haven't forgotten anything, but it won't be a trivial translation. Actually writing the Tree-sitter grammar would effectively be from scratch.

^ Having said that, existing Tree-sitter parsers can help guide you on how to design one. I'll also be attempting a guide on it in a month or so. I've got setting it up done, but I'll be adding more on design choices and Atom integration.

pedrorgirardi commented 5 years ago

@Aerijo your guide seems like a very good introduction. You must have put a reasonable amount of time on that, thank you.

oakmac commented 5 years ago

FYI - I have started this project with tree-sitter-clojure. I have a very rough branch of language-clojure for Atom working locally here.

I will also be giving an Unsession talk about this at Clojure/conj next week if anyone will be there :)

pedrorgirardi commented 5 years ago

Ha! This is funny @oakmac because I've found tree-sitter-clojure just yesterday.

I won't be at the Conj, but the unsession should be great and I would love to attend and hear about your experience with Tree-sitter.

I use Cursive and I like it very much, yet I really like thinking about "programming environments" and what a Clojure programming environment could be. I experiment a little bit with VS Code and I had a great time working with Peter on Calva for some time.

Atom seems to be more "hackable" than VS Code, so it might be a more suitable choice for Clojure & ClojureScript programming environment. I would love to hear what you think about Atom for Clojure development and what Tree-sitter could possibly enable developers to build.