7 ms·
I've tried messing around with haskell a few times, but the biggest problem I have is the tooling. I just tried to get haskell set up a few days ago and I coul
by resoluteteeth 9y ago
I've tried messing around with haskell a few times, but the biggest problem I have is the tooling.
I just tried to get haskell set up a few days ago and I couldn't get it working with either vscode or Idea. I also couldn't get ihaskell (jupyter notebook) installed successfully.
I might give it another shot based on these instructions, but the fact that pretty much every program seems to make different assumptions about whether you're using cabal or stack and how you have them set up is really annoying. I assume if you are really knowledgeable about this tools it's not that bad, but as a haskell beginner they are completely impenetrable. (Even just the yaml files used by stack seem completely incomprehensible compared to the formats used by most languages' build tools.)
Considering that the language itself has a pretty steep learning curve, it's really frustrating wasting several hours just trying to get the haskell environment set up without success and not even getting the point of being able to try to actually use it.
I've had a pretty bad opinion of the Ocaml and F# tooling in the past, but the haskell tooling is just so, so much worse. (F# seems to have gotten to a point where the tooling if you can just use .net core, although it gets horrible again if you then need to also use mono at the same time so you can use the interpreter.)
It's especially bad if you compare it to something like rust where cargo works so well it's actually in itself a reason to use rust.
- embwbam 9y agoIt takes a while for the Haskell community to reach consensus. Stack is definitely recommended by almost everyone for both beginners and production projects. It is used on every project I’ve run in to lately. Sure there are different ways to configure it, but these days there’s really one way to get started. Just download stack, make a new project, and start coding
- resoluteteeth 9y agoI get that Stack is what people should be using now but it's still not that helpful if I can't actually get actual instructions for setting up vscode, etc. based on using stack without "stack install." The fact that haskell users seem to think these things are completely obvious and doesn't need to be explained is frankly a big part of the problem.
- deleted 9y ago[deleted]
- embwbam 9y agoI have no idea how to configure vscode, but stack is really simple. This will get you started. stack new my-project cd my-project stack ghci > main http://seanhess.github.io/2015/08/04/practical-haskell-getting-started.html http://seanhess.github.io/2015/08/04/practical-haskell-getti... Haskell’s community evolved very differently from JS and the rest of open source. What seems simple to many isn’t necessarily what seems simple to the rest of us. Much of what this community considers simplicity is just convention and familiarity. But so many people from our world are using it now that things are slowly becoming more “intuitive”! I understand your frustration. It took me a lot of effort to get over the learning curve. Well worth it. But trust me, it’s easier than ever and getting better
- mintplant 9y agoA very quick Google search found Haskelly [0] and Haskero [1] for VS Code, both of whose installation instructions say to install Intero [2] locally in your project directory with "stack build intero" if you don't want to use "stack install" to install Intero globally. [0] https://marketplace.visualstudio.com/items?itemName=UCL.haskelly https://marketplace.visualstudio.com/items?itemName=UCL.hask... [1] https://marketplace.visualstudio.com/items?itemName=Vans.haskero https://marketplace.visualstudio.com/items?itemName=Vans.has... [2] https://github.com/commercialhaskell/intero https://github.com/commercialhaskell/intero
- platz 9y agoihaskell is a somewhat fragile project briding several disparate ecosystems/languages. I'm not really sure the value-add is there yet; in any case it is not a tool for beginners or the preferred method to get feedback from your programs. Haskell proper is pretty turn-key these days with stack. Stay away from edgelord / niche projects. Stay away from most of the IDE tooling, including ghc-mod. You don't need to be fighting the tooling when starting. The repl and "ghcid" should be all you need (though I grant it takes some learning to use these as effectively if you're used to an IDE- you will learn with experience). Just use the "ghcid" cli tool to get compile errors and feedback. It is rock solid. https://github.com/ndmitchell/ghcid https://github.com/ndmitchell/ghcid Your experience will be much smoother. It takes a bit getting used to if you're used to an IDE, but with Haskell it's usually a better to go for a multi-terminal/repl kind of setup
- resoluteteeth 9y ago> Stay away from most of the IDE tooling. You don't need to be fighting the tooling when starting. The repl and "ghcid" should be all you need. I'm honestly not sure I'm interested in learning haskell if this is considered an acceptable situation.
- nh2 9y agoIn practice, it is an acceptable (as in, not great, but sufficient) solution. It is annoying to not have the high quality of IDE tooling you'd enjoy with Java, but in contrast to Java you can be very productive in Haskell even without advanced IDEs (though you would be even more productive with them). There will be IDE tooling eventually.
- platz 9y agoThere is editor tooling, you can look at intero or dante for that. It works. My point is as a beginner, it is added friction when the focus should be on learning how to use the repl and the language. If you absolutely require an IDE, Haskell is probably not going to be your favorite language.
- 9y ago
- chillee 9y agoOcaml tooling has actually gotten substantially better over the past year or two. VSCode as an editor that just works. Opam for package management JBuilder for managing builds. Stdlib situation is still kind of a mess, but I think Base (which is just a stripped down Core) solves a lot of the current issues.
- lambdawitch 9y agoFor the sake of clarity, I'll point out that Jbuilder has been renamed to Dune: https://github.com/ocaml/dune https://github.com/ocaml/dune
- c-cube 9y agoI agree that jbuilder (dune) more or less solved the fragmentation problem for build systems, and is nice to use. I switched most of my projects to it. On the other hand I'm more pessimistic about the stdlib situation because Base breaks compat with the stdlib, thus making the migration impossible (or really painful) for a lot of projects. I'll therefore stick to my own extension of the stdlib (containers) in the foreseeable future…
- xfer 9y agoHow is Ocaml tooling worse than rust? Merlin is very powerful and it gives me everything i want from an editor integration. I still can't get point-at type to work in emacs/vim for rust reliably(macros make it even worse). Haskell tooling is good enough(i haven't worked on big projects, so maybe it doesn't scale) now with intero if you use emacs.
- Tomte 9y agoIs OPAM finally abailable for Windows? If not, it‘s definitely worse. That‘s something Rust got very right from the beginning.
- gmfawcett 9y agoI just installed this today on a Windows machine, and it's working great so far: https://fdopen.github.io/opam-repository-mingw/ https://fdopen.github.io/opam-repository-mingw/
- danharaj 9y agoHaskell + Nix is the best environment I've ever used for any development. My go-to project manager is this script in the reflex-platform, which is a bit poorly named (it will change eventually), because it's actually an environment for doing general cross-platform full stack Haskell development: https://github.com/reflex-frp/reflex-platform/blob/develop/project/default.nix https://github.com/reflex-frp/reflex-platform/blob/develop/p... The learning curve is definitely, shamelessly high. We've been slowly polishing it to make it easy for complete beginners to fully up-to-speed on a project in minutes, but it's a lot of work that happens mostly on weekends. Watch this space!
- Buttons840 9y agoYour go-to project manager is a script? Even if you did not intend it that way that is my impression of the reflex platform. Many have heard about the divide in Haskell package management between cabal-install and stack, but there is also reflex, which seems to rely on running arbitrary bash scripts and using Nix, thus leading to a third method of package management in Haskell. It's a big mess.
- danharaj 9y agoOk so, calling it a script was wrong. It's a nix function which takes arguments specifying various configurations about the project I'm working on, such as any dependency overrides. It then provides a nix derivation which can define shells and compile to whatever platforms I need. No bash scripting is necessary to use this machinery except a convenience script to install Nix if you don't have it. All of the functionality is just leveraging nix's powerful declarative model which easily defines the build artifacts of a project along with the environments necessary to hack on or compile them. This sits on top of cabal and stack, actually. Within a project shell provided by Nix, I'll use cabal to get a repl, for example. But since Nix is handling all the dependency management, cabal doesn't have to do any work in that regard.
- platz 9y agoI find it odd you are recommending this setup to someone who isn't even comfortable with the Haskell language yet, who now must learn this tooling as well.
- joeblau 9y agoWhat operating system are you running on? I paid for and downloaded Haskell For Mac[1] and it's been a great dev experience so far. The IDE is similar to Xcode (I'm an iOS developer) and the REPL is great for trying stuff out. [1] - http://haskellformac.com http://haskellformac.com
- drizze 9y agoWhat sort of apps can you build with Haskell For Mac? The website gives me the impression it’s more akin to Swift Playgrounds than IntelliJ.
- joeblau 9y agoYou have access to all of Haskell. I built a command line utility that downloads GitHub status from different cryptocurrency repos and ranks how productive each tokens development team is. It's similar CryptoMiso[1] but I have my own formula for figuring out what's valuable. From the tutorials they give, you can build all types of stuff. It looks like the IDE supports game development as well as some data analytics tools. In Haskell for Mac, the right side is like Swift Playgrounds (REPL) and the left side is like IntelliJ (IDE). It's actually kinda weird but that's how it's setup. [1] - https://cryptomiso.com https://cryptomiso.com
- cyclinghacker 9y agoMy advice would be start with stack and hpack, and remain with your editor or IDE of choice to start with. Learning any new language is difficult enough without having to also deal with a different workflow. This is my recipe for starting with haskell and intellij: - install stack, run `stack new helloworld simple-hpack` - make sure it builds: `cd helloworld && stack test --exec helloworld` - install https://github.com/rikvdkleij/intellij-haskell https://github.com/rikvdkleij/intellij-haskell and follow the `Getting started' guide
- marcosdumay 9y ago> My advice would be start with stack and hpack Interesting. I would advice to start with plain cabal. One has to learn how to deal with cabal anyway, so there's no point adding stack on top of it from the start.
- bsummer4 9y agoOne has to learn how to deal with cabal anyway Nah, I haven't used cabal-install in years now. Because of hpack, you don't even need to write .cabal files. The only time I touch cabal is when I need to write Setup.hs files, which is, mercifully, quite rare.
- st1ck 9y ago> One has to learn how to deal with cabal anyway With *.cabal project files yes, for sure. But `stack` has completely replaced `cabal` command for me. I don't even have it installed.
- emmelaich 9y agoSame with me. I download some code (or git clone) from an article or gist or somewhere which looks cool. I'd estimate 80% of the time I fail to compile. Typical reasons are errors from Cabal, stack is wrong version, things like that. If it was C or Python or even Rust I'd forge ahead and make it work. But with Haskell's tooling I'm too far out of my depth to bother.
- bsummer4 9y agoIf you upgrade stack and then do stack build, it's very close to being guaranteed to work. Stack (and stackage) is the best nicest, most-reliable build-system of any language.
- emmelaich 9y agoThanks and fully and completely understand why and how the current situation happened. And I fully appreciate the efforts people make to alleviate it. My sole concern is that the situation is accurately seen for what it is. So far, just in these comments I've seen: 1. just use plain cabal 2. use stack, you don't need cabal 3. use gchid 4. haskell+nix is best 5. use hpack To emphasise again, this is not a severe criticism. I've been around for too long not to know that this is an almost inevitable result of people working in open source with disparate purposes and heterogeneous environments. PS. I bought HaskellForMac and it's great. It ties you a Haskell version a little older than the latest but that's OK too.
- vaibhavsagar 9y agoI help maintain IHaskell and I'm sorry to hear you had trouble setting it up. If you'd like to open an issue on the IHaskell repo I can try to help you troubleshoot your install.