IHP – A Haskell web framework
github.com
github.com
- the video scaffold redirected to localhost:8000/Posts why in the world are the controller paths capitalized? So rare to see that but somehow I'm less surprised in haskell
- the name sounds a lot like i-Hop and I can't get it out of my head now and it will forever be that. First impressions have a way of sticking around
Otherwise I like the opinionated direction they chose. Especially being a dev-shop we're using it for ourselves so we don't really care about taking a community-census type approach to things. They only care about what works for creating real things.
Having gone down the Haskell road, letting someone make the hundreds of early choices for you seems to be the best way to go for early adoption. Typically the under-layers remain abstract enough for the true hackers, which also seems to be the case here (from reading about the blaze-html integration).
Which I always believe is a solid foundation for any useful framework. The demanded customizations can always be supported later. Modularization tends to come later as a project matures, but the early days it's best to take a singular path that works for the founding team until maturity is reached and wait/see if it does indeed become popular first to justify the more modular/customizable approach.
I haven't tried it myself though but I seem to be close to the target market being both a past Rails dev and a Haskell fan. So I'll keep it on the back burner for until I have time.
> why in the world are the controller paths capitalized
The idea behind that is that it makes mapping from url to action easier when trying to understand how things work.
E.g. `/Posts` maps to `PostsAction`. `/NewUser` maps to `NewUserAction`.
I think longterm urls don't matter that much anymore as many browsers just hide them completly (think Safari, many mobile browsers, etc.), so we optimize them for development purposes :)
(Disclaimer: Founder of digitally induced, the company behind IHP)
So far, hyperlinks have not gone away.
But which style of concatenation of words is surely subjective. I would have thought that FooBar -> foo-bar was the ad-hoc standard, but even then, people handle corner cases differently, such as “what if the word you’re url-ifying contains a dash?”
I'm increasingly encountering users that have trouble understanding that they should copy the URL to someone if they want to share a web page with them. Humans are logical creatures: if they see a part of the system that is constant, they will deduce that it could not have had an impact on the part that is changing. In the case of the URL this is an incorrect conclusion, but the UX from bad actors like Apple and Google is steering the user towards it.
If the intent is to show the host more prominently, then the URL should be visually split into the (more prominent) host part and the path part. The path part should not be simply hidden.
I'm not at all saying simplify the language for the LCD, but I have to manage all three of those tools and more and their usability is horrible. The configs are all over the place, there's 2 or 3 per project repo, another several global configs, the command line tools have a thousand flags and switches, the compiler language extensions are insane (i have like 30 turned on by default, and those are just the safe ones), i could continue...
This project, at least, tries to help the new user get into it quickly, I appreciate that because it helps me get my friends to try Haskell for a nontrivial use right away, then they want to invest the time to learn the rest of the Haskell toolchain bullshit.
You can even just use ghcup and cabal but work against a Stackage LTS snapshot for added ease.
If you end up using Nix in the future, barely anything will change for you if you start with bare cabal. It's additive, not a replacement.
Same goes for if you use stack as an enhancement, although a big appeal of stack is its own CLI.
At least that isn't cmake et al.
I find that not true. Scaffolding is not magic. IHP has little magic compared to big names like Rails and Spring Boot.
What I find that IHP is full of: type safety saving my ass from runtime drama.
Totally agree on the docs remark, the community is very friendly though.
For custom URLs check this: https://ihp.digitallyinduced.com/Guide/routing.html#custom-r... For JSON check this: https://ihp.digitallyinduced.com/Guide/view.html#json
I didn't get too far into it, though, because at the time it didn't support the Haskell language server, which made exploring the framework hard. They've added support for that since then, so I'm looking forward to trying it again. I'd also love to hear people's experiences, if anyone has gotten further in it.
It does now:
https://ihp.digitallyinduced.com/Guide/editors.html#notes-on...
Installing it was easy, even though this was my first time using Nix. I think shipping things with Nix, especially when what you ship is integrated, can be superior in Haskell to using stack or cabal. (Stack is easier, cabal is more flexible, neither handle dependencies outside of Haskell.)
I’ll definitely come back and check it out for another prototype soon. :)
I don't have any experience with Rails or other haskell frameworks.
> You thought Yesod was Rails? Nope. Yesod is a highly modular library for developing web applications with a few opinions and some scaffolds. > IHP is Rails - all the components are glued together in a way that makes modularity difficult.
The main difference is that IHP is very opinionated and cares a lot about giving a great developer experience. Where Yesod gives you 5 options to do things, IHP has one way to do it. This especially applies to the infrastructure: IHP takes care of installing the compiler, libraries and also provides a built-in dev server that automatically reloads your code.
Our standardized setup allows for a super quick way to get started building real things.
Another important thing is documentation. IHP has best-in-class documentation[1] with lot's of code examples. Compare it yourself:
Yesod: https://www.yesodweb.com/page/quickstart IHP: https://ihp.digitallyinduced.com/Guide/installation.html
[0]: https://twitter.com/mattoflambda/status/1275469470559907840 [1]: https://twitter.com/smdiehl/status/1276049218654912514
IHP is in the Rails to Django range.
This will not be fastest (that will be the C/C++/Rust solutions), but the programming experience is very high level. I want speed in runtime performance (1) and in developer productivity (2). I'd say Rust and Haskell have interesting offerings looking at these two metrics.
Would we have to use AJAX polling for that or would need to write Websocket Code manually, we'd need to spend way more time on that.
If this just a fun project then cool. I hoped the author learned something. I hope even more that they share what they learned.
Radical type safety for the masses!