5 ms·
Haskell IHP framework, from a technical and business perspective
- yumraj 5y agoThere may not be an easy answer, but could someone opine on how a Haskell/IHP based web application would compare with Elixir/Phoenix based solution. I'm primarily interested in Haskell vs Erlang/Elixir comparison rather than IHP vs Phoenix, since I'm aware that Phoenix may be more featured at the moment.
- tmm84 5y agoHere's a video on Haskell vs Elixir: https://www.youtube.com/watch?v=alXhK5ZI9SE&pp=ugMICgJqYRABGAE%3D https://www.youtube.com/watch?v=alXhK5ZI9SE&pp=ugMICgJqYRABG... For me personally when I look at Elixir/OTP vs Haskell it breaks down to this; concurrency/parallelism/scaling, laziness (Haskell), syntax (H minimal vs E Ruby-esque) and types (H static, E dynamic). These are what I personally notice between them and I could be wrong with my interpretation because I don't work with Haskell/Elixir but merely watch/read content on them.
- tromp 5y agoIs it possible to use IHP without installing Nix? I already have brew as general package manager and ghcup/cabal as Haskell toolchain/library manager and dread having yet another package manager that might interfere...
- _query 5y agoIt's not possible to use IHP without Nix. Using nix allows us to make fully reproducable dev environments as all versions (even e.g. the version of postgres used in dev mode) are pinned down. The IHP docs assume no knowledge about nix, so it should still mostly be very simple to get started. We compiled a couple more reasons why IHP uses nix in this blog post: https://ihp.digitallyinduced.com/blog/2020-07-22-why-ihp-is-using-nix.html https://ihp.digitallyinduced.com/blog/2020-07-22-why-ihp-is-... Btw: To give IHP a try without installing Nix you can also try out the official GitPod image here https://gitpod.io/#https://github.com/gitpod-io/template-ihp https://gitpod.io/#https://github.com/gitpod-io/template-ihp :)
- rgoulter 5y agoAlthough I see nix is required, it would be possible to run the ihp-new program with just nix installed, but without needing to change your PATH permanently. e.g. with a shell.nix file with contents: { pkgs ? import <nixpkgs> {} }: let ihp-new = pkgs.fetchzip { url = "https://downloads.digitallyinduced.com/ihp-new.tar.gz"; sha256 = "0prpw46iyrjwzglq38n4kfn68dv2piw6dn8464ra99yl1dml465m"; }; in pkgs.mkShell { packages = [pkgs.cachix ihp-new]; } Running nix-shell with this would download the ihp-new program, and you'd have access to it (and postgres, etc., when you run with a shell with direnv enabled), but outside of the nix-shell, your PATH and other things would be unaffected.
- _query 5y agoThe ihp-new command is only a shell script that does a few checks and then git clones the project boilerplate: https://github.com/digitallyinduced/ihp/blob/master/ProjectGenerator/bin/ihp-new https://github.com/digitallyinduced/ihp/blob/master/ProjectG... The actual IHP project has it's own nix-shell environment, so that all project dependencies are managed locally (https://github.com/digitallyinduced/ihp-boilerplate/blob/master/default.nix https://github.com/digitallyinduced/ihp-boilerplate/blob/mas...).
- iammisc 5y ago> dread having yet another package manager that might interfere... Nix won't and can't interfere with your system
- phaer 5y agoI am confused, the text says: > The subject of the mail will change based on the status of the Reservation. With the type system in place, the compiler makes sure we that do not forget any possible case. But the [linked code](https://github.com/Gizra/ihp-simple-seat-reservation/blob/f9a9c57eec8f02526beb24201d3125025a23e69b/Web/Mail/Reservations/Confirmation.hs#L12-L18 https://github.com/Gizra/ihp-simple-seat-reservation/blob/f9...) seems to include a wildcard clause which would just set the subject to an empty string. Am I missing something?
- HowardStark 5y agoThe important point isn’t that there’s a wild card, it’s that there isn’t an undefined clause. You know with compiler-assured certainty that WYSIWYG, which is a big step in code predictability.
- phaer 5y agoCould you elaborate? Wouldn't it be better to i.e. throw a runtime error than to send an email with an empty subject to a user from a business perspective in most cases?
- amitaibu 5y agoI tried to keep the code simple, so yeah - it was on the expense of making it more "right". In this case I wouldn't call the command send the mail unless status was explicitly Accepted or Rejected. But as notes above, the important part is that the compiler doesn't let me forget about all the possible cases (e.g. `Queue` in this example).
- leetrout 5y agoI tried Haskell a decade ago and gave up pretty quick due to some of the stereotypical reasons. I really like this test file the author linked to for a great example of what "real" haskell can look like. https://github.com/Gizra/ihp-simple-seat-reservation/blob/main/Test/Controller/ReservationsSpec.hs https://github.com/Gizra/ihp-simple-seat-reservation/blob/ma... I'm interested in other "pragmatic" haskell sources / tutorials that lose the ego / pretentiousness and demonstrate Getting Stuff Done™... any recommendations?
- _query 5y agoHere's a link to the IHP Chat Example app: https://github.com/digitallyinduced/ihp-chat-example-app/blob/master/Web/Controller/Messages.hs https://github.com/digitallyinduced/ihp-chat-example-app/blo... You can find a couple real-world examples here https://ihp.digitallyinduced.com/Guide/examples.html https://ihp.digitallyinduced.com/Guide/examples.html
- rgoulter 5y agoI like the term 'simple haskell' more. It links to a few blogposts with similar sentiments. http://simplehaskell.org/ http://simplehaskell.org/
- lalaithion 5y agoThe file linked is not what the 'simple Haskell' philosophy suggests. It is compiled with the following extensions enabled: OverloadedStrings NoImplicitPrelude ImplicitParams Rank2Types DisambiguateRecordFields NamedFieldPuns DuplicateRecordFields OverloadedLabels FlexibleContexts TypeSynonymInstances FlexibleInstances QuasiQuotes TypeFamilies PackageImports ScopedTypeVariables RecordWildCards TypeApplications DataKinds InstanceSigs DeriveGeneric MultiParamTypeClasses TypeOperators DeriveDataTypeable MultiWayIf UndecidableInstances BlockArguments PartialTypeSignatures LambdaCase DefaultSignatures EmptyDataDeriving BangPatterns BlockArguments MultiWayIf FunctionalDependencies PartialTypeSignatures StandaloneDeriving DerivingVia
- dustingetz 5y agoThe web framework landing page: https://ihp.digitallyinduced.com/ https://ihp.digitallyinduced.com/
- cosmic_quanta 5y agoI learned a lot about building Haskell web apps by studying the following source code: https://github.com/restyled-io/restyled.io https://github.com/restyled-io/restyled.io
- lngnmn2 5y agoIt is useless to say, but Haskell is a modeling and domain language, it is a sunset of math and highly sugared logic. The proper place if Haskell code is Fastcgi and batch processing. It should FFI everything infrastructure related and should be called by nginx or whatever. Using it as a Java EE with monads is plain, well, let's say "over-engineering".
- chowells 5y agoYou have never used Haskell, have you?
- thewakalix 5y agoIf it's useless to say, why did you say it?
- icrbow 5y agoWhy bother with nginx or whatever if its native server is http3-capable and performant enough by itself?
- lngnmn2 5y agoBecause I don't see the point of having everything implemented in the same language, in sort of monolith with lots of complex dependencies. For me, it is the same as to have a server in Mathlab. Also, like I said, the code I am unreadable J2EE like mess of useless, redundant abstractions.