HNHacker News
TopNewBestAskShowJobs

_query

1,262 karma · joined March 7, 2014

Founder, digitally induced GmbH

https://www.digitallyinduced.com/

marc a t digitallyinduced com

submissionscomments
_query··on Haskell for the Elm Enthusiast
If this made you interested in trying out haskell for making web apps, check out IHP https://ihp.digitallyinduced.com/ It's the easiest way to get started with building haskell web apps :) IHP is designed for non-haskellers, so it's easy to start with for most people that haven't written much haskell yet.
_query··on macOS Nix setup: an alternative to Homebrew (2020)
I've been using nix on macOS as my primary package manager for years. Really love it! Specifically nix-shell is a blessing a you can quickly try out things without worrying about breaking some other packages on the system.

Initially we've only used nix for development at my company, but now we're also running most of our servers with NixOS. This allows us to use our dev package definitions in production, so our dependencies are always in sync between dev and prod. I've written a blog post about all the advantages we get with nix in our framework IHP a while ago, if you're curious, check it out: https://ihp.digitallyinduced.com/blog/2020-07-22-why-ihp-is-...

If you're using an older mac and have troubles with installing nix, try out the new installer in this GH issue: https://github.com/NixOS/nix/pull/4289 (the command is in the "Try it out" section). It's already merged, but not released yet. So far this has solved all the issues on older macs for me.

Also check out https://nix.dev/ which has many great resources to get started :)

_query··on Functors and Monads for People Who Have Read Too Many “Tutorials”
> For instance, you don't see a "stand up a web app in Haskell in 10 minutes" tutorials. Historically it may have worked in Haskell's favour to slowly induct learners, but in this age where languages are fighting for mind space I don't agree that's a good approach anymore.

There's now the IHP framework that allows you to build haskell web apps in like 10 minutes. If you're curious, check it out: https://www.youtube.com/watch?v=UbDtS_mUMpI It's been called "Haskell on Rails", and for good reason.

_query··on The future of web software is HTML over WebSockets
This approach definitely has a lot of value for specific use cases. Specifically to get MVP done in a fast way. When you need to scale out, you can still add a SPA later on.

If you combine the approach of WebSockets + dom patching with postgres pg_notify you get some real magic :) In the new IHP framework we provide something like that. We call it Auto Refresh: https://ihp.digitallyinduced.com/Guide/auto-refresh.html

Auto Refresh is activated with a function call inside a controller action, like this:

  action ShowProjectAction { projectId } = autoRefresh do
      project <- fetch projectId
      render ShowView { .. }
The only difference to a normal IHP action is that it has the `autoRefresh` call in front of the do-block.

Once activated IHP will automatically track all tables your action is using e.g. in `SELECT * FROM ...` queries. Once the action sends a response IHP will start watching for any kind of `INSERT`, `UPDATE` or `DELETE` statement to all the tables used by your action using pg_notify.

When the page is rendered a small JavaScript function will connect back to the IHP server using a WebSocket connection.

Whenever an `INSERT`, `UPDATE` or `DELETE` happens to the tables used by your action IHP will rerun your action on the server-side. When the generated HTML looks different than the HTML generated on the initial page load it will send the new HTML to the browser using the WebSocket connection. The JavaScript listening on the WebSocket will use the new HTML to update the current page. It uses morphdom to only touch the parts of your current DOM that have changed.

Here's how this looks in the real world: https://twitter.com/digitallyinduce/status/13207288333943808... <- This view has no app-specific Javascript. The auto refresh is enabled using a single function call and the framework takes care of all the technical details.

Some use cases where this really shines:

- interactive dashboards (e.g. showing the current status of job queue)

- simple user chat systems (you can send messages using normal form submission, as long as auto refresh is enabled this works like a SPA)

- building a twitter clone, the feed will automatically add new content as it's added to the database

We're using this approach in production since last year and it saves an incredible amount of development time.

_query··on Reflections on Using Haskell for My Startup
Measured by GitHub stars, which is a good proxy:

https://star-history.t9t.io/#digitallyinduced/ihp&yesodweb/y...

We also have a very active community, e.g. over 100 people in Slack, over 180 in Gitter, over 100 weekly active projects (https://ihp-telemetry.digitallyinduced.com/admin/Events <- here's some telemetry)

_query··on Reflections on Using Haskell for My Startup
The tooling situation has improved a lot in the haskell ecosystem in the last year.

E.g. with Haskell Language Server there's now a good and standard way for having autocompletion, etc. inside VSCode and other editors.

In the web development space we now have IHP, which is like rails but with type-safety. It's already the second largest haskell framework, even though it was just launched last year: https://ihp.digitallyinduced.com/ (Disclaimer: I'm founder of the company that makes IHP)

_query··on Reflections on Using Haskell for My Startup
At digitally induced we're always looking for great developers to add to our haskell team: https://www.digitallyinduced.com/JobPositions :)
_query··on Reflections on Using Haskell for My Startup
Our company is also using a lot of haskell for our projects. Since we adopted haskell we had a lot more very talented developers apply.

I think this only might be a problem if you don't want to hire remote.

_query··on Haskell is our first choice for building production software systems
IHP is very opinionated in the way how it approaches building web applications (Code Gen, Project structure, Naming, ..). But exactly this kind of opinionated design makes it possible to be very productive, compared to doing everything yourselves.
_query··on Haskell is a Bad Programming Language (2020)
> I think that Haskell is a great language to prototype pure business logic because of the type system and focus on purity, but it has several warts, because haskellers focus more on language research than DX.

This is very true. We recently started https://github.com/digitallyinduced/haskell-ux to keep track of haskell DX improvements. Some of our suggestions are already issues on the GHC (haskell compiler) bug tracker.

Here's an example of a great UX improvement in GHC: https://gitlab.haskell.org/ghc/ghc/-/merge_requests/4711

_query··on Haskell is a Bad Programming Language (2020)
I think for making stuff the speed of iteration is the most important metric.

Haskell is great for this because:

- In dev mode it's super fast, see https://www.youtube.com/watch?v=nTjjDo57B8g&feature=youtu.be

- You can change features of your product easier thanks to the type system. Doing a big refactoring with rails always adds many bugs. With haskell you spend less time on doing these kind of changes because the compiler tells you what needs to be changed.

_query··on Haskell is a Bad Programming Language (2020)
The value of type safety is more that you're more productive because you can faster change things (as the compiler tells you what needs to be changed). This allows for faster iteration on your product.

Correctness is indeed not the most important thing, it's kind of a nice side effect.

_query··on Haskell is a Bad Programming Language (2020)
I'd pick elm for the frontend as it's kind of similiar to haskell syntax-wise but more optimized for the frontend context. Here's a great tutorial for this: https://driftercode.com/blog/ihp-with-elm/
_query··on Haskell is a Bad Programming Language (2020)
Haskell is pretty nice for building web applications.

Thanks to it's type system you can build much more stable web apps in less time. Usually later in the application life cycle you have a hard time refactoring stuff when working with e.g. JS or rails. Without tests you will definitly break stuff. With haskell you can confidently refactor your code without worrying about breaking stuff, the compiler will tell you.

The way data structure are declared in haskell is also very nice for domain modeling. You don't have as much boilerplate as e.g. when using PHP with doctrine.

The performance is also pretty good compared to python or rails.

_query··on Haskell is a Bad Programming Language (2020)
> programming languages are meant to ease the task of creating computer programs as opposed to writing assembly by hand

This! The haskell ecosystem is missing a certain kind of pragmatism. There's a lot of beautiful type abstractions, talking about monads, etc., but not enough builders doing actual application development. In my opinion it's not the language that is bad, but the ecosystem. Missing documentation, missing tooling and infrastructure, no focus on actually building applications.

We're trying to fix that with IHP, a new haskell framework with a focus on actual building applications. Imagine the productiveness of rails combined with the typesafety of haskell.

6 months after it's release it's already the second biggest haskell framework, and we just had a new record of weekly active users last week. To me this shows that by fixing the ecosystem haskell can reach a lot more than it's currently doing.

Check it out: https://ihp.digitallyinduced.com/ GitHub: https://github.com/digitallyinduced/ihp

_query··on New Haskell Foundation to Foster Haskell Adoption, Raises 200k USD
Here's a "boring" haskell app: https://dill.network/ It's a vegan product scanner. You can find the story behind the project here: https://twitter.com/larsparsfromage/status/13211859357117358...

Here's a "boring" internal management system: https://twitter.com/fegundersen/status/1325534608079941633

Disclaimer: Founder of digitally induced, the company that helps make boring things with IHP+Haskell :)

_query··on New Haskell Foundation to Foster Haskell Adoption, Raises 200k USD
We build an amazing web framework called IHP with haskell, imagine the productiveness of rails combined with the typesafety of haskell: https://ihp.digitallyinduced.com/

IHP has around 230 monthly active projects at the moment, and it's growing fast. It was released 8 months ago and now is already the second biggest haskell web framework :)

I think haskell has been previously tragically underused because it was missing good documentation and pragmatic solutions that help you to get things done. Atleast in the web dev space this has changed this year. Watch our IHP demo video and you'll get it: https://www.youtube.com/watch?v=UbDtS_mUMpI

Disclaimer: Founder of digitally induced, the company that makes IHP.

_query··on IHP – A Haskell web framework
Thanks! We'll improve the documentation on the points you've mentioned :) Created https://github.com/digitallyinduced/ihp/issues/570 to keep track of it.

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

_query··on IHP – A Haskell web framework
Yes, this is very similiar. We used it extensively to build IHP Cloud [0] where we have a lot of async background processing. AutoRefresh allows the view to be updated automatically when e.g. the deployment status changes without us writing any app-specific JS code. It's takes only a single line of haskell code, so it's implemented in seconds and then really just works :)

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.

[0]: https://ihpcloud.com/

_query··on IHP – A Haskell web framework
Someone from the haskell community summarized it like this [0]:

> 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

_query··on IHP – A Haskell web framework
Thanks for your thoughts!

> 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)

_query··on Advent of Code in Haskell: T Minus 16
Thanks for pointing out, added the disclaimer
_query··on Advent of Code in Haskell: T Minus 16
You need to check out IHP. It's a new truly batteries-included web framework for haskell. IHP allows you to get started in minutes. It takes care of all the infrastructure work so you can just build cool stuff and enjoy the type-safety.

https://ihp.digitallyinduced.com/

Disclaimer: Founder of digitally induced, the company that makes IHP :)

_query··on One Week of NixOS
If you're interested in just the package manager Nix check out https://nix.dev/ It guides you to get a reproducible development environment up and running with nix. This way you can get all the goodies like `nix-shell -p nodejs` without switching your OS first :)
_query··on Real World Haskell
If you have good internet connection it's usually downloaded a lot faster. We have switched the nixpkgs version in that version, so a lot of tooling had to be redownloaded. E.g. in our getting started video we install it on a fresh empty macbook: https://www.youtube.com/watch?v=PLl9Sjq6Nzc&feature=youtu.be The full download there takes around 9 minutes on a slow home office internet connection (it's speed up in the video, but you can see the real-world time at the top right).

We mainly added the warning in that release because usually the update process is very smooth and takes only one minute, e.g. see this tweet: https://twitter.com/mittie/status/1322574176792825861

_query··on Real World Haskell
We did a blog post a while ago sharing why we decided to use nix for all package management aspects of the framework. Take a look: https://ihp.digitallyinduced.com/blog/2020-07-22-why-ihp-is-...
_query··on Real World Haskell
To build some real world web applications check out IHP: https://ihp.digitallyinduced.com/

It's a truly batteries-included way to get started with building real world haskell web apps in minutes.

_query··on Haskell web framework IHP aims to make web development type-safe and easy
> Templating? Haskell provides such a wonderfully clean way to generate HTML via combinators and do notation. You don't need a quasi quoter to get a DSL. See Lucid. All templating does is remove control features (like forM, for example).

IHP's templating HSX is targeted at people with a react background that are familiar with JSX syntax. In the background it compiles down to blaze-html and can be used together with e.g. forM_ (which we have aliased to forEach). It's just a more familiar syntax on top of blaze html.

Some internal IHP functions are even still implemented with the blaze combinators: https://github.com/digitallyinduced/ihp/blob/master/IHP/View...

> They've reinvented common operators. For example, (|>), which is great, I've used it in Elm, but the Haskell version of this is (&) from Data.Function.

The |> just looks more beautiful to us :) Take a look at the gorgeous expressiveness of this: https://twitter.com/digitallyinduce/status/12990709068542484...

> They're ignoring Haskell conventions to make it more familiar to people coming from other backgrounds,

Yes, IHP is the haskell framework for builders :-)

_query··on Haskell web framework IHP aims to make web development type-safe and easy
Many people in the IHP community are beginning their haskell journey with IHP.

Check out e.g. 100 days of haskell by Lars Ulvestad: https://driftercode.com/blog/hundred-days-of-haskell-day-one...

Started around 60 days ago, and now here's the soon-to-be-production app: https://twitter.com/larsparsfromage/status/13149985667761725... :)

_query··on Haskell web framework IHP aims to make web development type-safe and easy
IHP apps are generally deployed on standard Cloud such as AWS. In the big picture you need to build the binary and CSS+JS and then copy the files onto your production server. There you just need to start the binary and pass some options (such as the DB connection) via env parameters.

Check the deployment guide for more details: https://ihp.digitallyinduced.com/Guide/deployment.html

There's also IHP Cloud which is basically "netlify for haskell". Here's a video of deploying a IHP haskell app in 60 seconds: https://twitter.com/digitallyinduce/status/13134104697854074... More infos here: https://ihpcloud.com/

← PreviousPage 4 of 6Next →