https://github.com/begriffs/c-mix
Demo of C project with Haskell functions
https://github.com/begriffs/c-mix
Last synced: 12 days ago
JSON representation
Demo of C project with Haskell functions
- Host: GitHub
- URL: https://github.com/begriffs/c-mix
- Owner: begriffs
- Created: 2019-01-26T08:07:15.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2019-01-31T04:27:21.000Z (about 7 years ago)
- Last Synced: 2025-05-30T19:11:32.063Z (10 months ago)
- Language: C
- Size: 4.88 KB
- Stars: 76
- Watchers: 7
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Is it a C project or a Haskell project?
The main program is C, but selected functions can be Haskell. For those
parts where automatic memory management, great numeric libraries,
containers, Unicode support, or parsing is useful, do it with
Haskell. For other parts where an imperative algorithm is the easiest
way to do something, or where memory should be managed more carefully,
do it in C.
This approach doesn't even use Cabal, just a portable makefile and the
functionality of GHC itself. The Haskell code has access to a useful set of
[libraries](https://downloads.haskell.org/~ghc/latest/docs/html/libraries/index.html)
which ships with every GHC installation. This includes a Haskell
interface to POSIX.1-2008.
By linking dynamically to the GHC runtime, the executable can stay
small at only a few kilobytes.