From 109079ed3eb6adab961509bc3d9ef98356203a4e Mon Sep 17 00:00:00 2001 From: Radon Rosborough Date: Sun, 23 Aug 2020 10:20:00 -0600 Subject: [PATCH] New language: Dylan --- backend/src/langs.ts | 18 ++++++++++++++++++ scripts/docker-install-phase3a.bash | 3 +++ scripts/docker-install-phase4.bash | 8 ++++++++ scripts/docker-install-phase7.bash | 21 +++++++++++++++++++++ 4 files changed, 50 insertions(+) diff --git a/backend/src/langs.ts b/backend/src/langs.ts index 08bf40f..0f07bd2 100644 --- a/backend/src/langs.ts +++ b/backend/src/langs.ts @@ -727,6 +727,24 @@ void main() compile: "pandoc main.txt -f dokuwiki -o main.html", run: "prettier --no-config main.html", template: `Hello, world! +`, + }, + dylan: { + aliases: ["opendylan"], + name: "Dylan", + setup: "cp -R /opt/dylan/project-template/* ./", + main: "main.dylan", + compile: "dylan-compiler -build main.lid", + run: "_build/bin/main", + template: `Module: main + +define function main + (name :: , arguments :: ) + format-out("Hello, world!\\n"); + exit-application(0); +end function main; + +main(application-name(), application-arguments()); `, }, elixir: { diff --git a/scripts/docker-install-phase3a.bash b/scripts/docker-install-phase3a.bash index 2379a6e..f65951d 100755 --- a/scripts/docker-install-phase3a.bash +++ b/scripts/docker-install-phase3a.bash @@ -82,6 +82,9 @@ dart # Dhall dhall +# Dylan +libunwind-dev + " apt-get install -y $(grep -v "^#" <<< "$packages") diff --git a/scripts/docker-install-phase4.bash b/scripts/docker-install-phase4.bash index d0444aa..c8b5ad6 100755 --- a/scripts/docker-install-phase4.bash +++ b/scripts/docker-install-phase4.bash @@ -66,6 +66,14 @@ tar -xf dhall-json-*-x86_64-linux.tar.bz2 -C dhall-json mv dhall-json/bin/dhall-to-json dhall-json/bin/json-to-dhall /usr/local/bin/ rm -rf dhall-json dhall-json-*-x86_64-linux.tar.bz2 +# Dylan +ver="$(latest_release dylan-lang/opendylan)" +wget -nv "https://github.com/dylan-lang/opendylan/releases/download/${ver}/opendylan-$(grep -Eo '[0-9]+\.[0-9]+' <<< "$ver")-x86_64-linux.tar.bz2" +tar -xf opendylan-*-x86_64-linux.tar.bz2 +rm opendylan-*-x86_64-linux.tar.bz2 +mv opendylan-* /opt/dylan +ln -s /opt/dylan/bin/dylan-compiler /opt/dylan/bin/make-dylan-app /usr/local/bin/ + # Elixir ver="$(latest_release elixir-lsp/elixir-ls)" wget -nv "https://github.com/elixir-lsp/elixir-ls/releases/download/${ver}/elixir-ls.zip" diff --git a/scripts/docker-install-phase7.bash b/scripts/docker-install-phase7.bash index 6a58887..5482ddb 100755 --- a/scripts/docker-install-phase7.bash +++ b/scripts/docker-install-phase7.bash @@ -12,6 +12,27 @@ mkdir -p /opt/cmd/home-template mv /home/build/.wine /opt/cmd/home-template/ chmod -R a=u,go-w /opt/cmd/home-template +# Dylan +pushd /opt/dylan +make-dylan-app main +mv main project-template +pushd project-template >/dev/null +cat <<"EOF" > main.dylan +Module: main + +define function main + (name :: , arguments :: ) + format-out("Hello, world!\n"); + exit-application(0); +end function main; + +main(application-name(), application-arguments()); +EOF +dylan-compiler -build main.lid +rm main.dylan +popd >/dev/null +popd >/dev/null + # Elm mkdir -p /opt/elm mkdir elm-project