2014-01-17 07:11:43 -05:00
# Picrin [![Build Status](https://travis-ci.org/wasabiz/picrin.png)](https://travis-ci.org/wasabiz/picrin)
2014-01-17 07:16:26 -05:00
Picrin is a lightweight scheme implementation intended to comply with full R7RS specification. Its code is written in pure C99 and does not requires any special external libraries installed on the platform.
2013-10-17 01:09:39 -04:00
2013-11-07 08:16:04 -05:00
## Features
2013-10-17 01:09:39 -04:00
- R7RS compatibility (but partial support)
- reentrant design (all VM states are stored in single global state object)
2014-02-27 08:25:20 -05:00
- bytecode interpreter (based on stack VM)
2013-10-17 08:03:23 -04:00
- direct threaded VM
2014-02-27 08:25:20 -05:00
- internal representation by nan-boxing
2013-11-09 00:16:35 -05:00
- conservative call/cc implementation (users can freely interleave native stack with VM stack)
2013-11-14 21:58:48 -05:00
- exact GC (simple mark and sweep, partially reference count is used as well)
2014-02-27 08:25:20 -05:00
- string representation by rope data structure
2013-12-10 06:43:03 -05:00
- support full set hygienic macro transformers, including implicit renaming macros
2013-12-10 12:10:07 -05:00
- extended library syntax
2013-10-17 07:53:39 -04:00
- advanced REPL support (multi-line input, etc)
2013-10-20 08:44:31 -04:00
- tiny & portable library (all functions will be in `libpicrin.so` )
2013-10-17 01:09:39 -04:00
2014-05-25 23:07:32 -04:00
## Documentation
2014-02-14 22:50:17 -05:00
2014-05-25 23:07:32 -04:00
See http://picrin.readthedocs.org/
2014-04-05 12:11:14 -04:00
2013-10-19 14:20:41 -04:00
## Homepage
Currently picrin is hosted on Github. You can freely send a bug report or pull-request, and fork the repository.
https://github.com/wasabiz/picrin
2014-04-05 03:22:33 -04:00
## IRC
There is a chat room on chat.freenode.org, channel #picrin .
2013-10-17 01:09:39 -04:00
## How to use it
2014-03-01 22:54:37 -05:00
- make `Makefile`
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 ..
2014-04-05 23:41:31 -04:00
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.
2014-03-01 22:54:37 -05:00
2013-10-17 01:09:39 -04:00
- build
2014-03-01 22:54:37 -05:00
A built executable binary will be under bin/ directory and shared libraries under lib/.
$ make
2013-11-28 10:15:10 -05:00
2014-04-05 23:44:11 -04:00
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).
2013-10-17 01:09:39 -04:00
2014-04-05 23:41:31 -04:00
- 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
2013-10-17 01:09:39 -04:00
- run
2014-04-05 23:41:31 -04:00
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.
2013-10-17 01:09:39 -04:00
$ make run
2013-11-13 23:57:28 -05:00
2014-04-05 23:41:31 -04:00
- debug run
2013-10-17 01:09:39 -04:00
2014-03-01 22:54:37 -05:00
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).
2013-11-28 10:15:10 -05:00
2014-03-01 22:54:37 -05:00
$ cmake -DCMAKE_BUILD_TYPE=Debug ..
2013-11-28 10:15:10 -05:00
2013-10-20 08:44:31 -04:00
2013-10-17 07:58:01 -04:00
## Requirement
2014-03-31 08:40:00 -04:00
Picrin scheme depends on some external libraries to build the binary:
2013-10-17 07:58:01 -04:00
2014-05-18 20:01:26 -04:00
- perl
2014-03-01 06:27:30 -05:00
- lex (preferably, flex)
2014-03-01 23:48:47 -05:00
- getopt
2014-05-25 23:06:16 -04:00
- libedit (optional)
2014-03-31 08:08:58 -04:00
- regex.h of POSIX.1 (optional)
2013-10-17 07:58:01 -04:00
2014-03-02 00:34:02 -05:00
Optional libraries are, if cmake detected them, automatically enabled.
2014-03-01 22:54:37 -05:00
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 :(
2013-10-19 14:35:08 -04:00
2013-10-17 01:09:39 -04:00
## Authors
2014-01-17 07:02:31 -05:00
See `AUTHORS`