From e0e982e4e66b94dd1dfb1b7e0de80692729c065d Mon Sep 17 00:00:00 2001 From: Your Name Date: Sat, 26 Apr 2025 02:53:43 +0530 Subject: Update README to include WASM compilation post. --- README.md | 7 ++++++- public/index.html | 10 +++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 730ecda..57f0c43 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,8 @@ Follows the book [Writing a C Compiler by Nora Sandler](https://nostarch.com/wri Post about my experience implementing the book [writing-a-c-compiler-in-clojure](https://shagunagrawal.me/posts/writing-a-c-compiler-in-clojure/). +Post on how to compile to WASM [compiling-clojure-to-webassembly](https://shagunagrawal.me/posts/compiling-clojure-to-wasm-image/). + ## Prerequisites * [Clojure](https://clojure.org) @@ -20,15 +22,18 @@ To see all available tasks in the project, run `bb tasks`: ``` sh bb tasks - The following tasks are available: clean Removes target folder. nrepl Starts a nrepl session. storm Starts a nrepl session with storm debugger. +lib:run:main Run's main only for cljcc library. +lib:build:jar Builds uberjar only for cljcc lib. +lib:build:wasm Builds native WASM image. cli:run:main Run's main CLI function. cli:build:jar Builds uberjar for CLI. cli:run:jar Runs CLI jar. +cli:build:wasm Builds native image for WASM. cli:build:native Builds native image for CLI. ``` diff --git a/public/index.html b/public/index.html index c0820b2..46de12d 100644 --- a/public/index.html +++ b/public/index.html @@ -25,11 +25,15 @@

- I have only implemented the first 12 chapters of the book. Refer the supported syntax section below. + Post on how I approached implementing the book in Clojure. Writing a C Compiler in Clojure

- Wrote about how I approached implementing this in Clojure. Writing a C Compiler in Clojure + Post on how to compile the clojure codebase to WASM. Compiling Clojure to Web Assembly +

+ +

+ I have only implemented the first 12 chapters of the book. Refer the supported syntax section below.

@@ -158,6 +162,7 @@ int main(void) { }); + // https://gist.github.com/designbyadrian/2eb329c853516cef618a // Store original console methods var originalConsoleLog = console.log; var originalConsoleError = console.error; @@ -204,7 +209,6 @@ int main(void) { async function runCompiler(source, stage) { - // https://gist.github.com/designbyadrian/2eb329c853516cef618a try { const args = [source, "linux", stage]; const config = new GraalVM.Config(); -- cgit v1.2.3