diff --git a/README.md b/README.md index 1fccaac1..319b0424 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,18 @@ [![Build Status](https://travis-ci.org/picrin-scheme/picrin.png)](https://travis-ci.org/picrin-scheme/picrin) [![Docs Status](https://readthedocs.org/projects/picrin/badge/?version=latest)](https://picrin.readthedocs.org/) -Picrin is a lightweight scheme implementation intended to comply with full R7RS specification. Its code is written in pure C89 and does not require any special external libraries installed on the platform. +Picrin is a lightweight R7RS scheme implementation written in pure C89. It contains a reasonably fast VM, an improved hygienic macro system, usuful contribution libraries, and simple but powerful C interface. + +- R7RS compatible +- Reentrant design (all VM states are stored in single global state object) +- Bytecode interpreter +- Direct threaded VM +- Internal representation by nan-boxing (available only on x64) +- Conservative call/cc implementation (VM stack and native c stack can interleave) +- Exact GC (simple mark and sweep, partially reference count) +- String representation by rope +- Hygienic macro transformers (syntactic closures, explicit and implicit renaming macros) +- Extended library syntax ## Documentation @@ -17,71 +28,36 @@ https://github.com/picrin-scheme/picrin ## IRC -There is a chat room on chat.freenode.org, channel #picrin. IRC logs here: https://botbot.me/freenode/picrin/ +Our chat room is at #picrin channel, chat.freenode.org. IRC logs here: https://botbot.me/freenode/picrin/ -## How to use it +## Build -To build picrin, you need some build tools installed on your platform. +Just type `make` in the project root directory. You will find an executable binary newly created at bin/ directory. -- cmake (>= 2.6) + $ make +When you are building picrin on x86_64 system, PIC_NAN_BOXING flag is automatically turned on (see include/picrin/config.h for detail). -### Generate Makefile +## Install -Change directory to `build` then run `cmake` to create Makefile. Once `Makefile` is generated you can run `make` command to build picrin. - - $ cd build - $ cmake .. - -Actually you don't necessarily need to move to `build` directory before running `cmake` (in that case `$ cmake .`), but I strongly recommend to follow above instruction. - -Before generating Makefile, you can change some compilation switches to enable or disable optional features. Take *NAN_BOXING* for example, when you turn on "Use C11 feature" flag and the platform supports addresses of 48bit length, it is enabled. - -### Build - -A built executable binary will be under bin/ directory and shared libraries under lib/. - - $ make - -If you are building picrin on other systems than x86_64, PIC_NAN_BOXING flag is automatically turned on (see include/picrin/config.h for detail). - -### Install - -Just running `make install`, picrin library, headers, and runtime binary are install on your system, by default into `/usr/local` directory. You can change this value via cmake. +`make install` target is provided. By default it installs picrin binary into `/usr/local/bin/`. $ make install -### Run +Since picrin does not use autoconf, if you want to specify the install directory, pass the custom path to `make` via command line argument. -Before installing picrin, you can try picrin without breaking any of your system. Simply directly run the binary `bin/picrin` from terminal, or you can use `make` to execute it like this. + $ make install prefix=/path/to/dir - $ make run - -### Run Test -To run all the test including contribs, execute this. - - $ make test - -To test only R7RS features, - - $ make test-r7rs - -### Debug run - -If you execute `cmake` with debug flag `-DCMAKE_BUILD_TYPE=Debug`, it builds the binary with all debug flags enabled (PIC_GC_STRESS, VM_DEBUG, DEBUG). - - $ cmake -DCMAKE_BUILD_TYPE=Debug .. - ## Requirement -Picrin scheme depends on some external libraries to build the binary: +To build Picrin Scheme from source code, some external libraries are required: - perl +- regex.h of POSIX.1 - libedit (optional) -- regex.h of POSIX.1 (optional) -Optional libraries are, if cmake detected them, automatically enabled. -The compilation is tested only on Mac OSX and Ubuntu. I think (or hope) it'll be ok to compile and run on other operating systems such as Arch or Windows, but I don't guarantee :( +Make command automatically turns on optional libraries if available. +Picrin is mainly developed on Mac OS X and only tested on OS X or Ubuntu 14.04+. When you tried to run picrin on other platforms and found something was wrong with it, please send us an issue. ## Authors diff --git a/docs/deploy.rst b/docs/deploy.rst index 7a4a9330..7bb36135 100644 --- a/docs/deploy.rst +++ b/docs/deploy.rst @@ -4,68 +4,34 @@ Installation Installation instructions below. -Build and Install ------------------ - -To build picrin, you need some build tools installed on your platform. - -- cmake (>= 2.6) -- git - -Because of submodule dependencies, it is necessary to get picrin's source code via git clone command. Basically our git dependencies are only due to submodules, so in fact, If you have no git on your machine, it is possible to build it by downloading a tarball from github page as well. But in such case, you are assumed to modify CMakeLists.txt by yourself to get it work completely. We just strongly recommend you to use git-clone. - -Generate Makefile -^^^^^^^^^^^^^^^^^ - -Change directory to `build` then run `ccmake` to create Makefile. Once `Makefile` is generated you can run `make` command to build picrin:: - - $ cd build - - $ ccmake .. - -Actually you don't necessarily need to move to `build` directory before running `ccmake` (in that case `$ ccmake .`), but I strongly recommend to follow above instruction. - -Before generating Makefile, you can change some compilation switches to enable or disable optional features. Take *NAN_BOXING* for example, when you turn on "Use C11 feature" flag and the platform supports addresses of 48bit length, it is enabled. - Build -^^^^^ +----- -A built executable binary will be under bin/ directory and shared libraries under lib/:: +Just type `make` in the project root directory. You will find an executable binary newly created at bin/ directory. - $ make + $ make -If you are building picrin on other systems than x86_64, PIC_NAN_BOXING flag is automatically turned on (see include/picrin/config.h for detail). +When you are building picrin on x86_64 system, PIC_NAN_BOXING flag is automatically turned on (see include/picrin/config.h for detail). Install -^^^^^^^ +------- -Just running `make install`, picrin library, headers, and runtime binary are install on your system, by default into `/usr/local` directory. You can change this value via ccmake:: +`make install` target is provided. By default it installs picrin binary into `/usr/local/bin/`. - $ make install + $ make install -Run -^^^ - -Before installing picrin, you can try picrin without breaking any of your system. Simply directly run the binary `bin/picrin` from terminal, or you can use `make` to execute it like this:: - - $ make run - -Debug run -^^^^^^^^^ - -If you execute `cmake` with debug flag `-DCMAKE_BUILD_TYPE=Debug`, it builds the binary with all debug flags enabled (PIC_GC_STRESS, VM_DEBUG, DEBUG):: - - $ cmake -DCMAKE_BUILD_TYPE=Debug .. +Since picrin does not use autoconf, if you want to specify the install directory, pass the custom path to `make` via command line argument. + $ make install prefix=/path/to/dir Requirement ----------- -Picrin scheme depends on some external libraries to build the binary: +To build Picrin Scheme from source code, some external libraries are required: - perl -- readline (optional) -- regex.h of POSIX.1 (optional) +- regex.h of POSIX.1 +- libedit (optional) -Optional libraries are, if cmake detected them, automatically enabled. -The compilation is tested only on Mac OSX and Ubuntu. I think (or hope) it'll be ok to compile and run on other operating systems such as Arch or Windows, but I don't guarantee :( +Make command automatically turns on optional libraries if available. +Picrin is mainly developed on Mac OS X and only tested on OS X or Ubuntu 14.04+. When you tried to run picrin on other platforms and found something was wrong with it, please send us an issue. diff --git a/docs/intro.rst b/docs/intro.rst index 5cc22c15..fa72e69c 100644 --- a/docs/intro.rst +++ b/docs/intro.rst @@ -1,20 +1,18 @@ Introduction ============ -Picrin is a lightweight scheme implementation intended to comply with full R7RS specification. Its code is written in pure C89 and does not require any special external libraries installed on the platform. +Picrin is a lightweight R7RS scheme implementation written in pure C89. It contains a reasonably fast VM, an improved hygienic macro system, usuful contribution libraries, and simple but powerful C interface. -- R7RS compatibility -- reentrant design (all VM states are stored in single global state object) -- bytecode interpreter (based on stack VM) -- direct threaded VM -- internal representation by nan-boxing -- conservative call/cc implementation (users can freely interleave native stack with VM stack) -- exact GC (simple mark and sweep, partially reference count is used as well) -- string representation by rope data structure -- support full set hygienic macro transformers, including implicit renaming macros -- extended library syntax -- advanced REPL support (multi-line input, etc) -- tiny & portable library (all functions will be in `libpicrin.so`) +- R7RS compatible +- Reentrant design (all VM states are stored in single global state object) +- Bytecode interpreter +- Direct threaded VM +- Internal representation by nan-boxing (available only on x64) +- Conservative call/cc implementation (VM stack and native c stack can interleave) +- Exact GC (simple mark and sweep, partially reference count) +- String representation by rope +- Hygienic macro transformers (syntactic closures, explicit and implicit renaming macros) +- Extended library syntax Homepage --------