Contributors
The primary call for help is to review, implement (in Erlang), and test the Scheme R7RS standard libraries. A secondary call for help is to identify, to fix, and to resolve key issues posted to CSCM’s issue tracker. A little bit of Scheme and/or Erlang programming experience is helpful but not absolutely necessary.
- section 2.1 CSCM Issue #2
-
- Development/Test
- done
- Review
- needs peer review
- section 4.3 Macros
-
- Development/Test
- beta done
- Review
- needs peer review
- section 5.4 Syntax definitions
-
- Development/Test
- beta done
- Review
- needs peer review
- section 5.5 Record-type definitions
-
- Development/Test
-
not yet started
- Review
- n/a
- section 6.1 Equivalence predicates
-
- Development/Test
- done
- Review
- needs peer review
- section 6.2 Numbers
-
- Development/Test
-
not yet started
- Review
- n/a
- section 6.3 Booleans
-
- Development/Test
- done
- Review
- needs peer review
- section 6.4 Pairs and lists
-
- Development/Test
- done
- Review
- needs peer review
- section 6.5 Symbols
-
- Development/Test
- done
- Review
- needs peer review
- section 6.6 Characters
-
- Development/Test
- done
- Review
- needs peer review
- section 6.7 Strings
-
- Development/Test
- done
- Review
- needs peer review
- section 6.8 Vectors
-
- Development/Test
- done
- Review
- needs peer review
- section 6.9 Bytevectors
-
- Development/Test
- done
- Review
- needs peer review
- section 6.10 Control features
-
- Development/Test
- done
- Review
- needs peer review
- section 6.11 Exceptions
-
- Development/Test
- done
- Review
- needs peer review
- section 6.13 Input and output
-
- Development/Test
- done
- Review
- needs peer review
- section 6.14 System interface
-
- Development/Test
- done
- Review
- needs peer review
- appendix A Case-Lambda Library
-
- Development/Test
-
not yet started
- Review
- n/a
- appendix A Char Library
-
- Development/Test
-
not yet started
- Review
- n/a
- appendix A Complex Library
-
- Development/Test
-
not yet started
- Review
- n/a
- appendix A CxR Library
-
- Development/Test
-
not yet started
- Review
- n/a
- appendix A Eval Library
-
- Development/Test
-
not yet started
- Review
- n/a
- appendix A File Library
-
- Development/Test
-
not yet started
- Review
- n/a
- appendix A Inexact Library
-
- Development/Test
-
not yet started
- Review
- n/a
- appendix A Lazy Library
-
- Development/Test
-
not yet started
- Review
- n/a
- appendix A Load Library
-
- Development/Test
-
not yet started
- Review
- n/a
- appendix A Process-Context Library
-
- Development/Test
-
not yet started
- Review
- n/a
- appendix A Read Library
-
- Development/Test
-
not yet started
- Review
- n/a
- appendix A Repl Library
-
- Development/Test
-
not yet started
- Review
- n/a
- appendix A Time Library
-
- Development/Test
-
not yet started
- Review
- n/a
- appendix A Write Library
-
- Development/Test
-
not yet started
- Review
- n/a
- appendix A R5RS Library
-
- Development/Test
-
not yet started
- Review
- n/a
Caution Please stay tuned for CSCM updates. The specification, documentation, and software are under construction.
Miscellaneous TODO Items
-
pending R7RS draft 10 changes
- Remove extra exponent markers from formal syntax
Getting Started
An incomplete list of steps for "Getting Started".
Mandatory
- read the Scheme overview paper
-
download and build
git clone git://github.com/the-concurrent-schemer/scm.git cd scm make deps make
Tip Check the Software Requirements listed below before attempting to download and build!
-
run "hello world" example
(define hello-world (lambda () (display "Hello World!")))
Since CSCM is under construction, this example must be run manually for the time being. Let’s use the Erlang shell for illustrative purposes.
-
Start the Erlang shell.
erl -pa ./deps/parse-tools/ebin -pa ebin
-
Save the "hello word" program as an Erlang string.
Str = "(define hello-world (lambda () (display \"Hello World!\")))".
-
Create an empty Scheme environment.
Env = scmi_env:the_empty().
-
Create and register a native Erlang function as a simple
implementation for the Scheme display library procedure. The
Erlang function writes the given arguments to stdout as Erlang
terms and simply returns a Scheme #false to the caller.
False = {boolean,undefined,false}. Proc = {nipv, 0, fun(Args) -> io:format("~p~n", [Args]), False end}. scmi_env:define_variable('display', Proc, Env).
-
Parse and evaluate the "hello world" program.
{ok, Exp} = scmd_parse:string(Str). scmi_eval:eval(Exp, Env).
-
Call the Scheme "hello-world" procedure and show the Scheme
return value in the Erlang shell.
R = scmi_eval:eval(['hello-world'], Env). R.
-
Start the Erlang shell.
Optional (but helpful)
- read the final Scheme R7RS small report specification and errata
-
review and understand
-
the layout of the scm git
repository
Tip Filename prefixes have meaning ⇒
scmd_
is "datum",scmi_
is "interpreter",scmc_
is "compiler",scml_
is "library", andxfm_
is "Erlang parse transform". -
the CSCM datum model
- implementation of Scheme datums by Erlang terms
- Scheme equivalence predicates base library and a subset of Scheme numbers base library
-
Erlang
types
used for documentation and static type analysis
Tip If helpful, review Erlang’s documentation about types and function specifications.
- Scheme datum and number (base 2, base 8, base 10, and base 16) tokenizers
- Scheme datum and number parsers
-
Scheme environment resource
wrapper
and
NIF
Tip If helpful, review Erlang’s documentation about API functions for an Erlang NIF library.
- Scheme interpreter evaluator and syntactic analyzer
- Scheme primitive expressions
- Scheme derived expressions
- Scheme macro expressions
- Scheme control features base library
- Scheme exceptions base library
- …
-
the layout of the scm git
repository
-
run xref
make xref
-
generate edocs
make doc
Note Steps describing how to setup and to run Erlang’s dialyzer will be added later.
Lines Of Code
Scheme datum
~1,200 Erlang LOC implements a Scheme datum tokenizer and parser.
$ cloc src/scmd_* 12 text files. 12 unique files. 0 files ignored. http://cloc.sourceforge.net v 1.58 T=0.5 s (24.0 files/s, 3856.0 lines/s) ------------------------------------------------------------------------------- Language files blank comment code ------------------------------------------------------------------------------- Erlang (yecc) 2 108 79 471 Erlang (leex) 5 192 264 332 Erlang 5 46 124 312 ------------------------------------------------------------------------------- SUM: 12 346 467 1115 -------------------------------------------------------------------------------
Scheme interpreter
~600 C/C++ LOC and ~3,200 Erlang LOC implements all Scheme primitive, derived, program, and macro expressions.
$ cloc src/scmi_* c_src 23 text files. 23 unique files. 0 files ignored. http://cloc.sourceforge.net v 1.58 T=0.5 s (46.0 files/s, 10914.0 lines/s) ------------------------------------------------------------------------------- Language files blank comment code ------------------------------------------------------------------------------- Erlang 15 669 659 3157 C++ 4 140 105 541 C/C++ Header 4 26 88 72 ------------------------------------------------------------------------------- SUM: 23 835 852 3770 -------------------------------------------------------------------------------
Scheme library
~400 Erlang LOC implements Scheme exceptions, continuations, dynamic-wind, and other control procedures.
$ cloc src/scml_base_control.erl src/scml_base_exception.erl 2 text files. 2 unique files. 0 files ignored. http://cloc.sourceforge.net v 1.58 T=0.5 s (4.0 files/s, 1238.0 lines/s) ------------------------------------------------------------------------------- Language files blank comment code ------------------------------------------------------------------------------- Erlang 2 67 187 365 ------------------------------------------------------------------------------- SUM: 2 67 187 365 -------------------------------------------------------------------------------
Note The above measurements were taken on a snapshot of CSCM after v0.5.0 with a modified version of cloc for detecting Erlang leex/yecc files.
Submissions
This process is a DRAFT
.
Please review and follow these guidelines for contribution submissions.
-
Try to keep all submissions simple, clear, and concise
- remove all unused or unnecessary code
- remove unnecessary whitespace
- fix all compiler warnings, run xref, and run dialyzer on each submission
-
use
@TODO
comment markers when helpful
- Create a topic branch off the dev branch for each pull request
- Create a single commit for each pull request and try to focus each commit on a single topic or a set of related topics ⇒ help make it easier for others to review and to test
-
Update the Edoc
@author
tag of each module where you are considered a primary author - Ensure the the copyright and license shown below is included in all submissions
- As much as "practically" possible, follow the CSCM roadmap and notify Joe N. in advance of your plans to minimize the duplication efforts
- Most importantly there is no rush and have fun!
Note For the near term, only documentation and code submissions will be accepted in an attempt to keep the layout and contents of the scm repository simple, clear and concise. Testing such as unit, regression, compatibility, and performance testing will be addressed later.
Software Requirements
- Erlang/OTP (Mandatory)
-
-
Erlang - http://www.erlang.org/
- 17 or newer, 17 has been tested most recently
- required for development ++ TIP: If you need to build and to install Erlang on your own, kerl is highly recommended
-
Erlang - http://www.erlang.org/
- Git (Mandatory)
-
-
Git - http://git-scm.com/
- Git 1.5.4 or newer, Git 1.9.3 has been tested most recently
- required for GitHub
-
GitHub - https://github.com
- Anonymous read-only access using the GIT protocol is default.
- Team members having read-write access should add his/her ssh public key under your GitHub account.
-
Git - http://git-scm.com/
- Python (Optional)
-
-
Python - http://www.python.org
- Python 2.4 or newer, Python 2.7.6 has been tested most recently (CAUTION: Python 3.x might be too new)
- required for AsciiDoc
-
Python - http://www.python.org
- AsciiDoc (Optional)
-
-
AsciiDoc - http://www.methods.co.nz/asciidoc/index.html
- Must be version 8.6.1 or newer, 8.6.9 has been tested most recently
- required for generating CSCM’s markdown documentation
-
AsciiDoc - http://www.methods.co.nz/asciidoc/index.html
Copyright and License
The MIT License Copyright (C) 2013-2014 by Joseph Wayne Norton <norton@alum.mit.edu> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Resources
Emacs
An editor (just like a programming language) is a creature of choice. An editor should also be a creature of comfort. If Emacs happens to be your favorite creature for editing, I highly recommend the following packages:
- whitespace
- indent
- erlang with flymake (and rebar support)
These packages are very helpful (and comforting) for Erlang development.