Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 36 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -519,9 +519,42 @@ Contributions are very welcome!
When modifying the compiler, run `make newmhs` or `make newmhsz` (the latter compresses the binary)
to generate a compiler that includes your changes.

## Libraries
## Third-party packages

Adding MicroHs support to a third-party package may take some initial effort, either by modifying the package itself, or by extending MicroHs.

- For conditional compilation you can test for `__MHS__` via CPP.

Once a package compiles with MicroHs, make sure it stays that way by adding a GitHub Action to the project repository:

```yaml
# file .github/workflows/mhs.yml

name: MicroHs

on:
pull_request:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Install MicroHs
uses: augustss/MicroHs@nightly

- name: Clone project repository
uses: actions/checkout@v4

- name: Build project
run: mcabal -r build
```

## Bundled libraries

The libraries live in the `lib/` directory. Adding missing functions/instances/types from the report is a welcome contribution.
The bundled libraries live in the `lib/` directory. Adding missing functions/instances/types from the report is a welcome contribution.
Common things from `base` and GHC boot libraries that use a lot of GHC-specific code (such as `array`, `bytestring`, `text`, ...) can also be added.

## Tests
Expand Down Expand Up @@ -606,6 +639,6 @@ [email protected]
* Q: Why are the error messages so bad?
* A: Error messages are boring.
*
* Q: Why is the so much source code?
* Q: Why is there so much source code?
* A: I wonder this myself. 10000+ lines of Haskell seems excessive.
6000+ lines of C is also more than I'd like for such a simple system.
15 changes: 15 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Setup MicroHs
description: Install `mhs`, `mcabal`, `cpphs`, and basic libraries to `$HOME/.mcabal`

branding:
icon: cpu
color: white

runs:
using: composite
steps:
- shell: bash
name: Install MicroHs
run: |
curl -sSL https://github.com/sol/MicroHs/releases/download/nightly/MicroHs-linux-x86_64.tar.gz | tar -xz -C "$HOME"
echo "$HOME/.mcabal/bin" >> "$GITHUB_PATH"