Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
aoh committed May 31, 2018
2 parents 2dd7f77 + f5f1f19 commit 2797759
Show file tree
Hide file tree
Showing 164 changed files with 3,093 additions and 5,829 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
doc/ol.1.gz
doc/ovm.1.gz
c/_vm.c
c/ol.c
c/vm.c
fasl/boot.fasl
Expand All @@ -9,3 +10,4 @@ tmp
bin/ol
bin/ol-old
bin/vm
.start
20 changes: 11 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
language: c

before_install:
- uname
- (uname | grep Linux && sudo apt-get update -qq && sudo apt-get install -y gcc-multilib libc6-dev-i386) || true

os:
os:
- linux
- osx

compiler:
- clang
- gcc

env:
- CFLAGS="-O2"

script: make
notifications:
irc:
channels: "chat.freenode.net#owl-lisp"
template: "%{branch}/%{commit}: %{result} (%{author}: %{commit_subject})"
skip_join: true
use_notice: true

before_script: uname -a

script: make 'CFLAGS=-Wall -O2'
2 changes: 1 addition & 1 deletion LICENCE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2012-2017 Aki Helin
Copyright (c) 2012-2018 Aki Helin

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
49 changes: 24 additions & 25 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ fasl/boot.fasl: fasl/init.fasl

fasl/ol.fasl: bin/vm fasl/boot.fasl owl/*.scm scheme/*.scm tests/*.scm tests/*.sh
# selfcompile boot.fasl until a fixed point is reached
@bin/vm fasl/init.fasl -e '(time-ms)' >.start
bin/vm fasl/boot.fasl --run owl/ol.scm -s none -o fasl/bootp.fasl
ls -l fasl/bootp.fasl
@bin/vm fasl/init.fasl -e '(str"bootstrap: "(-(time-ms)(read(open-input-file".start")))"ms\nfasl: "(file-size"fasl/bootp.fasl")"b")'
# check that the new image passes tests
CC="$(CC)" sh tests/run all bin/vm fasl/bootp.fasl
# copy new image to ol.fasl if it is a fixed point, otherwise recompile
cmp -s fasl/boot.fasl fasl/bootp.fasl && cp fasl/bootp.fasl fasl/ol.fasl || cp fasl/bootp.fasl fasl/boot.fasl && make fasl/ol.fasl

if cmp -s fasl/boot.fasl fasl/bootp.fasl; then mv fasl/bootp.fasl fasl/ol.fasl; else mv fasl/bootp.fasl fasl/boot.fasl && exec make fasl/ol.fasl; fi

## building just the virtual machine to run fasl images

Expand All @@ -36,27 +36,29 @@ bin/vm: c/vm.c

bin/diet-vm: c/vm.c
diet $(CC) -Os -o bin/diet-vm c/vm.c
strip bin/diet-vm
strip bin/diet-vm

bin/diet-ol: c/diet-ol.c
diet $(CC) -O2 -o bin/diet-ol c/diet-ol.c

c/vm.c: c/ovm.c
c/_vm.c: c/ovm.c
# remove comments and most white-space
sed -f bin/compact.sed c/ovm.c >c/_vm.c

c/vm.c: c/_vm.c
# make a vm without a bundled heap
echo "unsigned char *heap = 0;" > c/vm.c
cat c/ovm.c >> c/vm.c
echo 'static void *heap = 0;' | cat - c/_vm.c >c/vm.c

manual.md: doc/manual.md owl/*.scm scheme/*.scm
cat doc/manual.md > manual.md
bin/find-documentation.sh >> manual.md
bin/find-documentation.sh | cat doc/manual.md - >manual.md

manual.pdf: manual.md
pandoc --latex-engine xelatex -o manual.pdf manual.md

## building standalone image out of the fixed point fasl image

c/ol.c: fasl/ol.fasl
# compile the repl using the fixed point image
# compile the repl using the fixed point image
bin/vm fasl/ol.fasl --run owl/ol.scm -s some -o c/ol.c

c/diet-ol.c: fasl/ol.fasl
Expand All @@ -83,20 +85,20 @@ random-test: bin/vm bin/ol fasl/ol.fasl
CC="$(CC)" sh tests/run random bin/ol


## data
## data

owl/unicode-char-folds.scm:
echo "(define char-folds '(" > owl/unicode-char-folds.scm
curl http://www.unicode.org/Public/6.0.0/ucd/CaseFolding.txt | grep "[0-9A-F]* [SFC]; " | sed -re 's/ #.*//' -e 's/( [SFC])?;//g' -e 's/^/ /' -e 's/ / #x/g' -e 's/ /(/' -e 's/$$/)/' | tr "[A-F]" "[a-f]" >> owl/unicode-char-folds.scm
echo "))" >> owl/unicode-char-folds.scm
echo "(define char-folds '(" >owl/unicode-char-folds.scm
curl http://www.unicode.org/Public/6.0.0/ucd/CaseFolding.txt | grep "[0-9A-F]* [SFC]; " | sed -re 's/ #.*//' -e 's/( [SFC])?;//g' -e 's/^/ /' -e 's/ / #x/g' -e 's/ /(/' -e 's/$$/)/' | tr "[A-F]" "[a-f]" >> owl/unicode-char-folds.scm
echo '))' >>owl/unicode-char-folds.scm

## meta

doc/ol.1.gz: doc/ol.1
cat doc/ol.1 | gzip -9 > doc/ol.1.gz
gzip -9n <doc/ol.1 >doc/ol.1.gz

doc/ovm.1.gz: doc/ovm.1
cat doc/ovm.1 | gzip -9 > doc/ovm.1.gz
gzip -9n <doc/ovm.1 >doc/ovm.1.gz

install: bin/ol bin/vm doc/ol.1.gz doc/ovm.1.gz
-mkdir -p $(DESTDIR)$(PREFIX)$(BINDIR)
Expand All @@ -114,12 +116,12 @@ uninstall:

clean:
-rm -f fasl/boot.fasl fasl/bootp.fasl fasl/ol.fasl
-rm -f c/vm.c c/ol.c
-rm -f doc/*.gz
-rm -f tmp/*
-rm -f bin/ol bin/vm
-rm -f c/_vm.c c/vm.c c/ol.c
-rm -f doc/*.gz manual.md
-rm -f tmp/* .start
-rm -f bin/ol bin/ol-old bin/vm

# make a standalone binary against dietlibc for relase
# make a standalone binary against dietlibc for release
standalone: c/ol.c c/vm.c
diet gcc -O2 -o bin/vm c/vm.c
strip --strip-all bin/vm
Expand All @@ -129,7 +131,4 @@ standalone: c/ol.c c/vm.c
fasl-update: fasl/ol.fasl
cp fasl/ol.fasl fasl/init.fasl

todo: bin/vm
bin/vm fasl/ol.fasl -n owl/*.scm | less

.PHONY: all owl install uninstall todo test fasltest random-test owl standalone fasl-update clean simple-ol
.PHONY: all clean fasl-update fasltest install owl random-test simple-ol standalone test uninstall
37 changes: 16 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Owl Lisp

Builds:
master [![Build Status](https://travis-ci.org/aoh/owl-lisp.svg?branch=master)](https://travis-ci.org/aoh/owl-lisp),
dev [![Build Status](https://travis-ci.org/aoh/owl-lisp.svg?branch=develop)](https://travis-ci.org/aoh/owl-lisp)
Builds:
master [![Build Status](https://travis-ci.org/owl-lisp/owl.svg?branch=master)](https://travis-ci.org/owl-lisp/owl),
dev [![Build Status](https://travis-ci.org/owl-lisp/owl.svg?branch=develop)](https://travis-ci.org/owl-lisp/owl)

## Overview

Expand All @@ -12,7 +12,7 @@ is mainly based on the applicative subset of the R7RS standard.

## Requirements

You should have make and gcc or clang installed.
You should have make and gcc or clang installed.


## Installation
Expand All @@ -23,21 +23,20 @@ To install system-wide to /usr
$ sudo make install
```

Alternatively you can try it out with
Alternatively you can try it out with
```
$ make
$ cp bin/ol /somewhere/convenient
$ /somewhere/convenient/ol
You see a prompt
>
>
```

## Files

bin/ol - the owl interpreter/compiler
c/ovm.c - the virtual machine / shared owl lisp runtime
owl/*.scm - implementation of owl repl and compiler
bench/*.scm - some benchmarks
fasl/*.fasl - bytecode images for bin/vm used during boot
bin/vm - plain VM used during boot
c/ol.c - combined VM and REPL heap image
Expand All @@ -51,13 +50,13 @@ an owl program and a plain script is that the program should just have
a function of one argument as the last value, which will be called with
the command line argument list when the program is executed.

In addition to being a regular interpreter, owl also tries to make it
easy to compile programs for different platforms. Owl programs can be
In addition to being a regular interpreter, owl also tries to make it
easy to compile programs for different platforms. Owl programs can be
compiled with ol to C-files, which can be compiled to standalone binaries
without needing any owl-specific support files or libraries. The C files
also work on 32- and 64-bit systems, and compile as such at least on
Linux, OpenBSD, OSX and can be crosscompiled to Windows executables with
MinGW.
without needing any owl-specific support files or libraries. The C files
also work on 32- and 64-bit systems, and compile as such at least on
Linux, OpenBSD, and macOS or can be cross-compiled to Windows executables
with MinGW.

For example, to build a hello world program:
```
Expand All @@ -74,9 +73,9 @@ Or simply:
| ol -x c | gcc -x c -o hello - && ./hello
```

Parts of the compiled programs can be translated to C, instead of being
simply fasl-encoded, to increase speed. Using the --native flag compiles
most of the bytecode to C, and --usual-suspects compiles typically used
Parts of the compiled programs can be translated to C, instead of being
simply fasl-encoded, to increase speed. Using the --native flag compiles
most of the bytecode to C, and --usual-suspects compiles typically used
functions. To make programs run faster, one can use for example:

```
Expand All @@ -87,8 +86,4 @@ functions. To make programs run faster, one can use for example:

For further documentation and updates, see:

https://github.com/aoh/owl-lisp

https://haltp.org/f/owl-manual.pdf


https://github.com/owl-lisp/owl
4 changes: 2 additions & 2 deletions THANKS
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ in the development:
Pekka Pietikäinen Portability suggestions and patches.
Erno Kuusela Portability suggestions and general insight.

The code similarly isn't based on any implementation or document, but
many have definitely had an impact on it. A partial list of such sources
The code similarly isn't based on any implementation or document, but
many have definitely had an impact on it. A partial list of such sources
follows:

Recursive Programming Techniques, William H. Burge, 1975
Expand Down
41 changes: 0 additions & 41 deletions bench/amb-clos.l

This file was deleted.

57 changes: 0 additions & 57 deletions bench/amb-cont.l

This file was deleted.

14 changes: 0 additions & 14 deletions bench/arith.scm

This file was deleted.

Loading

0 comments on commit 2797759

Please sign in to comment.