Skip to content

Commit 0818cfa

Browse files
authored
Merge pull request #459 from yamacir-kit/release-candidate
Release candidate
2 parents 6e7e2f9 + 73a7739 commit 0818cfa

39 files changed

+974
-612
lines changed

CMakeLists.txt

-5
Original file line numberDiff line numberDiff line change
@@ -180,11 +180,6 @@ endforeach()
180180

181181
execute_process(COMMAND nproc OUTPUT_VARIABLE ${PROJECT_NAME}_NPROC)
182182

183-
add_custom_target(install.deb
184-
COMMAND ${CMAKE_MAKE_PROGRAM} -j${${PROJECT_NAME}_NPROC}
185-
COMMAND ${CMAKE_MAKE_PROGRAM} package
186-
COMMAND sudo apt install ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}_${PROJECT_VERSION}_amd64.deb)
187-
188183
add_custom_target(develop
189184
COMMAND ${CMAKE_MAKE_PROGRAM} -j${${PROJECT_NAME}_NPROC}
190185
COMMAND ${CMAKE_MAKE_PROGRAM} test ARGS=-j${${PROJECT_NAME}_NPROC}

README.md

+31-26
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,26 @@
66

77
## Overview
88

9-
> Programming languages should be designed not by piling feature on top of feature, but by removing the weaknesses and restrictions that make additional features appear necessary.
10-
> <div align="right">Revised<sup>7</sup> Report on the Algorithmic Language Scheme [1]</div>
9+
> Programming languages should be designed not by piling feature on top of
10+
> feature, but by removing the weaknesses and restrictions that make additional
11+
> features appear necessary.
12+
> <div align="right">
13+
> Revised<sup>7</sup> Report on the Algorithmic Language Scheme [1]
14+
> </div>
1115
12-
Meevax is an implementation of Lisp-1 programming language, supporting subset of the [Scheme](http://www.scheme-reports.org/) (R7RS) and [SRFI](https://srfi.schemers.org/)s.
16+
Meevax is an implementation of Lisp-1 programming language, supporting subset
17+
of the [Scheme](http://www.scheme-reports.org/) (R7RS) and
18+
[SRFI](https://srfi.schemers.org/)s.
1319

1420
### Releases
1521

1622
Latest release is [here](https://github.com/yamacir-kit/meevax/releases).
1723

18-
<img src="https://github.com/yamacir-kit/meevax/actions/workflows/build.yaml/badge.svg"/>
19-
<img src="https://github.com/yamacir-kit/meevax/actions/workflows/release.yaml/badge.svg"/>
20-
2124
### Features
2225

23-
- Architecture - SECD machine.
24-
- Modern C++ compatible dynamic typing - Meevax provides RTTI-based language runtime library.
26+
- Architecture - SECD machine.
27+
- Modern C++ compatible dynamic typing - Meevax provides RTTI-based language
28+
runtime library.
2529

2630
### Standards
2731

@@ -51,24 +55,26 @@ Subset of R7RS-small.
5155
| [ 78](https://srfi.schemers.org/srfi-78/srfi-78.html) | Lightweight testing | [`(srfi 78)`](./basis/srfi-78.ss) | Except `check-ec` |
5256
| [ 87](https://srfi.schemers.org/srfi-87/srfi-87.html) | => in case clauses | | R7RS 4.2.1 |
5357
| [ 98](https://srfi.schemers.org/srfi-98/srfi-98.html) | An interface to access environment variables | [`(srfi 98)`](./basis/srfi-98.ss) | R7RS 6.14 |
58+
| [111](https://srfi.schemers.org/srfi-111/srfi-111.html) | Boxes | [`(srfi 111)`](./basis/srfi-111.ss) | |
5459
| [149](https://srfi.schemers.org/srfi-149/srfi-149.html) | Basic syntax-rules template extensions | [`(srfi 149)`](./basis/srfi-149.ss) | R7RS 4.3.2 |
5560

5661
## Installation
5762

5863
### Requirements
5964

60-
- [GCC](https://gcc.gnu.org/) (>= 9.4.0) or [Clang](https://clang.llvm.org/) (>= 11.0.0)
61-
- [CMake](https://cmake.org/) (>= 3.16.3)
62-
- [GNU Make](http://savannah.gnu.org/projects/make)
63-
- [GNU Binutils](https://www.gnu.org/software/binutils/)
64-
- [GNU Multiple Precision Arithmetic Library (GMP)](https://gmplib.org/)
65+
- [GCC](https://gcc.gnu.org/) (>= 9.4.0) or [Clang](https://clang.llvm.org/) (>= 11.0.0)
66+
- [CMake](https://cmake.org/) (>= 3.16.3)
67+
- [GNU Make](http://savannah.gnu.org/projects/make)
68+
- [GNU Binutils](https://www.gnu.org/software/binutils/)
69+
- [GNU Multiple Precision Arithmetic Library (GMP)](https://gmplib.org/)
6570

6671
### Install
6772

6873
``` bash
6974
cmake -B build -DCMAKE_BUILD_TYPE=Release
7075
cd build
71-
make install.deb
76+
make package
77+
sudo apt install build/meevax_0.4.779_amd64.deb
7278
```
7379

7480
or
@@ -81,7 +87,7 @@ make install
8187

8288
### Uninstall
8389

84-
If you installed with `make install.deb`,
90+
If you installed with `sudo apt install`,
8591

8692
``` bash
8793
sudo apt remove meevax
@@ -98,18 +104,17 @@ sudo rm -rf /usr/local/share/meevax
98104

99105
### CMake targets
100106

101-
| Target Name | Description
102-
|--------------------|---
103-
| `all` (default) | Build shared-library `libmeevax.0.4.752.so` and executable `meevax`
104-
| `test` | Test executable `meevax`
105-
| `package` | Generate debian package `meevax_0.4.752_amd64.deb`
106-
| `install` | Copy files into `/usr/local`
107-
| `install.deb` | `all` + `package` + `sudo apt install <meevax>.deb`
107+
| Target Name | Description
108+
|-----------------|-------------
109+
| `all` (default) | Build shared-library `libmeevax.0.4.779.so` and executable `meevax`
110+
| `test` | Test executable `meevax`
111+
| `package` | Generate debian package `meevax_0.4.779_amd64.deb`
112+
| `install` | Copy files into `/usr/local` directly
108113

109114
## Usage
110115

111116
```
112-
Meevax Lisp 0.4.752
117+
Meevax Lisp 0.4.779
113118
114119
Usage:
115120
meevax [option...] [file...]
@@ -134,6 +139,6 @@ See [LICENSE](./LICENSE).
134139

135140
### Resources
136141

137-
* [Chibi-Scheme](https://github.com/ashinn/chibi-scheme)
138-
* [SECDR-Scheme](http://www.maroon.dti.ne.jp/nagar17/mulasame/)
139-
* [TinyScheme](http://tinyscheme.sourceforge.net/)
142+
* [Chibi-Scheme](https://github.com/ashinn/chibi-scheme)
143+
* [SECDR-Scheme](http://www.maroon.dti.ne.jp/nagar17/mulasame/)
144+
* [TinyScheme](http://tinyscheme.sourceforge.net/)

VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.4.752
1+
0.4.779

basis/meevax.ss

+1-8
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
(define-library (meevax macro-transformer)
22
(import (only (meevax comparator) eq? eqv?)
33
(only (meevax core) begin define if lambda quote set!)
4-
(only (meevax list) null?)
4+
(only (meevax list) assq null?)
55
(only (meevax pair) cons car cdr caar cdar)
66
(only (meevax syntactic-closure) identifier? syntactic-closure? make-syntactic-closure))
77

@@ -20,13 +20,6 @@
2020
(lambda (form use-env mac-env)
2121
(make-syntactic-closure use-env '() (f form mac-env))))
2222

23-
(define (assq x alist)
24-
(if (null? alist)
25-
#f
26-
(if (eq? x (caar alist))
27-
(car alist)
28-
(assq x (cdr alist)))))
29-
3023
(define (identifier=? environment1 identifier1
3124
environment2 identifier2)
3225
(eqv? (if (syntactic-closure? identifier1) identifier1 (make-syntactic-closure environment1 '() identifier1))

basis/r4rs-essential.ss

+1-10
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
(define-library (scheme r4rs essential)
22
(import (meevax character)
33
(meevax core)
4-
(meevax comparator)
4+
(only (meevax comparator) eq? eqv? equal?)
55
(meevax continuation)
66
(prefix (meevax environment) %)
77
(meevax function)
@@ -189,15 +189,6 @@
189189
(or (eq? x #t)
190190
(eq? x #f)))
191191

192-
(define (equal? x y)
193-
(if (and (pair? x)
194-
(pair? y))
195-
(and (equal? (car x)
196-
(car y))
197-
(equal? (cdr x)
198-
(cdr y)))
199-
(eqv? x y)))
200-
201192
(define (list? x)
202193
(let list? ((x x)
203194
(lag x))

basis/srfi-111.ss

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
(define-library (srfi 111)
2+
(import (meevax box))
3+
(export box box? (rename box-ref unbox) (rename box-set! set-box!)))

benchmark/ack.ss

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
(import (scheme base)
2+
(scheme write)
23
(scheme process-context))
34

45
(define (ack m n)
56
(cond ((= m 0) (+ n 1))
67
((= n 0) (ack (- m 1) 1))
78
(else (ack (- m 1) (ack m (- n 1))))))
89

9-
(ack 3 8)
10+
(display (ack 3 8))
11+
(newline)
1012

1113
(exit)

benchmark/tarai.ss

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
(import (scheme base)
2+
(scheme write)
23
(scheme process-context))
34

45
(define (tarai x y z)
@@ -7,6 +8,7 @@
78
(tarai (- y 1) z x)
89
(tarai (- z 1) x y))))
910

10-
(tarai 11 6 0)
11+
(display (tarai 11 6 0))
12+
(newline)
1113

1214
(exit)

configure/README.md

+30-25
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,26 @@
66

77
## Overview
88

9-
> Programming languages should be designed not by piling feature on top of feature, but by removing the weaknesses and restrictions that make additional features appear necessary.
10-
> <div align="right">Revised<sup>7</sup> Report on the Algorithmic Language Scheme [1]</div>
9+
> Programming languages should be designed not by piling feature on top of
10+
> feature, but by removing the weaknesses and restrictions that make additional
11+
> features appear necessary.
12+
> <div align="right">
13+
> Revised<sup>7</sup> Report on the Algorithmic Language Scheme [1]
14+
> </div>
1115
12-
Meevax is an implementation of Lisp-1 programming language, supporting subset of the [Scheme](http://www.scheme-reports.org/) (R7RS) and [SRFI](https://srfi.schemers.org/)s.
16+
Meevax is an implementation of Lisp-1 programming language, supporting subset
17+
of the [Scheme](http://www.scheme-reports.org/) (R7RS) and
18+
[SRFI](https://srfi.schemers.org/)s.
1319

1420
### Releases
1521

1622
Latest release is [here](https://github.com/yamacir-kit/meevax/releases).
1723

18-
<img src="https://github.com/yamacir-kit/meevax/actions/workflows/build.yaml/badge.svg"/>
19-
<img src="https://github.com/yamacir-kit/meevax/actions/workflows/release.yaml/badge.svg"/>
20-
2124
### Features
2225

23-
- Architecture - SECD machine.
24-
- Modern C++ compatible dynamic typing - Meevax provides RTTI-based language runtime library.
26+
- Architecture - SECD machine.
27+
- Modern C++ compatible dynamic typing - Meevax provides RTTI-based language
28+
runtime library.
2529

2630
### Standards
2731

@@ -51,24 +55,26 @@ Subset of R7RS-small.
5155
| [ 78](https://srfi.schemers.org/srfi-78/srfi-78.html) | Lightweight testing | [`(srfi 78)`](./basis/srfi-78.ss) | Except `check-ec` |
5256
| [ 87](https://srfi.schemers.org/srfi-87/srfi-87.html) | => in case clauses | | R7RS 4.2.1 |
5357
| [ 98](https://srfi.schemers.org/srfi-98/srfi-98.html) | An interface to access environment variables | [`(srfi 98)`](./basis/srfi-98.ss) | R7RS 6.14 |
58+
| [111](https://srfi.schemers.org/srfi-111/srfi-111.html) | Boxes | [`(srfi 111)`](./basis/srfi-111.ss) | |
5459
| [149](https://srfi.schemers.org/srfi-149/srfi-149.html) | Basic syntax-rules template extensions | [`(srfi 149)`](./basis/srfi-149.ss) | R7RS 4.3.2 |
5560

5661
## Installation
5762

5863
### Requirements
5964

60-
- [GCC](https://gcc.gnu.org/) (>= 9.4.0) or [Clang](https://clang.llvm.org/) (>= 11.0.0)
61-
- [CMake](https://cmake.org/) (>= ${CMAKE_MINIMUM_REQUIRED_VERSION})
62-
- [GNU Make](http://savannah.gnu.org/projects/make)
63-
- [GNU Binutils](https://www.gnu.org/software/binutils/)
64-
- [GNU Multiple Precision Arithmetic Library (GMP)](https://gmplib.org/)
65+
- [GCC](https://gcc.gnu.org/) (>= 9.4.0) or [Clang](https://clang.llvm.org/) (>= 11.0.0)
66+
- [CMake](https://cmake.org/) (>= ${CMAKE_MINIMUM_REQUIRED_VERSION})
67+
- [GNU Make](http://savannah.gnu.org/projects/make)
68+
- [GNU Binutils](https://www.gnu.org/software/binutils/)
69+
- [GNU Multiple Precision Arithmetic Library (GMP)](https://gmplib.org/)
6570

6671
### Install
6772

6873
``` bash
6974
cmake -B build -DCMAKE_BUILD_TYPE=Release
7075
cd build
71-
make install.deb
76+
make package
77+
sudo apt install build/${PROJECT_NAME}_${PROJECT_VERSION}_amd64.deb
7278
```
7379

7480
or
@@ -81,7 +87,7 @@ make install
8187

8288
### Uninstall
8389

84-
If you installed with `make install.deb`,
90+
If you installed with `sudo apt install`,
8591

8692
``` bash
8793
sudo apt remove meevax
@@ -98,13 +104,12 @@ sudo rm -rf ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}
98104

99105
### CMake targets
100106

101-
| Target Name | Description
102-
|--------------------|---
103-
| `all` (default) | Build shared-library `libmeevax.${PROJECT_VERSION}.so` and executable `meevax`
104-
| `test` | Test executable `meevax`
105-
| `package` | Generate debian package `meevax_${PROJECT_VERSION}_amd64.deb`
106-
| `install` | Copy files into `/usr/local`
107-
| `install.deb` | `all` + `package` + `sudo apt install <meevax>.deb`
107+
| Target Name | Description
108+
|-----------------|-------------
109+
| `all` (default) | Build shared-library `libmeevax.${PROJECT_VERSION}.so` and executable `meevax`
110+
| `test` | Test executable `meevax`
111+
| `package` | Generate debian package `meevax_${PROJECT_VERSION}_amd64.deb`
112+
| `install` | Copy files into `${CMAKE_INSTALL_PREFIX}` directly
108113

109114
## Usage
110115

@@ -122,6 +127,6 @@ See [LICENSE](./LICENSE).
122127

123128
### Resources
124129

125-
* [Chibi-Scheme](https://github.com/ashinn/chibi-scheme)
126-
* [SECDR-Scheme](http://www.maroon.dti.ne.jp/nagar17/mulasame/)
127-
* [TinyScheme](http://tinyscheme.sourceforge.net/)
130+
* [Chibi-Scheme](https://github.com/ashinn/chibi-scheme)
131+
* [SECDR-Scheme](http://www.maroon.dti.ne.jp/nagar17/mulasame/)
132+
* [TinyScheme](http://tinyscheme.sourceforge.net/)

configure/basis.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ inline namespace kernel
4444
R"##(${${PROJECT_NAME}_BASIS_srfi-45.ss})##",
4545
R"##(${${PROJECT_NAME}_BASIS_srfi-78.ss})##",
4646
R"##(${${PROJECT_NAME}_BASIS_srfi-98.ss})##",
47+
R"##(${${PROJECT_NAME}_BASIS_srfi-111.ss})##",
4748
R"##(${${PROJECT_NAME}_BASIS_srfi-149.ss})##",
4849
};
4950
}

include/meevax/kernel/box.hpp

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/*
2+
Copyright 2018-2023 Tatsuya Yamasaki.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
#ifndef INCLUDED_MEEVAX_KERNEL_BOX_HPP
18+
#define INCLUDED_MEEVAX_KERNEL_BOX_HPP
19+
20+
#include <meevax/kernel/pair.hpp>
21+
22+
namespace meevax
23+
{
24+
inline namespace kernel
25+
{
26+
struct box : public virtual pair // (value . unit)
27+
{
28+
using pair::pair;
29+
};
30+
31+
auto operator <<(std::ostream &, box const&) -> std::ostream &;
32+
} // namespace kernel
33+
} // namespace meevax
34+
35+
#endif // INCLUDED_MEEVAX_KERNEL_BOX_HPP

0 commit comments

Comments
 (0)