The Need for Haskell Bindings

Submitted by jgoerzen on Mon, 07/25/2005 - 7:10am.

Over at savonet, the OCaml folks have been busily writing bindings to various useful libraries: SSL, LDAP, alsa, fetch, etc. We don't have any of these in Haskell. I think it would be excellent to add them. But I don't have the time or expertise to do it all myself.

Anybody else interested in working on things like this?

Drupal is not Burger King!

Submitted by metaperl on Sun, 07/24/2005 - 11:06am.

The old motto of Burger King when I was growing up was: "Have it Your Way"

Drupal is a nice system, but note what I must do. I must visit this website, click on what I want to do and then fill out a bunch of forms to get my content up.

I have written two things recently. One on the Haskell pipeline paradigm:

And another on the ease with which top-down development is in Haskell:

But I did not savor the prospect of dealing with Drupal's limited HTML... in other words, I wanted to HAVE IT MY WAY.

Why couldn't I just open up a directory under a tree in a shell, code up my text and/or HTML and then have some sort of skulking process notice that a new directory was there and add the content to the system?

Maybe only after a darcs push was done should this happen so that you can develop and only publish when you push.

But at anyrate I envision a system that is built up from a large collection of handwritten directories without visiting websites and filling out forms, blah blah.

Exercise 6.16 in Thompson is Complete!

Submitted by metaperl on Wed, 07/20/2005 - 6:31am.

Well, 6 weeks ago I was low in motivation and actually bought 2 C++ books and intended to learn C++ and enter ICFP contest using it.

However, I think I am too old to learn C++... I really just didn't get the hang of it. Actually, I think I rushed things.

But anyway, Haskell is much easier on my head. I have been struggling with the image superposition exercises (6.16) for a long long time. In the process I found a bug in the Haskell tracer, hat:


And I learned how to use GHC's Debug.Trace.

I also was hit smack dab in the face with Haskell's non-determinism. I was using Debug.Trace.trace() and was confused about how output from trace and program output were interleaved:


And of course, I learned that lists in Haskell often end up reversed when you process them to generate another list... I kept staring at my final result until I realized that it was correct, only upside-down!

This was an excellent exercise and I'm glad that I did not skim over it. You've got to learn the language and how to debug the language as well and Thompson has once again shown why he has probably the best book introducing the Haskell language (at least better than Algorithms, haven't messed with my Hudak intro book).

How do you feel about not being able to modify arrays in-place

Submitted by metaperl on Tue, 06/28/2005 - 9:21am.

I was wondering if you thought it was efficient to only be able to return a new array for each modification of an array.

It seems like it would be a great hindrance to efficiency in comparison with a procedural approach to a programming problem.

Does Scala remind anyone of Haskell?

Submitted by metaperl on Mon, 06/20/2005 - 4:19pm.

I was staring at Scala as it crossed freshmeat and it reminded me strongly of Haskell:


By and large it does to me... anyone else?

Performance of Haskell (ghc-compiled) applications

Submitted by itkovian on Fri, 06/03/2005 - 2:14am.

I am wondering if there exists any interest in doing some research into the low-level performance of ghc-cmpiled Haskell (duh) applications. It seems to me that getting an idea on cache-miss rates, branch prediction, etc. could be of interest to the Haskell community.

Possible routes are
- performance counters (x86, PowerPC, x86-64)
- DSS simulation
- DIABLO/FIT to instrument the binaries (can we obtain statically compiled Haskell apps?)
- DIOTA to gather data

The main problem atm lies in the benchmarks that would be needed (of course!). People at #haskell have suggested using the ghc regression suite, but I am not sure if these qualify as real-world apps, i.e. the real stuff people use Haskell for.

All input is appreciated.

Question on Figure 6.3 in Thompson's "Craft of Functional Programming"

Submitted by metaperl on Mon, 05/30/2005 - 10:54pm.

In figure 6.3 we see 4 figures. The starting figure is to the "West" and shows two horses superimposed.

My question is, what are the coordinates of the reference point of the two images?

AUM : Creation, Maintenance, Destruction

Submitted by metaperl on Sun, 05/29/2005 - 8:42pm.

All phenomena, including computational acts, are acts of creation, maintenance, or destruction. Haskell contains a number of well designed creative acts:

  1. type constructors:

    c1 :: Contract
    c1 = zcb (date "1 Jan 2001") 100 Pounds
    zcb :: Date -> Float -> Currency -> Contract
    -- Zero coupon bond

    Pounds is a type constructor in the above... and zcb creates values of a certain type.

  2. lazy evaluation:

    nothing is created until it is needed

  3. list comprehensions

    concise ways to stating how a list is created.

Destruction is handled via automatic garbage control. There is little support for loading up and Maintaining data in-memory.

timed execution in Haskell

Submitted by metaperl on Fri, 05/27/2005 - 9:03am.

A question on #C++ caught my eye:

 im waiting for user input .. using getch() .. if a user hasnt entered another key within 1 second i want to perform some action, rather than waiting for a newline or something else .. using a while doesnt work because getch() hangs until u enter a char .. any ideas?

how easy would something like this be in Haskell?

Haskell is a strong metalanguage.

Submitted by metaperl on Fri, 05/27/2005 - 8:40am.

Haskell is very good at describing the structure or pattern involved in something. It excels at compiler design for this very reason.

It is also the reason that 5-line Perl programs take much longer in Haskell. For instance, look at this program to find the file with the longest length in Haskell: