News for hackers. Stuff that matters.
Re:Leaving Haskell Behind by pyrale on Thursday August 24, 2023 @08:04AM (#37247841)
As someone that has also written haskell for about a decade and moved away from it as a breadwinner recently (but for other reasons - I simply wanted to filter job offerings based on social utility rather than language stacks), I definitely agree with the author's first point: the Haskell community values learning extremely strongly. That's great because you work with curious people that have always something to teach and learn. But the community is not so strong when it comes to discard ideas after trying them, and so a professional haskell codebase, if not curated strictly, often ends up with lots of things that you can do but that you probably shouldn't use.

I, however, disagree about tooling. Haskell's tooling sucks, but having used several other languages since (python, js, java, rust, elm), most tooling sucks. After this tour, I miss the Haskell toolchain. Sure, cargo is great, but that's one in many, and most older languages don't have this. I wonder whether Rust can escape this fate as it ages. The author also mentions being dismayed by Python, so I guess that's mostly me seeing the glass half-full though.

Re:Leaving Haskell Behind by Tainnor on Thursday August 24, 2023 @08:14AM (#37247904)
I've also used several languages and IMHO, Haskell's tooling is some of the worst. Language server breaks with random errors all the time for me, I'm always confused about whether I should have ghcup or stack manage my Haskell versions (and what the benefits and drawbacks are), and so on. I have a project I work on from time to time, and I'm 100% sure that the next time I'll open it up, it will stop working again.

Python's mess of dependency and venv management system is probably equally bad, although my experience was that Poetry is decent.

By contrast, Ruby tooling usually works well (you can choose between chruby, rbenv and rvm, but they all work similarly, and Bundler just works(TM)), and Java has its warts but one of the best IDE experiences I've ever seen. Maybe the refactorings aren't as safe as in Haskell, but they're extremely easy to do.

Re:Leaving Haskell Behind by pyrale on Thursday August 24, 2023 @08:21AM (#37247953)
I've used stack+stackage, and I can still run all of my older projects. I agree that as a newcomer the choice is not evident, haskell is a small enough community that finding mentorship is not always evident if you don't know where to look.
Re:Leaving Haskell Behind by mananaysiempre on Thursday August 24, 2023 @08:48AM (#37248151)
> haskell is a small enough community that finding mentorship is not always evident

I don’t know about today, but ten years ago the answer was to hop on IRC and you’d get all of your IRC-sized non-FAQs answered, however difficult they are.

Re:Leaving Haskell Behind by bradrn on Thursday August 24, 2023 @09:22AM (#37248446)
I’m not on IRC, but the subreddit, the Discourse forum and the Discord server are all pretty good for this kind of thing too.
Re:Leaving Haskell Behind by pyrale on Thursday August 24, 2023 @08:54AM (#37248185)
There's libera chat now. But not everyone has the idea of looking there.
Re:Leaving Haskell Behind by tome on Thursday August 24, 2023 @10:54AM (#37249483)
It's still the case, as far as I know. Big list of channels: https://www.haskell.org/irc/
Re:Leaving Haskell Behind by revskill on Thursday August 24, 2023 @08:42AM (#37248101)
Not quite. I'm not sure about how Ruby with Bundler related to each other.

Recently, i upgraded Ruby, but then what's to do about Bundler then ? I'm confused.

Re:Leaving Haskell Behind by Tainnor on Thursday August 24, 2023 @08:46AM (#37248135)
Bundler is Ruby's dependency management tool, basically like npm or similar. It's come preinstalled with Ruby for a while now.
Re:Leaving Haskell Behind by bradrn on Thursday August 24, 2023 @09:21AM (#37248434)
> I'm always confused about whether I should have ghcup or stack manage my Haskell versions (and what the benefits and drawbacks are)

There was a long and drawn-out transition, but these days it’s quite simple: use GHCup to manage your tooling, and Cabal to manage your packages. At one point Stack was the best option, but no longer: it’s not as well maintained, and is missing a lot of features (see e.g. https://discourse.haskell.org/t/6849/23).

Re:Leaving Haskell Behind by Tainnor on Thursday August 24, 2023 @09:39AM (#37248642)
You say "don't use stack" and the other person in this comment thread says "use stack". Do you see the issue?
Re:Leaving Haskell Behind by bradrn on Thursday August 24, 2023 @09:59AM (#37248870)
Fair enough, though I’ll note that only I’ve given an up-to-date reference.
Re:Leaving Haskell Behind by Eddygandr on Thursday August 24, 2023 @10:27AM (#37249117)
Stack vs Cabal was a huge argument where I worked with multiple teams using different build tools. Add Nix and nix2whatever, and it was more fun. Spent half my time debugging build instructions
Re:Leaving Haskell Behind by pastage on Thursday August 24, 2023 @10:45AM (#37249347)
It is not that much better in Java land. Getting builds right takes lots of resources, keeping new and old things running is not trivial.
Re:Leaving Haskell Behind by Tainnor on Thursday August 24, 2023 @10:54AM (#37249480)
I haven't had that experience for newer code bases. Yes, there's some ancient "works only in my IDE" stuff but that's really not how modern Java is written.

Yes, there is a disagreement about whether to use maven or gradle, but IMHO they both work reasonably well out of the box.

Re:Leaving Haskell Behind by Mateon1 on Thursday August 24, 2023 @11:31AM (#37249994)
In my experience, if you have to build an older maven project, you have to go through a lot of painful hoops, mostly around HTTP vs HTTPS repos and java source/compiler versions. I have encountered many old projects that don't build out of the box, and of those, I've only managed to get about half working.
Re:Leaving Haskell Behind by twic on Thursday August 24, 2023 @05:46PM (#37254959)
Right now, things are pretty good. But this is surprisingly recent. Gradle and Maven have both been good at managing dependency versions for a long time. Gradle has also been good at managing the Gradle version, via the wrapper, for a long time; Maven has equivalent wrapper now, but it's quite new, and support in the wider ecosystem is patchy (eg a TeamCity Maven build step can't use a wrapper, i don't think). Meanwhile, there is no standard way to manage JDK versions; there are SDKMAN! and asdf, and they work fine, but they aren't de facto standards. Gradle lets you specify the JDK version to build with via toolchains, but this is quite new (6.7 in 2020). I have no idea if Maven has an equivalent.
Re:Leaving Haskell Behind by Tainnor on Friday August 25, 2023 @09:15AM (#37261351)
While what you say is true, the point about the JDK versions is mitigated a bit by the fact many things are backwards compatible. Although yes, if you jump from 8 to 17, you're going to run into some problems.

I'm not a huge fan of the gradle toolchain tool (I don't think gradle should be managing my JDKs and I would prefer if it could instead just fail the build if you use the wrong JDK version), but I do understand why it exists.

Re:Leaving Haskell Behind by mrkeen on Thursday August 24, 2023 @04:01PM (#37253820)
Yes. I've been in teams where there has been gradle vs maven arguments.

Right now the Mac (M1 or M2) users in our team can't run our integration tests. It has been suggested that if we migrate our 50-100 services to Java 17 then the tests will work for them again. Trying to do this breaks the Gradle scripts, and the errors are so vague I can't tell why it's complaining.

Re:Leaving Haskell Behind by Tainnor on Friday August 25, 2023 @09:17AM (#37261368)
While I understand what you're saying, the "XY doesn't work for mac users on M1/M2" is a really pervasive problem across all technologies.
Re:Leaving Haskell Behind by Tainnor on Thursday August 24, 2023 @10:56AM (#37249526)
In that same thread that you've linked, other people have later replied arguing for why they prefer Stack so... I don't really think that you've given an argument that is persuasive enough to someone who is new to Haskell.

(And I'm not even that new to Haskell. It's just that I don't use it every day and when I come back to it and have to remember the weird incantations and dances I have to perform to make HLS not crash or want to overwrite my stack-installed Haskell version, I'm usually rather annoyed.)

Re:Leaving Haskell Behind by pyrale on Friday August 25, 2023 @04:11AM (#37259307)
> In that same thread that you've linked, other people have later replied arguing for why they prefer Stack so...

I merely stated that I have no trouble running old projects using stack.

> I don't really think that you've given an argument that is persuasive enough to someone who is new to Haskell.

Honestly, cabal improved a lot since the old ages. For a beginner, either stack or cabal should be very fine imo.

> or want to overwrite my stack-installed Haskell version, I'm usually rather annoyed.

Not sure why you would want to do that. Either you use stack and let it handle your ghc install, or you don't, and I really don't see why you would use stack only for compiler install.

Re:Leaving Haskell Behind by Tainnor on Friday August 25, 2023 @09:12AM (#37261319)
> I merely stated that I have no trouble running old projects using stack.

I was referring to the linked forum thread.

> Not sure why you would want to do that. Either you use stack and let it handle your ghc install, or you don't, and I really don't see why you would use stack only for compiler install.

What I mean is that when I start VS Code on my Haskell project again after a couple months, it tells me that it needs to donwload a new version of GHC. And I don't know why since I didn't change anything about my project. And when I try to click on update, it fails and the HLS extension crashes. I can't tell you where exactly this goes wrong, but it's obvious that these tools don't all work well together.

edit: Now I see that my wording was confusing. You quoted me as saying that I want HLS to overwrite my GHC version, but what I meant was that I want to prevent HLS (actually, I should have said the VS Code Haskell plugin) from doing that. The subject of "want" in that sentence you quoted is "HLS".

Re:Leaving Haskell Behind by pyrale on Friday August 25, 2023 @11:42AM (#37262980)
Ah, didn't run into this issue, as I don't use vscode.

Apparently there is some work being done to improve the stack <> hls experience, but I wouldn't know how it's going and when it's being delivered: https://github.com/commercialhaskell/stack/issues/6154

Re:Leaving Haskell Behind by nonameiguess on Thursday August 24, 2023 @10:58AM (#37249556)
You posted a link to a forum. The official Haskell language "get started" page says to use both: https://www.haskell.org/get-started/
Re:Leaving Haskell Behind by george_____t on Thursday August 24, 2023 @05:34PM (#37254846)
It's listed after Cabal as an "alternative", so a lot of people will presumably ignore it if they don't see any reason why they'd want anything else.

I personally wish that page were even more opinionated, but it's politically tricky.

Re:Leaving Haskell Behind by talideon on Thursday August 24, 2023 @11:13AM (#37249771)
I expect that now that things are settling down around pyproject.yaml, Python's tooling will settle down. I've been settling on Hatch for most projects rather than using Poetry these days and Flit for smaller projects. It's managing to replace the mess of makefiles and shell scripts I used to have and supports standardised metadata. These days, I mostly use a combination of hatch, pip-tools (mostly when I'm dealing with lambdas and Django projects), and pipx whenever I'm doing anything with Python. it's not perfect yet, but it's much improved. The new pip dependency resolver still has its issues though if you haven't clamped your dependencies sufficiently and its solver can get caught in loops of excessive backtracking. Hopefully that'll improve too. pyenv is still somewhat hit-and-miss though.

What's really surprised me lately is how much better OCaml's opam tool has gotten! Last time I was using OCaml in anger, the experience was very, very clunky, but these days it's quite smooth.

Re:Leaving Haskell Behind by pdonis on Thursday August 24, 2023 @05:51PM (#37255017)
> I expect that now that things are settling down around pyproject.yaml, Python's tooling will settle down

First, a nitpick: it's pyproject.toml. YAML was considered for the language of this file and rejected in favor of TOML.

Second, unfortunately, I'm not sure I share your optimism. This is an area where IMO the Python developers have never been able to do things right. In fairness, they are trying to support a lot of very different use cases, but the proper way to do that would have been to let the communities surrounding each of those use cases invent their own tools, while focusing the standard tools in the Python standard library on the vast majority of Python projects that are pure python code--no extension modules, no weird compilation issues, just pure Python modules and packages for which build and install ought to be simple and straightforward. But even that simplest use case was never quite properly and standardly supported.

Even pyproject.toml illustrates this pattern: a new markup language was adopted, one which has no support in Python's standard library, which has no obvious advantages over previous file formats, and which now creates ambiguity between pyproject.toml and the previous supposed "standard" for declarative project metadata, setup.cfg. Which do I use now? I can't just use pyproject.toml because it doesn't include everything that setup.cfg does; and I can't just use setup.cfg if I want my project to be compliant with the latest build tool specs because setup.cfg alone is now considered a "legacy" build format. So now I have to use both, even for pure Python projects where this should have been a solved problem years ago.

At least the actual installation of pure Python projects is now a lot easier; once you have a properly built sdist or wheel, pip install will put it wherever you need. But the "properly built sdist or wheel" part is still IMO a lot harder than it needs to be for most projects.

Re:Leaving Haskell Behind by __d on Thursday August 24, 2023 @07:19PM (#37255800)
100% agree re: TOML. Just ... why? Is there really something so compelling about it that makes it worthwhile being different to everything else?

The fact that the PEP was proposed with this, discussed, accepted, implemented and deployed with this is indicative of the failures of process that lead to many of Python's problems. Python3, async, threads, GUI toolkits, the whole mess of tooling ...

Languages and their ecosystems need someone to say "no". To maintain a pragmatic path forward for users of the language, not developers of the language. Python hasn't got this. With all respect to Guido, and now the core group, they let this slide way too often.

Re:Leaving Haskell Behind by js2 on Thursday August 24, 2023 @11:40AM (#37250160)
[delayed]
Re:Leaving Haskell Behind by movpasd on Thursday August 24, 2023 @12:24PM (#37250807)
I don't have any issues with Python's packaging ecosystem anymore, having settled comfortably into a pyenv+virtualenv+pip-tools as my "stack" after going around the block a few times.

But even so, I must recognise how awful the experience is for new users. It's taken me years to settle into this system, and it can take half a day to get someone up to speed with these tools if they haven't used them.

I also work a lot with non-developers who need to use or contribute to Python models, so that doesn't help — but I bet it would take an order of magnitude less time to get them up to speed with something like cargo. Coaching them has helped me see how user-hostile the process is to beginners.

It also doesn't help how infectious "all-in-one" Python distributions like Anaconda can be, to the point that whenever anyone has an unexpected issue one of my first reflexes is to check their PATH. The fact that Rust has a widespread default toolchain multiplexer completely solves this issue.

I appreciate that maintaining such a toolchain is work, and there is value as well in the diversity and choice of an open ecosystem. But perhaps building is one place where first-class support by the reference implementation creates a worthwhile tradeoff.

Re:Leaving Haskell Behind by systems on Thursday August 24, 2023 @01:56PM (#37252338)
why do sometimes people say things like "and it can take half a day to get someone up to speed with these tools if they haven't used them"

half a day is like almost no time at all

half a day is just few hours, how is this a long time .. how is this any time at all

makes me doubt myself a bit, am i too mediocre to think that way

the previous line make more sense to me "It's taken me years to settle into this system" , now this is more like it

Re:Leaving Haskell Behind by carbotaniuman on Thursday August 24, 2023 @03:20PM (#37253381)
I don't think it's half a day to get proficient, it's half a day to hack something half working together so they're unblocked and can do the other stuff they want to do.
Re:Leaving Haskell Behind by throwawaymaths on Thursday August 24, 2023 @04:21PM (#37254043)
And then another half a day to get pissed off because you don't remember what settings are/are not in your venv and trying to exit and/or get back into the venv (assuming no prior experience with venv)

Fundamentally venv breaks your conceptions of what a shell is through cleverness, and that's a problem for people who are new.

Re:Leaving Haskell Behind by codeflo on Thursday August 24, 2023 @05:09PM (#37254585)
Half a day to get something running that's a "one off" for you is insane. With a compiled language project, I'd download a binary. In Python, I need to reproduce the developer's setup. And I've yet to find two different Python projects where the official build instructions are compatible -- each one recommends a different environment virtualizer, a different runtime, different settings, and different C libraries that aren't part of the virtualized environment.
Re:Leaving Haskell Behind by earthboundkid on Thursday August 24, 2023 @07:27PM (#37255873)
The thing that drives me insane about Python packaging is the degree of Stockholm Syndrome. PYTHON PACKAGING HAS KIDNAPPED YOU. YOU DON’T ACTUALLY LOVE IT.

None of Go, JavaScript, or Rust require a half a day to figure out packaging. Don’t defend Python. Push for it to change or leave it behind.

Re:Leaving Haskell Behind by mattgreenrocks on Thursday August 24, 2023 @08:06PM (#37256154)
Half a day is an eternity when it is makework.

Trudging through old SO answers, bad docs, GitHub issues, overly enthusiastic blog posts by someone making a todo app, and, the coup de gras: hitting paywalls on the one tutorial that might help you.

Factor in much higher rates for more senior devs and it amounts to a lot of waste.

Re:Leaving Haskell Behind by Aerbil313 on Friday August 25, 2023 @04:02PM (#37266356)
This whole thread is a discussion of ease vs. simplicity. Easiness is subjective, simplicity is not. We should not compare tools in terms of their ease of use. There was a famous talk on this, maybe someone can link.
Re:Leaving Haskell Behind by kevin_thibedeau on Thursday August 24, 2023 @05:25PM (#37254739)
I have issues precisely because of the misguided preference for virtualenvs in favor of traditional system package installation. It's obnoxious that pip now admonishes you for installing into site-packages even on a Debian system where that can't cause massive breakage. When you need isolated containers it's great. Everyone doesn't need a webdev focused, reproducible build for everyday shell life.
Re:Leaving Haskell Behind by dcow on Thursday August 24, 2023 @05:29PM (#37254775)
You really shouldn’t, though. If you use a dependency manager for some deps you should use it for all deps. Using a global/system cache would be great if dependencies were versioned and each script could specify which version is needed, but they’re not to my knowledge. And it’s all fun and games until some random install script somewhere updates a global dep and your stuff breaks and you don’t know where to even begin looking.
Re:Leaving Haskell Behind by Aerbil313 on Friday August 25, 2023 @04:06PM (#37266401)
I’m still waiting for Nix to mature and for its UX to improve.
Re:Leaving Haskell Behind by movpasd on Friday August 25, 2023 @03:15AM (#37258997)
In my personal experience, it's absolutely necessary. Breaking changes are all over the place. I have non-dev coworkers who have built Python tools without any knowledge of package management, and it's a minefield getting it up and running.

For individualised shell usage, sure. I have global installations of common data science utilities like pandas and jupyter, or requests.

Reproducibility isn't just about deployment, it's also about coordination with colleagues.

Re:Leaving Haskell Behind by dcow on Thursday August 24, 2023 @05:26PM (#37254751)
As someone new to using Python professionally after having used it here and there over the course of 15+ years, I’ve run into exactly this problem. It’s pretty standard for a language these days to bundle the dependency manager and build tooling. Python still does this via shell infection. And since there’s 5 different ways to do it it can leave someone trying to figure out what the right vibe is in 2023 spending hours reading about the pros and cons of everything. And all that just to land back on venv+pip+requirements.txt.

Python needs a cargo. Is Poetry it? I’ve been meaning to try it…

Re:Leaving Haskell Behind by impulser_ on Thursday August 24, 2023 @10:13PM (#37257091)
Have you tried Rye?

https://github.com/mitsuhiko/rye

This is probably the best package manager I used for Python. It feels a lot like Cargo. It sticks to the standards of Python. No custom lock files ect. Uses prebuilt Python so you don't have to build it. Handles global installs easily.

Re:Leaving Haskell Behind by movpasd on Friday August 25, 2023 @03:19AM (#37259020)
This is very interesting indeed! A lot of the design choices fix issues I've also personally encountered. The "experimental" dissuades me from using it for real projects, but I'll be keeping an eye on it.
Re:Leaving Haskell Behind by js2 on Friday August 25, 2023 @01:48PM (#37264758)
> Correctly installed, rye will automatically pick up the right Python without manually activating the virtualenv. That is enabled by having ~/.rye/shims at higher priority in your PATH.

I dislike this pattern. I don't want every language/tool manager in my PATH all the time. I much prefer the direnv. I hook only direnv into my shell. Then I can do what I need with an `.envrc` in each project directory.

Re:Leaving Haskell Behind by dcow on Saturday August 26, 2023 @03:46AM (#37270672)
I hate shell infection because 1) it only works in the shell, 2) it’s not stateless, and 3) depends on your working directory. I mean there’s a reason it’s called “shell infection”. Sounds like Rye specifically aims to address that issue. To each their own, I guess.
Re:Leaving Haskell Behind by movpasd on Friday August 25, 2023 @03:02AM (#37258934)
I've tried Poetry, the CLI is nice and user friendly to be sure, but it has many flaws that made me ultimately avoid it.

In my opinion, it tries to be far too "magic", hiding everything about the virtual environment and dependency management within it. This means that if anything breaks (and it does break!), I find it basically impossible to fix it without wiping everything and rebuilding the environment from scratch.

I find the documentation nice and clean to look at but somewhat clunky to navigate and very incomplete or not explicit enough — especially for beginners. For a tool that seems to want to be a "one-stop shop", you need to know a good deal already about Python packaging already to navigate it. The lack of explicitness also makes it hard to troubleshoot (as evoked above).

These are by far my biggest complaints, with the below bring mostly minor gripes.

Additionally, it seems to be targeted at library developers rather than applications (a distinction which to be fair none of the Python ecosystem makes, to the detriment of DX). This doesn't usually end up being a big issue as it's reasonably easy to "librarify" applications, but it's something else to learn. (Not every project wants wheelification as its end goal.)

The usage of pyproject.toml is nice, but the semantics of the file isn't quite as standardised as one might hope, especially when it comes to reflecting the package you're writing in the virtual environment. And the documentation around pyproject.toml is scattered and sparse. (A PEP is not documentation!)

I've complained a lot, so I should round off by saying that Poetry is a commendable project and I have high hopes for it; but as it exists now it's just too rickety for me to recommend it. But others may disagree, and by all means I'd give it a try for your next project.

My personal recommendation remains pyenv + virtualenv (or venv) + pip-tools, with simple projects just using a requirements.in files and then moving to pyproject.toml once it reaches a modest degree of maturity.

Re:Leaving Haskell Behind by scruple on Thursday August 24, 2023 @01:03PM (#37251483)
I've used Python intermittently throughout my career but today it is my primary language. I've also never really had issues and have pretty much always stuck with the basics. I'm not on a very large team, though. Only 5 developers will ever touch the Python we're writing. I've only ever worked on Python on very small teams, so I wonder if that factors in?
Re:Leaving Haskell Behind by nologic01 on Thursday August 24, 2023 @07:13PM (#37255752)
I think complaining about Python's tooling has become like complaining about the weather in some cold and rainy country. Good for chit-chat and noding in resigned consensus.

In the meantime I cant recall any instance in the last five years (at least) where a project would fail to get going based on a simple venv and pip setup.

An exception is CUDA but I think we can agree this is not what you need to setup every day.

I wonder if that benign view due to Linux and people experiencing something very different in other OS's.

Re:Leaving Haskell Behind by pharmakom on Friday August 25, 2023 @02:41AM (#37258817)
How do you build a bundle for Linux from macOS? In my experience this is only possible with Docker, and is a huge weakness of the Python ecosystem. Would love to hear solutions.
Re:Leaving Haskell Behind by Tainnor on Friday August 25, 2023 @09:06AM (#37261247)
> I got so annoyed with bundler I wrote a simple shell script to provide the moral equivalent of Python venvs to gem:

This already exists: https://rvm.io/gemsets

Most people don't use it because they haven't felt the need. Bundler already makes sure it loads exactly the right versions of gems for your project, so there's no need to isolate them from each other.

Re:Leaving Haskell Behind by grumpyprole on Thursday August 24, 2023 @04:54PM (#37254410)
Having developed Haskell professionally for many years, I've spent the last two years programming OCaml professionally. I've been really enjoying the OCaml tooling: dune, Merlin and ocamlformat work extremely well for me. Dune especially is packed full of features, for example a file-watch mode for tests. Merlin doesn't choke on large codebases like some of the Haskell tooling did and ocamlformat works better than any code formatter I have ever used. The tooling is so good, I can forgive the rather minimal standard library. OCaml is also very good regarding backwards compatibility, new releases don't break our builds.
Re:Leaving Haskell Behind by belmont_sup on Friday August 25, 2023 @11:15AM (#37262659)
I have to agree so much. Been following for years, and started new experiments this week. It all worked so well.

dune init …

opam install some tools like lsp

restart vscode

dune build --watch and I’m good to go.

Re:Leaving Haskell Behind by yawaramin on Sunday August 27, 2023 @12:53AM (#37279520)
1. I agree. And this is being worked on, in the future dune will take on more package management tasks.

2. Agree, YAML has decisively won the config format wars. But dune it's extremely unlikely that dune will change this, and we can at least tell ourselves that s-exprs are pretty cool after all.

3. Yup, I hope Eio becomes the de facto standard in the future.

Re:Leaving Haskell Behind by epolanski on Thursday August 24, 2023 @07:12PM (#37255742)
+1.

I have in most years learned some nicher languages: Elm, Rescript, Racket, Common Lisp.

But nothing is even remotely bad as Haskell is.

Even just setting up an IDE to have basics like syntax highlight or go to definition is a giant chore.

On the official Haskell devcontainer offered by GitHub is nearly impossible to add any external dependency, so having a one-click shareable Haskell environment in the cloud (the very basic to onboard people on the language without wasting them days into having their own inconsistent environment) is a must.

Another thing that I feel sucks is the default documentation for Haskell libraries. Doesn't say anything useful at all, bundles few definitions here and there, 0 examples, and more often than not there's 0 documentation.

Re:Leaving Haskell Behind by regularfry on Thursday August 24, 2023 @08:19AM (#37247937)
Cargo is an evolution of older ideas from Ruby's bundler, so in a sense it does have a longer pedigree than most other tools of that ilk. Bundler mostly doesn't suck. There are design choices I disagree with but there's a happy path to using it that gets a lot right. There are ways to do language tooling that don't suck.

Without much direct experience of cargo I can't say whether that carries across, but I wouldn't be surprised if it was genuinely the best of breed and stays that way.

Re:Leaving Haskell Behind by pyrale on Thursday August 24, 2023 @08:27AM (#37247991)
> so in a sense it does have a longer pedigree than most other tools of that ilk.

That's true of most new languages. It seems like most projects these days can produce a LSP with minimal effort, make the obvious choice of sandboxing every project separately to avoid dependency hells across projects, have at least basic distribution systems even with small communities, etc.

The community learned a lot from the mistakes of yore.

Re:Leaving Haskell Behind by paulddraper on Thursday August 24, 2023 @09:15AM (#37248372)
All I know about Ruby is that I always seem to download three versions of documentation
Re:Leaving Haskell Behind by nobleach on Thursday August 24, 2023 @09:29AM (#37248531)
Back when I used to use Ruby 10 years ago, I got used to doing the "no docs" args when I'd do a gem install. I always thought it was a cool idea to have local docs but, I never had an occasion to actually USE them. (never was I stuck in a non-internet-connected zone, wishing I had documentation)
Re:Leaving Haskell Behind by regularfry on Thursday August 24, 2023 @10:01AM (#37248888)
Adding `install: --no-document` into ~/.gemrc is something of a reflex for me. Should only be getting `ri` docs these days by default though.
Re:Leaving Haskell Behind by saurik on Thursday August 24, 2023 @09:15AM (#37248379)
FWIW, the thing which really sucks about cargo is how it handles cross-compilation. Most "professional" workflows are always cross-compilation: even if you are technically on Linux already you don't want to build for the exact version you have so you create a sysroot and cross compile towards it... and cargo is somehow so bad at this that increasingly large numbers of projects are being forced to turn on a environment variable that has in the name of the variable DO_NOT_USE to shift cargo stable into accepting nightly flags so we can activate a patch that they begrudgingly committed to fix the behavior of targets to not get infected by host configuration if they happen to look similar. The goal was that this would eventually become the default but it's been years now and the related bugs are just stacking up. As a package manager I'm sure it's great... as a build system? Not so much.

The situation frankly really just sucks: as far as I am concerned--from the shear number of bugs I have run into trying to do what should be table-stakes, and which even autoconf handles trivially: doing deterministic builds across platforms of a library to be embedded into another language's build system--cargo optimizes for extremely simple use cases (hell: ones so simple they lead to the wrong mental model of compiling in the first place! like, people seem to seriously think you need to compile for old systems ON old systems using old tools as cross-compilation is somehow treated as esoteric) while throwing the people who know what they are doing under the bus, which isn't at all how one should build tooling; instead, the goal should be to make extremely difficult things easier to pull off, even if it means the simple things have to be a bit harder, as your overall workflow is then easier to manage and you can better grow with your tooling rather than having to eventually throw it away entirely.

Re:Leaving Haskell Behind by regularfry on Thursday August 24, 2023 @10:10AM (#37248962)
Yeah, that tracks. That sort of cross-compiling isn't something you'd ever see in the Ruby world, as far as I can recall, so I guess it's a reversion to the mean.
Re:Leaving Haskell Behind by 15155 on Thursday August 24, 2023 @10:43AM (#37249331)
Does `cross build` not work for your use cases?
Re:Leaving Haskell Behind by kibwen on Thursday August 24, 2023 @10:46AM (#37249363)
You can set a default build target for a Cargo project with two lines of configuration, no nightly features necessary: https://doc.rust-lang.org/cargo/reference/config.html#buildt...

Can you clarify what this is referring to?

> the goal should be to make extremely difficult things easier to pull off, even if it means the simple things have to be a bit harder

There are dozens of existing build systems that have this philosophy, and personally I appreciate the default system being optimized for the average use case. The fact that the happy path is so easy is the reason that people overwhelmingly choose to use Cargo; we can lie to ourselves all we like about the appeal of things like memory safety and type safety, but at the end of the day Cargo is the reason that Rust is popular. (And to be clear, I'm not trying to say Cargo is perfect; I have a slew of my own bugs and feature requests filed against it.)

Re:Leaving Haskell Behind by saurik on Saturday August 26, 2023 @04:44AM (#37270868)
> ...but at the end of the day Cargo is the reason that Rust is popular.

FWIW, maybe that's true for you, but there are numerous other advantages to the language for which many people choose to use Rust--some even "despite" Cargo: you see Google having had to put in way way WAY too much work to get Bazel working for Rust :/--that it honestly feels a bit like belittling an extremely important language to make this claim so flippantly.

In my case, I often feel bad that I'm not using Rust more often, as I'm one of those developer churning out tons of C/C++ code. I do my best, but... I'm a security engineer! I know what I'm doing is stupid! But like, I'm having a hard enough time just dealing with the Rust library dependencies I've accumulated, so I'm not going to start developing even more Rust :(.

> You can set a default build target for a Cargo project with two lines of configuration, no nightly features necessary...

This doesn't work as, as soon as you start setting target-specific options, it infects the host's options, as they incorrectly modelled the problem as some kind of map from targets to flags. If you don't believe me, on your Linux computer, try cross-compile something complicated that will runs on a "least common denominator" Linux distribution, such as CentOS 7.

> Can you clarify what this is referring to?

Sure. I've Googled rust cargo target host bugs for you (which, FWIW, finds a number of bugs I've filed or have talked about, but it isn't as if I have a list anywhere). Note that one of these bugs is "closed", but I still provide them for context as a patch might have been merged but (as you'll find out if you read through all of these) it isn't stable.

https://github.com/rust-lang/cargo/issues/8147

https://github.com/rust-lang/cargo/issues/3349

https://github.com/rust-lang/cargo/pull/9322

https://github.com/rust-lang/cargo/issues/9453

https://github.com/rust-lang/cargo/pull/9753

The result of this work being left incomplete is that increasingly large numbers of "serious" projects--things I'd expect people in packaging land to have heard of, such as BuildRoot--are being forced to set the ridiculous environment variable __CARGO_TEST_CHANNEL_OVERRIDE_DO_NOT_USE_THIS="nightly" in order to get access to a flag that makes Cargo sort of work.

I remember a bunch of other ones but I think they are linked from these bugs (I didn't want to dig too long on this); you can also find--either linked from these bugs (as people will tag the bug in their patch) or by searching for that variable (as no one else would use that in a sane project) the projects that are slowly being forced into this crazy workaround.

(What is sad is I often see people surprised at how long it is taking for various of the more important clients to fully get into using Rust, as the safety issues are so severe from continuing to use C/C++; as you made the contention that you believe the reason why people use Rust is Cargo, I will say the opposite: the reason why we don't see more Rust is also Cargo.)

Re:Leaving Haskell Behind by twic on Thursday August 24, 2023 @05:48PM (#37254983)
Just do the build in a container modelling the appropriate environment. You don't need cooperation from the build tools (apart from controlling instruction selection), and you also don't need to trust that the build tool has implemented this feature correctly!
Re:Leaving Haskell Behind by saurik on Saturday August 26, 2023 @04:54AM (#37270919)
FWIW, it is easier to just not use Rust as the only serious build system I've had to work with that doesn't support this correctly is Cargo; and like, the mental model you are describing causes all kinds of other problems as it implies that if your build tooling simply can't run on a system old enough that you have to drop support for that system... people who are compiling serious apps (think Chrome or Ubuntu itself) and managing backports aren't sitting around with their CI systems running some old version of CentOS or Debian and praying their build tools continue to run on them: they just cross-compile.

And like, that Cargo doesn't handle this correctly is kind of silly as one of the engineers from BuildRoot seriously broke his back for a year jumping through hoops with them to come up with a compromise and satisfy all of their roadblocks (the Cargo people would rather spend hours talking with people about a patch than spend a few minutes touching it themselves... it was honestly demoralizing, but I've seen the same thing from projects like Flutter, so I think that it is just the reviewer / developer power dynamic that big tech taught a bunch of people) and the code is even in Cargo and yet is rotting in nightly.

(Meanwhile, I often see people bemoan how large projects aren't picking up Rust and using it to slowly cannibalize the C/C++ code in various projects, or are looking at distributions demanding answers for why there has been such struggle getting Rust code distributed, but the answers lie in the build model of the language and in no small part how difficult it is to use Cargo. If you just want to not care about those use cases and want to focus on self-compiled use cases--maybe you are doing web development!--that pick up all of the idiosyncrasies of the build system, then the community should just say that.)

Re:Leaving Haskell Behind by wslh on Thursday August 24, 2023 @08:32AM (#37248034)
I wonder why this discussion about tooling does not include .NET languages or Swift, even if the first class tooling are IDEs such as Visual Studio or Xcode. Most probably because the open source world escapes big tech dependencies.
Re:Leaving Haskell Behind by Tainnor on Thursday August 24, 2023 @08:40AM (#37248084)
No idea about .NET, but XCode is a joke of an IDE.
Re:Leaving Haskell Behind by bootsmann on Thursday August 24, 2023 @08:46AM (#37248134)
I appreciate the "run app on any iDevice" with one click that xcode offers, but yeah the rest of the UI is terribly clunky (Try moving the boundaries of frames).
Re:Leaving Haskell Behind by Tainnor on Thursday August 24, 2023 @08:47AM (#37248142)
Not just the UI. The IDE barely has any functionality. Automated refactorings? Nope.
Re:Leaving Haskell Behind by pyrale on Thursday August 24, 2023 @09:10AM (#37248337)
That's simply because I talk about my personal experience, and there's only so many languages you can experience professionally over a few years.
Re:Leaving Haskell Behind by paulddraper on Thursday August 24, 2023 @09:15AM (#37248377)
Linux
Re:Leaving Haskell Behind by wslh on Friday August 25, 2023 @06:48AM (#37260176)
Yes, but you can run both in Linux natively.
Re:Leaving Haskell Behind by bluk on Thursday August 24, 2023 @09:42AM (#37248669)
As much as I like Swift, the tooling has been and still is subpar. Swift package management is barely viable.

You have to use Xcode. You can try other IDEs but LSP equivalent features are at the most basic level. Xcode is the kitchen sink of IDEs which has led to many negative opinions as it struggles under its own weight. Every other year there’s new UI for things like debugging which is fine but what would be really nice is if the actual debugging worked. Technically there are reasons why you can’t print a local variable sometimes when stepping through a program, but in practice, I do not care and I want to know what the value is.

If you don’t care about the “optional” tooling like the dependency manager and LSP or a linter (which is closer to ESLint versus Rust Analyzer), the required tooling leaves much to be desired. The compiler sometimes gives up when it takes too much time to process a complex type. It would be understandable in some cases but most people encounter the problem when just writing seemingly simple SwiftUI. Error messages and auto fix-it suggestions are improving but still disappointing. I remember when Apple switched from GCC to LLVM and everyone was praising the error messages as a reason to switch.

Swift is actually ambitious. The generics system is world class. It has to support the legacy of a huge ecosystem on multiple platforms. SwiftUI is one of those bets that you might be surprised that Apple can still make. But whenever I fire up that SwiftUI Preview, I am crossing my fingers that maybe I’ll see something instead of an error. Swift lives up to its name in terms of moving quickly and the language design is probably fine, but outside of that, the tooling is still very immature for a decade old language which tons of resources are invested in.

Re:Leaving Haskell Behind by agos on Thursday August 24, 2023 @10:27AM (#37249118)
this has been my experience as well. After being one of the five people who liked using Objective-C I was eager to have this new, incredible language to work with, and pushed to adopt it as soon as reasonable on all the codebases I worked with.

That enthusiasm has since waned when stuff happened like compilation times slowing to a crawl because somebody used ternaries extensively. I still think it's a great language, but the tooling really makes it hard to love

Re:Leaving Haskell Behind by mymac on Thursday August 24, 2023 @08:19AM (#37247935)
If only Python would be able to really solve their dependency and backwards compatibility issues, those are really holding the adoption back. Though there is a good chance that even if they fixed those that people burned in the past will never go back into it.
Re:Leaving Haskell Behind by boxed on Thursday August 24, 2023 @10:20AM (#37249060)
> [python] backwards compatibility issues

What issues? A lot of problems with Python is due to keeping compatibility with Python 2.0. Implicit string concat bites me fairly often for example, and it has never been useful.

Re:Leaving Haskell Behind by mymac on Thursday August 24, 2023 @10:27AM (#37249115)
2->3 has been a complete disaster, anything older than a few weeks tends to randomly break with some kind of dependency issue, sometimes requiring multiple installations of python on the same machine which will bite each other in hard to predict ways. Python is a wonderful idea but I've yet to be able to write something in python and call it 'finished' because it never ever continues to work in the longer term. Highly frustrating and in my opinion unnecessary.
Re:Leaving Haskell Behind by boxed on Thursday August 24, 2023 @10:47AM (#37249381)
> 2->3 has been a complete disaster

It WAS a long slog yes. But now it's pretty much done. And there really was no way to fix the unicode issue without a big painful transition.

> anything older than a few weeks tends to randomly break with some kind of dependency issue

I absolutely do not have this issue. Maybe you're using libraries very different from what I do? But I do think I have pretty wide interests/projects...

> sometimes requiring multiple installations of python on the same machine which will bite each other in hard to predict ways

I don't know what you're talking about here. Do you have an example?

> I've yet to be able to write something in python and call it 'finished' because it never ever continues to work in the longer term.

I don't have this experience.

Re:Leaving Haskell Behind by paulddraper on Thursday August 24, 2023 @10:39AM (#37249260)
What dependency and backwards compatibility issues does Python have?

That other languages don't?

Re:Leaving Haskell Behind by mymac on Thursday August 24, 2023 @12:06PM (#37250548)
Python software simply rots while you're not watching it. Either you make it a full time occupation, every time some library gets an 'upgrade' (with a ton of breaking changes) you get to rewrite your code, sometimes in non-obvious and intrusive ways. And every time the language changes in some breaking way you get to spend (lots of) time on debugging hard to track down problems because the codebases they occur in are large enough to mask the problems that would have come out if the same situation had occurred during development.

And that's before we get into the various ways in which python versions and library versions can interfere with each other. You couldn't have made a much bigger mess if you tried. And I actually like the core language. But so many projects I wrote in python just stopped working. I remember having a pretty critical chunk of pygame code written for a CAD system that just stopped working after an upgrade and there was no way it was ever going to run again without rewriting it. That's the sort of thing that really puts me of an I remember it long after. Machine learning code is still so much in flux that it doesn't matter. But hardware abstraction layers such as pygame should be long lived and stable between versions. And that really is just one example.

Anyway, I think asking 'That other languages don't' doesn't really matter. But Haskell (see TFA) is one language that always tried hard not to be successful so breaking changes would be permitted (which is fair). Python tries both to be popular and to allow for major stuff to be broken every now and then and that is very rough on those that have large codebases in production.

By contrast, COBOL, FORTRAN, LISP, ERLANG, C and C++ code from ages ago still compiles, maybe you'll have to set a flag or two but they're pretty careful about stuff like that.

Re:Leaving Haskell Behind by aidos on Thursday August 24, 2023 @03:12PM (#37253274)
Are you pinning your dependency versions? If so, things should all still work later.

If you upgrade libs then sometimes you need to do some work. I’ve found python libs to be pretty stable though so it’s never too bad.

Re:Leaving Haskell Behind by dboreham on Thursday August 24, 2023 @07:05PM (#37255688)
> Either you make it a full time occupation

LOL Javascript enters the room.

Re:Leaving Haskell Behind by mberning on Thursday August 24, 2023 @08:18AM (#37247929)
I’m a bit incredulous that Java’s tooling is in the “sucks” category. You could say a lot of negative things about Java, but the tools available freely and commercially are in a league of their own.
Re:Leaving Haskell Behind by pyrale on Thursday August 24, 2023 @08:35AM (#37248047)
Well, it really depends on what you value in your tooling I guess. I tend to appreciate minimalist tooling, and Java definitely doesn't fit that bill.

To be fair, the language needs that tooling to be practical, and the quantity of it isn't helped by its long history so it isn't necessarily the tool makers that are to blame.

Re:Leaving Haskell Behind by Tainnor on Thursday August 24, 2023 @08:29AM (#37248004)
I think it's nuanced. IDEs are great, but there's often a lack of good CLI tools and they often show their age. For example, I find checkstyle rather annoying to configure and use.
Re:Leaving Haskell Behind by CraigJPerry on Thursday August 24, 2023 @08:36AM (#37248056)
If you’re looking for alternatives, SonarQube has jumped quite far in the last few releases. I like the coherence of the platform now and i find the default gates aren’t oppressive like they were in days gone by.

I’ve gone all in on them these days, the feedback from sonarlint in the IDE is usually useful.

Re:Leaving Haskell Behind by Tainnor on Thursday August 24, 2023 @08:42AM (#37248097)
Last I checked, configuring stuff in SonarQube still involves fiddling with the UI instead of config files. And you need to host it somewhere.
Re:Leaving Haskell Behind by pooya72 on Thursday August 24, 2023 @08:25AM (#37247980)
Yes, it's definitely much easier to get up and running with Java than it is with Haskell. This includes everything from setting up the JDK, setting up your IDE, to building and deploying your applications.
Re:Leaving Haskell Behind by dkarl on Thursday August 24, 2023 @09:40AM (#37248647)
What Java build tool would you say does dependency management decently? Most people are still using Maven or Gradle.
Re:Leaving Haskell Behind by pjmlp on Thursday August 24, 2023 @10:10AM (#37248963)
Rightfully so, most of the alternatives are found lacking in feature parity.
Re:Leaving Haskell Behind by paulddraper on Thursday August 24, 2023 @10:39AM (#37249265)
Maven or Gradle
Re:Leaving Haskell Behind by dkarl on Thursday August 24, 2023 @11:40AM (#37250153)
I feel like Maven is doomed by its history. When Maven was created, expressing dependencies with version ranges was encouraged. But there was no lockfile concept, so that did not work well. Instead of adding lockfiles, they decided to leave the tool as it was but encourage people not to use dependency ranges. But dependency ranges are still supported, so you need a plugin to check your POM files and make sure you aren't using them. Dependency resolution is recursive, so indirect dependencies might still use version ranges, so you need a plugin to detect those ambiguities so you can pin those versions yourself in your own POM. If, despite your best efforts, you end up with an indirect dependency being specified with two different versions, Maven doesn't mind that at all (by default, if will package both, and leave it up to chance which one gets loaded at runtime) so you need a plugin to detect that situation as well.

To sum up, we realized the default behavior was wrong over a decade ago, but rather than change the default behavior of the tool, maybe add a new version of POM files where sanity is the default (it's a versioned format! c'mon!) or a new non-XML file format that triggers a new mode of operation, they stuck with the legacy behavior, forcing every new project to include a bunch of XML boilerplate just to get the behavior that they realized should have been the default 15+ years ago.

That was the situation last time I used Maven, anyway. I'd love to hear that Maven has since added a new mode of operation that is sane by default, without needing extra plugins and configuration, and doesn't use XML.

I can't comment on Gradle. I've worked on a couple of Gradle projects, and the build files were a mess, but I don't know if they needed to be a mess or it was just bad luck.

Re:Leaving Haskell Behind by TJSomething on Thursday August 24, 2023 @11:59AM (#37250448)
Gradle can be quite good, but it's also really easy to make a completely unmaintainable Gradle file.
Re:Leaving Haskell Behind by twic on Thursday August 24, 2023 @06:25PM (#37255348)
Gradle is expressive and extensible, but unfortunately, that encourages programmers to express themselves and extend it.
Re:Leaving Haskell Behind by paulddraper on Thursday August 24, 2023 @03:19PM (#37253362)
> expressing dependencies with version ranges was encouraged

In years of Java development, I've seen that only once, maybe twice.

And this was 8+ years ago.

Re:Leaving Haskell Behind by dkarl on Thursday August 24, 2023 @04:27PM (#37254124)
The v1 release of Maven was in 2004. But it's unfortunate that Maven moved away from ranges. The "problem" with ranges was that they created non-reproducible builds, because different dependency resolutions could change the build. Every new release of a third-party dependency had the potential to invalidate a tagged and tested version of your application.

Other build tools in other languages decided to use lockfiles to achieve stable builds with dependency ranges. If your application depends on libraries A and B, and A and B depend on library C, then the build tool can check that the lockfile specifies a version of C that fits the ranges specified by A and B, or, if library C isn't in the lock file, find an appropriate version of library C and add it to the lock file.

But not Maven. Maven's solution is for A and B to declare dependencies on exact versions of library C, and then to pick one or the other depending on many degrees of transitivity separate your project from A or B. Seriously:

"Maven picks the 'nearest definition'. That is, it uses the version of the closest dependency to your project in the tree of dependencies. You can always guarantee a version by declaring it explicitly in your project's POM. Note that if two dependency versions are at the same depth in the dependency tree, the first declaration wins." [0]

So if A depends on C 1.2 and B depends on C 1.5, and A appears before B in your pom file, Maven will bundle 1.2 with your application and not fail the build.

I don't know the history of how anybody ever thought that was a good idea. Anyway, they quickly realized that pinning versions in the build was the right solution after all, but instead of adding a separate lockfile, they decided to make you list all the versions in the project file itself. Which is exactly where you want all your transitive dependencies listed, right in your build file, taking up half a dozen lines each because it's XML, right?

Of course Maven is still happy to fall back its "pick the first nearest" algorithm if you fail to pin one of your transitive dependencies, which means your builds might not be reproducible. My boss (quite sensibly) said our builds had to be reproducible no matter what Maven allowed or encouraged, so I had to write a plugin to check for that.

The real tragedy is that because library publishers no longer use dependency ranges, you get to debug and discover violations of semver yourself. Does library A, which specifies C 1.2, also work with C 1.5? The publishers of library A might know that it doesn't, but they don't publish that fact with their library. Jackson plugins were especially prone to semver-unexpected breakage because Jackson didn't have any stable API for plugins. Jackson plugins typically had to use private implementation details of Jackson to work at all, so they sometimes broke on patch releases of Jackson. Library publishers could have encoded knowledge about this kind of breakage in their dependency declarations, but "best practices" said to specify a single version, so that's what they did.

[0] https://maven.apache.org/guides/introduction/introduction-to...

Re:Leaving Haskell Behind by yw3410 on Thursday August 24, 2023 @04:40PM (#37254260)
Also, Mavens metadata model is recursive. You want need a dependency? You're going to have to pull in the parent, which is probably an Uber pom. Take a look at your M2 cache, it's probably got a kubernetes pom even if you've never touched it before because your logging library uses an Uber pom...
Re:Leaving Haskell Behind by Tainnor on Thursday August 24, 2023 @11:16AM (#37249804)
Depends on what you call "decently". Maven and Gradle do the job, but the bigger problem is the ecosystem:

Libraries don't declare version ranges for their transitive dependencies (like they do e.g. in Ruby), instead they just depend on a specific version. Of course, because two different libraries may depend on the same subdependency but in different versions, you will just get one version and you have no way of knowing whether it will work correctly.

That isn't a problem in 90% of cases, but sometimes it is and you'll notice it when you're suddenly getting ClassNotFound exceptions.

There are some solutions to this, e.g. bigger frameworks like Spring publish BOMs, which are just sets of library versions known to work together, but they don't cover everything.

Re:Leaving Haskell Behind by dkarl on Thursday August 24, 2023 @11:44AM (#37250205)
> Libraries don't declare version ranges for their transitive dependencies

That's the behavior that Maven itself recommends, so Maven is at least part of the problem.

Maven could also sanity-check your build for these issues by default, but it doesn't; it leaves that up to plugins, which you have to configure (in XML) in your build file every time you set up a new project.

Re:Leaving Haskell Behind by tadfisher on Thursday August 24, 2023 @01:53PM (#37252302)
You can depend on version ranges with Gradle, and those ranges are transitive if the library is also using Gradle; otherwise, you can override a library's transitive dependencies pretty easily with component metadata rules.

You can do so much with Gradle, but 90% of learning it is figuring out what knobs you need to twist; there's a lot of feature overlap and second-system-effect going on.

Re:Leaving Haskell Behind by alex_smart on Thursday August 24, 2023 @08:44AM (#37248111)
What is wrong with Java's tooling?
Re:Leaving Haskell Behind by pyrale on Thursday August 24, 2023 @09:25AM (#37248482)
If you ask for my personal experience:

- The community leans a lot on configuration over code, and that's annoying. Sometimes, a hardcoded string in your conf could have been a hardcoded string directly in the code.

- Sometimes, dependency injection systems are so abstract that knowing which class is depended on in a specific runtime instance becomes a pain in the ass.

- Your idea just won't load class x, the obvious "clean cache" doesn't work as advertised, and you're back to stack overflow to know which couple of file you need to get rid of. That stuff happens just often enough for you to have a lingering feeling of annoyance, but not often enough for you to remember the exact files.

- Sure, idea is great. But in <other language> I was fine with just vim. The LSP was a great help, not a lifesaver.

- Unit testing is great. Annotations are great. Don't you enjoy that unit test class with a dozen annotations spanning 20 lines just above?

- Hibernate. Spring too, while we're at it. Not sure whether you consider this one squarely fits the tooling box.

Re:Leaving Haskell Behind by systems_glitch on Thursday August 24, 2023 @11:00AM (#37249581)
These are job security features :P

Seriously though, the hours spent fighting dependency injection and Hibernate issues alone, when working on a really big Java project, could've been a full-time job.

For maximum fun, I once worked on a large ERP system that started out as a Struts 2/Hibernate 3/Jetty project and had an entire Rails app bolted on using JRuby. Some of the stuff in the JRuby side was injected thru Spring. ActiveRecord had to talk through Hibernate.

Re:Leaving Haskell Behind by patmorgan23 on Thursday August 24, 2023 @01:55PM (#37252322)
Gross
Re:Leaving Haskell Behind by systems_glitch on Thursday August 24, 2023 @02:47PM (#37252984)
I know, right? Hundreds of millions of dollars flowed through that system every year. I got the ball rolling on killing that design with fire after we hit one of the pathological limits in IIRC Hibernate 3 and thread safety.
Re:Leaving Haskell Behind by Tainnor on Thursday August 24, 2023 @11:05AM (#37249673)
I agree with some of that criticism (although I haven't had issues with having to manually delete files - if you do, I suspect it's a project that hasn't been set up with a proper maven/gradle setup but where all the build info is in some IDE config. that's an antipattern at this point but used to be very common).

But I don't think it's necessarily about the tooling.

And yes, Hibernate is just horrible.

Re:Leaving Haskell Behind by pyrale on Thursday August 24, 2023 @03:25PM (#37253446)
Everything is in Maven and works fine in CI, which definitely does not use idea. But in some situations Idea believes the pom isn't as fresh as its rendition, unfortunately. I can live with some caching, but everytime that happens and the "clean cache" option doesn't work, I weep.
Re:Leaving Haskell Behind by MBCook on Friday August 25, 2023 @12:12AM (#37257959)
I don’t tend to run into that. But you should be able to fix it right clicking the pom and choosing Maven -> Reimport.

The number of times I actually needed to clean my cache I could probably count on one hand over the last 10 years.

Re:Leaving Haskell Behind by gmfawcett on Thursday August 24, 2023 @07:01PM (#37255658)
Really, only the LSP comment relates to Java tooling. The other comments are about language, framework, and cultural issues. Not disagreeing with your observations, though.
Re:Leaving Haskell Behind by xmcqdpt2 on Thursday August 24, 2023 @09:02AM (#37248262)
Too much XML?

Seriously though what's a decent Java build tool? Hacking on Gradle means having to learn another PL entirely. Maven?

Then say I want to publish a library for others to use from their own java project, how do I do that? I've never actually done it, but that page

https://maven.apache.org/repository/guide-central-repository...

seems awfully complicated compared to say

https://doc.rust-lang.org/cargo/reference/publishing.html

or even the pip equivalent.

Granted, working on a well set up java project is nice, but the setup process is not simple.

Re:Leaving Haskell Behind by paulddraper on Thursday August 24, 2023 @09:20AM (#37248419)
So you don't like a config language like XML because _____ and you don't like a DSL like Groovy because _____.

What is acceptable?

P.S. For easier publishing, use a different repo e.g. Artifactory instead of Maven Central.

Re:Leaving Haskell Behind by pjmlp on Thursday August 24, 2023 @10:07AM (#37248943)
Not only do Maven and Gradle support binary libraries (including native code) instead of waiting to build the whole universe on each checkout, their plugins for mixed language development are way better than writing build.rs scripts.
Re:Leaving Haskell Behind by alex_smart on Thursday August 24, 2023 @10:34AM (#37249197)
That maven link is perhaps not the most useful, but it is not hard to find better-written articles. For example-

https://docs.github.com/en/actions/publishing-packages/publi...

The steps are roughly: 1. Configure the repository you want to push to. 2. Set up your account with the repository. 3. Configure your credentials. 4. Deploy.

Re:Leaving Haskell Behind by chriswarbo on Thursday August 24, 2023 @10:39AM (#37249255)
I actually prefer using Maven and its giant XML files: at least they're declarative, and are easily parsed, transformed, generated, etc. by scripts. Most attempted replacements (Gradle, SBT, etc.) stick with largely the same model (i.e. no extra functionality) but use a full programming language for their "config" (Groovy, Scala, etc.).

The latter gives us a "config" that's subject to Rice's theorem: it's essentially opaque, with no way of knowing what it will do other than executing it. An example I ran into at work: there's no way to list the dependencies of an SBT project (in order to set up an offline sandbox). SBT provides commands which claim to do that, but config files often append dependencies based on arbitrary logic; e.g. we had some like "when running unit tests, add this mocking plugin"; since "list dependencies" doesn't run the unit tests, that plugin dependency was missing from the sandbox.

Re:Leaving Haskell Behind by Tainnor on Thursday August 24, 2023 @11:08AM (#37249710)
> there's no way to list the dependencies of an SBT project (in order to set up an offline sandbox, in our case for reproducible building with Nix)

Well, the same is true for Maven. I know because I've tried. Plugins can download arbitrary dependencies at execution time.

That's where the point about Rice's theorem falls apart: it applies as much to maven as to Gradle because maven plugins can do whatever they want.

Re:Leaving Haskell Behind by chopin on Thursday August 24, 2023 @05:04PM (#37254529)
But that can't be runtime dependencies to your code?

I've written a couple of Maven plugins and you must declare your dependencies explicitely even for those. Pulling in stuff dynamically would be possible but not very clever.

Re:Leaving Haskell Behind by Tainnor on Friday August 25, 2023 @08:46AM (#37261087)
The maven surefire plugin downloads dependencies dynamically depending on the kind of tests it finds. Is it not very clever? I agree. But it's one of the most popular maven plugins.
Re:Leaving Haskell Behind by chriswarbo on Friday August 25, 2023 @11:36AM (#37262906)
That sort of thing is unfortunate, but not too bad since we can add those packages to our own dependency list (e.g. in the pluginManagement section). It's a bit redundant, but as a bonus it ensures that such "dynamic" behaviour is acting as expected (since the build will fail if it picks different packages to the ones we wrote down!)

The same approach can be used when depending on third-party jars/plugins which don't fully specify their dependencies: just add the missing ones as extra dependencies of our project. (This happens a lot, where projects have undeclared dependencies on some commonly-used library, and don't notice since it's usually available in a well-stocked ~/.maven2 cache)

Re:Leaving Haskell Behind by chopin on Saturday August 26, 2023 @05:14AM (#37270993)
During Maven build, sure. But it does not add unknown dependencies to your code at runtime.

I am used to classpath problems with surefire but that it downloads undeclared stuff is new to me. Afair it pulls only in transitive dependencies. Could you give an example?

I am mainly building war files and it turned out to be good practice to explicitely declare any ambigous transitive dependencies. There's even a Maven plugin which shows up classes with different hash during build, https://basepom.github.io/dependency-versions-check-maven-pl...

Re:Leaving Haskell Behind by Tainnor on Sunday August 27, 2023 @02:06AM (#37279848)
"Runtime" was imprecise, I meant at build execution time. The point being that you can't pre-download the dependencies without executing the build.
Re:Leaving Haskell Behind by grumpyprole on Thursday August 24, 2023 @05:05PM (#37254543)
Yep, SBT and Gradle make Maven look good.
Re:Leaving Haskell Behind by twic on Thursday August 24, 2023 @06:21PM (#37255321)
Gradle is declarative. The 'code' you write does not conduct the build; it assembles an object graph which describes the build, much like the one you get from parsing the Maven XML. The advantage of using code for this is that you the description can be more concise, expressive, etc. But once it's run, the graph is built, and you can explore that, list dependencies, etc, quite safely.
Re:Leaving Haskell Behind by grumpyprole on Thursday August 24, 2023 @06:38PM (#37255472)
> Gradle is declarative

Gradles own docs say "Well-designed build scripts consist mostly of declarative configuration rather than imperative logic".

When it's up to the programmer to make a script declarative, it's not a declarative language.

Re:Leaving Haskell Behind by gmfawcett on Thursday August 24, 2023 @07:02PM (#37255665)
Yes, Maven. Just embrace it, and move on: the decision will pay dividends.
Re:Leaving Haskell Behind by layer8 on Thursday August 24, 2023 @04:47PM (#37254331)
Maven is awfully slow and awfully stateful (plugins or multiple executions interfering with each other), has too many quirks, and documentation is lacking. Gradle is imperative and also stateful.

Dependency injection and annotation-driven development is “magic happens here” that is hard to analyze when something doesn’t work, and hard to reason about in the sense of building a proof that it will always behave in the correct and intended way.

Re:Leaving Haskell Behind by grumpyprole on Thursday August 24, 2023 @05:03PM (#37254525)
Don't forget Scala's SBT, a truly awful design with lots of additional bad taste added on top.
Re:Leaving Haskell Behind by alex_smart on Friday August 25, 2023 @04:38PM (#37266736)
> Dependency injection and annotation-driven development is “magic happens here” that is hard to analyze when something doesn’t work

I don't quite get the criticism against annotations. Metaprogramming and code as data seem to get a lot of love in the context of lisp, python or ruby, but a lot of hate when it happens to be done in Java. I absolutely love the powers that reflection, annotations etc give me.

The difficulty of analyzing dependency injection and "magic happens here" is overstated. Just run the code in the debugger. And if you are having problems with the auto-configuration stuff, you can always selectively disable it and explicitly define the beans you need.

Re:Leaving Haskell Behind by layer8 on Saturday August 26, 2023 @04:32PM (#37276628)
> Just run the code in the debugger.

How do you set a breakpoint on an annotation? You can’t, and that’s the issue. You can’t reason about annotations in the precise way you can reason about library calls.

Re:Leaving Haskell Behind by alex_smart on Saturday September 09, 2023 @09:43AM (#37445315)
> How do you set a breakpoint on an annotation? You can’t, and that’s the issue.

You can set a breakpoint on your normal method and you can see if any proxy object was introduced by the annotation in the call stack and set a breakpoint there. You can also just see the usages of the annotation to see where and how it is being used and set a breakpoint there.

Anyway, going back to my original question, similar criticism is equally valid when you do metaprogramming in lisp/python/ruby. Why are these concerns only raised in the context of Java?

Re:Leaving Haskell Behind by lovasoa on Thursday August 24, 2023 @08:45AM (#37248126)
> I simply wanted to filter job offerings based on social utility rather than language stacks

I wish more people did that.

Re:Leaving Haskell Behind by Eddygandr on Thursday August 24, 2023 @10:29AM (#37249135)
I think this happens with experience - I’ve recently done the same after spending years chasing languages to work in
Re:Leaving Haskell Behind by Symmetry on Thursday August 24, 2023 @10:37AM (#37249231)
Re:Leaving Haskell Behind by ParetoOptimal on Thursday August 24, 2023 @02:44PM (#37252953)
In my experience the organizations that claim to have social utility fail at it and don't pay well.

Language stacks are much easier to fact check.

Re:Leaving Haskell Behind by pyrale on Thursday August 24, 2023 @03:36PM (#37253572)
You don't have to listen to orgs to make your opinion.

There are plenty of orgs that obviously produce a vital service for society, and they are usually starved of good IT people: health care, social services, logistics, electricity production & distribution, industry, agriculture, emergency responders, etc.

> and don't pay well.

:(

Well, the comp is still high enough to live a comfortable life, I just won't be able to bankroll a political party in the near future.

Re:Leaving Haskell Behind by otikik on Thursday August 24, 2023 @11:59AM (#37250444)
> filter job offerings based on social utility rather than language stacks

Any pointers on how to do this? A person that close to me is thinking about entering the High Frequency Trading world, and I would like to give them some alternatives.

Re:Leaving Haskell Behind by RhysU on Thursday August 24, 2023 @12:07PM (#37250561)
Pushing advertisements to people who don't want to see them? /s

Every trade matches two parties who came to the market to trade.

Re:Leaving Haskell Behind by otikik on Thursday August 24, 2023 @08:00PM (#37256105)
> Pushing advertisements to people who don't want to see them? /s

That’s… where they work at now

Re:Leaving Haskell Behind by pyrale on Friday August 25, 2023 @04:27AM (#37259387)
Well, for starters you have to fight the urge to get as much compensation as you can. Once you realize that 90% of SWE job offerings will land you in the top 10-20% of earners, and provided you're fine with the lifestyle that allows, most companies need tech.

The two criteria I'm interested in as an IC is how useful the job is in my eyes (this you can know before applying), and whether the company gives me enough independence to be able to make things right. So my interviews focus on a single factor: whether the company culture and organization is conductive to good, productive work I will be proud of down the line.

Re:Leaving Haskell Behind by jgwil2 on Thursday August 24, 2023 @12:47PM (#37251215)
Haskell's tooling has put me off ever really trying to get into it again. However, I've dabbled in Purescript a few times and it always seems to offer a pretty smooth experience, especially if you're familiar with JS tooling.
Re:Leaving Haskell Behind by george_____t on Thursday August 24, 2023 @05:39PM (#37254889)
It has been rapidly improving over the last few years, though this can mean it's difficult to keep up.

HLS (the LSP implementation) in particular is a pretty young project, and key compiler improvements which will help it improve are still landing.

Re:Leaving Haskell Behind by friend_and_foe on Thursday August 24, 2023 @04:15PM (#37253976)
Yeah most tooling sucks. I think tooling in general was a bad idea. A compiler and an interactive shell/interpreter are all you need, you look at NPM and the current state of the python package management system, a total disaster. I personally would rather use a language where I had to include all dependencies within my program, rather than automatically fetching them from a remote server, deal with versions and version locks, all that stuff was a bad idea.
Re:Leaving Haskell Behind by throwawaymaths on Thursday August 24, 2023 @04:19PM (#37254020)
> A compiler and an interactive shell/interpreter are all you need

You might also want a good testing in the lang or stdlib, and a documentation system.

Re:Leaving Haskell Behind by friend_and_foe on Thursday August 24, 2023 @10:20PM (#37257148)
Well the thing about testing with Haskell, the type system ensures that you're not going to have the most common bugs. If there's an error, it's probably an error in your logic or you did some math wrong or something like that. So testing, you'd basically write tests for your mental model of how the program should operate. And because of the type system you're probably going to use unsafe for a lot of test code.
Re:Leaving Haskell Behind by throwawaymaths on Thursday August 24, 2023 @10:31PM (#37257254)
Clearly the type system is comprehensively self documenting too.
Re:Leaving Haskell Behind by pshc on Thursday August 24, 2023 @07:27PM (#37255872)
Python and JavaScript both had their various fragmented package management systems added well after the language was invented and suffer for it. JavaScript is especially hobbled by the need for an intermediary bundling step.

More modern languages like Rust, where tooling was carefully designed in tandem with the initial language release, fare much better in this regard.

Re:Leaving Haskell Behind by swader999 on Thursday August 24, 2023 @05:52PM (#37255031)
I haven't seen better tooling than what's available for C#. Curious to hear from others who strongly disagree.
Re:Leaving Haskell Behind by all2 on Thursday August 24, 2023 @07:12PM (#37255743)
C# tooling is dense, but the build tools generally "just work" TM. Occasionally I have to purge my build artifacts because the build tool doesn't clean things up completely, but that is a small pain compared to working with python. Another commenter noted that Poetry is quite good and it is (I've noticed they added venv support directly into the tool - you still need pyenv to manage multiple venvs, though).
Re:Leaving Haskell Behind by kahnclusions on Thursday August 24, 2023 @07:53PM (#37256065)
I too have used several languages and for me Haskell’s is the worst I’ve had the displeasure of using. It could be forgivable if the language itself wasn’t so unfathomable to newcomers.

JavaScript’s situation isn’t great, but it’s still easier to work with than Haskell, in terms of hours of frustration.

For me it’s Rust that has really raised the bar for what quality tooling looks like.