summaryrefslogtreecommitdiff
path: root/src/runtime/haskell-bind/README
diff options
context:
space:
mode:
authorkr.angelov <kr.angelov@gmail.com>2013-12-10 16:11:47 +0000
committerkr.angelov <kr.angelov@gmail.com>2013-12-10 16:11:47 +0000
commit0851308099f625bb451f80e62e33137df199322f (patch)
treea2758d78b2e3ae4df7c04e3f50bd9860332f8076 /src/runtime/haskell-bind/README
parent97d56065c4f03d7004c1f32ede2ff93ced1e7757 (diff)
move src/runtime/haskell/CRuntimeFFI to src/runtime/haskell-bind. Don't mess up with the stable Haskell runtime!
Diffstat (limited to 'src/runtime/haskell-bind/README')
-rw-r--r--src/runtime/haskell-bind/README32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/runtime/haskell-bind/README b/src/runtime/haskell-bind/README
new file mode 100644
index 000000000..64b6b7276
--- /dev/null
+++ b/src/runtime/haskell-bind/README
@@ -0,0 +1,32 @@
+This is a work in progress, but usable as it is now.
+Some memory leaks and segfaults to be expected.
+
+
+The files are
+
+CRuntimeFFI.hsc -- user-friendly functions, almost the same as in the real Haskell PGF library.
+Gu.hsc -- mindlessly copypasted functions from various files in gu/
+PgfLow.hs -- mindlessly copypasted functions from various files in pgf/
+
+The first two files (.hsc) use some special constructions for accessing C objects from Haskell.
+See the syntax here: http://www.haskell.org/ghc/docs/7.2.1/html/users_guide/hsc2hs.html
+
+HOW TO COMPILE:
+
+hsc2hs Gu.hsc CRuntimeFFI.hsc -v --cflag="-std=c99" && ghc -lpgf -lgu --make CRuntimeFFI
+
+HOW TO USE:
+
+- Symlink or copy the files in this directory to the directory you're working with; these files are not included in any makefiles
+- Import CRuntimeFFI to a Haskell program you're writing
+
+ module Main where
+ import CRuntimeFFI
+
+- Use the functions in your program
+
+ main = do
+ pgf <- readPGF "Foo.pgf"
+ let english = getConcr pgf (mkCId ("FooEng"))
+
+I haven't managed to make it work in ghci, get errors about unknown symbols (low level C functions).