Earlier quoted context omitted.
Python has so many footguns for server work and the world's worst typing system. It sounds like Golang is perfect for your use-case
Golang has to compile the world iirc, so it'll need more and more time and resources as the slop grows in size. Whereas Python just interprets and gets off to the races. Feels like we had this discussion years ago as humans..the false promise of dynamic languages.
After 7 years in production, Scarf has reluctantly moved away from Haskell
121–130 of 320 posts
Re: After 7 years in production, Scarf has reluctantly moved away from Haskell
#122Re: After 7 years in production, Scarf has reluctantly moved away from Haskell
#123Earlier quoted context omitted.
Golang has to compile the world iirc, so it'll need more and more time and resources as the slop grows in size. Whereas Python just interprets and gets off to the races. Feels like we had this discussion years ago as humans..the false promise of dynamic languages.
Python just interprets and blows up in production more like it ;) Also so slow. But bad Golang is full of `any` and turns into a Python in disguise.
Re: After 7 years in production, Scarf has reluctantly moved away from Haskell
#124Earlier quoted context omitted.
Additionally in modern Java there are even the options of AOT and JIT caches, which can be reused across runs. Or if staying on Linux, JVM snapshots.
javac doesn't really do a whole lot. Consequently, whatever compile time you are complaining about would be worse with any other compiled language. Most optimization work in Java happens at runtime.
Secondly, there are several ways how Java source code becomes machine code, depending on which JVM and JDK is being used, not taking into account the ART cousin.
Re: After 7 years in production, Scarf has reluctantly moved away from Haskell
#125Earlier quoted context omitted.
Just to put it in perspective, most Scala programmers rejected Scala3 before it was even written. The Scala team, in their infinite wisdom with a collective 2 years of professional programming under their belt knew better. Nobody switched and Scala2 has been slowly dying with their neglect ever since. PS The Scala team should have been fixing their type inference engine which lacked some important features and needed…
wait, how did the scala team end up with only 2 years of professional programming experience? did the original developers all leave?
Re: After 7 years in production, Scarf has reluctantly moved away from Haskell
#126For what it's worth, I've been using Haskell in production at Bitnomial, a financial exchange, and LLMs + Haskell is an extremely productive combo. Since Opus 4.6, LLMs have been pretty clever at using fancy types with libraries like Servant and Beam. The expressiveness of the types, combined with feedback from the compiler, means that agents converge quickly to something that works. I don't think I've noticed agents…
I'd be very curious to hear your take if you gave another language a proper try for comparison with the same tools. I think you'll be as surprised as we were.
Haskell compiles slowly, but we have not found that to significantly inhibit AI-supported dev so far. We use ghci with `-fobject-code`, and our largest leaf module (10k lines of webserver request handlers) takes 8 seconds to `:reload`. To run stuff in it, the agent pipes `:reload`, or other invocations, into `ghci`.
Working on parts parts that are early in the module chain, such as our Prelude, makes the whole-project `:reload` take 50 seconds. Much of that could be avoided if we didn't suffer from the TH recompilation problem (https://gist.github.com/nh2/14e653bcbdc7f40042da3755539e554a). Originally I made a small GHC patch to hack that out (what this conservative recompilation protects from cannot happen in our project), which made the reload much faster, but the logic was changed in recent GHC so that doesn't work anymore.
In C++, we have some individual files (and thus compilation units) that take 45 seconds to compile.
Python is of course the fastest to (build+run). However, Python also has some problems with repeated runs: Once you have many imports, just starting the program (e.g. `--help`) takes ~2 seconds resolving imports. Do `import pytorch`, add another 2 seconds. For repeated runs, this can be a pain; Haskell and C++ are much faster for that, so they win when you don't have to change the code but repeatedly use already-compiled tools in a different way.
In all 3 languages, getting things to typecheck is very fast, because the agent directly reads the vscode LSP typechecking errors which are I agree that GHC devs should focus most of their efforts on compile speed, and real-world pain solving. Some parts of that are indeed being done (e.g. newest GHC can write bytecode to disk to make the above workflow much faster, and codegen is by far the slowest part of compilation). But I think the focus should be even more on that. I consider most important and unsolved:
* solving Generics being slow to compile, especially for types with many constructors
* solving deriving classes being slow to compile
* solving TemplateHaskell causing too much recompilation
* doing staged compilation,
so that the next module can typecheck as soon as its imports are typechecked,
as opposed to waiting that codegen is done;
this unlocks a large amount of parallel work availability
All of these have open GHC tickets that I think should be the highest focus.Other real-world production things are being solved quite nicely currently:
* The new Haskell debugger
* Much better stacktraces
* Much better runtime introspection to debug runtime hangs etc
I get your general point that if iteration speed (as in change code + run, 100s of times a day) is your highest value, Python does quite well. We intentionally chose Python for the part of the codebase that's relatively simple data importing but from 50 different sources, count growing adding new sources all the time, and need just quickly iterate on each until we got it.But I find it would not be a great language for the other parts. Its concurrency story is bad, its interpreter is very slow and immediately disqualifies Python when you need to do e.g. a line of code for every 1000 Bytes (say for streaming small data chunks), typing is very useful but bolted-on and not always correct.
Things where Haskell remains best-in-class is anything nontrivial-webservers, I/O, program correctness, the main "general purpose" programming, refactoring and long-term maintainability.
Re: After 7 years in production, Scarf has reluctantly moved away from Haskell
#127Earlier quoted context omitted.
I'd be very curious to hear your take if you gave another language a proper try for comparison with the same tools. I think you'll be as surprised as we were.
Hey, we have a 10 year old Haskell/Python/C++/TypeScript/Nix codebase, and use all of them regularly. Haskell compiles slowly, but we have not found that to significantly inhibit AI-supported dev so far. We use ghci with `-fobject-code`, and our largest leaf module (10k lines of webserver request handlers) takes 8 seconds to `:reload`. To run stuff in it, the agent pipes `:reload`, or other invocations, into `ghci`.…
LLMs removed some of the difficulty of Haskell, e.g. some interesting ideas to make things safer with sophisticated types or mechanisms like TemplateHaskell are now MUCH easier to implement in a few minutes. Also Haskell's general stance of breaking backwards compat in fundamental places if it's needed to make the language better, thus causing moderate amounds of upgrade grind, completely evaporated as a drawback because LLMs are extremely good at fixing type errors to bring code up to date with the latest changes.
The LLMs are very good at explaining Haskell compile errors.
Learning Haskell and maintaining projects in it is now easier than ever.
Re: After 7 years in production, Scarf has reluctantly moved away from Haskell
#128Also I assume the cost of development skyrocketed so much over the months that our company started implementing drastic cost reductiom measures everywhere that seem to mitigate any improvement we've had.
Re: After 7 years in production, Scarf has reluctantly moved away from Haskell
#129Re: After 7 years in production, Scarf has reluctantly moved away from Haskell
#130Haskell definitely needs to improve a lot of things, but moving to python is obviously a mistake for most cases. Golang is probably the best language for LLM things, it's got reasonably strong types, compiles very fast, and is simple. Much nicer to work with than Rust for example. But these days most code should probably be golang or rust if you're not building a webui.
Also typescript is a better overall language than golang. More expressive types. Golang wins in performance and simplicity and raw ugliness.