[Haskell-cafe] Requesting Feedback: I Love Haskell, but can't find a place to use it

34 views
Skip to first unread message

Jonathan Geddes

unread,
May 30, 2012, 8:30:28 PM5/30/12
to haskel...@haskell.org
I love Haskell. It is my absolute favorite language. But I have a very hard time finding places where I can actually use it!

I had hoped that compiling Haskell to C with -fvia-C (or would it be just -C?) would allow Haskell to run in new, uncharted territory such as Android (with NDK), IOS, Google's NaCl, etc. But today I learned that GHC's C backend has been deprecated!  Is it more difficult than I am imagining to get Haskell to work in these environments? Is it simply a matter of low interest in this kind of work? Or something more fundamental? Am I missing something?

I'm hoping that the Haskell->JavaScript efforts will mature enough to make Haskell viable for client-side web apps. (I think the first sign of this will be a self-hosting Haskell->JavaScript compiler.)

I use Haskell for Server-Side code with various web frameworks, but over the years more and more of the app logic is moved into client-side JavaScript, leaving the server-side code as little more than a simple validation and security layer over the database and other services. Haskell doesn't have any trouble with this, of course, but it's not exactly a role where it can shine. (Of course this is not true of ALL server-side code, just the kind of apps I have been writing.)

So anyway I'd like to request feedback: where can I use Haskell besides simple CLI utilities, dull server code, or project Euler problems? Even if it's just to contribute to getting Haskell in the environments mentioned above, any feedback is welcome!

Thanks for reading,

--J Arthur

Brandon Allbery

unread,
May 30, 2012, 10:32:08 PM5/30/12
to Jonathan Geddes, haskel...@haskell.org
On Wed, May 30, 2012 at 8:30 PM, Jonathan Geddes <geddes....@gmail.com> wrote:
I had hoped that compiling Haskell to C with -fvia-C (or would it be just -C?) would allow Haskell to run in new, uncharted territory such as Android (with NDK), IOS, Google's NaCl, etc. But today I learned that GHC's C backend has been deprecated!  Is it more difficult than I am imagining to get Haskell to work in these environments? Is it simply a matter of low interest in this kind of work? Or something more fundamental? Am I missing something?

The C backend was never suitable for that; it couldn't cross-compile and it used some crufty Perl to apply dubious optimizations to the generated code (and never did anything interesting on x86 anyway due to lack of registers).  The portable ANSI C backend, which is used to port GHC to a new platform in the absence of cross-compilation, still works — but produces rather slow code.  The native and LLVM backends are much better, and there is at least some potential for cross-compilation.

I believe there is work proceeding on an ARM native code generator that can be used to target Android.

--
brandon s allbery                                      allb...@gmail.com
wandering unix systems administrator (available)     (412) 475-9364 vm/sms

Johannes Waldmann

unread,
May 31, 2012, 7:11:18 AM5/31/12
to haskel...@haskell.org
Jonathan Geddes <geddes.jonathan <at> gmail.com> writes:

> I love Haskell. It is my absolute favorite language.
> But I have a very hard time finding places where I can actually use it!

have you considered "your head" as such a place that should be easy to find.

even "just for specifying things", Haskell is tremendously useful.
even if you don't write programs, but just their types.
you can express your software design that way,
and have it formally verified (by the compiler's type checker).

best regards, J. W.



_______________________________________________
Haskell-Cafe mailing list
Haskel...@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Ivan Perez

unread,
May 31, 2012, 10:41:10 AM5/31/12
to Jonathan Geddes, haskel...@haskell.org
On 31 May 2012 01:30, Jonathan Geddes <geddes....@gmail.com> wrote:
> I love Haskell. It is my absolute favorite language. But I have a very hard
> time finding places where I can actually use it!
This has been bugging me for years and, like you, I think we ought to
lean towards web-pages and mobile devices.

Yesod has been a tremendous push forward in this direction but, as you
already stated, the browser and android devices remain mostly
unexplored in Haskell. Here's my bit:

- There's a port of ghc for iphone.
- There's frege (http://code.google.com/p/frege/), a non-strict, pure,
functional programming language in the spirit of Haskell.
- I've been working as a freelance developer for some time now. I
focus on desktop apps in Haskell. I can't say I'm overwhelmed by the
amount of offers (speaking of which, if anyone needs a freelance
haskell developer,... ahem), but this area will not be clinically
"dead" as long as we cannot use web applications knowing (99% sure)
that the owner of the website cannot use our personal information for
any purpose other than giving us our service. There's only two kinds
of clients here, though: those that explicitly want Haskell, and those
than don't care about the programming language. Otherwise, you'll have
to sell Haskell and, personally, I'm not that good a salesman (10%
success, tops).
- I've also ported Haskell designs to other programming languages
(with small adaptations). I only found this cost-effective because the
code in Haskell was not going to be thrown away.

Good luck. Please, let us know what you find.

Cheers,
Ivan.

Jonathan Geddes

unread,
May 31, 2012, 11:42:20 AM5/31/12
to Ivan Perez, haskel...@haskell.org
Thanks for the responses, everyone.

>J. W. wrote:
>have you considered "your head" as such a place that should be easy to find.
> even "just for specifying things", Haskell is tremendously useful.
>even if you don't write programs, but just their types.
>you can express your software design that way,
> and have it formally verified (by the compiler's type checker).

Yes! And in fact this is exactly how I use Haskell now (aside from little scripts and such). It has had a HUGE effect on the way I write software. There have been a number of times that a colleague has asked what a strange comment was in my Java[Script] code. When I tell them that the funny looking one-liner is the Haskell equivalent of the following 30+ Java[Script] lines, they are incredulous, to say the least. But taking that beautiful Haskell one-liner and manually transcribing it into an imperative language feels like being a human compiler. My favorite example of this was the use of the power set in JavaScript:

>//powerSet = filterM (const [True, False])

and then a few dozen JavaScript lines it "compiled down to" via the human compiler.

--J Arthur

Vagif Verdi

unread,
May 31, 2012, 1:03:27 PM5/31/12
to haskel...@googlegroups.com, haskel...@haskell.org
Besides our web app and batch pdf generation procedures, i use haskell for internal one-off tasks.
Often i am being asked to import various data to database from text/excel files. Haskell is an excellent tool for this.

Richard O'Keefe

unread,
May 31, 2012, 6:42:11 PM5/31/12
to Johannes Waldmann, haskel...@haskell.org
It's difficult to imagine any kind of program that doesn't need
testing; surely there is a role for Haskell in writing test data
generators?

Michael Oswald

unread,
Jun 1, 2012, 12:01:48 PM6/1/12
to haskel...@haskell.org
> So anyway I'd like to request feedback: where can I use Haskell besides
> simple CLI utilities, dull server code, or project Euler problems? Even
> if it's just to contribute to getting Haskell in the environments
> mentioned above, any feedback is welcome!

Well I have used it for some not-so-typical Haskell tasks:

- An installer (command line) for some other software in C++ (unpacking,
installing COTS libraries, installing and setting up MySQL on different
machines including replication, setting up and installing the software
and also apply updates to it)
- A satellite simulator for testing mission control systems. It's very
basic but it can handle telecommands and arbitrary telemetry (definable
with a DSL which is loaded and interpreted at runtime), as well as basic
ground station routing messages, on-board queue simulation, on-board
software upload/download simulation and also some statistics about sent
telecommands. I actually used it for some telecommand performance
measurements for a real mission control system for an existing satellite
(which it simulated) as well as on debugging actions on the MCS. For me
the main point was to see if I could implement this functionality in
Haskell (there are other test-sims in C++ but with less functionality
and still a lot bigger in LOC). Due to the imperative nature and my
(ahem) limited abilities in Haskell the code is in parts very ugly, but
it grows and is refactored if I need new features. Currently if I have
time I am working on a GUI for it (otherwise it's just command line).
- Various test programs to stimulate servers with input. Especially
encoding/decoding of various (binary) protocols is far much easier and
faster to write in Haskell.
- Various conversion tools. E.g. currently I have a tool in the pipe
(just in the beginning stage) to convert something like CSV output into
a OpenOffice Calc spreadsheet for further processing/graphing/whatever.
Also I'd like to have a kind of OpenDocument library to be able to
generate reports, so this is the next step then. Due to my very limited
time in the moment this is currently stalled.


For me it would also be quite interesting to have a working CORBA
implementation with Haskell (as we have some applications at work which
use it), but I seem to be the only one.


lg,
Michael
Reply all
Reply to author
Forward
0 new messages