mirror of
https://github.com/J3RN/wasmfromthegroundup-hs
synced 2026-08-31 19:20:17 +00:00
No description
- Haskell 97.9%
- HTML 2.1%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| app | ||
| src/WasmFromTheGroundUp | ||
| test | ||
| .gitignore | ||
| index.html | ||
| LICENSE | ||
| package.yaml | ||
| README.md | ||
| Setup.hs | ||
| stack.yaml | ||
| stack.yaml.lock | ||
| wasmfromthegroundup.cabal | ||
WebAssembly from the Ground Up - Haskell
⚠️Work in progress! I am only partway through the book, and will add more ports as I go.⚠️
This is a collection of code from WebAssembly from the Ground Up ported from JavaScript and Ohm to Haskell.
General Notes
- Whereas JavaScript uses
Uint8Arrayto represent an array of bytes, this Haskell code uses bytestring builders (Data.ByteString.Builder). TheData.ByteString.Buildermodule provides many helpers that WebAssembly from the Ground Up must implement from scratch for JavaScript (e.g.stringUtf8,word32LE). - I'm not a Haskell expert. If you have a cleaner way to implement something, send me a pull request!
- That said, I'm trying to keep the code fairly understandable to someone with a limited knowledge of Haskell. I'm using typeclasses, but this is about as advanced as it get (at the moment). I'm intentionally doing function composition with parentheses (e.g.
()) instead of the composition operator (.) for this approachability reason. - My Haskell code style is probably bad and/or inconsistent, I'm not using a formatter at the moment, but I'm open to it.