7 ms·
Haskell is an underrated super power for building backends and web apps. Since 2019 when the blog post was written the ecosystem has improved quite a lot. With
by _query 5y ago
Haskell is an underrated super power for building backends and web apps. Since 2019 when the blog post was written the ecosystem has improved quite a lot. With the Haskell Language Server and the Haskell Plugin for VS Code there's now really nice editor support. The language itself also got major improvements, e.g. support for dot-notation has been added, so you can now write `someValue.someField` as in other languages.
If you're interested in Haskell and are doing web dev, check out IHP, Haskell's version of Laravel/Rails/Django: https://ihp.digitallyinduced.com/ https://ihp.digitallyinduced.com/ (Disclaimer: I'm founder of the company that makes IHP)
- tluyben2 5y agoIHP is a nice product and works really well for my side project; hopefully I can convince my colleagues to use it for our main project too.
- _query 5y agoThanks for sharing, really happy to hear this! :)
- nextos 5y agoSlightly off-topic but how would you convince upper management or a fresh startup to use Haskell? What would be the selling points compared to more mainstream (non-lazy) functional choices? I'm pretty fluent in Haskell, but finding Haskell jobs is hard compared to OCaml or F#, which are a bit of a niche of their own. Actually, I routinely get OCaml offers when advertising Haskell on my CV. I find this interesting and exciting as OCaml was not very frequent outside academia a few years back.
- throwaway17_17 5y agoI think management would have to buy in on developer investment. People who want to work with Haskell, on average, seem quite devoted. I feel like those devs who really want to use Haskell at production scale truly believe in functional programming as a superior endeavor, also, most devs devoted to Haskell also love advanced type systems and are particularly drawn to deeper Haskell the more they do it. Long statements, but I really do think employee retention and personal fulfillment would lead to a better working environment. So that is the way I’d argue it. Obviously a comprehensive sampling of performance metrics would be needed along with the more HR reasonings, but I think there are plenty of examples where Haskell is performing acceptably.
- IanCal 5y agoThat looks really interesting, and I want to also say that that is an exceptional landing page. It has a lot of useful information at just the right level to inform and interest me. Looks like a good way of getting back into experimenting with haskell.
- _query 5y agoThanks a lot for this feedback :) Shared it with the team!
- jeremyjh 5y agoIf I recall correctly, in IHP you can have at most three joins in a SQL query, is that right?
- _query 5y agoYep, the query builder is only designed for simple queries. For complex queries with many joins, it's best to do a raw SQL query instead: https://ihp.digitallyinduced.com/Guide/database.html#raw-sql-queries https://ihp.digitallyinduced.com/Guide/database.html#raw-sql...
- jeremyjh 5y agoI love Haskell, developed daily with it (side projects & libraries) for like five years, but I think it is way behind other languages when it comes to super basic tasks common to database-backed web applications like mapping a set of relational tables to a tree of data (think Company -> Contacts -> Addresses -> City, only a few layers deeper and more joins in order to find the right data-set) that can be serialized to JSON and sent to an API client. I literally could not find a way to do this without lots of slogging for every single query. And then if I want to take that graph of data back, and validate it and apply changes (like Elixir's Ecto Changesets) then god help me...I just have to write so much code to do something a library should be doing for me. And it seems nearly impossible to write that library in Haskell's type system. Would love to be wrong about this.
- _query 5y agoAgree, Haskell's works best when working with flat data structures. IHP also only supports one-level nesting depth, like this: post <- fetch postId >>= fetchRelated #comments This is fine for simple form based CRUD apps. As you mentioned you're consuming the data with a JS frontend: For these cases we added a subsystem called DataSync to IHP. DataSync allows to use the IHP query builder directly from the JS side. This way we basically avoid needing to hand-write these nested graph API responses. Complex forms that depend on a lot of complex data can now be implemented using React components. Here's an example query call from the JS: const todos = await query('todos') .where('id', 'd94173ec-1d91-421e-8fdc-20a3161b7802') .or(where('id', '173ecd94-911d-1e42-dc8f-1b780320a316')) .fetch() This way the frontend can query data that it needs just in time. And also write records to the database without needing to manually writing API actions (thus avoid the data tree problem). You can find an example of this here: https://ihp.digitallyinduced.com/Guide/realtime-spas.html#building-a-realtime-spa-with-ihp-datasync https://ihp.digitallyinduced.com/Guide/realtime-spas.html#bu... For web apps that are fully consumed by a single page app, we're right now building IHP Backend, which provides the IHP tooling + the DataSync API in a way that is way simpler than full stack IHP. If you're curious, you can find a demo video here: https://youtu.be/-jj19fpkd2c https://youtu.be/-jj19fpkd2c
- Jyaif 5y agoAt least in the EU, you are not supposed to embed a youtube video in your page without adding a cookie consent form of some sort.
- _query 5y agoIf you don't like cookies, you can disable them in your browser settings https://support.google.com/accounts/answer/61416?hl=de&co=GENIE.Platform%3DDesktop https://support.google.com/accounts/answer/61416?hl=de&co=GE...
- Jyaif 5y agoTell that to the EU.
- cubefox 5y agoGoogle actually offers a way to embed videos without there being cookies set. You just have to change the domain name. I think it's something like youtube-nocookies.com.
- Jyaif 5y agoLast I heard it does not work: https://axbom.com/embed-youtube-videos-without-cookies https://axbom.com/embed-youtube-videos-without-cookies
- berns 5y agoOne thing that struck me is that i18n will be included in the paid version. Does it mean that it will not be open source?
- _query 5y agoThe basic version is open source. There's an additional commercial version that supports the development of IHP, you can find more infos here https://ihp.digitallyinduced.com/blog/6392ad84-e96a-46ce-9ab5-1d9523d48b23-announcing-the-new-ihp-developer-subscription-ihp-v0-14 https://ihp.digitallyinduced.com/blog/6392ad84-e96a-46ce-9ab... :)
- berns 5y agoThank you. I hope the strategy turns out great. But, you know, i18n is such a basic feature. You said "check out IHP, Haskell's version of Laravel/Rails/Django"...
- dmead 5y agoI was a Haskell user for about 5-6 years in the 2000s That's wild they allow dot notation now. That must have taken some convincing.
- Proudmuslim 5y agoThis looks excellent, thanks for the link!
- jumpy_flamingo 5y agoI didn't know about the dot notation, very cool but at the same time kinda awkward in a functional setting, goes a little bit against the other type of haskell syntax, I think someField someValue syntax is more explicit.
- marcosdumay 5y ago> e.g. support for dot-notation has been added I just lost a big block of time because of this, please contextualize correctly that claim when you make it. Support for dot-notation like it's documented at the proposals has been partially added. Field fetching is complete, field updates isn't released at all. It is being actively developed, and both bring very interesting features that you can't get in most languages - after all, it's Haskell - but it was only partially released up to now.
- AnimalMuppet 5y agoCan you explain what "interesting features that you can't get in most languages" it brings? Because in most languages, field fetching and field updates aren't novel at all...
- marcosdumay 5y agoFetching and updates are rebindable operations that you can overload for specific types (well, like most languages properties), for everything on some part of your code, or even on the standard library.