Hacker News new | ask | show | jobs
by gsuuon 724 days ago
This is cool, I think an integrated compiler and LSP is a great standard for new languages. I'd go one further though and say that syntax highlighting should also be part of that language core. This way you have a single source of truth wrt to that language: how it should look, what it means and how it runs.

Tree-sitter is widely supported (both in editors and on web) for syntax highlighting as well as making semantic nodes available for external tools to interact with. Is there any chance you'd add a tree-sitter integration to this project? Or conversely, build out a compatible API that can be used with editors/tools that use tree-sitter's library?

The licensing is a bit confusing - for example, what happens with open-source projects that use this that are then used in commercial projects?

1 comments

> build out a compatible API that can be used with editors/tools that use tree-sitter's library?

That's an interesting idea. Tree-Sitter and Lady Deirdre are quite different in their approaches to parsing. Tree-Sitter is a GLR parser, while Lady Deirdre is a recursive-descent parser. In the Lady Deirdre API, there are customizable traits that let you define new types of files with parsers ("documents" in terms of Lady Deirdre). Perhaps it would be possible to create an adapter, but I would implement it as a separate crate.

> what happens with open-source projects that use this that are then used in commercial projects?

Good question. The idea is that if you link to Lady Deirdre in the Cargo.toml dependencies, it is up to the commercial project authors. They will compile the actual executable intended for selling by downloading both your crate and my crate. However, I'm not a lawyer, and this is not legal advice. Just my thoughts.