7 ms·
Show HN: IHP v1.0 – Batteries-included web framework built on Haskell and Nix
- njaremko 4y agoIt looks like Docker support is still a paid feature? That's disappointing. I had written a blog post outlining how important docker support was and explaining how little work it was to get working, and at the time the maintainers agreed it should be a free feature, but it seems they've changed their minds.
- _query 4y agoThere's some unofficial ways to build docker images, check https://zacwood.me/posts/building-ihp-apps-github-actions/ https://zacwood.me/posts/building-ihp-apps-github-actions/ :) We've not changed our minds on docker becoming a free feature eventually. We just didn't update the pricing yet, but this is planned for the near future.
- VTimofeenko 4y agoIf it's using nix for building - there's multiple ways to DIY turn that into a docker container, like pkgs.dockerTools.buildImage or nixpacks: https://github.com/railwayapp/nixpacks https://github.com/railwayapp/nixpacks
- _query 4y agoIHP is really easy to package with nix nowadays. In fact the official docker building also just uses `pkgs.dockerTools.buildImage` and calls nix-build :) Most people with nix experience can easily figure out how to do exactly the same thing as the "official" way.
- njrc9 4y agoOne of the nice features of IHP is that, thanks to Haskell’s strict type checking, it does not just eliminate bugs, it also speeds up development. E.g. if you want to change or build a new feature, you don’t need to write tests for it since the compiler basically does that for you. Since you don’t need to write tests, your work is perhaps half of what it would be normally – and neither do you have to know how to write good tests, which is an entire skill in itself.
- tome 4y agoNot sure if you're being sarcastic, but Haskell developers should definitely write tests, and good ones know how to write good tests. The type system eliminates the need for some forms of testing, but not all.
- njrc9 4y agoThanks for the feedback. I am definitely a beginner in Haskell, which would explain why I came to this conclusion. Could you recommend some good sources on testing in Haskell?
- dllthomas 4y agoWhile of course Haskell has more normal testing infrastructure available (eg. https://hspec.github.io/ https://hspec.github.io/), my favorite bit of Haskell testing is QuickCheck, which IIUC started life in Haskell and has been reimplemented in other languages with various degrees of effectiveness and various degrees of connection to the original project. John Hughes (not the filmmaker) gives a great talk about it: https://youtu.be/zi0rHwfiX1Q https://youtu.be/zi0rHwfiX1Q
- njrc9 4y agoThank you very much! I just finished watching the video and am now reading more on QuickCheck. This approach makes a lot of sense.
- switchbak 4y agoDon't need to write _type_ tests (like you would in a dynamic language). Having strong typing doesn't magically do formal validation on your logic. Leaning heavily on types is good practice, but that doesn't eliminate most of the high value tests you'd have to write.
- mananaysiempre 4y agoHaskell's QuickCheck, AFAIK the first prominent implementation of property-based testing, gained its popularity partly because it eliminated a good part of the tedium by inferring the sampling strategies from the types (which in idiomatic Haskell are, due to liberal use of opaque type synonyms, often quite a bit more specific than in any other non-dependently-typed language I've seen). Which does not free the programmer from writing down the properties themselves—in that respect your objection is valid—, but IME still makes it quite a bit more ergonomic than e.g. Python's otherwise functionally equivalent Hypothesis.
- montmorency88 4y agoIHP is already used in production for a number of commercial projects, but I'd also highly recommend the framework for anyone interested in just learning and hacking away with haskell. The IHP IDE is a great playground and you are automatically set up with a postgres db, ghc, hls, etc. So a lot of the configuration barrier is removed and you can just start writing Haskell and experimenting with some of the cool libraries on hackage.
- z9znz 4y agoIt looks great! Do you think the web-based IDE is enough to be productive? For example, could this work on a Chromebook (in browser) or an iPad Pro (browser only)?
- _query 4y agoThe IDE is mostly designed as an extension to an editor heavy workflow (e.g. I use Sublime + VIM to build IHP itself). So it's unlikely to work well with a Chromebook. A workaround might be to use the GitPod integration for a web based code editor. The IDE is btw entirely optional and everything can be done via code. E.g. all operations done via the visual Schema Designer are saved in the Application/Schema.sql file. That file can be edited from a code editor as you want. All operations in the schema designer operate on the AST of the parsed Schema.sql file.
- xrd 4y agoIs this something I can play with despite zero knowledge of Haskell?
- _query 4y agoYes, you can get pretty far without knowing anything about Haskell. Once you've something on the screen you'll eventually get to learn a bit more about functional programming and Haskell. A good starting might btw be our IHP Casts Youtube playlist https://www.youtube.com/watch?v=PLl9Sjq6Nzc&list=PLenFm8BWuKlS0IaE31DmKB_PbkMLmwWmG https://www.youtube.com/watch?v=PLl9Sjq6Nzc&list=PLenFm8BWuK...
- jalino23 4y agoI guess its time to learn myself a haskell for great good!
- _query 4y agoReally happy we've finally got to the 1.0 status :) If you like to take a look at the code, check our GitHub at https://github.com/digitallyinduced/ihp https://github.com/digitallyinduced/ihp
- desireco42 4y agoWow, just started watching video, this is really nice. The integrated environment, db and everything makes it super easy to get started. I guess you made it so you just have no excuses to try this out. Big thank you for developers.
- _query 4y agoThanks! :) I appreciate your feedback
- desireco42 4y agoHere is more feedback. Installation of everything is a little bit hairy... It didn't work in my fish shell but I had to switch to zsh to make it work... When you edit database, instead of waiting for you to click update, maybe you can prompt user after update... "Do you want to run migrations?" Small things like that. Overall I love functional aspects of it and will be playing more in days to come.
- mgomez 4y agoI've been meaning to pick up either Haskell or OCaml for my next language. On the OCaml side, I see Cornell's free CS 3110 textbook recommended around here. Is there something similar on the Haskell side?
- belmont_sup 4y agoI’m going through Effective Haskell. https://pragprog.com/titles/rshaskell/effective-haskell/ https://pragprog.com/titles/rshaskell/effective-haskell/ Pretty great resource, but still WIP.
- weatherlight 4y agoSame. Thus far its been pretty easy to follow along and I haven't ran into any show stopping issues.
- buzzy_hacker 4y agoWe used http://www.learnyouahaskell.com/ http://www.learnyouahaskell.com/ in my PL class in college, I enjoyed it
- cosmic_quanta 4y agoI learned by reading Haskell Programming from First Principles. Great book which covers most topics you'd need to know in order to write and read Haskell in the wild. Highly recommended
- doe88 4y agoAlso, this wiki is a great ressource: https://en.wikibooks.org/wiki/Haskell https://en.wikibooks.org/wiki/Haskell
- theCodeStig 4y agoThe academic analogue would be: Programming in Haskell, by Graham Hutton http://www.cs.nott.ac.uk/~pszgmh/pih.html http://www.cs.nott.ac.uk/~pszgmh/pih.html
- ilrwbwrkhv 4y agoWhy is the editor integration and autocomplete still so poor? Shouldn't strong types help with that?
- _query 4y agoCheck out the docs on editor integrations: https://ihp.digitallyinduced.com/Guide/editors.html https://ihp.digitallyinduced.com/Guide/editors.html With VSCode the editor integration and autocompletion should work really well. You can see a demo in this video: https://www.youtube.com/watch?v=_8_8XYO6rgY https://www.youtube.com/watch?v=_8_8XYO6rgY
- ilrwbwrkhv 4y agoThe jsx seem not to have highlighting or completions?
- _query 4y agoThere's a couple editor plugins to get you that: For VS Code: https://marketplace.visualstudio.com/items?itemName=s0kil.vscode-hsx https://marketplace.visualstudio.com/items?itemName=s0kil.vs... for For Sublime: https://packagecontrol.io/packages/Haskell%20HSX https://packagecontrol.io/packages/Haskell%20HSX
- tobias2014 4y agoHow does this compare with Yesod?