Show HN: Lady Deirdre 2 – Rust Framework for Compilers and LSP Servers
141 points| Eliah_Lakhin | 1 year ago |github.com
I would like to share with you my project, Lady Deirdre.
Lady Deirdre is a framework that helps you create new programming languages in Rust. It is specifically designed to develop compilers and interpreters with support for code editor extensions (LSP servers) from day one.
The framework includes essential components to design parsers and semantic analyzers capable of incrementally reparsing dynamically evolving source code.
Lady Deirdre can be seen as a replacement for preexisting projects with similar goals, such as Tree-Sitter, Rowan, or Salsa. However, Lady Deirdre aims to offer a unified framework API that guides you through the steps of programming language development, providing even more components necessary to develop a full-featured language ecosystem. For example, components to develop a source code formatter.
I will be happy to answer any questions.
Ilya
[+] [-] gsuuon|1 year ago|reply
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?
[+] [-] Eliah_Lakhin|1 year ago|reply
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.
[+] [-] armchairhacker|1 year ago|reply
That being said, I really doubt anyone will buy a commercial license. People don't sell compilers and IDEs, and the ones who do are large corporations who make everything themselves. Look at state of language tooling today: nearly every compiler is open-source, every language server is free, every IDE is free except JetBrains (a well-known company with a large reputation) and Sublime Text (being heavily replaced by VS Code), and anything not open-source has an active open-source alternative. Nobody's going to buy a license from you to sell their compiler, because nobody's planning to sell their compiler.
For this reason I'd recommend changing the license. I don't think it's overly-restrictive or dishonest, I think it's fair to expect being paid if someone makes >$200,000 off your work. But nonetheless it hurts adoption, a lot of people will see "proprietary" and not even read the license text. You're more likely to make money distributing it as MIT / Apache, letting it get popular, and setting up donations/sponsorships to fund development. But honestly, if you're looking to make money this isn't the space to do so: you could be hired by someone to work on PL, or you could sell something like a game, but you're not going to sell your own PL.
[+] [-] Eliah_Lakhin|1 year ago|reply
I agree with your point about the licensing. I would also add that tools for the development of compiler front-ends are quite a niche market. So, honestly speaking, I don't plan to earn much from my project regardless of the license terms. This work is part of a higher-level in-progress toolset, which is closer to the end users. I have dedicated it as a separate project primarily for public preview, with some restrictions on distribution and use, as I haven't decided on the overall toolset distribution model yet. But it is possible that I will change the licensing terms of Lady Deirdre in the future to something less restrictive (maybe even MIT) to make it more popular, this is just not my current goal. I apologize for any inconvenience my current licensing terms may cause.
[+] [-] giancarlostoro|1 year ago|reply
[+] [-] prmph|1 year ago|reply
So as it is, I seriously doubt that anyone wanting a quicker way to implement a language will use this; why would I want to hamper adoption of my language by hobbling it with such a license?
[+] [-] unknown|1 year ago|reply
[deleted]
[+] [-] winter_blue|1 year ago|reply
[+] [-] solarpunk|1 year ago|reply
[+] [-] WJW|1 year ago|reply
(did you know the game + expansion are available for 4.99 on Steam and it runs out of the box on linux? Just saying)
[+] [-] mdaniel|1 year ago|reply
It would have also gone a long way if you had mentioned the licensing, which I am always interested in: https://github.com/Eliah-Lakhin/lady-deirdre#copyright
As for a question: why the seemingly needless location of everything down in a "work" folder? Is there something else that you envision one day living at the top-level which you just planned for by putting everything someone would care about one further click away?
[+] [-] Eliah_Lakhin|1 year ago|reply
> why the seemingly needless location of everything down in a "work" folder?
It's just easier for me to organize the filesystem this way on my local machine. Everything that is unrelated to the development is outside of the work directory. Also, the license agreement refers to the "work". Perhaps it would be clearer for users if the work directory is clearly dedicated.
> Is there something else that you envision one day living at the top-level which you just planned for by putting everything someone would care about one further click away?
Everything that I planned to publish that is related to Lady Deirdre is already in the repository. I use this project for my other programming language project that I plan to release soon, but it will be in a separate GitHub repo. Actually, Lady Deirdre initially was separated from the language project codebase as I thought it may be useful for other programming language authors.
[+] [-] unknown|1 year ago|reply
[deleted]
[+] [-] weinzierl|1 year ago|reply
To be a true replacement, there is at least one crucial feature missing: A LICENSE file that starts with "The MIT License (MIT)".
Nothing against "source available" but thinking to have a chance to stand in for more permissively licensed projects is very much unrealistic.
[+] [-] vlovich123|1 year ago|reply
[+] [-] eqvinox|1 year ago|reply
How much, monetarily, would you be willing to contribute to implement that feature?
[+] [-] unknown|1 year ago|reply
[deleted]
[+] [-] mtndew4brkfst|1 year ago|reply
[+] [-] williamcotton|1 year ago|reply
[+] [-] unknown|1 year ago|reply
[deleted]
[+] [-] samatman|1 year ago|reply
[deleted]
[+] [-] itishappy|1 year ago|reply
> This work is proprietary software with source-available code.
> To copy, use, distribute, and contribute to this work, you must agree to the terms and conditions of the General License Agreement.
It's pretty clear on the rights granted:
> Please be aware that my work is proprietary software, intended for solo development. For this reason, the agreement requires you to automatically assign me the changes you make to my project's source code.
> However, if you want to create an extension for my crate, you can develop a separate crate that uses my crate's public APIs through Cargo. In this case, you don't have to assign me your work, and you can distribute your project under any permissive license, such as the MIT license.
These quotes are all pulled from the readme, and the last edit was 5 hours before your comment. Where's the lie?
[+] [-] unknown|1 year ago|reply
[deleted]
[+] [-] ilrwbwrkhv|1 year ago|reply
[deleted]