Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 202 lines (131 sloc) 5.84 kB
64e93a0 @hraberg moved down version
authored
1 # 神.clj | Shen for Clojure
2
5b56b11 @hraberg README
authored
3 http://shenlanguage.org/
4
5 Shen is a portable functional programming language by [Mark Tarver](http://www.lambdassociates.org/) that offers
6
7 * pattern matching,
8 * λ calculus consistency,
9 * macros,
10 * optional lazy evaluation,
11 * static type checking,
12 * an integrated fully functional Prolog,
13 * and an inbuilt compiler-compiler.
14
15
4ab268a @hraberg This, not the, port
authored
16 ## This Clojure Port
5b56b11 @hraberg README
authored
17
76875eb @hraberg missing quotation mark
authored
18 `[shen.clj "0.1.4"]` | [Marginalia](http://ghettojedi.org/shen.clj/)
092ee7c @hraberg Packaging refactorings
authored
19
b89c4f7 @hraberg Minor restructuring
authored
20 Is a work in progress. Passes the Shen 3.1 test suite.
4894c0a @hraberg How to run
authored
21
28d28da @hraberg While seemingly on topic, confusing
authored
22 Uses [Leiningen](https://github.com/technomancy/leiningen) to build.
7def9b6 @hraberg Link
authored
23 The script [`build`](https://github.com/hraberg/shen.clj/blob/master/build) is used for full, repeatable builds.
28d28da @hraberg While seemingly on topic, confusing
authored
24
c355ab8 @hraberg 'when it's done'
authored
25
6470749 @hraberg Cleaning up some code, updating docs
authored
26 ### To run the REPL:
4894c0a @hraberg How to run
authored
27
a3c3871 @hraberg No colons, please
authored
28 #### Standalone release
dd243a4 @hraberg Direct link/instruction to standalone jar
authored
29
da18ca0 @hraberg 0.1.4 + docs
authored
30 `java -jar `[`shen.clj-0.1.4-standalone.jar`](https://github.com/downloads/hraberg/shen.clj/shen.clj-0.1.4-standalone.jar)
dd243a4 @hraberg Direct link/instruction to standalone jar
authored
31
32
33 #### Leiningen
c33d0d7 @hraberg Direct link/instruction to standalone jar
authored
34
68c0d3a @hraberg Clarifying that lein repl doesn't manage to pick up the generated file
authored
35 lein trampoline run
36
37 # If shen.clj already exists, for readline support:
0644c7d @hraberg Detecting REPL and launches Shen
authored
38 lein repl
a3e227d @hraberg Link, license
authored
39
092ee7c @hraberg Packaging refactorings
authored
40 # java:
da18ca0 @hraberg 0.1.4 + docs
authored
41 java -cp lib/clojure-1.4.0-beta5.jar:shen.clj-0.1.4.jar shen
8b1248a @hraberg Leiningen-less install
authored
42
43
44 #### Plain
092ee7c @hraberg Packaging refactorings
authored
45
365a4ec @hraberg Updated installation/dist instructions, and added the dist README + b…
authored
46 ./shen.clj
092ee7c @hraberg Packaging refactorings
authored
47
8865ac3 @hraberg How to build without Leiningen
authored
48 ---
49
6470749 @hraberg Cleaning up some code, updating docs
authored
50 Shen 2010, copyright (C) 2010 Mark Tarver
8703515 @hraberg Upgraded to Shen 3.1
authored
51 www.lambdassociates.org, version 3.1
8b1248a @hraberg Leiningen-less install
authored
52 running under Clojure, implementation: Clojure 1.4.0-beta5 [jvm 1.8.0-ea]
da18ca0 @hraberg 0.1.4 + docs
authored
53 port 0.1.4 ported by Håkan Råberg
6470749 @hraberg Cleaning up some code, updating docs
authored
54
55
56 (0-) (define super
57 [Value Succ End] Action Combine Zero ->
58 (if (End Value)
59 Zero
60 (Combine (Action Value)
61 (super [(Succ Value) Succ End]
62 Action Combine Zero))))
cf856d5 @hraberg Reflected as symbols, not vars are returned
authored
63 super
6470749 @hraberg Cleaning up some code, updating docs
authored
64
65 (1-) (define for
66 Stream Action -> (super Stream Action do 0))
cf856d5 @hraberg Reflected as symbols, not vars are returned
authored
67 for
6470749 @hraberg Cleaning up some code, updating docs
authored
68
69 (2-) (define filter
70 Stream Condition ->
71 (super Stream
72 (/. Val (if (Condition Val) [Val] []))
73 append
74 []))
cf856d5 @hraberg Reflected as symbols, not vars are returned
authored
75 filter
6470749 @hraberg Cleaning up some code, updating docs
authored
76
77 (3-) (for [0 (+ 1) (= 10)] print)
78 01234567890
79
80 (4-) (filter [0 (+ 1) (= 100)]
81 (/. X (integer? (/ X 3))))
82 [0 3 6 9 12 15 18 21 24 27 30 33 36 39 42 45 48 51 54 57 60... etc]
83
d724402 @hraberg Test suite is now running (79% pass in 5 mins; 10x slower than CLisp)
authored
84
ec6835a @hraberg Preparing 0.1.0
authored
85 ### The Shen Test Suite
da13eb2 @hraberg Various fixes - narrowing in on defmacro
authored
86
6deec62 @hraberg Note that we could get the cleaned up docstrings from shen-mode.el
authored
87 The Shen test suite is now running, slowly but surely:
d724402 @hraberg Test suite is now running (79% pass in 5 mins; 10x slower than CLisp)
authored
88
89 [... loads of output ...]
b942f4e @hraberg 100%
authored
90 passed ... 146
91 failed ...0
92 pass rate ...100%
d724402 @hraberg Test suite is now running (79% pass in 5 mins; 10x slower than CLisp)
authored
93
94 ok
95 0
96
b942f4e @hraberg 100%
authored
97 run time: 19.022 secs
d724402 @hraberg Test suite is now running (79% pass in 5 mins; 10x slower than CLisp)
authored
98 loaded
99
f5ad571 @hraberg build script
authored
100 The suite can be run via:
47ae409 @hraberg How to run the test suite from leiningen + shen.test/-main needs to i…
authored
101
102 yes | lein trampoline run -m shen.test
d724402 @hraberg Test suite is now running (79% pass in 5 mins; 10x slower than CLisp)
authored
103
ec6835a @hraberg Preparing 0.1.0
authored
104
105 The benchmarks can be run via:
106
107 JAVA_OPTS="-Xss4m" lein run -m shen.benchmarks
108
109
283c86c @hraberg 0.1.2
authored
110 * Performance is not a goal for 0.1.x, but some tuning has been made to ease development.
7f6ec59 @hraberg Updated with info about macros and test suite state of play
authored
111
539ea1e @hraberg Update on the status regards to Shen libraries
authored
112 ### Libraries
113
9abc810 @hraberg Updated to remove a few known issues which are fixed
authored
114 * [`strlib.shen`](http://www.shenlanguage.org/library.html) loads and type checks ok.
115 * [`vectors.shen`](http://www.shenlanguage.org/library.html) loads and type checks ok.
4a764d6 @hraberg the maths-library loads and type checks
authored
116 * [`maths-lib.shen`](http://www.shenlanguage.org/library.html) loads and type checks ok.
539ea1e @hraberg Update on the status regards to Shen libraries
authored
117 * [shen-libs](https://github.com/vasil-sd/shen-libs) part of it loads, but [`file-system.shen`](https://github.com/vasil-sd/shen-libs/blob/master/file-system/file-system.shen) needs a java.io version to proceeed.
118
ec6835a @hraberg Preparing 0.1.0
authored
119
120 ### 神, define, prolog? and defprolog macros
7f6ec59 @hraberg Updated with info about macros and test suite state of play
authored
121
122 Instead of using Shen's reader, you can embed Shen directly in Clojure using these macros.
123 For simplicity, all Shen code lives and is evaluated in the `shen` namespace for now (this will likely change).
124
c8d1023 @hraberg highlighting in markdown?
authored
125 ```clojure
5c2fc9f @hraberg No need for extra indent
authored
126 ; shen.test/shenlanguage.org
127 (define for
128 Stream Action -> (super Stream Action do 0))
129
130 ; shen.test/printer
131 (
132 (cons 1 2))
133 "[1 | 2]"
134
135 (
136 (@p 1 2))
137 "(@p 1 2)"
138
139 ; shen.test/partials
140 (
141 ( X Y (+ X Y)) 2))
142 fn?
c8d1023 @hraberg highlighting in markdown?
authored
143 ```
7f6ec59 @hraberg Updated with info about macros and test suite state of play
authored
144
145 As can be seen `λ` stands in for `/.` in Shen to avoid Clojure reader macros.
146 `@p`, `@s` and `@v` are converted from Clojure deref to their Shen symbols.
56bde31 @hraberg Clarity
authored
147 Characters, like `\;`, will also be converted to symbols.
7f6ec59 @hraberg Updated with info about macros and test suite state of play
authored
148
c3392cc @hraberg Some notes about interop
authored
149 Note that `[]` in Shen are lists, and not Clojure vectors. A Clojure vector with a count of 2 is used to represent a cons pair internally.
150
7f6ec59 @hraberg Updated with info about macros and test suite state of play
authored
151 See [`shen.test`](https://github.com/hraberg/shen.clj/blob/master/test/shen/test.clj) for more examples.
da13eb2 @hraberg Various fixes - narrowing in on defmacro
authored
152
6470749 @hraberg Cleaning up some code, updating docs
authored
153
c3392cc @hraberg Some notes about interop
authored
154 #### Shen calling Clojure
155
156 Shen code can (but this is not very tested) access `clojure.core`, which is required as `core`:
157
158 (
159 (core/with-out-str
160 (for [0 (+ 1) (= 10)] print)))
161 "\"0123456789\""
162
163 More advanced mixing and requiring of Clojure packages isn't supported yet.
164
165
509608e @hraberg Disregard for how markdown actually works
authored
166 ## Roadmap
167
b1f3248 @hraberg M-x flyspell-mode
authored
168 This port, while aiming to conform closely (and hopefully fully) to the [Shen specification](http://shenlanguage.org/Documentation/shendoc.htm), has its primary goal to enable Shen's power in real world Clojure code.
509608e @hraberg Disregard for how markdown actually works
authored
169
170 * Shen / Clojure interop:
47ae409 @hraberg How to run the test suite from leiningen + shen.test/-main needs to i…
authored
171 * Shen packages as namespaces?
ec6835a @hraberg Preparing 0.1.0
authored
172 * Hiding Shen internal names.
47ae409 @hraberg How to run the test suite from leiningen + shen.test/-main needs to i…
authored
173 * Bringing smaller parts of Shen goodness back into Clojure: predicate dispatch, pattern matching, prolog. Maybe even the type system.
174 * Ensuring Shen can call Clojure/Java properly.
509608e @hraberg Disregard for how markdown actually works
authored
175 * Future / Questions
d0f8e78 @hraberg Cleaning out todo list
authored
176 * More TCO than implicit recur for KLambda?
1daf562 @hraberg Note about Shen lazyiness
authored
177 * Making Shen as lazy as its host?
47ae409 @hraberg How to run the test suite from leiningen + shen.test/-main needs to i…
authored
178 * Existing Shen libraries and portability?
179 * ClojureScript.
ec6835a @hraberg Preparing 0.1.0
authored
180 * overwrite.clj - rewriting more parts of Shen into Clojure if interop or performance requires it.
181 * [Shen in 15 minutes](http://www.shenlanguage.org/learn-shen/tutorials/shen_in_15mins.html#shen-in-15mins) as smoke test for the REPL
509608e @hraberg Disregard for how markdown actually works
authored
182
6470749 @hraberg Cleaning up some code, updating docs
authored
183
184 #### The other port, Shen to Clojure
8da7859 @hraberg Link to Dominik's port
authored
185
186 http://code.google.com/p/shen-to-clojure/
187
a3e227d @hraberg Link, license
authored
188 ## License
189
190 http://shenlanguage.org/license.html
384f96f @hraberg attribution
authored
191
23c9ae5 @hraberg Consistency
authored
192 Shen, Copyright © 2010-2012 Mark Tarver
b6cb6a8 @hraberg attribution
authored
193
232d28b @hraberg What is this project really called?
authored
194 shen.clj, Copyright © 2012 Håkan Råberg
a9e7753 @hraberg YourKit Open Source License
authored
195
196 ---
197 YourKit is kindly supporting open source projects with its full-featured Java Profiler.
198 YourKit, LLC is the creator of innovative and intelligent tools for profiling
199 Java and .NET applications. Take a look at YourKit's leading software products:
200 <a href="http://www.yourkit.com/java/profiler/index.jsp">YourKit Java Profiler</a> and
201 <a href="http://www.yourkit.com/.net/profiler/index.jsp">YourKit .NET Profiler</a>.
Something went wrong with that request. Please try again.