Skip to content

Commit

Permalink
Merge pull request #28 from PLTools/more-dune
Browse files Browse the repository at this point in the history
More dune
  • Loading branch information
dboulytchev authored Sep 13, 2024
2 parents 6761c1d + cd033dd commit d836301
Show file tree
Hide file tree
Showing 34,331 changed files with 26,915 additions and 12,826 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
50 changes: 24 additions & 26 deletions Lama.opam
Original file line number Diff line number Diff line change
@@ -1,32 +1,30 @@
# This file is generated by dune, edit dune-project instead
opam-version: "2.0"
version: "1.30"

synopsis: "Lama programming language"
maintainer: "dboulytchev@gmail.com"
authors: [
"Dmitry Boulytchev <dboulytchev@gmail.com>"
"Daniil Berezun <danya.berezun@gmail.com>"
"Egor Sheremetov <egor.sheremetov.dev@gmail.com>"
]
homepage: "https://github.com/PLTools/Lama"
synopsis:
"A programming language (initially developed by JetBrains Research) for educational purposes as an exemplary language to introduce the domain of programming languages, compilers, and tools"
maintainer: ["http://github.com/Kakadu"]
authors: ["http://github.com/dboulytchev" "http://github.com/danyaberezun"]
license: "GPL-3.0-only"
homepage: "https://github.com/PLTools/Lama"
bug-reports: "https://github.com/PLTools/Lama/issues"

depends: [
"ocaml" { >= "4.13.1" }
"ocamlfind" { build }
"camlp5" { >= "8.00.05" }
"ostap" { >= "0.5"}
"GT" { >= "0.5.1" }
"posix-uname" { = "2.0.2" }
"dune" {>= "3.3"}
"posix-uname"
"GT"
"ostap" {>= "0.6"}
"odoc" {with-doc}
]

build: [
[make]
[make "regression"] {with-test}
["dune" "subst"] {dev}
[
"dune"
"build"
"-p"
name
"-j"
jobs
"@install"
"@runtest" {with-test}
"@doc" {with-doc}
]
]
install: [make "install"]

dev-repo: "git+https://github.com/PLTools/Lama.git"
url {
src: "git+https://github.com/PLTools/Lama.git#1.30"
}
55 changes: 25 additions & 30 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,48 +1,43 @@
EXECUTABLE = src/lamac
.PHONY: all regression
.PHONY: clean test regression regression-expressions regression-all uninstall install build

INSTALL ?= install -v
MKDIR ?= mkdir
BUILDDIR = build

.PHONY: all regression
BUILDDIR = _build

all:
$(MAKE) -C src
$(MAKE) -C runtime
$(MAKE) -C stdlib
.DEFAULT_GOAL := build

STD_FILES=$(shell ls stdlib/*.[oi] stdlib/*.lama runtime/runtime.a runtime/Std.i)
all: build test

build: all
mkdir -p $(BUILDDIR)
cp -r runtime/Std.i runtime/runtime.a stdlib/* src/lamac $(BUILDDIR)
build:
dune b src runtime runtime32 stdlib tutorial

install: all
$(INSTALL) $(EXECUTABLE) `opam var bin`
$(MKDIR) -p `opam var share`/Lama
$(INSTALL) $(STD_FILES) `opam var share`/Lama/
dune b @install --profile=release
dune install --profile=release
$(MKDIR) -p `opam var share`/Lama/x64
$(INSTALL) $(shell ls _build/default/stdlib/x64/*.[oi] _build/default/stdlib/x64/stdlib/*.lama \
runtime/runtime.a runtime/Std.i) \
`opam var share`/Lama/x64
$(MKDIR) -p `opam var share`/Lama/x32
$(INSTALL) $(shell ls _build/default/stdlib/x32/*.[oi] _build/default/stdlib/x32/stdlib/*.lama \
runtime32/runtime.a runtime32/Std.i) \
`opam var share`/Lama/x32

uninstall:
$(RM) -r `opam var share`/Lama
$(RM) `opam var bin`/$(EXECUTABLE)
dune uninstall


regression-all: regression regression-expressions

test: regression
regression:
$(MAKE) clean check -j8 -C regression
$(MAKE) clean check -j8 -C stdlib/regression
dune test regression

regression-expressions:
$(MAKE) clean check -j8 -C regression/expressions
$(MAKE) clean check -j8 -C regression/deep-expressions

negative_scenarios_tests:
$(MAKE) -C runtime negative_tests
dune test regression_long

clean:
$(MAKE) clean -C src
$(MAKE) clean -C runtime
$(MAKE) clean -C stdlib
$(MAKE) clean -C regression
$(MAKE) clean -C byterun
$(MAKE) clean -C bench
rm -rf $(BUILDDIR)
@dune clean

12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

# Lama

![lama](lama.svg) 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.
![lama](lama.svg) is a programming language (initualy 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:

* procedural with first-class functions - functions can be passed as arguments, placed in data structures,
Expand Down Expand Up @@ -52,8 +52,8 @@ Ubuntu-based variant of WSL is recommended.
sudo apt install gcc
```

- MacOS: `clang`
- MacOS: `clang`

Should be automatically installed with developer tools.

- [opam](http://opam.ocaml.org) (>= 2.0.4)
Expand All @@ -67,13 +67,13 @@ Ubuntu-based variant of WSL is recommended.
1. Install the right [switch](https://opam.ocaml.org/doc/Manual.html#Switches) for the OCaml compiler

```bash
opam switch create lama --packages=ocaml-variants.4.14.0+options,ocaml-option-flambda
opam switch create lama --packages=ocaml-variants.4.14.2+options,ocaml-option-flambda
```

* In the above command:

- `opam switch create` is a subcommand to create a new switch
- `ocaml-variants.4.14.0+options` is the name of a standard template for the switch
- `ocaml-variants.4.14.2+options` is the name of a standard template for the switch
- `lama` is an alias for the switch being created; on success a directory `$(HOME)/.opam/lama` should be created

2. Update PATH variable for the fresh switch. (You can add these commands to your `~/.bashrc` for convenience but they should be added by `opam`)
Expand All @@ -83,7 +83,7 @@ Ubuntu-based variant of WSL is recommended.

* Check that the OCaml compiler is now available in PATH by running `which ocamlc`; it should answer with `/home/user/.opam/lama/bin/ocamlc` (or similar) and `ocamlc -v` should answer with
```
The OCaml compiler, version 4.10.1
The OCaml compiler, version 4.14.2
Standard library directory: /home/user/.opam/lama/lib/ocaml
```

Expand Down
12 changes: 0 additions & 12 deletions byterun/.,

This file was deleted.

1 change: 1 addition & 0 deletions byterun/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/byterun.exe
10 changes: 0 additions & 10 deletions byterun/Makefile

This file was deleted.

9 changes: 9 additions & 0 deletions byterun/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
(rule
(target byterun.exe)
(deps
(:main byterun.c)
(:runtime ../runtime/runtime.a))
(mode
(promote (until-clean)))
(action
(run gcc -g %{main} %{runtime} -o %{target})))
22 changes: 22 additions & 0 deletions dune-project
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
(lang dune 3.3)

(cram enable)

(generate_opam_files true)

(bug_reports "https://github.com/PLTools/Lama/issues")

(homepage "https://github.com/PLTools/Lama")

(maintainers "http://github.com/Kakadu")

(authors "http://github.com/dboulytchev" "http://github.com/danyaberezun")

(license GPL-3.0-only)

(package
(name Lama)
(synopsis
"A programming language (initially developed by JetBrains Research) for educational purposes as an exemplary language to introduce the domain of programming languages, compilers, and tools")
(depends
posix-uname
GT
(ostap
(>= 0.6))))
1 change: 1 addition & 0 deletions performance/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/*.exe
14 changes: 0 additions & 14 deletions performance/Makefile

This file was deleted.

21 changes: 21 additions & 0 deletions performance/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
(rule
(targets Sort.x64.exe)
(deps
(:lama Sort.lama)
../runtime/runtime.a)
(mode
(promote (until-clean)))
(action
(setenv
LAMA
"../runtime"
(run
%{project_root}/src/Driver.exe
-march=x86_64
%{lama}
-I
../stdlib/x64
-I
../runtime
-o
%{targets}))))
24 changes: 0 additions & 24 deletions regression/Makefile

This file was deleted.

16 changes: 0 additions & 16 deletions regression/common.ml

This file was deleted.

1 change: 0 additions & 1 deletion regression/deep-expressions/orig/generated00000.log

This file was deleted.

1 change: 0 additions & 1 deletion regression/deep-expressions/orig/generated00001.log

This file was deleted.

1 change: 0 additions & 1 deletion regression/deep-expressions/orig/generated00002.log

This file was deleted.

1 change: 0 additions & 1 deletion regression/deep-expressions/orig/generated00003.log

This file was deleted.

1 change: 0 additions & 1 deletion regression/deep-expressions/orig/generated00004.log

This file was deleted.

1 change: 0 additions & 1 deletion regression/deep-expressions/orig/generated00005.log

This file was deleted.

1 change: 0 additions & 1 deletion regression/deep-expressions/orig/generated00006.log

This file was deleted.

1 change: 0 additions & 1 deletion regression/deep-expressions/orig/generated00007.log

This file was deleted.

1 change: 0 additions & 1 deletion regression/deep-expressions/orig/generated00008.log

This file was deleted.

1 change: 0 additions & 1 deletion regression/deep-expressions/orig/generated00009.log

This file was deleted.

1 change: 0 additions & 1 deletion regression/deep-expressions/orig/generated00010.log

This file was deleted.

1 change: 0 additions & 1 deletion regression/deep-expressions/orig/generated00011.log

This file was deleted.

1 change: 0 additions & 1 deletion regression/deep-expressions/orig/generated00012.log

This file was deleted.

1 change: 0 additions & 1 deletion regression/deep-expressions/orig/generated00013.log

This file was deleted.

1 change: 0 additions & 1 deletion regression/deep-expressions/orig/generated00014.log

This file was deleted.

1 change: 0 additions & 1 deletion regression/deep-expressions/orig/generated00015.log

This file was deleted.

1 change: 0 additions & 1 deletion regression/deep-expressions/orig/generated00016.log

This file was deleted.

1 change: 0 additions & 1 deletion regression/deep-expressions/orig/generated00017.log

This file was deleted.

1 change: 0 additions & 1 deletion regression/deep-expressions/orig/generated00018.log

This file was deleted.

1 change: 0 additions & 1 deletion regression/deep-expressions/orig/generated00019.log

This file was deleted.

1 change: 0 additions & 1 deletion regression/deep-expressions/orig/generated00020.log

This file was deleted.

1 change: 0 additions & 1 deletion regression/deep-expressions/orig/generated00021.log

This file was deleted.

1 change: 0 additions & 1 deletion regression/deep-expressions/orig/generated00022.log

This file was deleted.

1 change: 0 additions & 1 deletion regression/deep-expressions/orig/generated00023.log

This file was deleted.

1 change: 0 additions & 1 deletion regression/deep-expressions/orig/generated00024.log

This file was deleted.

1 change: 0 additions & 1 deletion regression/deep-expressions/orig/generated00025.log

This file was deleted.

1 change: 0 additions & 1 deletion regression/deep-expressions/orig/generated00026.log

This file was deleted.

1 change: 0 additions & 1 deletion regression/deep-expressions/orig/generated00027.log

This file was deleted.

1 change: 0 additions & 1 deletion regression/deep-expressions/orig/generated00028.log

This file was deleted.

1 change: 0 additions & 1 deletion regression/deep-expressions/orig/generated00029.log

This file was deleted.

1 change: 0 additions & 1 deletion regression/deep-expressions/orig/generated00030.log

This file was deleted.

1 change: 0 additions & 1 deletion regression/deep-expressions/orig/generated00031.log

This file was deleted.

1 change: 0 additions & 1 deletion regression/deep-expressions/orig/generated00032.log

This file was deleted.

1 change: 0 additions & 1 deletion regression/deep-expressions/orig/generated00033.log

This file was deleted.

1 change: 0 additions & 1 deletion regression/deep-expressions/orig/generated00034.log

This file was deleted.

1 change: 0 additions & 1 deletion regression/deep-expressions/orig/generated00035.log

This file was deleted.

1 change: 0 additions & 1 deletion regression/deep-expressions/orig/generated00036.log

This file was deleted.

1 change: 0 additions & 1 deletion regression/deep-expressions/orig/generated00037.log

This file was deleted.

1 change: 0 additions & 1 deletion regression/deep-expressions/orig/generated00038.log

This file was deleted.

Loading

0 comments on commit d836301

Please sign in to comment.