Skip to content

Commit

Permalink
Merge pull request #456 from yamacir-kit/release-candidate
Browse files Browse the repository at this point in the history
Release candidate
  • Loading branch information
yamacir-kit authored Jul 20, 2023
2 parents c68cf4c + 04e0b2f commit 6e7e2f9
Show file tree
Hide file tree
Showing 43 changed files with 953 additions and 1,015 deletions.
15 changes: 7 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(CMAKE_VERBOSE_MAKEFILE OFF)

string(JOIN " " AGGRESSIVE_OPTIMIZATION_OPTIONS
# "-fdata-sections"
# "-ffunction-sections"
# "-flto" # This optimization causes a SEGV when compiling with Clang 10.
# "-fmerge-all-constants" # This optimization is very effective in reducing binary size, but non-standard to the C++ standard.
# "-march=native" # This optimization causes "Illegal instruction" error (is Valgrind's bug) on CI.
Expand Down Expand Up @@ -49,9 +47,11 @@ else()
set(${PROJECT_NAME}_BYTE_ORDER "little-endian")
endif()

configure_file(${CMAKE_CURRENT_SOURCE_DIR}/configure/help.txt ${CMAKE_CURRENT_BINARY_DIR}/help.txt)
file(READ ${CMAKE_CURRENT_SOURCE_DIR}/configure/help.txt ${PROJECT_NAME}_HELP_UNCONFIGURED)

file(READ ${CMAKE_CURRENT_BINARY_DIR}/help.txt ${PROJECT_NAME}_HELP_TEXT)
string(CONFIGURE ${${PROJECT_NAME}_HELP_UNCONFIGURED} ${PROJECT_NAME}_HELP)

string(TOLOWER ${CMAKE_SYSTEM_NAME} ${PROJECT_NAME}_SYSTEM_NAME)

configure_file(${CMAKE_CURRENT_SOURCE_DIR}/configure/version.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/kernel/version.cpp)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/configure/README.md ${CMAKE_CURRENT_SOURCE_DIR}/README.md)
Expand Down Expand Up @@ -132,15 +132,14 @@ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config-version.cmake

# ---- Target package ----------------------------------------------------------

set(CPACK_DEBIAN_FILE_NAME DEB-DEFAULT)
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Tatsuya Yamasaki")
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
set(CPACK_GENERATOR DEB)
set(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE)
set(CPACK_RESOURCE_FILE_README ${CMAKE_CURRENT_SOURCE_DIR}/README.md)
set(CPACK_THREADS 0)

set(CPACK_DEBIAN_FILE_NAME DEB-DEFAULT)
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Tatsuya Yamasaki")
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)

include(CPack)

# ---- Target test -------------------------------------------------------------
Expand Down
40 changes: 9 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,8 @@
<p align="center">
<img src="https://github.com/yamacir-kit/meevax/wiki/svg/meevax-logo.v8.png" alt="Meevax Lisp System"/>
<img src="https://github.com/yamacir-kit/meevax/wiki/svg/meevax-logo.v9.png" alt="Meevax Lisp System"/>
<br/>
<img src="https://github.com/yamacir-kit/meevax/wiki/svg/description.png" alt="A programmable programming lanugage."/>
</p>
<hr/>
<p align="center">
<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"/>
</p>
<p align="center">
<b>
<a href="#Overview">Overview</a>
</b>
&nbsp;|&nbsp;
<b>
<a href="#Installation">Installation</a>
</b>
&nbsp;|&nbsp;
<b>
<a href="#Usage">Usage</a>
</b>
&nbsp;|&nbsp;
<b>
<a href="#License">License</a>
</b>
&nbsp;|&nbsp;
<b>
<a href="#References">References</a>
</b>
</p>

## Overview

Expand All @@ -41,6 +15,9 @@ Meevax is an implementation of Lisp-1 programming language, supporting subset of

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.
Expand All @@ -56,12 +33,13 @@ Subset of R7RS-small.
|--------------------------------------------------------:|:-------------------------------------------------------|:------------------------------------|:------------------|
| [ 0](https://srfi.schemers.org/srfi-0/srfi-0.html) | Feature-based conditional expansion construct | [`(srfi 0)`](./basis/srfi-0.ss) | R7RS 4.2.1 |
| [ 1](https://srfi.schemers.org/srfi-1/srfi-1.html) | List Library | [`(srfi 1)`](./basis/srfi-1.ss) | |
| [ 6](https://srfi.schemers.org/srfi-6/srfi-6.html) | Basic String Ports | [`(srfi 6)`](./basis/srfi-6.ss) | R7RS 6.13 |
| [ 4](https://srfi.schemers.org/srfi-4/srfi-4.html) | Homogeneous numeric vector datatypes | [`(srfi 4)`](./basis/srfi-4.ss) | R7RS 6.9 |
| [ 6](https://srfi.schemers.org/srfi-6/srfi-6.html) | Basic String Ports | [`(srfi 6)`](./basis/srfi-6.ss) | R7RS 6.13 |
| [ 8](https://srfi.schemers.org/srfi-8/srfi-8.html) | receive: Binding to multiple values | [`(srfi 8)`](./basis/srfi-8.ss) | |
| [ 9](https://srfi.schemers.org/srfi-9/srfi-9.html) | Defining Record Types | [`(srfi 9)`](./basis/srfi-9.ss) | R7RS 5.5 |
| [ 10](https://srfi.schemers.org/srfi-10/srfi-10.html) | #, external form | | |
| [ 11](https://srfi.schemers.org/srfi-11/srfi-11.html) | Syntax for receiving multiple values | [`(srfi 11)`](./basis/srfi-11.ss) | R7RS 4.2.2 |
| [ 16](https://srfi.schemers.org/srfi-16/srfi-16.html) | Syntax for procedures of variable arity | [`(srfi 16)`](./basis/srfi-16.ss) | R7RS 4.2.9 |
| [ 23](https://srfi.schemers.org/srfi-23/srfi-23.html) | Error reporting mechanism | [`(srfi 23)`](./basis/srfi-23.ss) | R7RS 6.11 |
| [ 30](https://srfi.schemers.org/srfi-30/srfi-30.html) | Nested Multi-line Comments | | R7RS 2.2 |
| [ 31](https://srfi.schemers.org/srfi-31/srfi-31.html) | A special form rec for recursive evaluation | [`(srfi 31)`](./basis/srfi-31.ss) | |
Expand Down Expand Up @@ -122,16 +100,16 @@ sudo rm -rf /usr/local/share/meevax

| Target Name | Description
|--------------------|---
| `all` (default) | Build shared-library `libmeevax.0.4.724.so` and executable `meevax`
| `all` (default) | Build shared-library `libmeevax.0.4.752.so` and executable `meevax`
| `test` | Test executable `meevax`
| `package` | Generate debian package `meevax_0.4.724_amd64.deb`
| `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`

## Usage

```
Meevax Lisp 0.4.724
Meevax Lisp 0.4.752
Usage:
meevax [option...] [file...]
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.4.724
0.4.752
4 changes: 2 additions & 2 deletions basis/meevax.ss
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
(import (only (meevax comparator) eq? eqv?)
(only (meevax core) begin define if lambda quote set!)
(only (meevax list) null?)
(only (meevax macro) identifier? syntactic-closure? make-syntactic-closure)
(only (meevax pair) cons car cdr caar cdar))
(only (meevax pair) cons car cdr caar cdar)
(only (meevax syntactic-closure) identifier? syntactic-closure? make-syntactic-closure))

(export make-syntactic-closure
identifier?
Expand Down
22 changes: 12 additions & 10 deletions basis/r4rs.ss
Original file line number Diff line number Diff line change
Expand Up @@ -84,22 +84,24 @@
(else (inexact (denominator (exact x))))))

(define (rationalize x e) ; from Chibi-Scheme lib/scheme/extras.scm (https://ml.cddddr.org/scheme/msg01498.html)
(define (sr x y return)
(define (simplest-rational x y return)
(let ((fx (floor x))
(fy (floor y)))
(cond ((>= fx x) (return fx 1))
((= fx fy) (sr (/ (- y fy))
(/ (- x fx))
(lambda (n d)
(return (+ d (* fx n)) n))))
(cond ((>= fx x)
(return fx 1))
((= fx fy)
(simplest-rational (/ (- y fy))
(/ (- x fx))
(lambda (n d)
(return (+ d (* fx n)) n))))
(else (return (+ fx 1) 1)))))
(let ((return (if (negative? x)
(lambda (num den)
(/ (- num) den))
/))
(x (abs x))
(e (abs e)))
(sr (- x e) (+ x e) return)))
(simplest-rational (- x e) (+ x e) return)))

(define (make-rectangular x y)
(+ x (* y (sqrt -1))))
Expand Down Expand Up @@ -159,7 +161,7 @@
(thunk)
(set! %current-output-port previous-output-port)))

(define (char-ready? . port)
(%get-char-ready? (if (pair? port)
(car port)
(define (char-ready? . xs)
(%get-char-ready? (if (pair? xs)
(car xs)
(current-input-port))))))
Loading

0 comments on commit 6e7e2f9

Please sign in to comment.