4 ms·
> SourceKit-LSP is built on top of sourcekitd 23 and clangd 23 for high-fidelity language support, and provides a powerful source code index as well as cross-la
by sdegutis 8y ago
> SourceKit-LSP is built on top of sourcekitd 23 and clangd 23 for high-fidelity language support, and provides a powerful source code index as well as cross-language support.
That's pretty much been Apple's motto for a while: need language support for anything other than compiling the language, like IDEs or documentation generation? Why not add it directly into the compiler? This has pros and cons, but personally I like the direction Microsoft has gone: rewrite everything in JavaScript (actually TypeScript) so that it's super portable and more easily embeddable.
- geodel 8y agoSeems Apple as a company is not totally hijacked by Javascript people. I am happy that Apple took some stand against Java/Flash/Javascript when it interfered with quality of user experience.
- xenadu02 8y ago> I like the direction Microsoft has gone: rewrite everything in JavaScript (actually TypeScript) so that it's super portable and more easily embeddable. That is not at all what Microsoft has done. C# LSP support is driven by their C# Roslyn compiler. Are you confusing this with their VS Code editor? LSP solves a completely different problem: MN (editorslanguages) by providing a glue layer that compilers and editors can plug into. The whole point of these things is to keep a single source of truth; why would you (poorly) reinvent a compiler for Swift when you can just use the actual Swift compiler?
- setr 8y ago>Why not add it directly into the compiler? afaict, most, if not everything, that the LSP is expected to put out is information that is already known to the compiler, as its required for compilation and error'ing. The LSP is just a standardized way to extract that information from the compiler, instead of re-implementing the work in the IDE.
- favorited 8y agoThose tools aren't added to the compiler, they're standalone pieces of software which use the LLVM toolchain as libraries. And that's an LLVM principle, not Apple's. LLVM and its related tools have always been designed to be used as libraries, not simply executables.
- woolvalley 8y agoIt's simple code reuse... you know that compilers are made of many modules and have stages right? Why reinvent writing a code -> lexer-> ast parser for your indexer when you already have a well tested and fast one in llvm? Did you know for example, that when you build your app in xcode that it uses that partial build product to also feed the indexer, so you don't have to scan the same code twice? https://www.tutorialspoint.com/compiler_design/compiler_design_phases_of_compiler.htm https://www.tutorialspoint.com/compiler_design/compiler_desi...