From ebfb05856ff2d8354a9dcc09743fd44e5f630606 Mon Sep 17 00:00:00 2001 From: Kakadu Date: Wed, 26 Aug 2020 16:37:24 +0300 Subject: [PATCH 1/3] Update build for new GT Signed-off-by: Kakadu --- src/Makefile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Makefile b/src/Makefile index ed77617e0..af5d51222 100644 --- a/src/Makefile +++ b/src/Makefile @@ -3,9 +3,9 @@ OCAMLC = ocamlfind c OCAMLOPT = ocamlfind opt OCAMLDEP = ocamlfind dep SOURCES = version.ml stdpath.ml Language.ml Pprinter.ml SM.ml X86.ml Driver.ml -CAMLP5 = -syntax camlp5o -package ostap.syntax,GT.syntax.all +CAMLP5 = -syntax camlp5o -package ostap.syntax,GT-p5,GT.syntax.all PXFLAGS = $(CAMLP5) -BFLAGS = -rectypes -g -w -13-58 -package ostap,unix +BFLAGS = -rectypes -g -w -13-58 -package GT,ostap,unix OFLAGS = $(BFLAGS) all: depend metagen $(TOPFILE) @@ -45,4 +45,3 @@ clean: %.cmx: %.ml $(OCAMLOPT) -c $(OFLAGS) $(STATIC) $(PXFLAGS) $< - From eaa03785ed41f6141cc1e6081ee11733d95ca833 Mon Sep 17 00:00:00 2001 From: Kakadu Date: Fri, 12 Feb 2021 20:20:49 +0300 Subject: [PATCH 2/3] Update README and opam files Signed-off-by: Kakadu --- Lama.opam | 27 +++++++++++++++++++++++++++ README.md | 55 +++++++++++++++++++++++++++++++++++++++++++------------ opam | 32 -------------------------------- 3 files changed, 70 insertions(+), 44 deletions(-) create mode 100644 Lama.opam delete mode 100644 opam diff --git a/Lama.opam b/Lama.opam new file mode 100644 index 000000000..1f7af5948 --- /dev/null +++ b/Lama.opam @@ -0,0 +1,27 @@ +opam-version: "2.0" +version: "1.10" + +synopsis: "Lama programming system" +maintainer: "dboulytchev@gmail.com" +authors: "dboulytchev@gmail.com" +homepage: "https://github.com/JetBrains-Research/Lama" +bug-reports: "https://github.com/JetBrains-Research/Lama/issues" + +depends: [ + "ocaml" { >= "4.07.1" } + "ocamlfind" { build } + "camlp5" { >= "8.00"} + "ostap" { >= "0.5"} + "GT" { >= "0.4.0"} +] + +build: [ + [make] + [make "regression"] {with-test} +] +install: [make "install"] + +dev-repo: "git+https://github.com/JetBrains-Research/Lama.git" +url { + src: "git+https://github.com/JetBrains-Research/Lama.git#1.10+ocaml4.10" +} diff --git a/README.md b/README.md index 0dc90f05a..000e7b1c6 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Lama +# Lama ![lama](lama.png) is a programming language developed by JetBrains Research for educational purposes as an exemplary language to introduce the domain of programming languages, compilers and tools. Its general characteristics are: @@ -38,21 +38,52 @@ The language specification can be found [here](lama-spec.pdf). ## Installation -Prerequisites: +Windows users should get Windows Subsystem for Linux a.k.a WSL (recommended) or cygwin. Ubuntu-based variant of WSL is recommended. -* gcc-multilib -* ocaml (4.07.1 <= . < 4.10) [http://ocaml.org] -* opam (>= 2.0.4) [http://opam.ocaml.org] +* System-wide prerequisites: -Installing: + - `sudo apt install gcc-multilib` (in Debian-based GNU/Linux) + - [opam](http://opam.ocaml.org) (>= 2.0.4) + - [OCaml](http://ocaml.org) (>= 4.10.1). *Optional* because it can be easily installed through opam. Compiler variant with `flambda` switch is recommended -* `opam pin add -n ostap https://github.com/dboulytchev/ostap.git#memoCPS` (remember of "#" being a comment character in bash) -* `opam pin add -y lama https://github.com/JetBrains-Research/Lama.git` +* Check that `opam` is installed (using commands `which opam` or `opam --version`) -Smoke-testing: +* Install right switch for OCaml compiler -* `pushd tutorial` -* `make` -* `popd` + `opam switch create lama ocaml-variants.4.10.1+fp+flambda` + In above command: + - `opam switch create` is a subcommand to create a new switch + - `ocaml-variants.4.10.1+fp+flambda` is name of a standart template for the switch + - `lama` is an alias for the switch being created; on success a directory `$(HOME)/.opam/lama` should be created + +* Update PATH variable for the fresh switch. (You can add these commands to your `~/.bashrc` for convenience but they should be added by `opam`) + + ``` + export OPAMSWITCH=lama + eval $(opam env) + ``` + + Check that OCaml compiler is now available in PATH: running `which ocamlc` should give `/home/user/.opam/lama/bin/ocamlc` (or similar) and `ocamlc -v` should give + + ``` + The OCaml compiler, version 4.10.1 + Standard library directory: /home/user/.opam/lama/lib/ocaml + ``` + +* Pin Lama package using `opam` and right URL (remember of "#" being a comment character in bash) + + `opam pin add Lama https://github.com/JetBrains-Research/Lama-devel.git\#1.10+ocaml4.10 -y` + + The `-y` switch meands "reply always 'yes'". + +* Check that `lamac` exectuable was installed: `which lamac` should give + + ``` + /home/user/.opam/lama/bin/lamac + ``` + +### Smoke-testing: + +Install `lama` system-wide, clone the repository and run `make -C tutorial` diff --git a/opam b/opam deleted file mode 100644 index 4c4723efa..000000000 --- a/opam +++ /dev/null @@ -1,32 +0,0 @@ -opam-version: "2.0" -name: "Lama" -version: "1.0" - -synopsis: "Lama programming system" -maintainer: "dboulytchev@gmail.com" -authors: "dboulytchev@gmail.com" -homepage: "https://github.com/JetBrains-Research/Lama" -bug-reports: "https://github.com/JetBrains-Research/Lama/issues" - -depends: [ - "ocaml" { >= "4.07.1" } - "ocamlfind" { build } - "camlp5" { >= "7.05"} - "ostap" { >= "0.3"} - "GT" { >= "0.2"} -] - -build: [ - [make "-f" "Makefile"] - [make "-f" "Makefile" "regression"] {with-test} -] -install: [make "install"] - -#remove: ["ocamlfind" "remove" "compiler-workout"] -#flags: light-uninstall - -dev-repo: "git+https://github.com/JetBrains-Research/Lama.git" -url { - src: "git+https://github.com/JetBrains-Research/Lama.git#1.00" -} - From 43af0d24f06f211ad1bf47735584d83ed190e025 Mon Sep 17 00:00:00 2001 From: Kakadu Date: Fri, 12 Feb 2021 21:49:17 +0300 Subject: [PATCH 3/3] Update .gitignore files Signed-off-by: Kakadu --- README.md | 4 ++-- regression/.gitignore | 1 + stdlib/.gitignore | 3 +++ tutorial/.gitignore | 1 + 4 files changed, 7 insertions(+), 2 deletions(-) create mode 120000 regression/.gitignore create mode 120000 tutorial/.gitignore diff --git a/README.md b/README.md index 000e7b1c6..d56814b75 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,7 @@ Windows users should get Windows Subsystem for Linux a.k.a WSL (recommended) or * Check that `opam` is installed (using commands `which opam` or `opam --version`) -* Install right switch for OCaml compiler +* Install right [switch](https://opam.ocaml.org/doc/Manual.html#Switches) for OCaml compiler `opam switch create lama ocaml-variants.4.10.1+fp+flambda` @@ -72,7 +72,7 @@ Windows users should get Windows Subsystem for Linux a.k.a WSL (recommended) or Standard library directory: /home/user/.opam/lama/lib/ocaml ``` -* Pin Lama package using `opam` and right URL (remember of "#" being a comment character in bash) +* Pin Lama package using `opam` and right URL (remember of "#" being a comment character in various shells) `opam pin add Lama https://github.com/JetBrains-Research/Lama-devel.git\#1.10+ocaml4.10 -y` diff --git a/regression/.gitignore b/regression/.gitignore new file mode 120000 index 000000000..65f1cfa74 --- /dev/null +++ b/regression/.gitignore @@ -0,0 +1 @@ +../stdlib/.gitignore \ No newline at end of file diff --git a/stdlib/.gitignore b/stdlib/.gitignore index 48382914d..0ec54007e 100644 --- a/stdlib/.gitignore +++ b/stdlib/.gitignore @@ -1,3 +1,6 @@ +*.html +*.sm +*.log *.i *.s diff --git a/tutorial/.gitignore b/tutorial/.gitignore new file mode 120000 index 000000000..65f1cfa74 --- /dev/null +++ b/tutorial/.gitignore @@ -0,0 +1 @@ +../stdlib/.gitignore \ No newline at end of file