11# inline-rust
22
3- [ ![ Build Status] [ 5 ]] [ 6 ]
4- [ ![ Windows build status] [ 7 ]] [ 8 ]
5-
63This package allows you to write Rust inline in your Haskell source using
74quasiquotes. Here is a short example. For more examples, check out the
8- [ examples] ( examples ) folder .
5+ [ examples] ( examples ) directory .
96
107``` haskell
118-- examples/Hello.hs
@@ -32,44 +29,3 @@ main = do
3229```
3330
3431If you want to use this with GHCi, make sure to pass in ` -fobject-code ` .
35-
36- ## Building
37-
38- This currently depends on a GHC [ feature] [ 1 ] that will be available in GHC 8.6.
39- Until then, you'll have to [ build GHC] [ 0 ] yourself or get a binary. For the
40- latter, you can install one of GHC's nightly builds.
41-
42- $ curl https://ghc-artifacts.s3.amazonaws.com/nightly/validate-x86_64-darwin/latest/bindist.tar.xz | tar xz
43- $ cd ghc-*
44- $ ./configure && make install
45-
46- With that installed, something like the following should work
47-
48- $ cabal new-build -w /usr/local/bin/ghc-8.5.20180423
49- $ cabal new-test -w /usr/local/bin/ghc-8.5.20180423
50-
51- Running the examples is only a matter of threading through the right package
52- databases. With a new enough Cabal, ` new-exec ` does this for you.
53-
54- $ cabal new-exec -w /usr/local/bin/ghc-8.5.20180423 ghc -- -threaded -package inline-rust examples/Hello.hs
55- [1 of 1] Compiling Main ( examples/Hello.hs, examples/Hello.o )
56- Linking examples/Hello ...
57- $ ./examples/Hello
58- Haskell: Hello. Enter a number:
59- 42
60- Rust: Your number is 42
61- Haskell: Rust says number plus 1 is 43
62-
63- ## Bugs
64-
65- Please report bugs to [ the issue tracker] [ 4 ]
66-
67- [ 0 ] : https://ghc.haskell.org/trac/ghc/wiki/Building
68- [ 1 ] : https://phabricator.haskell.org/D4217
69- [ 2 ] : https://github.com/harpocrates/inline-rust/tree/master/examples
70- [ 3 ] : https://github.com/harpocrates/language-rust
71- [ 4 ] : https://github.com/harpocrates/inline-rust/issues
72- [ 5] : https://travis-ci.org/harpocrates/inline-rust.svg?branch=master
73- [ 6 ] : https://travis-ci.org/harpocrates/inline-rust
74- [ 7 ] : https://ci.appveyor.com/api/projects/status/xiwf8743n2f7n400?svg=true
75- [ 8 ] : https://ci.appveyor.com/project/harpocrates/inline-rust
0 commit comments