4 ms·
I thought this article was about "building a language server" like the title says, but this is really just a grammar set for an existing language server.. unles
by ktm5j 7y ago
I thought this article was about "building a language server" like the title says, but this is really just a grammar set for an existing language server.. unless I'm missing something? I realize that this is being picky about wording, but it's a little misleading.
- _bxg1 7y agoMy impression was that it's glue code that wraps around an existing compiler and turns it into a language server. There are piles of resources out there already on writing compilers
- laumars 7y agoIs there any good resources on writing language servers? I've tried writing my own one but while LSP is well documented, it wasn't really beginner friendly (ie where do I start when writing one from scratch?).
- nickmqb 7y agoI didn't look for any resources beyond the LSP spec and VS Code documentation, so I can't offer any recommendations here I'm afraid. That said, looking back I'm pretty happy with the choice of using VS Code as the initial editor to get things up and running. While not perfect (e.g. VS Code will silently ignore your JSON message if you miss a closing brace), the docs are pretty good and it offers a reasonable level of debugging functionality (such as an output window where you can see messages sent to the language server). The Muon VS Code extension [1] is pretty minimal in itself, and it's MIT licensed so feel free fork and use it as a starting point. [1] https://github.com/nickmqb/vscode-muon https://github.com/nickmqb/vscode-muon
- laumars 7y agoThank you. I may well do just that. (this is what I love about open source -- when it works well everyone is giving each other a helping leg up).
- ahaferburg 7y agoThe Sublime Text LSP plugin has some debugging facilities, you can poke it however you like since it's written in Python, and the project is run by two of the most positive, supportive, and just plain nice people that I've ever dealt with in an open source project. https://github.com/tomv564/LSP https://github.com/tomv564/LSP
- nickmqb 7y agoAuthor here. I wrote both the language server and Muon compiler [1] from scratch. The language server reuses the compiler code, for parsing and type checking. I'm not sure which grammar you're referring to? The VS Code extension [2] does contain a grammar, but it's only used for syntax highlighting. [1] https://github.com/nickmqb/muon/tree/master/compiler https://github.com/nickmqb/muon/tree/master/compiler [2] https://github.com/nickmqb/vscode-muon https://github.com/nickmqb/vscode-muon
- tasogare 7y agoThe properties of the language listed on the websites are compelling, but I wonder what are you using the language for except the compiler?
- nickmqb 7y agoMy main focus has been on the compiler and language server so far. Next up is a tool for generating foreign function definitions. This tool will make it easier to work with 3rd party libraries. Once ready, I'm planning on writing some examples, such as perhaps a small OpenGL program to demonstrate this functionality. Hopefully that will encourage users to give Muon a try for their own projects!
- ktm5j 7y agoSorry for the misunderstanding, I didn't read clearly.. my apologies. Very cool!