Difference between revisions of "Applications and libraries/Operating system"

From HaskellWiki
Jump to navigation Jump to search
(Bulat's process lib belongs here)
(62 intermediate revisions by 24 users not shown)
Line 1: Line 1:
  +
'''Operating Systems and Systems Programming'''
  +
  +
See also [[Research papers/Program development#Operating systems|research papers on this topic]].
  +
 
__TOC__
 
__TOC__
   
  +
== Applications ==
== Standalone implementations of operating systems in Haskell ==
 
   
  +
=== Standalone operating systems ===
;[http://www.cse.ogi.edu/~hallgren/House/ House]
 
:House is a platform for exploring various ideas relating to low-level and system-level programming in a high-level functional language, or in short for building operating systems in Haskell.
 
   
  +
;[http://programatica.cs.pdx.edu/House/ House]
== Filesystems ==
 
  +
:House is a platform for exploring various ideas relating to low-level and system-level programming in a high-level functional language, or in short for building operating systems in Haskell. [http://web.cecs.pdx.edu/~kennyg/house/ A more up to date, unofficial version.]
   
;[http://abridgegame.org/repos/fuse_example Fuse]
+
;[http://www.ninj4.net/kinetic/ Kinetic]
  +
:Kinetic is an operating system where the expressiveness of Haskell's type system guides the design of operating system features and facilities.
:David Roundy's combination of a nice DarcsIO-style filesystem interface on the Haskell side (called FuseIO) with an interface to libfuse (which is a library for creating filesystems from user space on linux).
 
   
;[http://cvs.haskell.org/darcs/hfuse/ hfuse]
+
;[http://github.com/tathougies/hos Hos]
  +
:Hos is an x86-64 microkernel-based operating system written in Haskell 98 and compiled with JHC. With the exception of the bootstrap code, architecture-specific task switching, and low-level memory manager, all parts are written in Haskell. It currently supports user-space cooperative (for-now) multitasking, IPC, ELF loading, and has the beginnings of an ATA driver. The kernel and user space interaction is expressed as a continuation with the kernel yielding to a user space thread and waiting for the user space to yield control back (either explicitly or through an interrupt or trap). Patches welcome! For help building, e-mail [mailto:travis@athougies.net travis@athougies.net]
:Jeremy Bobbio's fuse bindings
 
   
  +
=== Filesystems ===
;Halfs, the Haskell Filesystem
 
  +
  +
;[http://www.haskell.org/halfs/ Halfs, the Haskell Filesystem]
  +
:Halfs is a filesystem implemented in Haskell. Halfs can be mounted and used like any other Linux filesystem, or used as a library.
   
 
;[http://okmij.org/ftp/Computation/Continuations.html#zipper-fs ZipperFS]
 
;[http://okmij.org/ftp/Computation/Continuations.html#zipper-fs ZipperFS]
:Oleg Kiselyov's file server/OS where threading and exceptions are all realized via delimited continuations.
+
:Oleg Kiselyov's [[zipper]]-based file server/OS where threading and exceptions are all realized via delimited [[continuation]]s.
  +
  +
;[http://article.gmane.org/gmane.comp.lang.haskell.general/13585 Debian From Scratch]
  +
:A single, full debian rescue CD. The tool that generates these ISO images (dfsbuild) is written in Haskell.
  +
  +
=== Hardware emulators ===
  +
  +
;[http://www.mutantlemon.com/omegagb/ OmegaGB]
  +
:OmegaGB is a Nintendo Game Boy emulator written in Haskell.
  +
  +
;[http://naesten.dyndns.org:8080/repos/ZMachine/ ZMachine]
  +
:ZMachine is a Z-machine (Infocom's interactive fiction VM) interpreter which currently needs attention to its UI rather badly. This points to the darcs repository, as I suppose you can tell. It uses Gtk2Hs, but it just goes down hill from there. Help welcome! --[[User:SamB|SamB]] 03:40, 6 December 2006 (UTC) (the author)
  +
  +
=== Window managers ===
  +
  +
;[http://www.xmonad.org/ xmonad]
  +
:A lightweight X11 window manager.
  +
  +
;[http://www.bluetile.org Bluetile]
  +
:A tiling window manager based on xmonad which focuses on making the tiling paradigm easily accessible to users coming from traditional window managers by drawing on known conventions and providing both mouse and keyboard access for all features. It also tries to be usable 'out of the box', requiring minimal to no configuration in most cases.
  +
  +
;[http://article.gmane.org/gmane.comp.lang.haskell.cafe/30804 hswm]
  +
:A non-tiling window manager with a plugin architecture
  +
  +
=== Shell utilities ===
  +
  +
;[http://web.comlab.ox.ac.uk/oucl/work/ian.lynagh/haskell-ls/ haskell-ls]
  +
:A (near-)clone of the GNU ls utility.
  +
  +
;[http://www.cse.unsw.edu.au/~dons/h4sh.html h4sh]
  +
:h4sh provides a set of Haskell List functions as normal unix shell commands. This allows us to use Haskell in shell scripts transparently. Each program is generated from the corresponding Haskell function's type
  +
  +
=== Package management ===
  +
  +
;[http://www.haskell.org/haskellwiki/himerge Himerge]
  +
:Luis Araujo's Haskell gui frontend to Emerge
  +
  +
== Libraries ==
  +
  +
=== Filesystems ===
  +
  +
;[http://abridgegame.org/repos/fuse_example Fuse]
  +
:David Roundy's combination of a nice DarcsIO-style filesystem interface on the Haskell side (called FuseIO) with an interface to libfuse (which is a library for creating filesystems from user space on linux).
  +
  +
;[http://code.haskell.org/hfuse/ hfuse]
  +
:Jeremy Bobbio's fuse bindings.
  +
  +
;[http://haskell.org/~kolmodin/code/hinotify/ hinotify]
  +
:A library binding to [http://www.kernel.org/pub/linux/kernel/people/rml/inotify/ inotify], providing file system event notification, by simply add a watcher to a file or directory and get an event when it is accessed or modified.
   
== Dynamic linking ==
+
=== Dynamic linking ===
   
 
;[http://www.cse.unsw.edu.au/~dons/hs-plugins hs-plugins]
 
;[http://www.cse.unsw.edu.au/~dons/hs-plugins hs-plugins]
 
:Library support for dynamically loading Haskell modules, as well as compiling source or ''eval'' code fragments at runtime.
 
:Library support for dynamically loading Haskell modules, as well as compiling source or ''eval'' code fragments at runtime.
   
== Processes ==
+
=== Processes ===
   
;[http://www.haskell.org/~petersen/haskell/popenhs/ popenhs]
+
;[http://hackage.haskell.org/package/popenhs-1.0.0 popenhs]
:A small library, based on runProcess in the standardised posix library. It provides lazy output from subprocesses.
+
:An old small library, based on runProcess in the standardised posix library. It provides lazy output from subprocesses.
   
 
;[http://freearc.narod.ru/ Process]
 
;[http://freearc.narod.ru/ Process]
 
:Process is a fun library for easing decomposition of algorithms to several processes, which transmit intermediate data via Unix-like pipes. Each sub-process is just a function started with forkIO/forkOS with one additional parameter-pipe.
 
:Process is a fun library for easing decomposition of algorithms to several processes, which transmit intermediate data via Unix-like pipes. Each sub-process is just a function started with forkIO/forkOS with one additional parameter-pipe.
   
  +
See also [[Libraries and tools/Concurrency and parallelism | concurrency and parallelism]]
See also [[Libraries_and_tools/Concurrency_and_parallelism]]
 
   
== Shell ==
+
=== Environment ===
   
  +
;[http://repetae.net/john/recent/out/GetOptions.html GetOptions]
=== Link collections on pure functional shells ===
 
  +
:This module provides an advanced option parsing routine which can properly parse options depending on what types are infered for them as well as produce a pretty error message with usage info when an incorrect option is used.
   
  +
;[https://hackage.haskell.org/package/optparse-applicative Optparse-applicative]
* [http://lambda-the-ultimate.org/classic/message9846.html on Lambda the Ultimate]
 
  +
:[http://www.reddit.com/r/haskell/comments/3cfax3/new_haskellers_ask_anything/csv0q4r Discussion on Reddit]. Turtle (see elsewhere on this page) provides a beginner-friendly wrapper: [http://www.reddit.com/r/haskell/comments/3cfax3/new_haskellers_ask_anything/csv5cqe Reddit link]
* [http://www.cse.unsw.edu.au/~pls/thesis-topics/functionalshell.html Thesis Topic: The Design and Implementation of a Functional Shell]
 
   
=== Haskell shell examples ===
+
=== Time ===
  +
  +
;[http://semantic.org/TimeLib/ TimeLib]
  +
:TimeLib is an attempt to redesign the current library for handling time (System.Time), balancing expressive functionality and intelligible simplicity. Now at version 0.2, TimeLib features representation of TAI, UTC and UT1, as well as Gregorian, ISO 8601 week, and "year and day" calendars, time-zones, and functions for strftime-style formatting. We'd like to collect some additional documentation on this wiki, too: [[Libraries and tools/Time library | Time library]]
  +
  +
;[http://www.cs.chalmers.se/~bringert/darcs/parsedate/doc/ ParseDate]
  +
:ParseDate provides a function for parsing dates and times given a date format string.
  +
  +
;[http://uebb.cs.tu-berlin.de/~magr/projects/rdtsc/doc/ rdtsc]
  +
:Provides the function 'rdtsc' for accessing the time stamp counter on modern IA-32 processors. This is a 64-bit counter which counts the number of ticks since the machine has been powered up. Using this instruction, you can make very precise time measurements.
  +
  +
=== Terminal ===
  +
;[[Library/VTY]]
  +
: A simple terminal interface library. It provides: handling of suspend/resume, window resizes, minimizes repaint area, automatically decodes keyboard keys into (key,modifier) tuples, and more!
  +
  +
=== Shell ===
  +
  +
==== Haskell shell examples ====
   
 
;[http://www.volker-wysk.de/hsshellscript HsShellScript]
 
;[http://www.volker-wysk.de/hsshellscript HsShellScript]
Line 56: Line 129:
   
 
;[http://directory.fsf.org/shell-haskell.html shell-haskell]
 
;[http://directory.fsf.org/shell-haskell.html shell-haskell]
  +
:start an external shell command asynchronously, write data to its standard input and read results from its standard output. There is a [http://darcs.haskell.org/shell-pipe/ Darcs repository] with a cabalized version.
:library for communicating with other processes via Haskell code
 
   
  +
;[http://haskell.org/hashell hashell]
=== Shell utilities ===
 
  +
:shell with some scripting capabilities to use Haskell as a scripting language.
   
  +
;[http://www.haskell.org/pipermail/haskell/2006-June/018059.html Haskell Shell (HSH)]
;[http://web.comlab.ox.ac.uk/oucl/work/ian.lynagh/haskell-ls/ haskell-ls]
 
  +
:HSH, the Haskell shell. Things are still very preliminary in many ways, but this version already lets you:
:A (near-)clone of the GNU ls utility.
 
  +
* Run commands
  +
* Pipe things between commands
  +
* Pipe command input/output into and out of pure Haskell functions
  +
* Pure Haskell functions are as much a first-class citizen as is grep or cat
   
;[http://www.cse.unsw.edu.au/~dons/h4sh.html h4sh]
+
;[http://hackage.haskell.org/package/shelly shelly]
  +
: a convenient library for shell scripting using modern (Text) and safe (sytem-filepath) techniques and featuring good error messages.
:h4sh provides a set of Haskell List functions as normal unix shell commands. This allows us to use Haskell in shell scripts transparently. Each program is generated from the corresponding Haskell function's type
 
  +
  +
;[http://hackage.haskell.org/package/shell-monad shell-monad]
  +
: Procedures written in this monad produce shell scripts.
  +
  +
;[https://github.com/Gabriel439/Haskell-Turtle-Library Turtle]
  +
: Turtle is a reimplementation of the Unix command line environment in Haskell so that you can use Haskell as a scripting language or a shell.
  +
  +
;[https://github.com/jekor/hesh Hesh]
  +
: Haskell Extensible Shell, makes writing scripts in Haskell easier. Uses Template Haskell.
  +
  +
;[https://github.com/chrisdone/hell Hell]
  +
: A simple read-eval-print (REPL) loop for Haskell that has some simple awareness of the current directory and completion works.
  +
  +
;[https://github.com/cpennington/h4sh h4sh]
  +
: Makes Haskell functions available as unix shell commands.
  +
  +
==== Link collections on pure functional shells ====
  +
  +
* [http://lambda-the-ultimate.org/classic/message9846.html on Lambda the Ultimate]
  +
* [http://www.cse.unsw.edu.au/~pls/thesis-topics/functionalshell.html Thesis Topic: The Design and Implementation of a Functional Shell]
   
 
=== File utilities ===
 
=== File utilities ===
Line 70: Line 168:
 
;[http://quux.org/devel/magic-haskell magic-haskell]
 
;[http://quux.org/devel/magic-haskell magic-haskell]
 
:magic-haskell is a binding to the libmagic library. With magic-haskell, you can determine the type of a file by looking at its contents rather than its name. This library also can yield the MIME type of a file by looking at its contents.
 
:magic-haskell is a binding to the libmagic library. With magic-haskell, you can determine the type of a file by looking at its contents rather than its name. This library also can yield the MIME type of a file by looking at its contents.
  +
  +
;[http://darcs.haskell.org/iff IFF parser]
  +
:Parse files in the [http://www.digitalpreservation.gov/formats/fdd/fdd000115.shtml#identification Interchange File Format] by Electronic Arts as used in AIFF, ILBM, 8SVX and so on. Creation of IFF files is planned.
  +
  +
;[http://www.cse.unsw.edu.au/~dons/code/icfp05/MkTemp.hs mkstemps]
  +
:A Haskell reimplementation of the C mktemp/mkstemp/mkstemps library from OpenBSD
  +
  +
;[http://www.cse.unsw.edu.au/~dons/haskell-1990-2000/msg04763.html Unix.hs]
  +
:Koen Claessen's binding to common unix functions.
  +
  +
;[http://hackage.haskell.org/cgi-bin/hackage-scripts/package/FileManip-0.1 FileManip]
  +
:A Haskell library for working with files and directories. Includes code for pattern matching, finding files, modifying file contents, and more.
  +
  +
=== Logging ===
  +
  +
;[http://repetae.net/john/recent/out/ErrorLog.html ErrorLog]
  +
:Manages an error log with proper locking. has a number of useful routines for detecting and reporting erronious conditions.
  +
  +
;[http://www.cse.unsw.edu.au/~dons/code/icfp05/Logging.hs Logging]
  +
:Multiple debug levels and log file support
  +
  +
{{LibrariesPage}}

Revision as of 18:07, 22 January 2016

Operating Systems and Systems Programming

See also research papers on this topic.

Applications

Standalone operating systems

House
House is a platform for exploring various ideas relating to low-level and system-level programming in a high-level functional language, or in short for building operating systems in Haskell. A more up to date, unofficial version.
Kinetic
Kinetic is an operating system where the expressiveness of Haskell's type system guides the design of operating system features and facilities.
Hos
Hos is an x86-64 microkernel-based operating system written in Haskell 98 and compiled with JHC. With the exception of the bootstrap code, architecture-specific task switching, and low-level memory manager, all parts are written in Haskell. It currently supports user-space cooperative (for-now) multitasking, IPC, ELF loading, and has the beginnings of an ATA driver. The kernel and user space interaction is expressed as a continuation with the kernel yielding to a user space thread and waiting for the user space to yield control back (either explicitly or through an interrupt or trap). Patches welcome! For help building, e-mail travis@athougies.net

Filesystems

Halfs, the Haskell Filesystem
Halfs is a filesystem implemented in Haskell. Halfs can be mounted and used like any other Linux filesystem, or used as a library.
ZipperFS
Oleg Kiselyov's zipper-based file server/OS where threading and exceptions are all realized via delimited continuations.
Debian From Scratch
A single, full debian rescue CD. The tool that generates these ISO images (dfsbuild) is written in Haskell.

Hardware emulators

OmegaGB
OmegaGB is a Nintendo Game Boy emulator written in Haskell.
ZMachine
ZMachine is a Z-machine (Infocom's interactive fiction VM) interpreter which currently needs attention to its UI rather badly. This points to the darcs repository, as I suppose you can tell. It uses Gtk2Hs, but it just goes down hill from there. Help welcome! --SamB 03:40, 6 December 2006 (UTC) (the author)

Window managers

xmonad
A lightweight X11 window manager.
Bluetile
A tiling window manager based on xmonad which focuses on making the tiling paradigm easily accessible to users coming from traditional window managers by drawing on known conventions and providing both mouse and keyboard access for all features. It also tries to be usable 'out of the box', requiring minimal to no configuration in most cases.
hswm
A non-tiling window manager with a plugin architecture

Shell utilities

haskell-ls
A (near-)clone of the GNU ls utility.
h4sh
h4sh provides a set of Haskell List functions as normal unix shell commands. This allows us to use Haskell in shell scripts transparently. Each program is generated from the corresponding Haskell function's type

Package management

Himerge
Luis Araujo's Haskell gui frontend to Emerge

Libraries

Filesystems

Fuse
David Roundy's combination of a nice DarcsIO-style filesystem interface on the Haskell side (called FuseIO) with an interface to libfuse (which is a library for creating filesystems from user space on linux).
hfuse
Jeremy Bobbio's fuse bindings.
hinotify
A library binding to inotify, providing file system event notification, by simply add a watcher to a file or directory and get an event when it is accessed or modified.

Dynamic linking

hs-plugins
Library support for dynamically loading Haskell modules, as well as compiling source or eval code fragments at runtime.

Processes

popenhs
An old small library, based on runProcess in the standardised posix library. It provides lazy output from subprocesses.
Process
Process is a fun library for easing decomposition of algorithms to several processes, which transmit intermediate data via Unix-like pipes. Each sub-process is just a function started with forkIO/forkOS with one additional parameter-pipe.

See also concurrency and parallelism

Environment

GetOptions
This module provides an advanced option parsing routine which can properly parse options depending on what types are infered for them as well as produce a pretty error message with usage info when an incorrect option is used.
Optparse-applicative
Discussion on Reddit. Turtle (see elsewhere on this page) provides a beginner-friendly wrapper: Reddit link

Time

TimeLib
TimeLib is an attempt to redesign the current library for handling time (System.Time), balancing expressive functionality and intelligible simplicity. Now at version 0.2, TimeLib features representation of TAI, UTC and UT1, as well as Gregorian, ISO 8601 week, and "year and day" calendars, time-zones, and functions for strftime-style formatting. We'd like to collect some additional documentation on this wiki, too: Time library
ParseDate
ParseDate provides a function for parsing dates and times given a date format string.
rdtsc
Provides the function 'rdtsc' for accessing the time stamp counter on modern IA-32 processors. This is a 64-bit counter which counts the number of ticks since the machine has been powered up. Using this instruction, you can make very precise time measurements.

Terminal

Library/VTY
A simple terminal interface library. It provides: handling of suspend/resume, window resizes, minimizes repaint area, automatically decodes keyboard keys into (key,modifier) tuples, and more!

Shell

Haskell shell examples

HsShellScript
A library for using Haskell for tasks which are usually done by shell scripts, e.g. command line parsing, analysing paths, etc. It can be used also for tasks usually done GetOpt (a module for GNU-/POSIX-like option handling of commandline arguments). But also for many other things.
Jim Mattson's Hsh Haskell shell
on the software page by Ralf Hinze. Hsh seems to be written in Haskell 1.3.
HaSh
a nascent project page on a shell scripting system
Monadic i/o and UNIX shell programming
UNIX pipes as IO monads.
shell-haskell
start an external shell command asynchronously, write data to its standard input and read results from its standard output. There is a Darcs repository with a cabalized version.
hashell
shell with some scripting capabilities to use Haskell as a scripting language.
Haskell Shell (HSH)
HSH, the Haskell shell. Things are still very preliminary in many ways, but this version already lets you:
  • Run commands
  • Pipe things between commands
  • Pipe command input/output into and out of pure Haskell functions
  • Pure Haskell functions are as much a first-class citizen as is grep or cat
shelly
a convenient library for shell scripting using modern (Text) and safe (sytem-filepath) techniques and featuring good error messages.
shell-monad
Procedures written in this monad produce shell scripts.
Turtle
Turtle is a reimplementation of the Unix command line environment in Haskell so that you can use Haskell as a scripting language or a shell.
Hesh
Haskell Extensible Shell, makes writing scripts in Haskell easier. Uses Template Haskell.
Hell
A simple read-eval-print (REPL) loop for Haskell that has some simple awareness of the current directory and completion works.
h4sh
Makes Haskell functions available as unix shell commands.

Link collections on pure functional shells

File utilities

magic-haskell
magic-haskell is a binding to the libmagic library. With magic-haskell, you can determine the type of a file by looking at its contents rather than its name. This library also can yield the MIME type of a file by looking at its contents.
IFF parser
Parse files in the Interchange File Format by Electronic Arts as used in AIFF, ILBM, 8SVX and so on. Creation of IFF files is planned.
mkstemps
A Haskell reimplementation of the C mktemp/mkstemp/mkstemps library from OpenBSD
Unix.hs
Koen Claessen's binding to common unix functions.
FileManip
A Haskell library for working with files and directories. Includes code for pattern matching, finding files, modifying file contents, and more.

Logging

ErrorLog
Manages an error log with proper locking. has a number of useful routines for detecting and reporting erronious conditions.
Logging
Multiple debug levels and log file support

This page contains a list of libraries and tools in a certain category. For a comprehensive list of such pages, see Applications and libraries.