https://github.com/gren-lang/compiler
Compiler for the Gren programming language
https://github.com/gren-lang/compiler
Last synced: 2 days ago
JSON representation
Compiler for the Gren programming language
- Host: GitHub
- URL: https://github.com/gren-lang/compiler
- Owner: gren-lang
- License: other
- Created: 2021-12-20T17:50:36.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2025-04-04T12:48:15.000Z (10 days ago)
- Last Synced: 2025-04-06T04:29:05.661Z (9 days ago)
- Language: Haskell
- Homepage: https://gren-lang.org
- Size: 11.3 MB
- Stars: 428
- Watchers: 15
- Forks: 24
- Open Issues: 70
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Roadmap: ROADMAP.md
Awesome Lists containing this project
- awesome-programming-languages - Gren - Gren is a pure functional programming language that is easy to learn, but powerful in use. (Uncategorized / Uncategorized)
README
# Gren
Compiler for Gren, a pure functional programming language that is easy to learn, but powerful in use.
There are easier ways to install the compiler than compiling the source, you might want to read the [setup instructions](https://gren-lang.org/install).
## Build from source
This project uses [devbox](https://www.jetify.com/devbox) for managing dependencies required to build the project. If you don't want to use devbox,
you can find a list of the requried dependencies and the commands for building the compiler in `devbox.json`.Since Gren 0.4 the compiler is implemented in two parts. The Gren-part of the compiler lives in `src`, and once built it acts
as a frontend to the Haskell-part of the compiler.The end goal is for the entire compiler to be written in Gren.
To build the compiler:
1. Use `devbox run prepare-deps` to setup the required dependencies. The first time you run this it might take a while.
2. Build the compiler with `devbox run build`. This will create a `cli.js` file and a `gren` executable in the project root directory.You can now execute the Gren-part of the compiler with `node ./cli.js` or just `./cli.js`. This either requires `node` to be installed,
or that you've entered the development shell by using `devbox shell`. The Gren-part of the compiler will by default download a pre-built
binary of the Haskell-part from Github. If you want to run the compiler with the Haskell-part you've just built, set the path
to the Haskell-binary in a `GREN_BIN` environment variable, like: `GREN_BIN=$PWD/gren node ./cli.js`.You might also want to study the scripts defined in `devbox.json`. You can execute one of these scripts by running
`devbox run `.