From d00e383dd4dcd7c38fa9be5c2659ae237e65f0fe Mon Sep 17 00:00:00 2001 From: mrsekut Date: Sun, 12 Dec 2021 13:31:50 +0900 Subject: [PATCH] PureScript: fix README, Dockerfile and Makefile --- .psc-ide-port | 1 - README.md | 12 +++++++++++- impls/purs/Dockerfile | 7 ++++--- impls/purs/Makefile | 17 ++++++++++++++--- 4 files changed, 29 insertions(+), 8 deletions(-) delete mode 100644 .psc-ide-port diff --git a/.psc-ide-port b/.psc-ide-port deleted file mode 100644 index e31a4371..00000000 --- a/.psc-ide-port +++ /dev/null @@ -1 +0,0 @@ -15273 \ No newline at end of file diff --git a/README.md b/README.md index fdd1c7f6..fe431b05 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ process guide](process/guide.md) there is also a [mal/make-a-lisp FAQ](docs/FAQ.md) where I attempt to answer some common questions. -**3. Mal is implemented in 86 languages (92 different implementations and 114 runtime modes)** +**3. Mal is implemented in 87 languages (93 different implementations and 115 runtime modes)** | Language | Creator | | -------- | ------- | @@ -110,6 +110,7 @@ FAQ](docs/FAQ.md) where I attempt to answer some common questions. | [PostScript](#postscript-level-23) | [Joel Martin](https://github.com/kanaka) | | [PowerShell](#powershell) | [Joel Martin](https://github.com/kanaka) | | [Prolog](#prolog-logical-language) | [Nicolas Boulenguez](https://github.com/asarhaddon) | +| [PureScript](#purescript) | [mrsekut](https://github.com/mrsekut) | | [Python](#python-2x-and-3x) (2.X & 3.X) | [Joel Martin](https://github.com/kanaka) | | [Python #2](#python2-3x) (3.X) | [Gavin Lewis](https://github.com/epylar) | | [RPython](#rpython) | [Joel Martin](https://github.com/kanaka) | @@ -938,6 +939,15 @@ cd impls/prolog swipl stepX_YYY ``` +### PureScript +The PureScript implementation requires the spago compiler version 0.20.2. + +``` +cd impls/purs +make +node ./stepX_YYY.js +``` + ### Python (2.X and 3.X) ``` diff --git a/impls/purs/Dockerfile b/impls/purs/Dockerfile index 935e655b..1eb013ea 100644 --- a/impls/purs/Dockerfile +++ b/impls/purs/Dockerfile @@ -30,8 +30,9 @@ RUN curl -sL https://deb.nodesource.com/setup_12.x | bash - # Install nodejs RUN apt-get -y install nodejs -# Install purescript -RUN apt-get install -y libtinfo5 +# Install purescript and deps +RUN apt-get install -y git libtinfo5 RUN npm install -g --unsafe-perm purescript spago -ENV NPM_CONFIG_CACHE /mal/.npm \ No newline at end of file +ENV NPM_CONFIG_CACHE /mal/.npm +ENV HOME /mal \ No newline at end of file diff --git a/impls/purs/Makefile b/impls/purs/Makefile index b97196b7..6e44cd4c 100644 --- a/impls/purs/Makefile +++ b/impls/purs/Makefile @@ -1,5 +1,9 @@ -src/step%: - spago bundle-app --main ${${@F}} --to $(@F:%.purs=%.js) +step%.js: src/step%.purs $(OTHER_SRCS) node_modules/readline-sync + spago bundle-app --main $($(<:src/%=%)) --to $@ + + +node_modules/readline-sync: + npm install ##################### @@ -14,4 +18,11 @@ step6_file.purs = Mal.Step6 step7_quote.purs = Mal.Step7 step8_macros.purs = Mal.Step8 step9_try.purs = Mal.Step9 -stepA_mal.purs = Mal.StepA \ No newline at end of file +stepA_mal.purs = Mal.StepA + +OTHER_SRCS = src/Readline.js src/Readline.purs src/Types.purs src/Reader.purs \ + src/Printer.purs src/Env.purs src/Core.purs + + +clean: + rm -rf step*.js output/* \ No newline at end of file