Advent of Code in Haskell: T Minus 16
bulters.dev
bulters.dev
Have you tried doing something beyond puzzles like AoC? There's a weird communal perception of Haskell being a near enough insurmountable challenge, so instead of people getting their hands dirty, they just flirt with it on and off for years on end.
In my experience, after I had written a web app or two in Haskell I wasn't sure what all the fuss was about. It's an excellent language to be productive in. The libraries and tooling are great. The water is warm; jump in.
Please don't take the above as criticism; it isn't intended that way. It's great that you're learning and sharing Haskell :) Also FYI your about page currently is a 404.
I tried to give the language a spin, and struggled with many a barrier to get to the point where I see significant progress (books, build tools)
I understand that you are invested in the Haskell ecosystem with your company, and I am happy that the language has more adoption in the business sector. The design space of Haskell is huge, however, and then on boarding process to make serious applications is not convenient at all.
I think you are correct. Would you perhaps have some resources at hand that would combine on boarding with a simple Web project?
https://ihp.digitallyinduced.com/
Disclaimer: Founder of digitally induced, the company that makes IHP :)
Not that IHP is bad (the batteries included approach for sure is a good idea), it just feels a little bit disingenuous otherwise.
On the other hand, there's nothing magical about compiling a file with GHC, just like compiling with gcc. So a simple Makefile might suffice in a lot of cases (like doing AoC challenges).
Things start to get more complicated when you add Cabal (and Stack) into the mix, but even with just Cabal you get a lot of added benefits which not too much added complexity.
Things like IHP go one step further and go all-in on using nix. I've looked at using nix for a few hours and decided it is - right now - not worth the effort of actually learning it. Nothing to prevent me from using it to build something with IHP though.
> self contained puzzles
These hit pretty close to home. The thing is, at any given time I either don't have an actual project I'm eager / able to start, or if I am motivated to "get stuff done" then I don't want to complicate the effort with something new so I reach for more familiar tools.
I've considered building a simple CRUD REST API or small CLI script in haskell. Do you really suspect I'd learn much more than I would with Advent of Code (which I have done before)?
On the one hand, stuff like learning Hesod, database interaction, and I/O generally would be a real skill. On the other hand, one time I attempted to hack Postgrest to work for Redshift. It mostly worked (read only, no bells and whistles) and that was cool but I didn't really feel i learned much
If you're doing a CRUD thing, I'd suggest supporting both JSON and HTML representations of your responses (and Yesod works great for this). I think the art is in the details between the language parts you know and the libraries you end up interfacing with. Once you start doing this for real, that's when the details you learned in isolation in the beginning all begin to fit together.
My main candidate for this right now involves webscraping from a relatively small single source, structuring the data, and serving it in a different manner.
If I may tag on a semi related question: does https://hackage.haskell.org/package/tagsoup look like an OK html parsing library? Any general advice on choosing packages?
Thanks for this, I'm socially committed now ;-)
For what it's worth, I've dabbled with Go for about two years, doing the matasano crypto challenge and an AoC using it, before I actually started using it for "real work"TM.
So yeah, self contained puzzles like AoC, Project Euler, Rosalind, etc is the migration path. It's hard to find something reasonably educational and medium level to work on; meanwhile I'm not exactly free to arbitrarily switch to langX at work.
I'm also a roguelike fan and every year I think about trying out a very simple 7DRL in some language I'd like to learn, but without libtcod bindings I'd spend all the time working on i/o and display and not any actual game logic. However, something along these lines is probably my best bet for a medium educational "fun" project for language learning so I should figure out how to use libtcod from langX!
The puzzle projects do let me get familiar with parsing command line args, reading/writing files, splitting input and strings, etc. So that's definitely valuable.
Meanwhile, C# keeps getting better and faster every year, so I keep going back.
Regarding the trying part: I'm actually doing that "as we speak". I had an idea for a web-app on the shelve which I'm currently implementing with the help of IHP. Might do a write-up about that in the future.
Main idea here was to offer my notes for some of my co-workers who struggle with the same things I do/did.
Personally, I like to believe that haskell is - as you mentioned - not an insurmountable challenge to use. So I will probably not write about learning functors/applicatives/monads/etc., but will use them (at some point).
edit: added the word NOT.
Thanks for posting how you get everything set up for AoC! It's always neat to see how folks tackle the problems and set up their dev environments -- there's a good bit that can be automated between setting up each day's challenge.
edit: thanks for pointing out the erred link, updated.
- https://typeclasses.com/beginner-crash-course
- https://yannesposito.com/Scratch/en/blog/Haskell-the-Hard-Wa...