mirror of
https://github.com/ProgramSnail/Lama.git
synced 2025-12-05 22:38:44 +00:00
Merge pull request #23 from JetBrains-Research/1.10+ocaml4.10
Update 1.10 for OCaml >= 4.10
This commit is contained in:
commit
6123bf0da6
7 changed files with 77 additions and 47 deletions
27
Lama.opam
Normal file
27
Lama.opam
Normal file
|
|
@ -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"
|
||||||
|
}
|
||||||
55
README.md
55
README.md
|
|
@ -1,4 +1,4 @@
|
||||||
# Lama
|
# Lama
|
||||||
|
|
||||||
 is a programming language developed by JetBrains Research for educational purposes as an exemplary language to introduce
|
 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:
|
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
|
## 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
|
* System-wide prerequisites:
|
||||||
* ocaml (4.07.1 <= . < 4.10) [http://ocaml.org]
|
|
||||||
* opam (>= 2.0.4) [http://opam.ocaml.org]
|
|
||||||
|
|
||||||
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)
|
* Check that `opam` is installed (using commands `which opam` or `opam --version`)
|
||||||
* `opam pin add -y lama https://github.com/JetBrains-Research/Lama.git`
|
|
||||||
|
|
||||||
Smoke-testing:
|
* Install right [switch](https://opam.ocaml.org/doc/Manual.html#Switches) for OCaml compiler
|
||||||
|
|
||||||
* `pushd tutorial`
|
`opam switch create lama ocaml-variants.4.10.1+fp+flambda`
|
||||||
* `make`
|
|
||||||
* `popd`
|
|
||||||
|
|
||||||
|
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 various shells)
|
||||||
|
|
||||||
|
`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`
|
||||||
|
|
|
||||||
32
opam
32
opam
|
|
@ -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"
|
|
||||||
}
|
|
||||||
|
|
||||||
1
regression/.gitignore
vendored
Symbolic link
1
regression/.gitignore
vendored
Symbolic link
|
|
@ -0,0 +1 @@
|
||||||
|
../stdlib/.gitignore
|
||||||
|
|
@ -3,9 +3,9 @@ OCAMLC = ocamlfind c
|
||||||
OCAMLOPT = ocamlfind opt
|
OCAMLOPT = ocamlfind opt
|
||||||
OCAMLDEP = ocamlfind dep
|
OCAMLDEP = ocamlfind dep
|
||||||
SOURCES = version.ml stdpath.ml Language.ml Pprinter.ml SM.ml X86.ml Driver.ml
|
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)
|
PXFLAGS = $(CAMLP5)
|
||||||
BFLAGS = -rectypes -g -w -13-58 -package ostap,unix
|
BFLAGS = -rectypes -g -w -13-58 -package GT,ostap,unix
|
||||||
OFLAGS = $(BFLAGS)
|
OFLAGS = $(BFLAGS)
|
||||||
|
|
||||||
all: depend metagen $(TOPFILE)
|
all: depend metagen $(TOPFILE)
|
||||||
|
|
@ -45,4 +45,3 @@ clean:
|
||||||
|
|
||||||
%.cmx: %.ml
|
%.cmx: %.ml
|
||||||
$(OCAMLOPT) -c $(OFLAGS) $(STATIC) $(PXFLAGS) $<
|
$(OCAMLOPT) -c $(OFLAGS) $(STATIC) $(PXFLAGS) $<
|
||||||
|
|
||||||
|
|
|
||||||
3
stdlib/.gitignore
vendored
3
stdlib/.gitignore
vendored
|
|
@ -1,3 +1,6 @@
|
||||||
|
*.html
|
||||||
|
*.sm
|
||||||
|
*.log
|
||||||
*.i
|
*.i
|
||||||
*.s
|
*.s
|
||||||
|
|
||||||
|
|
|
||||||
1
tutorial/.gitignore
vendored
Symbolic link
1
tutorial/.gitignore
vendored
Symbolic link
|
|
@ -0,0 +1 @@
|
||||||
|
../stdlib/.gitignore
|
||||||
Loading…
Add table
Add a link
Reference in a new issue