5 ms·
Could someone explain what's the difference between both approaches and what are the advantages of Clangd?
by raverbashing 9y ago
Could someone explain what's the difference between both approaches and what are the advantages of Clangd?
- barrkel 9y agoIn process vs out of process; and language-specific binding vs JSON-RPC. Moving stuff out of process means, increased reliability and potentially ability to share data across multiple clients. Moving everything to LSP with two supported transports (JSON-RPC and something more native) means that editors like Emacs, vim, VSCode can benefit from tooling without needing to link against a library and work with C bindings.
- ninkendo 9y agoMoving language parsing/refactoring/etc into a separate daemon is a step towards unifying tooling around specific protocols for interacting with compilers. Microsoft's effort towards a single language server protocol is worth mentioning: https://github.com/Microsoft/language-server-protocol https://github.com/Microsoft/language-server-protocol I'd love to see a future when new languages/compilers can implement this protocol for their external compiling daemons and just get support in all the various text editors/IDEs automatically.
- dwheeler 9y agoClangd implements the "Language Server Protocol" (LSP). More info about LSP here: https://microsoft.github.io/language-server-protocol/ https://microsoft.github.io/language-server-protocol/ https://langserver.org/ https://langserver.org/ A quick cut-and-paste from the first URL explains why LSP was created: "Adding features like auto complete, go to definition, or documentation on hover for a programming language takes significant effort. Traditionally this work had to be repeated for each development tool, as each tool provides different APIs for implementing the same feature. A Language Server is meant to provide the language-specific smarts and communicate with development tools over a protocol that enables inter-process communication. The idea behind the Language Server Protocol (LSP) is to standardize the protocol for how such servers and development tools communicate. This way, a single Language Server can be re-used in multiple development tools, which in turn can support multiple languages with minimal effort."