A semester of Haskell-language-server: an internship report
tweag.io
tweag.io
Conclusions:
I've been AFK from HLS development for a few months. Let me give you my status.
I do not find myself excited to work on GHC-related refactoring tools. I personally find that the stability and quality of the ghc-exactprint API has made it unpleasant for me to work on new refactoring tools.
Alan Zimmerman has done absolutely fantastic work on the ghc-exactprint API, and the effort is genuinely leviathan. I'm not exaggerating - it's a mind-boggling amount of work.
However, the result is still not easy enough to work with (for me) to make me want to work on it. I had a massive amount of energy and spent well over 60 hours on tactics and code actions. And by the end, I realized I could not trust that a future version of GHC wouldn't simply break all of it again.
https://github.com/haskell/haskell-language-server/issues/35...Original issue: https://github.com/haskell/haskell-language-server/issues/29...
If you’re curious about what that means for Haskell, try opening a Haskell project, starting LSP, and hovering a few variables while watching the HLS process’s memory usage.
That out of the way, I would suggest that you do give LSP a try. The beauty of LSP is that it doesn’t care what editor you’re using, so you can just use lsp-mode and get going.
in $current_year, LSP is considered an important part of a language’s ecosystem.
if there are glaring issues with it, something is seriously wrong- maybe the language itself has performance issues, or tiny userbase, etc.
If a language has a rock solid and performant LSP implementation, it says a lot about the current status and culture of that language with regards to its capacity as a professional-grade general purpose programming language.
* rock solid and performant compiler/interpreter
* rock solid and performant VM/run time system
* rock solid build tool
* large and helpful community
* wide array of free learning resources
* pragmatic approach to balancing new features with stability
it says a lot about the current status and culture of that language with regards to its capacity as a professional-grade general purpose programming language".
I'm a member of the Haskell community who takes an active interest in making Haskell more accessible for production use, so I'd be interested to know reasons, if any, we should prioritise the development of haskell-language-server above other parts of the ecosystem.
> I'm a member of the Haskell community who takes an active interest in making Haskell more accessible for production use, so I'd be interested to know reasons, if any, we should prioritise the development of haskell-language-server above other parts of the ecosystem.
Thank you for your response, I'll do my best!
It's not that a great LSP implies anything, rather that the inverse does; if a language (or its community) declares itself as professional grade, comparisons with other professional grade languages are inevitable.
The LSP is the second impression one gets are first installing the language and setting up a new project, and it's probably the most used tool in a day-to-day experience with the language; you spend more time navigating and reading code than compiling it (if not, my condolences).
If I pick Go or Zig (which is in beta), I get the following out of the box:
* Quick installation
* Easy integration into my existing code editor
* Full blown, blazingly fast LSP even if I'm on dinosaur equipment
* First code compiled and ran within minutes of downloading the first binary
Compared to your average functional programming language experience:
* Finicky installation on some systems, and/or not available on all systems
* LSP is available, but is either semi-complete, broken between versions, slow and/or expensive
* First compile often requires some compilation of the language/std itself, which can take minutes, or it fails with opaque errors in some dependency I don't know about
Some combination of above has been true for me with Erlang, Elixir, Clojure, OCaml, F#, Elm and Haskell. I'm a sucker for and love all these languages, but unfortunately most of them don't hold a candle (with regards to my previous points) to most other languages.
I want to emphasize that I prefer functional languages and use one or more daily (Clojure at work, Elixir and OCaml for fun), this is not a stab at them, merely a general observation.
I've heard about Rust's LSP being buggy, but I had great success with it when I used it in a project. It gave a lot of useful suggestions and linting in relatively complex situations so it's understandable that it would have a hairy edge cases. But I never really saw them in personal usage, which was a very different experience from HLS.
So my personal impression of rust-analyzer was "high quality", and HLS less so.
But I find that people that think like that are just swimming through tons of publicity and unable to make their way through it.
There's also other consultancies I can think of that make non-trivial efforts to foster a community around the language. Gaiwan has Lambda Island as a subsidiary that publishes video tutorials, hosts the ClojureVerse Q&A forum, and has dozens of open source libraries under the "Lambda Island" organization on GitHub, with active maintenance by Gaiwan employees. Then there's Juxt, which does more consulting than open source, but they have their own open source software (like XTDB) and libraries, which are also maintained by employees of the company. But personally, I think the dozens of individuals that Cognitect sponsors through GitHub is enough evidence for corporate backing of the language, considering who they sponsor end up spanning a vast majority of libraries and tooling that Clojure developers use every day.
Good riddance Haskell.