21

Seems that there are not much work done on Haskell for web. People uses it as a learning tool for functional programming more than business. Has anyone developed and deployed web application on Haskell, yet? Please, share the links.

The next session comments might change my mind and plan something else which could be also useful in terms of business. Guidance, Guidance, Please!

I'm planning to learn a functional programming language and I picked Haskell.

Is Haskell "cooked" enough to develop a commercial web application? Or should I start looking for other options, maybe even something other than a functional programming language, if it is worthy?

Investment in learning a language is very expensive and I want to make sure Haskell is really worth it to learn.

Guidance, Please.

Ramiz Uddin
  • 4,249
  • 4
  • 40
  • 72
  • 1
    Is Haskell a good choice for web applications? http://jekor.com/article/is-haskell-a-good-choice-for-web-applications – Ramiz Uddin Aug 12 '09 at 05:08
  • 1
    Haskell itself is mature enough for real-world applications. Web frameworks may vary, though. I've been looking at Yesod, which looks very interesting (and is mature enough to have an O'Reilly book, for what that's worth...) – comingstorm May 03 '13 at 19:29

10 Answers10

12

Ramiz,

Your title mentions "commerical web applications," while your question doesn't, so I'm assuming that the end goal is to write a web application using a functional programming language.

If this is the case, I recommend that you start with yaws, a fast HTTP server written in the functional concurrent programming language Erlang. You'll learn the ups and downs of twisting PHP-like scripts into a functional mindset, much of which you can then translate into your work with Haskell.

If you'd really like to stick with Haskell, and the choice of language is more important to you than the general functional approach, then take a look at the Real World Haskell book. That will give you a sense of how the language solves common problems that you might be interested in tackling while you learn the language.

asukharev
  • 477
  • 6
  • 12
Saketh
  • 136
  • 3
  • Thanks, Saketh. I'm so-concerned about Haskell here. The point I mentioned Haskell here as this looks much-in-talk than any other. And also very old and having very good progress. The concerns are to learn a language that could beneficial in two ways: learning and earning. Thats it! You could suggest me to other options I'll defintely look into them. – Ramiz Uddin Aug 10 '09 at 06:12
8

As you learn new languages, the investment required decreases. Even if you start with Haskell, the functional knowledge you gain will help you learn other languages.

It also depends what language you come from. If you come from Java I'd suggest scala, if you come from .net I'd suggest f#

Luke Schafer
  • 9,209
  • 2
  • 28
  • 29
  • One benefit of this route: you learn some of either the Java or .Net class libraries. – Harold L Aug 10 '09 at 06:11
  • I don't want .net wrapper as this hides alot of matter which you should know/having good understanding. Openness, a do-it-yourself would be more crunchy to get most from the language. – Ramiz Uddin Aug 10 '09 at 06:31
  • there's no such thing as a '.net wrapper' - it's a framework. – Luke Schafer Aug 12 '09 at 09:29
6

I for one consider Haskell to be my secret weapon - that tool that gives me a little edge over other developers, and frequently find places to used it in my consulting jobs.

DSLs, for example, are pretty hot these days in custom software. Haskell is a ridiculously good fit for this type of work.

If that isn't the kind of "commercial" environment you have in mind, some kind of polyglot project is probably best (I think good UI is one of Haskell's weaknesses). I have a project going right now that has Haskell running as a fast cgi "service" in the back end (I tend not to like 'frameworks' too much, and really don't like the ones available for Haskell right now), served up by a Flex (Adobe Flash Platform) front end. The eventual intent for this project will be to be sold commercially* to smaller-to-medium sized businesses as a financial planning aid.

Last thing I'll say is that, while I personally love Haskell, I think its FP in general that provides the biggest direct benefit. To this end, if you find yourself eyeing another FP language such as F#, Scala or Erlang, and think it'll be a better fit then I say run with it.

*Actually, the project will be used internally for at least a year before marketting to outside parties begins.

Shaun
  • 3,928
  • 22
  • 21
6

If you're talking about web app development then the language you choose is only as mature as the libraries written around it for web development.

ADAM
  • 3,903
  • 4
  • 29
  • 45
  • Can we deliver a web application on Haskell? – Ramiz Uddin Aug 11 '09 at 10:44
  • 4
    Yes, we can. Our site is written completely in Haskell and it was one of the best decisions we made. Sure, it's a startup, and sure, it may go nowhere, but if it doesn't go anywhere, it won't be because we chose Haskell, that's for sure. – clintm Jan 26 '10 at 05:58
2

If you're going for web development I suggest you take a really deep look into the inside of JavaScript.
Javascript is a dynamic, weakly typed, prototype-based language with first-class functions.
It has many functional capeabilities and you can use either V8, TraceMonkey or the Windows Shell (but it runs JScript) to run it on none-browser enviorments.

the_drow
  • 18,571
  • 25
  • 126
  • 193
  • JavaScript was once a primary language and the only experience I had. And still loving as it helps me to choice web as my career path. I've seen very progressive growth towards JS server-side but I believe somethings are made for a specific purpose. – Ramiz Uddin Aug 10 '09 at 06:18
  • Real javascript for the server-side is probably the best thing created EVER :) Javascript is great because I'm used to the C style syntax, because it's very dynamic and fast to develop with. Once it matures for desktops as well it will be my language of choice. – the_drow Aug 10 '09 at 06:44
  • Now why the downvote? I suggested another functional language like the OP asked for. – the_drow Aug 10 '09 at 07:07
  • 2
    @the_drow: I'm not the downvote, but I think I know what it was about. It's debatable whether Javascript is "functional". Merely having first-class functions does not cut it in a lot of people's minds — it certainly doesn't put it in the same space as Haskell. See here for a stricter definition of a functional language: http://enfranchisedmind.com/blog/posts/what-is-a-functional-programming-language/ – Chuck Aug 25 '09 at 17:40
  • +1 @the_drow recommended JS before NodeJS was cool! B-) – Angad Feb 24 '13 at 17:35
2

There's a fairly rich ecosystem of web related libraries and a small number of commercial users. The company I work at uses Haskell for web apps in the security market.

Have a look at the libraries to see what is on offer: http://hackage.haskell.org/packages/archive/pkg-list.html#cat:web

Don Stewart
  • 137,316
  • 36
  • 365
  • 468
2

There are a number of Haskell libraries for developing websites (Happstack, Kibro, Hack, Salvia, Turbinado); the problem is that it's hard to know which ones are good. Many of these libraries are quite young. I expect that the situation will become better in the next couple of years as these libraries mature, and become clearer as these libraries become better documented.

In the meantime, I would say that Haskell is a fine language for writing web applications, provided that you are willing to spend some time getting to know the libraries and perhaps improving them when they fall short of your needs.

daf
  • 5,085
  • 4
  • 31
  • 34
2

Check out jinjing's code: http://github.com/nfjinjing/loli/tree/master Yes, it's still experimental. But it opens your eyes a bit.

Haskell itself is certainly cooked enough. People who don't trust Java use Haskell (see http://www.galois.com) when they need to protect the Government's data.

But Haskell's web frameworks leave something to be desired. So it may not be the most productive environment at the moment. But ... if you master it, untold power will be yours :)

Dan
  • 5,763
  • 3
  • 17
  • 13
2

If you think in the long term as well as the short term, Haskell is the best option. It has many different web developments, but there are a lot of commonalities in them, for example all the frameworks use applicative functors for form creation, and the libraries are interchangeable . So if you learn a framework it is easy to change to other since basically the database interface, rendering etc techniques/libraries are the same most of the time. On the other side, there are many things to learn form Haskell even if you decide to change to other language. You will benefit from it. So definitively Haskell is worth to learn.

Thinking as an investment on the future, but perhaps not for doing something terribly critical now, I think that procedural frameworks (either continuation-based or not) are the future of web development, since they are less complex and the code is much more maintainable and intuitive. Examples are: ocsigen (ocaml), seaside (smalltalk), coccoon (javascript), and my own: mflow written in Haskell.

Have you ever seen a three page Web application in a tweet? https://twitter.com/AGoCorona/status/329648864082677760

agocorona
  • 166
  • 1
  • 5
0

Now, it is no doubt that haskell can be used for commercial web development as demonstrated by
the company janrain, who is using the web framework snap.

It might be interesting to note that the first version of haskell (haskell 1.0) was released in 1990! And looking at how haskell was then and how it is now one can surely say that there has been a lot of "cooking".

HaskellElephant
  • 9,819
  • 4
  • 38
  • 67