Merge pull request #8 from catseye/develop-0.9
Develop 0.8-2021.1231
Chris Pressey authored 3 years ago
GitHub committed 3 years ago
0 | 0 | History of Robin |
1 | 1 | ================ |
2 | ||
3 | Robin 0.8-2021.1231 | |
4 | ------------------- | |
5 | ||
6 | A minor release, with no changes to the language. | |
7 | In the distribution, however, | |
8 | ||
9 | * Added a `cabalfile` for the purpose of tracking | |
10 | dependencies. | |
11 | * Replaced `build.sh` and `clean.sh` with a Makefile | |
12 | which uses `cabal`, if available, to build the | |
13 | `robin.exe` executable. It also supports building | |
14 | the JavaScript version using `hastec`. | |
15 | * Changed `test.sh` to search for and use Falderal | |
16 | appliances to test the different implementations | |
17 | rather than using them via the `bin/robin` convenience | |
18 | wrapper script. | |
19 | * Made the `LICENSE` file more succinct (no legal changes), | |
20 | put the documentation license on the documentation | |
21 | specifically, and placed the example programs in the | |
22 | `eg` directory in the pubic domain. | |
23 | * Made the HTML-based demo use the "standard" JavaScript | |
24 | launcher used by Cat's Eye Technologies' other `hastec`- | |
25 | built projects, as well as some example Robin programs. | |
2 | 26 | |
3 | 27 | Robin 0.8 |
4 | 28 | --------- |
0 | Robin is distributed under the following, BSD-compatible licenses. | |
0 | BSD 3-Clause License | |
1 | 1 | |
2 | All documentation and tests are covered by this license, modelled | |
3 | after the "Report on the Programming Language Haskell 98" license: | |
4 | ||
5 | ----------------------------------------------------------------------------- | |
6 | ||
7 | Copyright (c)2012-2020 Chris Pressey, Cat's Eye Technologies. | |
8 | ||
9 | The authors intend this Report to belong to the entire Robin | |
10 | community, and so we grant permission to copy and distribute it for | |
11 | any purpose, provided that it is reproduced in its entirety, | |
12 | including this Notice. Modified versions of this Report may also be | |
13 | copied and distributed for any purpose, provided that the modified | |
14 | version is clearly presented as such, and that it does not claim to | |
15 | be a definition of the Robin Programming Language. | |
16 | ||
17 | ----------------------------------------------------------------------------- | |
18 | ||
19 | All source code for the reference interpreter is covered by this BSD-style | |
20 | license: | |
21 | ||
22 | ----------------------------------------------------------------------------- | |
23 | ||
24 | Copyright (c)2012-2020 Chris Pressey, Cat's Eye Technologies. | |
2 | Copyright (c) 2012-2021, Chris Pressey, Cat's Eye Technologies. | |
25 | 3 | All rights reserved. |
26 | 4 | |
27 | 5 | Redistribution and use in source and binary forms, with or without |
28 | modification, are permitted provided that the following conditions | |
29 | are met: | |
6 | modification, are permitted provided that the following conditions are met: | |
30 | 7 | |
31 | 1. Redistributions of source code must retain the above copyright | |
32 | notices, this list of conditions and the following disclaimer. | |
33 | 2. Redistributions in binary form must reproduce the above copyright | |
34 | notices, this list of conditions, and the following disclaimer in | |
35 | the documentation and/or other materials provided with the | |
36 | distribution. | |
37 | 3. Neither the names of the copyright holders nor the names of their | |
38 | contributors may be used to endorse or promote products derived | |
39 | from this software without specific prior written permission. | |
8 | * Redistributions of source code must retain the above copyright notice, this | |
9 | list of conditions and the following disclaimer. | |
40 | 10 | |
41 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
42 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
43 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS | |
44 | FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE | |
45 | COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, | |
46 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, | |
47 | BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | |
48 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | |
49 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |
50 | LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN | |
51 | ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
52 | POSSIBILITY OF SUCH DAMAGE. | |
11 | * Redistributions in binary form must reproduce the above copyright notice, | |
12 | this list of conditions and the following disclaimer in the documentation | |
13 | and/or other materials provided with the distribution. | |
53 | 14 | |
54 | ----------------------------------------------------------------------------- | |
15 | * Neither the name of the copyright holder nor the names of its | |
16 | contributors may be used to endorse or promote products derived from | |
17 | this software without specific prior written permission. | |
18 | ||
19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |
20 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |
21 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |
22 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | |
23 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |
24 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |
25 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | |
26 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |
27 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
28 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
0 | PROG=robin | |
1 | ||
2 | all: exe web | |
3 | ||
4 | exe: pkg/stdlib.robin bin/$(PROG).exe | |
5 | ||
6 | bin/$(PROG).exe: | |
7 | ifneq (, $(shell command -v cabal 2>/dev/null)) | |
8 | cabal v2-build $(PROG) | |
9 | cp -p `find dist-newstyle/ -name $(PROG) -executable -type f` bin/$(PROG).exe | |
10 | else | |
11 | ifneq (, $(shell command -v ghc 2>/dev/null)) | |
12 | (cd src && ghc --make Main.hs -o ../bin/$(PROG).exe) | |
13 | else | |
14 | echo "neither cabal nor ghc found in PATH, skipping exe build" | |
15 | endif | |
16 | endif | |
17 | ||
18 | # For the web build to work, you need parsec installed in a way where haste can use it: | |
19 | # | |
20 | # haste-cabal install parsec-3.1.1 | |
21 | # | |
22 | # Later versions might not work. For example, 3.1.13.0 fails to build for me at: | |
23 | # Preprocessing library generic-deriving-1.12.3... | |
24 | # src/Generics/Deriving/TH/Pre4_9.hs:177:20: | |
25 | # parse error on input ‘->’ | |
26 | # | |
27 | # The hastec from containerized-hastec comes with parsec already installed this way. | |
28 | # | |
29 | # You also need random installed in a way that haste can use it: | |
30 | # | |
31 | # haste-cabal install random-1.1 | |
32 | # | |
33 | ||
34 | web: demo/$(PROG).js | |
35 | ||
36 | demo/$(PROG).js: | |
37 | ifeq (, $(shell command -v hastec 2>/dev/null)) | |
38 | echo "hastec not found in PATH, skipping web build" | |
39 | else | |
40 | (cd src && hastec --make HasteMain.hs -o $(PROG).js && mv $(PROG).js ../demo/$(PROG).js) | |
41 | endif | |
42 | ||
43 | pkg/stdlib.robin: | |
44 | ./build-packages.sh | |
45 | ||
46 | clean: | |
47 | rm -f bin/$(PROG).exe demo/$(PROG).js | |
48 | find . -name '*.o' -exec rm {} \; | |
49 | find . -name '*.hi' -exec rm {} \; | |
50 | find . -name '*.jsmod' -exec rm {} \; | |
51 | find pkg -name '*.robin' -exec rm {} \; | |
52 | rm -rf dist-newstyle | |
53 | rm -f .ghc.environment.* |
28 | 28 | To use it, you'll need an implementation of Haskell installed (typically either |
29 | 29 | `ghc` or Hugs). |
30 | 30 | |
31 | If you have [shelf][] installed, you can just run `shelf_dockgh catseye/Robin`. | |
31 | First, clone this repository and `cd` into the repo directory. Then run | |
32 | 32 | |
33 | If not, you can clone this repository, `cd` into the repo directory, and run | |
33 | make | |
34 | 34 | |
35 | ./build.sh | |
35 | If you have `cabal` installed, the Makefile will use it to build the `robin` | |
36 | executable, and this will take care of obtaining and building the dependencies. | |
36 | 37 | |
37 | to build the reference interpreter. (If you don't have `ghc`, no executable will | |
38 | be built, but the `bin/robin` script will use `runhaskell` or `runhugs` instead.) | |
38 | If you do not have `cabal`, the Makefile will use `ghc` directly to build the | |
39 | executable, but in this case, you will need to ensure you have dependencies | |
40 | like `parsec` and `random` installed, yourself. | |
39 | 41 | |
40 | You can then run it on one of the example Robin sources in `eg` like so: | |
42 | (If you don't have `ghc` at all, no executable will be built; but that's OK, | |
43 | because in this case the `bin/robin` driver script will fall back to using | |
44 | `runhaskell` or `runhugs` instead.) | |
45 | ||
46 | In any case, the Makefile will also build build the standard library | |
47 | (`pkg/stdlib.robin`). And this same Makefile can be used to build the | |
48 | JavaScript version of the interpreter, with `make web`. | |
49 | ||
50 | After running `make`, you can run the Robin interpreter using the | |
51 | driver script in `bin`, on one of the example Robin sources in `eg` like so: | |
41 | 52 | |
42 | 53 | bin/robin pkg/stdlib.robin eg/hello-world.robin |
43 | 54 | |
52 | 63 | ------- |
53 | 64 | |
54 | 65 | If you have a few minutes to spare, and you have [Falderal][] installed, |
55 | you can run the test suite (consisting of more than 400 unit tests) by running | |
66 | you can run the test suite (consisting of more than 600 unit tests) by running | |
56 | 67 | |
57 | 68 | ./test.sh |
58 | 69 |
0 | -- Initial Robin.cabal generated by cabal init. For further documentation, | |
1 | -- see http://haskell.org/cabal/users-guide/ | |
2 | ||
3 | name: Robin | |
4 | version: 0.8 | |
5 | synopsis: Experimental language where both functions and macros are defined in terms of fexprs | |
6 | -- description: | |
7 | homepage: https://catseye.tc/node/Robin | |
8 | license: BSD3 | |
9 | license-file: LICENSE | |
10 | author: Chris Pressey | |
11 | maintainer: cpressey@catseye.tc | |
12 | -- copyright: | |
13 | category: Language | |
14 | build-type: Simple | |
15 | extra-source-files: HISTORY.md, README.md | |
16 | cabal-version: >=1.10 | |
17 | ||
18 | executable robin | |
19 | main-is: Main.hs | |
20 | other-modules: | |
21 | Language.Robin.Builtins | |
22 | Language.Robin.CmdLine | |
23 | Language.Robin.Env | |
24 | Language.Robin.Eval | |
25 | Language.Robin.EventLoop | |
26 | Language.Robin.Expr | |
27 | Language.Robin.Facilities | |
28 | Language.Robin.Facilities.Concurrent | |
29 | Language.Robin.Facilities.LineTerminal | |
30 | Language.Robin.Facilities.RandomSource | |
31 | Language.Robin.Intrinsics | |
32 | Language.Robin.Parser | |
33 | Language.Robin.Reactor | |
34 | Language.Robin.TopLevel | |
35 | other-extensions: FlexibleContexts | |
36 | build-depends: base >=4.9 && <=4.16, QuickCheck >=2.13 && <2.14, random >=1.1 && <1.2, parsec >=3.1 && <3.2 | |
37 | hs-source-dirs: src | |
38 | default-language: Haskell98 |
116 | 116 | |
117 | 117 | Rename `fun` to `function`. This is because Robin prefers full words |
118 | 118 | over abbreviations, which are jargon-y. |
119 | ||
120 | Distribution | |
121 | ------------ | |
122 | ||
123 | Probably need to bite the bullet and add a `cabal` or `stack` | |
124 | package descriptor. | |
125 | ||
126 | cabal install random-1.1 | |
127 | cabal install parsec-3.1.1 | |
128 | cabal install QuickCheck-2.13.2 | |
129 |
0 | The following functionalities are used to test Robin Expressions. | |
1 | ||
2 | -> Functionality "Evaluate core Robin Expression" is implemented by shell command | |
3 | -> "bin/robin eval %(test-body-file)" | |
4 | ||
5 | -> Functionality "Evaluate Robin Expression (with literal)" is implemented by shell command | |
6 | -> "bin/robin stdlib/literal.robin eval %(test-body-file)" | |
7 | ||
8 | -> Functionality "Evaluate Robin Expression (with literal and bind)" is implemented by shell command | |
9 | -> "bin/robin stdlib/literal.robin stdlib/bind.robin eval %(test-body-file)" | |
10 | ||
11 | -> Functionality "Evaluate Robin Expression (with literal and bind and list)" is implemented by shell command | |
12 | -> "bin/robin stdlib/literal.robin stdlib/bind.robin stdlib/list.robin eval %(test-body-file)" | |
13 | ||
14 | -> Functionality "Evaluate Robin Expression (with Small)" is implemented by shell command | |
15 | -> "bin/robin pkg/small.robin eval %(test-body-file)" | |
16 | ||
17 | -> Functionality "Evaluate Robin Expression (with List)" is implemented by shell command | |
18 | -> "bin/robin pkg/small.robin pkg/list.robin eval %(test-body-file)" | |
19 | ||
20 | -> Functionality "Evaluate Robin Expression (with Env)" is implemented by shell command | |
21 | -> "bin/robin pkg/small.robin pkg/list.robin pkg/env.robin eval %(test-body-file)" | |
22 | ||
23 | -> Functionality "Evaluate Robin Expression (with Boolean)" is implemented by shell command | |
24 | -> "bin/robin pkg/small.robin pkg/boolean.robin eval %(test-body-file)" | |
25 | ||
26 | -> Functionality "Evaluate Robin Expression (with Arith)" is implemented by shell command | |
27 | -> "bin/robin pkg/small.robin pkg/arith.robin eval %(test-body-file)" | |
28 | ||
29 | -> Functionality "Evaluate Robin Expression (with Stdlib)" is implemented by shell command | |
30 | -> "bin/robin pkg/stdlib.robin eval %(test-body-file)" | |
31 | ||
32 | The following functionalities are used to test Robin Toplevel programs. | |
33 | ||
34 | -> Functionality "Execute core Robin Toplevel Program" is implemented by shell command | |
35 | -> "bin/robin %(test-body-file)" | |
36 | ||
37 | -> Functionality "Execute Robin Toplevel Program (with Small)" is implemented by shell command | |
38 | -> "bin/robin pkg/small.robin %(test-body-file)" | |
39 | ||
40 | -> Functionality "Execute Robin Toplevel Program (with Stdlib)" is implemented by shell command | |
41 | -> "bin/robin pkg/stdlib.robin %(test-body-file)" |
0 | The following functionalities are used to test Robin Expressions. | |
1 | ||
2 | -> Functionality "Evaluate core Robin Expression" is implemented by shell command | |
3 | -> "bin/robin.exe eval %(test-body-file)" | |
4 | ||
5 | -> Functionality "Evaluate Robin Expression (with literal)" is implemented by shell command | |
6 | -> "bin/robin.exe stdlib/literal.robin eval %(test-body-file)" | |
7 | ||
8 | -> Functionality "Evaluate Robin Expression (with literal and bind)" is implemented by shell command | |
9 | -> "bin/robin.exe stdlib/literal.robin stdlib/bind.robin eval %(test-body-file)" | |
10 | ||
11 | -> Functionality "Evaluate Robin Expression (with literal and bind and list)" is implemented by shell command | |
12 | -> "bin/robin.exe stdlib/literal.robin stdlib/bind.robin stdlib/list.robin eval %(test-body-file)" | |
13 | ||
14 | -> Functionality "Evaluate Robin Expression (with Small)" is implemented by shell command | |
15 | -> "bin/robin.exe pkg/small.robin eval %(test-body-file)" | |
16 | ||
17 | -> Functionality "Evaluate Robin Expression (with List)" is implemented by shell command | |
18 | -> "bin/robin.exe pkg/small.robin pkg/list.robin eval %(test-body-file)" | |
19 | ||
20 | -> Functionality "Evaluate Robin Expression (with Env)" is implemented by shell command | |
21 | -> "bin/robin.exe pkg/small.robin pkg/list.robin pkg/env.robin eval %(test-body-file)" | |
22 | ||
23 | -> Functionality "Evaluate Robin Expression (with Boolean)" is implemented by shell command | |
24 | -> "bin/robin.exe pkg/small.robin pkg/boolean.robin eval %(test-body-file)" | |
25 | ||
26 | -> Functionality "Evaluate Robin Expression (with Arith)" is implemented by shell command | |
27 | -> "bin/robin.exe pkg/small.robin pkg/arith.robin eval %(test-body-file)" | |
28 | ||
29 | -> Functionality "Evaluate Robin Expression (with Stdlib)" is implemented by shell command | |
30 | -> "bin/robin.exe pkg/stdlib.robin eval %(test-body-file)" | |
31 | ||
32 | The following functionalities are used to test Robin Toplevel programs. | |
33 | ||
34 | -> Functionality "Execute core Robin Toplevel Program" is implemented by shell command | |
35 | -> "bin/robin.exe %(test-body-file)" | |
36 | ||
37 | -> Functionality "Execute Robin Toplevel Program (with Small)" is implemented by shell command | |
38 | -> "bin/robin.exe pkg/small.robin %(test-body-file)" | |
39 | ||
40 | -> Functionality "Execute Robin Toplevel Program (with Stdlib)" is implemented by shell command | |
41 | -> "bin/robin.exe pkg/stdlib.robin %(test-body-file)" |
0 | The following functionalities are used to test Robin Expressions. | |
1 | ||
2 | -> Functionality "Evaluate core Robin Expression" is implemented by shell command | |
3 | -> "bin/robin.exe --enable-builtins eval %(test-body-file)" | |
4 | ||
5 | -> Functionality "Evaluate Robin Expression (with literal)" is implemented by shell command | |
6 | -> "bin/robin.exe --enable-builtins stdlib/literal.robin eval %(test-body-file)" | |
7 | ||
8 | -> Functionality "Evaluate Robin Expression (with literal and bind)" is implemented by shell command | |
9 | -> "bin/robin.exe --enable-builtins stdlib/literal.robin stdlib/bind.robin eval %(test-body-file)" | |
10 | ||
11 | -> Functionality "Evaluate Robin Expression (with literal and bind and list)" is implemented by shell command | |
12 | -> "bin/robin.exe --enable-builtins stdlib/literal.robin stdlib/bind.robin stdlib/list.robin eval %(test-body-file)" | |
13 | ||
14 | -> Functionality "Evaluate Robin Expression (with Small)" is implemented by shell command | |
15 | -> "bin/robin.exe --enable-builtins pkg/small.robin eval %(test-body-file)" | |
16 | ||
17 | -> Functionality "Evaluate Robin Expression (with List)" is implemented by shell command | |
18 | -> "bin/robin.exe --enable-builtins pkg/list.robin eval %(test-body-file)" | |
19 | ||
20 | -> Functionality "Evaluate Robin Expression (with Env)" is implemented by shell command | |
21 | -> "bin/robin.exe --enable-builtins pkg/list.robin pkg/env.robin eval %(test-body-file)" | |
22 | ||
23 | -> Functionality "Evaluate Robin Expression (with Boolean)" is implemented by shell command | |
24 | -> "bin/robin.exe --enable-builtins pkg/boolean.robin eval %(test-body-file)" | |
25 | ||
26 | -> Functionality "Evaluate Robin Expression (with Arith)" is implemented by shell command | |
27 | -> "bin/robin.exe --enable-builtins pkg/arith.robin eval %(test-body-file)" | |
28 | ||
29 | -> Functionality "Evaluate Robin Expression (with Stdlib)" is implemented by shell command | |
30 | -> "bin/robin.exe --enable-builtins pkg/stdlib.robin eval %(test-body-file)" | |
31 | ||
32 | The following functionalities are used to test Robin Toplevel programs. | |
33 | ||
34 | -> Functionality "Execute core Robin Toplevel Program" is implemented by shell command | |
35 | -> "bin/robin.exe --enable-builtins %(test-body-file)" | |
36 | ||
37 | -> Functionality "Execute Robin Toplevel Program (with Small)" is implemented by shell command | |
38 | -> "bin/robin.exe --enable-builtins %(test-body-file)" | |
39 | ||
40 | -> Functionality "Execute Robin Toplevel Program (with Stdlib)" is implemented by shell command | |
41 | -> "bin/robin.exe --enable-builtins pkg/stdlib.robin %(test-body-file)" |
0 | The following functionalities are used to test Robin Expressions. | |
1 | ||
2 | -> Functionality "Evaluate core Robin Expression" is implemented by shell command | |
3 | -> "bin/robin --enable-builtins eval %(test-body-file)" | |
4 | ||
5 | -> Functionality "Evaluate Robin Expression (with literal)" is implemented by shell command | |
6 | -> "bin/robin --enable-builtins stdlib/literal.robin eval %(test-body-file)" | |
7 | ||
8 | -> Functionality "Evaluate Robin Expression (with literal and bind)" is implemented by shell command | |
9 | -> "bin/robin --enable-builtins stdlib/literal.robin stdlib/bind.robin eval %(test-body-file)" | |
10 | ||
11 | -> Functionality "Evaluate Robin Expression (with literal and bind and list)" is implemented by shell command | |
12 | -> "bin/robin --enable-builtins stdlib/literal.robin stdlib/bind.robin stdlib/list.robin eval %(test-body-file)" | |
13 | ||
14 | -> Functionality "Evaluate Robin Expression (with Small)" is implemented by shell command | |
15 | -> "bin/robin --enable-builtins pkg/small.robin eval %(test-body-file)" | |
16 | ||
17 | -> Functionality "Evaluate Robin Expression (with List)" is implemented by shell command | |
18 | -> "bin/robin --enable-builtins pkg/list.robin eval %(test-body-file)" | |
19 | ||
20 | -> Functionality "Evaluate Robin Expression (with Env)" is implemented by shell command | |
21 | -> "bin/robin --enable-builtins pkg/list.robin pkg/env.robin eval %(test-body-file)" | |
22 | ||
23 | -> Functionality "Evaluate Robin Expression (with Boolean)" is implemented by shell command | |
24 | -> "bin/robin --enable-builtins pkg/boolean.robin eval %(test-body-file)" | |
25 | ||
26 | -> Functionality "Evaluate Robin Expression (with Arith)" is implemented by shell command | |
27 | -> "bin/robin --enable-builtins pkg/arith.robin eval %(test-body-file)" | |
28 | ||
29 | -> Functionality "Evaluate Robin Expression (with Stdlib)" is implemented by shell command | |
30 | -> "bin/robin --enable-builtins pkg/stdlib.robin eval %(test-body-file)" | |
31 | ||
32 | The following functionalities are used to test Robin Toplevel programs. | |
33 | ||
34 | -> Functionality "Execute core Robin Toplevel Program" is implemented by shell command | |
35 | -> "bin/robin --enable-builtins %(test-body-file)" | |
36 | ||
37 | -> Functionality "Execute Robin Toplevel Program (with Small)" is implemented by shell command | |
38 | -> "bin/robin --enable-builtins %(test-body-file)" | |
39 | ||
40 | -> Functionality "Execute Robin Toplevel Program (with Stdlib)" is implemented by shell command | |
41 | -> "bin/robin --enable-builtins pkg/stdlib.robin %(test-body-file)" |
0 | The following functionalities are used to test Robin Expressions. | |
1 | ||
2 | -> Functionality "Evaluate core Robin Expression" is implemented by shell command | |
3 | -> "runhaskell -isrc src/Main.hs --enable-builtins eval %(test-body-file)" | |
4 | ||
5 | -> Functionality "Evaluate Robin Expression (with literal)" is implemented by shell command | |
6 | -> "runhaskell -isrc src/Main.hs --enable-builtins stdlib/literal.robin eval %(test-body-file)" | |
7 | ||
8 | -> Functionality "Evaluate Robin Expression (with literal and bind)" is implemented by shell command | |
9 | -> "runhaskell -isrc src/Main.hs --enable-builtins stdlib/literal.robin stdlib/bind.robin eval %(test-body-file)" | |
10 | ||
11 | -> Functionality "Evaluate Robin Expression (with literal and bind and list)" is implemented by shell command | |
12 | -> "runhaskell -isrc src/Main.hs --enable-builtins stdlib/literal.robin stdlib/bind.robin stdlib/list.robin eval %(test-body-file)" | |
13 | ||
14 | -> Functionality "Evaluate Robin Expression (with Small)" is implemented by shell command | |
15 | -> "runhaskell -isrc src/Main.hs --enable-builtins pkg/small.robin eval %(test-body-file)" | |
16 | ||
17 | -> Functionality "Evaluate Robin Expression (with List)" is implemented by shell command | |
18 | -> "runhaskell -isrc src/Main.hs --enable-builtins pkg/list.robin eval %(test-body-file)" | |
19 | ||
20 | -> Functionality "Evaluate Robin Expression (with Env)" is implemented by shell command | |
21 | -> "runhaskell -isrc src/Main.hs --enable-builtins pkg/list.robin pkg/env.robin eval %(test-body-file)" | |
22 | ||
23 | -> Functionality "Evaluate Robin Expression (with Boolean)" is implemented by shell command | |
24 | -> "runhaskell -isrc src/Main.hs --enable-builtins pkg/boolean.robin eval %(test-body-file)" | |
25 | ||
26 | -> Functionality "Evaluate Robin Expression (with Arith)" is implemented by shell command | |
27 | -> "runhaskell -isrc src/Main.hs --enable-builtins pkg/arith.robin eval %(test-body-file)" | |
28 | ||
29 | -> Functionality "Evaluate Robin Expression (with Stdlib)" is implemented by shell command | |
30 | -> "runhaskell -isrc src/Main.hs --enable-builtins pkg/stdlib.robin eval %(test-body-file)" | |
31 | ||
32 | The following functionalities are used to test Robin Toplevel programs. | |
33 | ||
34 | -> Functionality "Execute core Robin Toplevel Program" is implemented by shell command | |
35 | -> "runhaskell -isrc src/Main.hs --enable-builtins %(test-body-file)" | |
36 | ||
37 | -> Functionality "Execute Robin Toplevel Program (with Small)" is implemented by shell command | |
38 | -> "runhaskell -isrc src/Main.hs --enable-builtins %(test-body-file)" | |
39 | ||
40 | -> Functionality "Execute Robin Toplevel Program (with Stdlib)" is implemented by shell command | |
41 | -> "runhaskell -isrc src/Main.hs --enable-builtins pkg/stdlib.robin %(test-body-file)" |
0 | The following functionalities are used to test Robin Expressions. | |
1 | ||
2 | -> Functionality "Evaluate core Robin Expression" is implemented by shell command | |
3 | -> "runhugs -isrc src/HugsMain.hs --enable-builtins eval %(test-body-file)" | |
4 | ||
5 | -> Functionality "Evaluate Robin Expression (with literal)" is implemented by shell command | |
6 | -> "runhugs -isrc src/HugsMain.hs --enable-builtins stdlib/literal.robin eval %(test-body-file)" | |
7 | ||
8 | -> Functionality "Evaluate Robin Expression (with literal and bind)" is implemented by shell command | |
9 | -> "runhugs -isrc src/HugsMain.hs --enable-builtins stdlib/literal.robin stdlib/bind.robin eval %(test-body-file)" | |
10 | ||
11 | -> Functionality "Evaluate Robin Expression (with literal and bind and list)" is implemented by shell command | |
12 | -> "runhugs -isrc src/HugsMain.hs --enable-builtins stdlib/literal.robin stdlib/bind.robin stdlib/list.robin eval %(test-body-file)" | |
13 | ||
14 | -> Functionality "Evaluate Robin Expression (with Small)" is implemented by shell command | |
15 | -> "runhugs -isrc src/HugsMain.hs --enable-builtins pkg/small.robin eval %(test-body-file)" | |
16 | ||
17 | -> Functionality "Evaluate Robin Expression (with List)" is implemented by shell command | |
18 | -> "runhugs -isrc src/HugsMain.hs --enable-builtins pkg/list.robin eval %(test-body-file)" | |
19 | ||
20 | -> Functionality "Evaluate Robin Expression (with Env)" is implemented by shell command | |
21 | -> "runhugs -isrc src/HugsMain.hs --enable-builtins pkg/list.robin pkg/env.robin eval %(test-body-file)" | |
22 | ||
23 | -> Functionality "Evaluate Robin Expression (with Boolean)" is implemented by shell command | |
24 | -> "runhugs -isrc src/HugsMain.hs --enable-builtins pkg/boolean.robin eval %(test-body-file)" | |
25 | ||
26 | -> Functionality "Evaluate Robin Expression (with Arith)" is implemented by shell command | |
27 | -> "runhugs -isrc src/HugsMain.hs --enable-builtins pkg/arith.robin eval %(test-body-file)" | |
28 | ||
29 | -> Functionality "Evaluate Robin Expression (with Stdlib)" is implemented by shell command | |
30 | -> "runhugs -isrc src/HugsMain.hs --enable-builtins pkg/stdlib.robin eval %(test-body-file)" | |
31 | ||
32 | The following functionalities are used to test Robin Toplevel programs. | |
33 | ||
34 | -> Functionality "Execute core Robin Toplevel Program" is implemented by shell command | |
35 | -> "runhugs -isrc src/HugsMain.hs --enable-builtins %(test-body-file)" | |
36 | ||
37 | -> Functionality "Execute Robin Toplevel Program (with Small)" is implemented by shell command | |
38 | -> "runhugs -isrc src/HugsMain.hs --enable-builtins %(test-body-file)" | |
39 | ||
40 | -> Functionality "Execute Robin Toplevel Program (with Stdlib)" is implemented by shell command | |
41 | -> "runhugs -isrc src/HugsMain.hs --enable-builtins pkg/stdlib.robin %(test-body-file)" |
0 | #!/bin/sh | |
1 | ||
2 | PROG=robin | |
3 | ||
4 | if command -v ghc >/dev/null 2>&1; then | |
5 | echo "building $PROG.exe with ghc" | |
6 | (cd src && ghc --make Main.hs -o ../bin/$PROG.exe) || exit 1 | |
7 | else | |
8 | echo "ghc not found, not building $PROG.exe" | |
9 | fi | |
10 | ||
11 | # For this to work, you need hastec installed. | |
12 | # You also need parsec installed in a way that haste can use it: | |
13 | # | |
14 | # haste-cabal install parsec-3.1.1 | |
15 | # | |
16 | # Later versions might not work. For example, 3.1.13.0 fails to build for me at: | |
17 | # Preprocessing library generic-deriving-1.12.3... | |
18 | # src/Generics/Deriving/TH/Pre4_9.hs:177:20: | |
19 | # parse error on input ‘->’ | |
20 | # | |
21 | # You also need random installed in a way that haste can use it: | |
22 | # | |
23 | # haste-cabal install random-1.1 | |
24 | # | |
25 | ||
26 | if command -v hastec >/dev/null 2>&1; then | |
27 | echo "building $PROG.js with hastec" | |
28 | (cd src && hastec --make HasteMain.hs -o $PROG.js && mv $PROG.js ../demo/$PROG.js) || exit 1 | |
29 | else | |
30 | echo "hastec not found, not building $PROG.js" | |
31 | fi | |
32 | ||
33 | ./build-packages.sh |
0 | #!/bin/sh | |
1 | ||
2 | find . -name "*.o" -exec rm {} \; | |
3 | find . -name "*.hi" -exec rm {} \; | |
4 | find . -name "*.jsmod" -exec rm {} \; | |
5 | find . -name "*.exe" -exec rm {} \; | |
6 | rm -rf pkg/*.robin demo/robin.js |
0 | function launch(config) { | |
1 | config.container.innerHTML = ` | |
2 | <textarea id="prog" rows="10" cols="80"></textarea> | |
3 | <div id="control-panel"></div> | |
4 | <div><button id="run-button">Run</button></div> | |
5 | <pre id="result"></pre> | |
6 | `; | |
7 | ||
8 | function makeSelect(container, labelText, optionsArray, fun) { | |
9 | var label = document.createElement('label'); | |
10 | label.innerHTML = labelText; | |
11 | container.appendChild(label); | |
12 | var select = document.createElement("select"); | |
13 | for (var i = 0; i < optionsArray.length; i++) { | |
14 | var op = document.createElement("option"); | |
15 | op.text = optionsArray[i].filename; | |
16 | op.value = optionsArray[i].contents; | |
17 | select.options.add(op); | |
18 | } | |
19 | select.onchange = function(e) { | |
20 | fun(optionsArray[select.selectedIndex]); | |
21 | }; | |
22 | select.selectedIndex = 0; | |
23 | label.appendChild(select); | |
24 | return select; | |
25 | }; | |
26 | ||
27 | function selectOptionByText(selectElem, text) { | |
28 | var optElem; | |
29 | for (var i = 0; optElem = selectElem.options[i]; i++) { | |
30 | if (optElem.text === text) { | |
31 | selectElem.selectedIndex = i; | |
32 | selectElem.dispatchEvent(new Event('change')); | |
33 | return; | |
34 | } | |
35 | } | |
36 | } | |
37 | ||
38 | var controlPanel = document.getElementById('control-panel'); | |
39 | var select = makeSelect(controlPanel, "example program:", examplePrograms, function(option) { | |
40 | document.getElementById('prog').value = option.contents; | |
41 | }); | |
42 | selectOptionByText(select, config.initialOption); | |
43 | } |
12 | 12 | <pre id="result"></pre> |
13 | 13 | </div> |
14 | 14 | |
15 | <script src="../eg/examplePrograms.jsonp.js"></script> | |
16 | <script src="hastec-launcher.js"></script> | |
15 | 17 | <script src="robin.js"></script> |
18 | <script> | |
19 | launch({ | |
20 | container: document.getElementById('installation'), | |
21 | initialOption: "fact.robin" | |
22 | }); | |
23 | </script> | |
16 | 24 | </body> |
7 | 7 | |
8 | 8 | For normative definitions of the symbols in the standard library, |
9 | 9 | see the definition files in the [stdlib directory](../stdlib/). |
10 | ||
11 | License | |
12 | ------- | |
13 | ||
14 | All documentation and tests for Robin are covered by the following | |
15 | BSD-compatible license, modelled after the "Report on the Programming | |
16 | Language Haskell 98" license: | |
17 | ||
18 | Copyright (c)2012-2021 Chris Pressey, Cat's Eye Technologies. | |
19 | ||
20 | The authors intend this Report to belong to the entire Robin | |
21 | community, and so we grant permission to copy and distribute it for | |
22 | any purpose, provided that it is reproduced in its entirety, | |
23 | including this Notice. Modified versions of this Report may also be | |
24 | copied and distributed for any purpose, provided that the modified | |
25 | version is clearly presented as such, and that it does not claim to | |
26 | be a definition of the Robin Programming Language. |
0 | The Robin programs in this directory are in the public domain. |
0 | examplePrograms = [ | |
1 | { | |
2 | "contents": "(define a 1)\n(define b 1)\n(assert (equal? (subtract a b) 99))\n", | |
3 | "filename": "assertion.robin" | |
4 | }, | |
5 | { | |
6 | "contents": ";''Example of a recursive fexpr. It takes a list of bindings a la `let`\n and returns a snippet of code `bind`ing those values. This is actually\n how `let` is now defined in the stdlib.''\n\n(define expand-let (fexpr (args env)\n (bind body (head (tail args))\n (bind expand-let-r (fexpr (iargs ienv)\n (bind self (eval ienv (head iargs))\n (bind items (eval ienv (head (tail iargs)))\n (if (equal? items ())\n body\n (prepend (literal bind)\n (prepend (head (head items))\n (prepend (head (tail (head items)))\n (prepend (self self (tail items))\n ()))))))))\n (expand-let-r expand-let-r (head args))))))\n\n(display (expand-let ((a 1) (b 2) (c 3)) foo))\n", | |
7 | "filename": "expand-let.robin" | |
8 | }, | |
9 | { | |
10 | "contents": ";''Example of a recursive function.''\n\n(define fact (fun (self n)\n (multiply n\n (if (gt? n 1)\n (self self (subtract n 1))\n 1))))\n(display (fact fact 5))\n", | |
11 | "filename": "fact.robin" | |
12 | } | |
13 | ]; |
0 | 0 | #!/bin/sh |
1 | 1 | |
2 | 2 | if [ "${NOBUILD}x" = "x" ]; then |
3 | ./build.sh || exit 1 | |
3 | ./build-packages.sh || exit 1 | |
4 | 4 | fi |
5 | 5 | |
6 | # | |
7 | # `bin/robin` is a shell script wrapper which is intended to be convenient | |
8 | # for command-line usage, but it is not used by this test driver. | |
9 | # | |
10 | # Instead, this test driver finds different implementations of robin | |
11 | # and uses Falderal appliances to test each of those implementations. | |
12 | # | |
13 | # It does not test under `runhaskell` by default because it's quite slow | |
14 | # (slower than `runhugs`, even), and largely redundant if you have built | |
15 | # an executable with the same `ghc` that `runhaskell` will be using. | |
16 | # But you can supply your own list of appliances in the `APPLIANCES` | |
17 | # env var, and include `appliances/runhaskell-robin.md` in it if you like. | |
18 | # | |
19 | ||
6 | 20 | if [ "${APPLIANCES}x" = "x" ]; then |
7 | APPLIANCES="appliances/robin.md appliances/robin-no-builtins.md" | |
21 | if [ -x "bin/robin.exe" ]; then | |
22 | APPLIANCES="${APPLIANCES} appliances/robin.exe.md appliances/robin.exe-no-builtins.md" | |
23 | fi | |
24 | if command -v runhugs 2>&1 >/dev/null ; then | |
25 | APPLIANCES="${APPLIANCES} appliances/runhugs-robin.md" | |
26 | fi | |
8 | 27 | fi |
28 | echo "Implementations under test: ${APPLIANCES}" | |
9 | 29 | |
10 | 30 | if [ "${FALDERAL}x" = "x" ]; then |
11 | 31 | FALDERAL="falderal -b" |
19 | 39 | fi |
20 | 40 | |
21 | 41 | for PACKAGE in $PACKAGES; do |
22 | echo "Running tests on '$PACKAGE' package..." | |
23 | $FALDERAL $APPLIANCES pkg/$PACKAGE.robin || exit 1 | |
42 | echo "Running tests on '$PACKAGE' package..." | |
43 | $FALDERAL $APPLIANCES pkg/$PACKAGE.robin || exit 1 | |
24 | 44 | done |
25 | 45 | |
26 | if [ "x$FORCE_HUGS" != "x" ] ; then | |
27 | echo "Can't run QuickCheck tests with Hugs, skipping" | |
28 | elif command -v runhaskell 2>&1 >/dev/null ; then | |
29 | runhaskell -isrc src/QuickCheckTests.hs || exit 1 | |
46 | if command -v runhaskell 2>&1 >/dev/null ; then | |
47 | runhaskell -isrc src/QuickCheckTests.hs || exit 1 | |
48 | else | |
49 | echo "No runhaskell available, not running QuickCheck tests." | |
30 | 50 | fi |