Skip to content

Commit 0e148ad

Browse files
committed
Update README
1 parent 81b688e commit 0e148ad

File tree

2 files changed

+46
-6
lines changed

2 files changed

+46
-6
lines changed

assets/construction_1f6a7.png

4.03 KB
Loading

test-readme/README.lhs

Lines changed: 46 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,16 @@ halide-haskell
33
</h1>
44
55
<div align="center">
6+
7+
<img src="assets/construction_1f6a7.png" width="32">This project is still under heavy development and might not be production-ready<img src="assets/construction_1f6a7.png" width="32"><br>
8+
We encourage experimenting with it and reporting any issues you run into via
9+
[Github issues](https://github.com/twesterhout/halide-haskell/issues).
10+
611
<br />
712
8-
[![license](https://img.shields.io/github/license/twesterhout/halide-haskell.svg?style=flat-square)](LICENSE)
13+
[**Tutorials**](https://github.com/twesterhout/halide-haskell/tree/master/tutorials) | [**Documentation**](https://hackage.haskell.org/package/halide-haskell-0.0.1.0) | [**Showcases**](https://github.com/twesterhout/halide-haskell-examples)
914
15+
[![license](https://img.shields.io/github/license/twesterhout/halide-haskell.svg?style=flat-square)](LICENSE)
1016
[![build](https://img.shields.io/github/actions/workflow/status/twesterhout/halide-haskell/ci.yml?style=flat-square)](https://github.com/twesterhout/halide-haskell/actions/workflows/ci.yml)
1117
[![Hackage](https://img.shields.io/hackage/v/halide-haskell?style=flat-square)](https://hackage.haskell.org/package/halide-haskell)
1218
@@ -33,10 +39,13 @@ This package provides Haskell bindings that allow to write Halide embedded in
3339
Haskell without C++ 😋.
3440
</h4>
3541
36-
- [Tutorials](https://github.com/twesterhout/halide-haskell/tree/master/tutorials)
37-
- [Reference documentation](https://hackage.haskell.org/package/halide-haskell-0.0.1.0)
42+
- [Example usage](#-example-usage)
43+
- [Installing](#-installing)
44+
- [Motivation](#-motivation)
45+
- [Contributing](#-contributing)
46+
3847
39-
## 🚀 Getting started
48+
## 🚀 Example usage
4049
4150
As a simple example, here's how you could implement array addition with halide-haskell:
4251
@@ -75,7 +84,37 @@ main = do
7584
print =<< peekToList out'
7685
```
7786
78-
For more examples, have a look a the [tutorials](https://github.com/twesterhout/halide-haskell/tree/master/tutorials).
87+
For more examples, have a look at the [tutorials](https://github.com/twesterhout/halide-haskell/tree/master/tutorials).
88+
89+
## 💻 Installing
90+
91+
Currently, the easiest way to install the library is using
92+
[Nix](https://nixos.org/). It is not a fundamental limitation, because the
93+
library itself is just a normal Cabal-based Haskell project, but installing &
94+
patching (not all our bug fixes have been upstreamed yet) the system
95+
dependencies is just too much work without Nix.
96+
97+
So, once you have Nix installed, you can add halide-haskell to your flake
98+
inputs like [this project
99+
demonstrates](https://github.com/twesterhout/halide-haskell-examples/blob/main/flake.nix#L27)
100+
and then include it in your `build-depends` section in the Cabal file.
101+
102+
If you just want to try building the library, type
103+
104+
```sh
105+
nix build
106+
```
107+
108+
and to run an example, try
109+
110+
```sh
111+
nix run
112+
nix run .#ghc927-intel-ocl.halide-haskell # for Intel OpenCL support
113+
nix run .#ghc927-cuda.halide-haskell # for CUDA support
114+
nix run .#ghc944.halide-haskell # to build with GHC 9.4.4 instead
115+
```
116+
117+
(for OpenCL and CUDA, you may need to set `NIXPKGS_ALLOW_UNFREE=1`)
79118
80119
## 🤩 Motivation
81120
@@ -143,7 +182,8 @@ Currently, the best way to get started is to use Nix:
143182
nix develop
144183
```
145184
146-
This will drop you into a shell with all the necessary tools to build the code such that you can do
185+
This will drop you into a shell with all the necessary tools to build the code
186+
such that you can do
147187
148188
```sh
149189
cabal build

0 commit comments

Comments
 (0)