-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathREADME
113 lines (84 loc) · 3.73 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
* COPYING
This file is part of NCONC.
NCONC is free software: you can redistribute it and/or modify it under
the terms of the Lesser GNU General Public License as published by the
Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
NCONC is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the Lesser GNU General Public
License for more details.
You should have received a copy of the Lesser GNU General Public
License along with NCONC. See the files COPYING.LESSER and COPYING. If
these files are not present, see http://www.gnu.org/licenses/
* LICENSE
Copyright (C) 2011 Patrick Logan
Distributed under the terms of the GNU LESSER GENERAL PUBLIC LICENSE, Version 3.
in this distribution for license information.
See also http://www.gnu.org/licenses/
* CONTACT
patrickdlogan uses gmail
* NCONC
NCONC is an implementation of Scheme (a dialect of Lisp) written in
Javascript.
* Usage
** Include the nconc.js script and dependencies.
** Read scheme expressions from javascript: _.schemeRead("...")
** Evaluate scheme expressions from javascript:
var sexpr = _.schemeRead("((lambda (x) (- x)) -7)");
var value = _.schemeEval(sexpr);
// => value is 7.
Generate the parser:
This can be done within a javascript script, from the online pegjs
grammer generator, or from a shell.
From a shell:
public/scripts/genparser.sh
Testing:
From a shell:
"public/scripts/testonce.sh" will run the qunit tests using phantomjs
once.
"public/scripts/test.sh" will run the qunit tests when any file in
public/ is saved. This uses inotifywait in a loop.
"lein run" will start a server. Goto
http://localhost:8383/nconc-test.html to run the qunit tests. This is
useful, for example, running in FF or Chrome to see exceptions and/or
to use their dev tools.
A browser is needed to test long-running code. phantomjs currently has
a problem.
* TODO
** dynamic-wind
** Fluids
** Multi-processing with trampolines
** Other stuff with trampolines
** Expansion Passing Style macros (stepper, tracer, debugger, etc.)
** List (and array) comprehension macro(s).
** Timer-based execution of the trampoline.
** Printing
** User Interface (read-eval-print loop)
*** Influences: CLIM, Don't Fidget With Widgets, Xeel
*** Declarative UI code with fluids and pub/sub
** More of everything (standard library).
* INCLUDED DEPENDENCIES:
** jquery - not used much except to run qunit in the browser.
** qunit - the unit tests are written in qunit.
** underscore.js - run-time library for collections, etc.
* Separate Dependencies:
** clojure's lein build tool - currently used just to run qunit tests and serve the files via http.
*** lein is installed from a shell script and all other dependencies from there.
*** download the lein shell script, make it executable, and located on the PATH.
*** run "lein self-install"
*** at the top-level directory for nconc, run "lein deps"
*** from the same location, run "lein run"
*** goto http://localhost:8383/nconc-test.html and the tests should have been successful.
** phantomjs - used to run the qunit tests from a shell using a "headless" webkit.
*** requires qt 4.7 or greater and libqtwebkit4
*** install build-essential
*** install libqtwebkit4
*** install qt4-qmake
*** install libqt4-dev
*** make sure phantomjs is located on the PATH
*** from the top-level for nconc, run "public/scripts/testonce.sh"
*** there should be no output when the tests are successful
** PEG.js - used to build the parser. a pre-built parser is included for the current grammar at runtime.
** the parser can be generated online at http://pegjs.majda.cz/online
** or it can be generated from the shell but nodejs and jake are required.