From 215e57b0422be2674b8dbdef43868b541dc3bf3e Mon Sep 17 00:00:00 2001 From: Robin Heggelund Hansen Date: Thu, 24 Oct 2024 21:40:45 +0200 Subject: [PATCH 1/5] Update dev docs. --- CONTRIBUTING.md | 6 ------ README.md | 15 +++++++++++---- ROADMAP.md | 15 ++------------- devbox.json | 2 +- package-lock.json | 4 ++-- package.json | 4 ++-- 6 files changed, 18 insertions(+), 28 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0e7c4a36..62911784 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -35,12 +35,6 @@ To do so: All PRs will be considered, but going through the above process significantly improves your chances of a merge! -## Local development commands - -- build: `cabal build -f dev` -- run tests: `cabal test -f dev` -- format files: `ormolu --mode inplace $(git ls-files '*.hs')` - ## Back-up / Historic Archives There's also a [Zulip](https://gren.zulipchat.com) with older diff --git a/README.md b/README.md index add15cf3..ad80a851 100644 --- a/README.md +++ b/README.md @@ -6,10 +6,17 @@ There are easier ways to install the compiler than compiling the source, you mig ## Build from source -The Gren compiler is written in Haskell, so to build from source you need to have GHC 9.4 (Haskell compiler) and Cabal 3.8 (haskell build tool) installed on your system. +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 their specific versions in `devbox.json`. -You can install these using [ghcup](https://www.haskell.org/ghcup/). By default, ghcup will install an older version of Haskell and Cabal, so you can install and set the required versions using `ghcup tui`. +Since Gren 0.4 the compiler is implemented in two parts. The Gren-portion of the compiler lives in `src`, and once built it acts +as a frontend to the Haskell-portion of the compiler. -Compiling and installing the project should just be a matter of `cabal install`, after which you should be able to run the `gren` command from your command line. +The end goal is for the entire compiler to be written in Gren, but for now you need to build both Gren- and Haskell-portions of the compiler. -Read the `CONTRIBUTING.md` file for some helpful commands for working on the compiler itself. +1. Use `devbox shell` to get a terminal with the required dependencies installed. +2. Use `./build_dev_bin.sh` to build the Haskell-based compiler. You should now have a `./gren` file in your directory. +3. Build the Gren compiler with `npm run prepublishOnly` +4. You can now execute your local build with `GREN_BIN=./gren node ./cli.js` + +`GREN_BIN` tells the compiler which Haskell-binary to communicate with. If not specified, it will be downloaded. diff --git a/ROADMAP.md b/ROADMAP.md index 904c67b4..f70877ed 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -8,16 +8,5 @@ Also, keep in mind that this only focuses on the big picture. Major features lik ## Releases -- December 2023 - Parametric modules, or OCaml functors, to enable defining things like equality, comparisons etc. for your own types and use them in data structures like Dict. This release also removes the "magic" type classes currently in the language, like `number` and `comparable`. - -- June 2024 - Stabelization period. Mostly bugfixes and code gen improvements. While we prepare for the next big thing. - -- December 2024 - Re-evaluating how concurrency works in the language. More specifically, we'll re-evaluate how `Task`, `Cmd`, `Process` and effect modules work. - -- June 2025 - Re-evaluate records and custom types. - -- December 2025 - Re-evaluate interop: ports and kernel code. - -- June 2026 - Compile to Web Assembly instead of JS. This will give us proper integers, big integers, hopefully smaller asset size and possibly enable future optimizations in codegen. - -- December 2026 - The language is considered complete. Both the compiler and core packages will commit to maintaining backwards compatability from here on out. +- June 2025 - Rewrite dependency management in Gren +- December 2025 - Rewrite parser in Gren. Parametric modules. Operators as syntax sugar. diff --git a/devbox.json b/devbox.json index fb17eea6..2abe6183 100644 --- a/devbox.json +++ b/devbox.json @@ -1,5 +1,5 @@ { - "$schema": "https://raw.githubusercontent.com/jetify-com/devbox/0.13.4/.schema/devbox.schema.json", + "$schema": "https://raw.githubusercontent.com/jetify-com/devbox/0.13.5/.schema/devbox.schema.json", "packages": [ "nodejs@20", "ghc@9.4.8", diff --git a/package-lock.json b/package-lock.json index ffea6224..86f66fb4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "gren-lang", - "version": "0.4.5", + "version": "0.4.6", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "gren-lang", - "version": "0.4.5", + "version": "0.4.6", "license": "BSD-3-Clause", "dependencies": { "postject": "^1.0.0-alpha.6" diff --git a/package.json b/package.json index 32747985..8a8e29e3 100644 --- a/package.json +++ b/package.json @@ -1,10 +1,10 @@ { "name": "gren-lang", - "version": "0.4.5", + "version": "0.4.6", "description": "Compiler for the Gren programming language", "scripts": { "test": "echo \"Error: no test specified\" && exit 1", - "prepublishOnly": "gren make src/Main.gren --optimize --output=compiler.js", + "prepublishOnly": "npx --package=gren-lang@0.4.5 -- gren make src/Main.gren --optimize --output=compiler.js", "prettier": "prettier -w \"!**/*.json\" .", "prettier:check": "prettier -c \"!**/*.json\" ." }, From 5fbdadbff6614ec60383ecee1d5b8760e3467818 Mon Sep 17 00:00:00 2001 From: Robin Heggelund Hansen Date: Thu, 24 Oct 2024 21:43:04 +0200 Subject: [PATCH 2/5] Add reference to devbox scripts in README. --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index ad80a851..0b36e991 100644 --- a/README.md +++ b/README.md @@ -20,3 +20,5 @@ The end goal is for the entire compiler to be written in Gren, but for now you n 4. You can now execute your local build with `GREN_BIN=./gren node ./cli.js` `GREN_BIN` tells the compiler which Haskell-binary to communicate with. If not specified, it will be downloaded. + +Don't forget to check the `scripts` defined in `devbox.json`. They can be executed using `devbox run