Skip to content

Commit

Permalink
Merge pull request #459 from yamacir-kit/release-candidate
Browse files Browse the repository at this point in the history
Release candidate
  • Loading branch information
yamacir-kit authored Sep 3, 2023
2 parents 6e7e2f9 + 73a7739 commit 0818cfa
Show file tree
Hide file tree
Showing 39 changed files with 974 additions and 612 deletions.
5 changes: 0 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -180,11 +180,6 @@ endforeach()

execute_process(COMMAND nproc OUTPUT_VARIABLE ${PROJECT_NAME}_NPROC)

add_custom_target(install.deb
COMMAND ${CMAKE_MAKE_PROGRAM} -j${${PROJECT_NAME}_NPROC}
COMMAND ${CMAKE_MAKE_PROGRAM} package
COMMAND sudo apt install ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}_${PROJECT_VERSION}_amd64.deb)

add_custom_target(develop
COMMAND ${CMAKE_MAKE_PROGRAM} -j${${PROJECT_NAME}_NPROC}
COMMAND ${CMAKE_MAKE_PROGRAM} test ARGS=-j${${PROJECT_NAME}_NPROC}
Expand Down
57 changes: 31 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,26 @@

## Overview

> 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.
> <div align="right">Revised<sup>7</sup> Report on the Algorithmic Language Scheme [1]</div>
> 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.
> <div align="right">
> Revised<sup>7</sup> Report on the Algorithmic Language Scheme [1]
> </div>
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.
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.

### Releases

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

<img src="https://github.com/yamacir-kit/meevax/actions/workflows/build.yaml/badge.svg"/>
<img src="https://github.com/yamacir-kit/meevax/actions/workflows/release.yaml/badge.svg"/>

### Features

- Architecture - SECD machine.
- Modern C++ compatible dynamic typing - Meevax provides RTTI-based language runtime library.
- Architecture - SECD machine.
- Modern C++ compatible dynamic typing - Meevax provides RTTI-based language
runtime library.

### Standards

Expand Down Expand Up @@ -51,24 +55,26 @@ Subset of R7RS-small.
| [ 78](https://srfi.schemers.org/srfi-78/srfi-78.html) | Lightweight testing | [`(srfi 78)`](./basis/srfi-78.ss) | Except `check-ec` |
| [ 87](https://srfi.schemers.org/srfi-87/srfi-87.html) | => in case clauses | | R7RS 4.2.1 |
| [ 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 |
| [111](https://srfi.schemers.org/srfi-111/srfi-111.html) | Boxes | [`(srfi 111)`](./basis/srfi-111.ss) | |
| [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 |

## Installation

### Requirements

- [GCC](https://gcc.gnu.org/) (>= 9.4.0) or [Clang](https://clang.llvm.org/) (>= 11.0.0)
- [CMake](https://cmake.org/) (>= 3.16.3)
- [GNU Make](http://savannah.gnu.org/projects/make)
- [GNU Binutils](https://www.gnu.org/software/binutils/)
- [GNU Multiple Precision Arithmetic Library (GMP)](https://gmplib.org/)
- [GCC](https://gcc.gnu.org/) (>= 9.4.0) or [Clang](https://clang.llvm.org/) (>= 11.0.0)
- [CMake](https://cmake.org/) (>= 3.16.3)
- [GNU Make](http://savannah.gnu.org/projects/make)
- [GNU Binutils](https://www.gnu.org/software/binutils/)
- [GNU Multiple Precision Arithmetic Library (GMP)](https://gmplib.org/)

### Install

``` bash
cmake -B build -DCMAKE_BUILD_TYPE=Release
cd build
make install.deb
make package
sudo apt install build/meevax_0.4.779_amd64.deb
```

or
Expand All @@ -81,7 +87,7 @@ make install

### Uninstall

If you installed with `make install.deb`,
If you installed with `sudo apt install`,

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

### CMake targets

| Target Name | Description
|--------------------|---
| `all` (default) | Build shared-library `libmeevax.0.4.752.so` and executable `meevax`
| `test` | Test executable `meevax`
| `package` | Generate debian package `meevax_0.4.752_amd64.deb`
| `install` | Copy files into `/usr/local`
| `install.deb` | `all` + `package` + `sudo apt install <meevax>.deb`
| Target Name | Description
|-----------------|-------------
| `all` (default) | Build shared-library `libmeevax.0.4.779.so` and executable `meevax`
| `test` | Test executable `meevax`
| `package` | Generate debian package `meevax_0.4.779_amd64.deb`
| `install` | Copy files into `/usr/local` directly

## Usage

```
Meevax Lisp 0.4.752
Meevax Lisp 0.4.779
Usage:
meevax [option...] [file...]
Expand All @@ -134,6 +139,6 @@ See [LICENSE](./LICENSE).

### Resources

* [Chibi-Scheme](https://github.com/ashinn/chibi-scheme)
* [SECDR-Scheme](http://www.maroon.dti.ne.jp/nagar17/mulasame/)
* [TinyScheme](http://tinyscheme.sourceforge.net/)
* [Chibi-Scheme](https://github.com/ashinn/chibi-scheme)
* [SECDR-Scheme](http://www.maroon.dti.ne.jp/nagar17/mulasame/)
* [TinyScheme](http://tinyscheme.sourceforge.net/)
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.4.752
0.4.779
9 changes: 1 addition & 8 deletions basis/meevax.ss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
(define-library (meevax macro-transformer)
(import (only (meevax comparator) eq? eqv?)
(only (meevax core) begin define if lambda quote set!)
(only (meevax list) null?)
(only (meevax list) assq null?)
(only (meevax pair) cons car cdr caar cdar)
(only (meevax syntactic-closure) identifier? syntactic-closure? make-syntactic-closure))

Expand All @@ -20,13 +20,6 @@
(lambda (form use-env mac-env)
(make-syntactic-closure use-env '() (f form mac-env))))

(define (assq x alist)
(if (null? alist)
#f
(if (eq? x (caar alist))
(car alist)
(assq x (cdr alist)))))

(define (identifier=? environment1 identifier1
environment2 identifier2)
(eqv? (if (syntactic-closure? identifier1) identifier1 (make-syntactic-closure environment1 '() identifier1))
Expand Down
11 changes: 1 addition & 10 deletions basis/r4rs-essential.ss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
(define-library (scheme r4rs essential)
(import (meevax character)
(meevax core)
(meevax comparator)
(only (meevax comparator) eq? eqv? equal?)
(meevax continuation)
(prefix (meevax environment) %)
(meevax function)
Expand Down Expand Up @@ -189,15 +189,6 @@
(or (eq? x #t)
(eq? x #f)))

(define (equal? x y)
(if (and (pair? x)
(pair? y))
(and (equal? (car x)
(car y))
(equal? (cdr x)
(cdr y)))
(eqv? x y)))

(define (list? x)
(let list? ((x x)
(lag x))
Expand Down
3 changes: 3 additions & 0 deletions basis/srfi-111.ss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
(define-library (srfi 111)
(import (meevax box))
(export box box? (rename box-ref unbox) (rename box-set! set-box!)))
4 changes: 3 additions & 1 deletion benchmark/ack.ss
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
(import (scheme base)
(scheme write)
(scheme process-context))

(define (ack m n)
(cond ((= m 0) (+ n 1))
((= n 0) (ack (- m 1) 1))
(else (ack (- m 1) (ack m (- n 1))))))

(ack 3 8)
(display (ack 3 8))
(newline)

(exit)
4 changes: 3 additions & 1 deletion benchmark/tarai.ss
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
(import (scheme base)
(scheme write)
(scheme process-context))

(define (tarai x y z)
Expand All @@ -7,6 +8,7 @@
(tarai (- y 1) z x)
(tarai (- z 1) x y))))

(tarai 11 6 0)
(display (tarai 11 6 0))
(newline)

(exit)
55 changes: 30 additions & 25 deletions configure/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,26 @@

## Overview

> 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.
> <div align="right">Revised<sup>7</sup> Report on the Algorithmic Language Scheme [1]</div>
> 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.
> <div align="right">
> Revised<sup>7</sup> Report on the Algorithmic Language Scheme [1]
> </div>
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.
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.

### Releases

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

<img src="https://github.com/yamacir-kit/meevax/actions/workflows/build.yaml/badge.svg"/>
<img src="https://github.com/yamacir-kit/meevax/actions/workflows/release.yaml/badge.svg"/>

### Features

- Architecture - SECD machine.
- Modern C++ compatible dynamic typing - Meevax provides RTTI-based language runtime library.
- Architecture - SECD machine.
- Modern C++ compatible dynamic typing - Meevax provides RTTI-based language
runtime library.

### Standards

Expand Down Expand Up @@ -51,24 +55,26 @@ Subset of R7RS-small.
| [ 78](https://srfi.schemers.org/srfi-78/srfi-78.html) | Lightweight testing | [`(srfi 78)`](./basis/srfi-78.ss) | Except `check-ec` |
| [ 87](https://srfi.schemers.org/srfi-87/srfi-87.html) | => in case clauses | | R7RS 4.2.1 |
| [ 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 |
| [111](https://srfi.schemers.org/srfi-111/srfi-111.html) | Boxes | [`(srfi 111)`](./basis/srfi-111.ss) | |
| [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 |

## Installation

### Requirements

- [GCC](https://gcc.gnu.org/) (>= 9.4.0) or [Clang](https://clang.llvm.org/) (>= 11.0.0)
- [CMake](https://cmake.org/) (>= ${CMAKE_MINIMUM_REQUIRED_VERSION})
- [GNU Make](http://savannah.gnu.org/projects/make)
- [GNU Binutils](https://www.gnu.org/software/binutils/)
- [GNU Multiple Precision Arithmetic Library (GMP)](https://gmplib.org/)
- [GCC](https://gcc.gnu.org/) (>= 9.4.0) or [Clang](https://clang.llvm.org/) (>= 11.0.0)
- [CMake](https://cmake.org/) (>= ${CMAKE_MINIMUM_REQUIRED_VERSION})
- [GNU Make](http://savannah.gnu.org/projects/make)
- [GNU Binutils](https://www.gnu.org/software/binutils/)
- [GNU Multiple Precision Arithmetic Library (GMP)](https://gmplib.org/)

### Install

``` bash
cmake -B build -DCMAKE_BUILD_TYPE=Release
cd build
make install.deb
make package
sudo apt install build/${PROJECT_NAME}_${PROJECT_VERSION}_amd64.deb
```

or
Expand All @@ -81,7 +87,7 @@ make install

### Uninstall

If you installed with `make install.deb`,
If you installed with `sudo apt install`,

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

### CMake targets

| Target Name | Description
|--------------------|---
| `all` (default) | Build shared-library `libmeevax.${PROJECT_VERSION}.so` and executable `meevax`
| `test` | Test executable `meevax`
| `package` | Generate debian package `meevax_${PROJECT_VERSION}_amd64.deb`
| `install` | Copy files into `/usr/local`
| `install.deb` | `all` + `package` + `sudo apt install <meevax>.deb`
| Target Name | Description
|-----------------|-------------
| `all` (default) | Build shared-library `libmeevax.${PROJECT_VERSION}.so` and executable `meevax`
| `test` | Test executable `meevax`
| `package` | Generate debian package `meevax_${PROJECT_VERSION}_amd64.deb`
| `install` | Copy files into `${CMAKE_INSTALL_PREFIX}` directly

## Usage

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

### Resources

* [Chibi-Scheme](https://github.com/ashinn/chibi-scheme)
* [SECDR-Scheme](http://www.maroon.dti.ne.jp/nagar17/mulasame/)
* [TinyScheme](http://tinyscheme.sourceforge.net/)
* [Chibi-Scheme](https://github.com/ashinn/chibi-scheme)
* [SECDR-Scheme](http://www.maroon.dti.ne.jp/nagar17/mulasame/)
* [TinyScheme](http://tinyscheme.sourceforge.net/)
1 change: 1 addition & 0 deletions configure/basis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ inline namespace kernel
R"##(${${PROJECT_NAME}_BASIS_srfi-45.ss})##",
R"##(${${PROJECT_NAME}_BASIS_srfi-78.ss})##",
R"##(${${PROJECT_NAME}_BASIS_srfi-98.ss})##",
R"##(${${PROJECT_NAME}_BASIS_srfi-111.ss})##",
R"##(${${PROJECT_NAME}_BASIS_srfi-149.ss})##",
};
}
Expand Down
35 changes: 35 additions & 0 deletions include/meevax/kernel/box.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
Copyright 2018-2023 Tatsuya Yamasaki.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

#ifndef INCLUDED_MEEVAX_KERNEL_BOX_HPP
#define INCLUDED_MEEVAX_KERNEL_BOX_HPP

#include <meevax/kernel/pair.hpp>

namespace meevax
{
inline namespace kernel
{
struct box : public virtual pair // (value . unit)
{
using pair::pair;
};

auto operator <<(std::ostream &, box const&) -> std::ostream &;
} // namespace kernel
} // namespace meevax

#endif // INCLUDED_MEEVAX_KERNEL_BOX_HPP
Loading

0 comments on commit 0818cfa

Please sign in to comment.