[Haskell-cafe] Some Haskell platformish questions

Stefan O'Rear stefanor at cox.net
Wed Aug 1 17:24:08 EDT 2007

On Wed, Aug 01, 2007 at 01:48:07PM -0700, David Pollak wrote:
> Howdy,
> I'm considering building a desktop app using Haskell.  The primary target
> for the app is Windows, but if it runs on Linux and Mac (Intel and PPC),
> that'd be a bonus.  I've got a bunch of questions that hopefully folks can
> answer.

I use a Unix; treat my answers as thus qualified.

> Well, before I start, you might well be asking "Gee David, you're a Scala
> kind of guy... I mean, you're the primary contributor to lift... why not use
> Scala?"  Well, I'm looking to build something that compiles down to native
> code and has a smaller download (and runtime) footprint than the JVM
> offers.  I've come to love functional programming and am taking the current
> side project as an opportunity to learn Haskell.
> So... on to the questions:
>    - Can GHC generate stand-alone executables with all the dependencies
>    linked in such that I can distribute the single file without worrying about
>    including a bunch of DLLs/SOs? The answer seems to be yes, but I wanted to
>    confirm.

Currently, GHC doesn't support generating shared libraries at all, so
all you have to worry about is libc and friends, but that's usually
pre-installled and some combination of -static -optl-static will fix it.

>    - How much of a distribution footprint is the Haskell runtime?  If I
>    have a "Hello World" app, roughly how big will the EXE be (if one includes
>    the JRE in the runtime, a Java/Scala program has a minimum footprint of
>    20M... that's big.)

About 500kb.

>    - Same goes for the runtime... I've looked at the stats on the
>    Language Shootout home page and these look encouraging, but I wanted to see
>    if the reasonable footprint is a reality.

It's pretty reasonable.  I don't have exact numbers due to the
vagarities of Linux demand loading, but Don reports that xmonad and dwm
use very similar amounts of memory, ie whatever RTS overhead exists is
swamped by the 2MB runtime footprint of Xlib.

>    - How real/solid/stable is the wxHaskell widgets package?  Is it being
>    well maintained?  Is there (okay... this is pie in the sky) an GUI Builder
>    for it?
>    - How are the Windows/COM bindings in Haskell... would it be possible
>    to, for example, embed an IE Browser COM control in a a wxHaskell window?


>    - I found a package to do HTTP requests in Haskell but it does not
>    seem to support HTTPS.  Is there an HTTPS client package for Haskell?

Maybe soon; the current HTTP package is widely acknowledged as being in
dire need of an overhaul, and Mietek Bak is doing exactly that as part
of the SoC.

>    - How are Strings internally represented?  Are they single byte or
>    multi-byte characters?  How easy it is to translate to/from internal
>    representation to UTF-8?

A cons-list of characters, so 12 bytes per character.  Characters are
internally memoized only if they are smaller than 256, so add 8 bytes
for every non-latin1 character.  Double the numbers for a 64-bit system.

They can represent full Unicode, but there's none of the traditional
"multi byte" stuff - one cell is one character.

Quite easy, Mertens et al recently released a utf8-string library that
should make it completely automatic.  (I haven't used it yet)

>    - How's the XML support?  Will the XML parser handle non-Latin
>    characters and properly encode stuff?  Does XML get parsed down into easily
>    mappable/filterable collections?

We have no less than three XML parsers, none of which I have experience

>    - Is there support for SHA256 (I saw an SSLeay package which had
>    support for a lot of stuff, but not SHA256)?

Probably not.

>    - I understand that Haskell has "a better approach" to parallelizing
>    tasks, but I have not seen much about the actual manifestation of this...
>    would someone be so kind as to give me a pointer?


We also have ordinary threads with basic standard concurrency
abstractions, Control.Concurrent.*.

>    - On a related note, I have become a fan (via Scala) of Erlang-style
>    Actors and asynchronous message passing.  Are there any similar packages for
>    Haskell?

Sure.  Control.Concurrent.Chan gives asynchronous message passing.

>    - I tend to do most of my coding in either Emacs or Eclipse... how's
>    the Haskell support in either?  Is there a preferred editor (I don't mean to
>    start any wars here... :-)

Emacs and vi both have native support for Haskell.  Emacs additionally
has basic integration with the interactive environments (Reload buffer,
stuff like that) and passable auto-indenting (hard to do right in a
language with significant whitespace); B. Schmidt's "shim" package
provides more, like automatic error highlighting.

Eclipse supports Haskell via an addon-package "EclipseFP", I've only
heard about it never used it.

>    - Are there any production Haskell-based desktop apps of note?
> Anyway... sorry for the long list of questions.  I look forward to hearing
> from you all and learning more about Haskell.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://www.haskell.org/pipermail/haskell-cafe/attachments/20070801/1f39a0ba/attachment.bin

More information about the Haskell-Cafe mailing list