[Nix-dev] Use Haskell for Shell Scripting

Tim Barbour trb at categorical.net
Sat Jan 31 22:59:13 CET 2015


At Sat, 31 Jan 2015 13:22:09 +0100,
Ertugrul Söylemez wrote:
> [...]
> I have actually experimented with using Haskell (and a few other FP
> languages) as a substitute for shells.
> [...]
> You might be interested why Curry didn't work.  Simple: I couldn't figure
> out how to write a program.  Actually I went through the whole tutorial, did
> all the exercises (they aren't really difficult to a Haskell programmer) and
> then skimmed through the whole PAKCS manual.  I could write extremely
> elegant algorithmic code and was quite amazed at the beauty of this
> language, even compared to Haskell.  But in the end I still didn't know how
> to turn all this beautiful Curry code into an executable file that I can run
> without invoking PAKCS explicitly.  Something with a shebang or ideally
> something binary.  It would probably be possible to write wrapper scripts,
> but let's just wait until one of the implementations becomes mature enough
> for systems programming.

Curry is indeed a beautiful language, and is essentially a conservative
extension of Haskell. I am surprised that more Haskell folk have not adopted
it.

PAKCS compiles Curry to Prolog (typically SICStus), which drags in the Prolog
system. To get a binary executable, a better choice would be MCC (compiles
Curry to native code) or KiCS2 (compiles Curry to Haskell, which can go into
ghc):

   http://www-ps.informatik.uni-kiel.de/currywiki/implementations/overview

Tim


More information about the nix-dev mailing list