-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathindex.html
More file actions
222 lines (201 loc) · 7.86 KB
/
index.html
File metadata and controls
222 lines (201 loc) · 7.86 KB
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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>CL21</title>
<link rel="stylesheet" href="./stylesheets/main.css" type="text/css" media="screen, tv, print">
<link rel="stylesheet" href="./stylesheets/github.css" type="text/css" media="screen, tv, print">
<link href='http://fonts.googleapis.com/css?family=Open+Sans:400,700' rel='stylesheet' type='text/css'>
<script type="text/javascript" src="javascripts/highlight-lisp.js"></script>
</head>
<body>
<header>
<h1><a href="./">CL21</a></h1>
<iframe class="gh-btn"
src="http://ghbtns.com/github-btn.html?user=cl21&repo=cl21&type=watch&count=true&size=large"
allowtransparency="true" frameborder="0" scrolling="0" width="170" height="30"></iframe>
<nav>
<ul>
<!--<li><a href="./docs/">Documents</a></li>-->
<li><a href="#installation">Installation</a></li>
<li><a href="https://github.com/cl21/cl21">The Project</a></li>
</ul>
</nav>
</header>
<div id="main">
<article>
<p>CL21 is an experimental project redesigning Common Lisp.</p>
<section id="features">
<h2>Features</h2>
<ul>
<li>More object oriented.</li>
<li>Add more functional programming facilities.</li>
<li>Organize symbols into several packages.</li>
<li>Include MOP.</li>
<li>Syntax for regular expression.</li>
<li>Written in pure Common Lisp.</li>
</ul>
</section>
<section id="comparison">
<h2>Comparison</h2>
<table>
<theader>
<tr>
<th>CL21</th>
<th>Common Lisp</th>
</tr>
</theader>
<tbody>
<tr>
<td>
<pre><code class="lisp">
(let ((name "John"))
(princ #"Hello, ${name}\n"))
</code></pre>
</td>
<td>
<pre><code class="lisp">
(let ((name "John"))
(format t "Hello, ~A~%" name))
</code></pre>
</td>
</tr>
<tr>
<td>
<pre><code class="lisp">
(defvar *hash* #H(:name "Eitaro Fukamachi"))
(getf *hash* :name)
(coerce *hash* 'plist)
</code></pre>
</td>
<td>
<pre><code class="lisp">
(defvar *hash* (make-hash-table))
(setf (gethash :name *hash*) "Eitaro Fukamachi")
(gethash :name *hash*)
(let ((plist nil))
(maphash (lambda (k v)
(setf plist (list* k v plist)))
*hash*)
plist)
</code></pre>
</td>
</tr>
<tr>
<td>
<pre><code class="lisp">
(doeach ((key val) *hash*)
(when (< (length key) 2)
(princ #"${x}\n")))
</code></pre>
</td>
<td>
<pre><code class="lisp">
(loop for key being each hash-key of *hash*
using (hash-value val)
when (< (length key) 2)
do (format t "~A~%" val))
</code></pre>
</td>
</tr>
<tr>
<td>
<pre><code class="lisp">
(let ((query (dbi:execute
(dbi:prepare *db*
"SELECT * FROM table"))))
(while-let1 (row (dbi:fetch query))
(princ row)))
</code></pre>
</td>
<td>
<pre><code class="lisp">
(loop with query = (dbi:execute
(dbi:prepare *db*
"SELECT * FROM table"))
for row = (dbi:fetch query)
while row
do (princ row))
</code></pre>
</td>
</tr>
<tr>
<td>
<pre><code class="lisp">
(use-package :cl21.re)
(#/^(\d{4})-(\d{2})-(\d{2})$/ "2014-01-23")
(re-replace #/a/ig "Eitaro Fukamachi" "α")
</code></pre>
</td>
<td>
<pre><code class="lisp">
(ql:quickload :cl-ppcre)
(use-package :cl-ppcre)
(scan-to-strings "^(\\d{4})-(\\d{2})-(\\d{2})$"
"2014-01-23")
(regex-replace-all "a" "Eitaro Fukamachi" "α"
:preserve-case nil)
</code></pre>
</td>
</tr>
<tr>
<td>
</td>
<td>
</td>
</tr>
</tbody>
</table>
</section>
<section id="motivation">
<h2>Motivation</h2>
<blockquote>
<p>Common Lisp has succeeded.</p>
<div class="who">— <a href="http://www.cs.cmu.edu/Groups/AI/html/cltl/cltl2.html" target="_blank">Common Lisp the Language, 2nd Edition</a></div>
</blockquote>
<p>Dear Common Lispers,</p>
<p>Common Lisp has the most expressive power of any modern language. It has first class functions with lexical closures, an object system with multiple-dispatch and a metaobject protocol, true macros, and more. It is ANSI standardized and has numerous high-performance implementations, many of which are free software.</p>
<p>In spite of this, it has not had much success (at least in Japan). Its community is very small compared to languages like Ruby and most young Lispers are hacking with Clojure.</p>
<p>Why? Common Lisp is much faster than them. Ruby has no macros and even Clojure doesn't have reader macros. Why then?</p>
<p>Because these languges are well-designed and work for most people for most purposes. These languages are easy to use and the speed isn't an issue.</p>
<p>Is Common Lisp sufficiently well-designed? I don't think so. You use different functions to do the same thing to different data types (<code>elt</code>, <code>aref</code>, <code>nth</code>). You have long names for commonly used macros (<code>destructuring-bind</code>, <code>multiple-value-bind</code>). There is no consistency in argument order (<code>getf</code> and <code>gethash</code>). To put it simply, the language is time-consuming to learn.</p>
<p>Given this, how can programmers coming from other languages believe Common Lisp is the most expressive one?</p>
<p>Fortunately in Common Lisp we can improve the interface with abstractions such as functions, macros, and reader macros. If you believe our language is the most expressive and powerful language, then let's justify that belief.</p>
<p>We should consider the future of the language, not only for ourselves but for the next generation.</p>
<div class="note">Written on January 26, 2014 by Eitaro Fukamachi.</div>
<section>
<section id="discuss">
<h2>Discuss about this</h2>
<p>Have some ideas which make CL21 look good? Do you know more efficient way to implement those facilities?</p>
<p>Comments are always welcome. Join discussion at <a href="http://www.reddit.com/r/lisp/comments/1xkx6u/a_set_of_macros_promising_to_modernize_common/" target="_blank">reddit</a> or <a href="https://github.com/cl21/cl21/issues" target="_blank">GitHub Issues</a>.
</section>
<section id="requirements">
<h2>Requirements</h2>
<ul>
<li>Common Lisp Implementation (SBCL, Clozure CL, GNU CLISP or Allegro CL)</li>
<li><a href="http://www.quicklisp.org/beta/" target="_blank">Quicklisp</a></li>
</ul>
</section>
<section id="installation">
<h2>Installation</h2>
<pre><code class="lisp">
(ql-dist:install-dist "http://dists.cl21.org/cl21.txt")
(ql:quickload :cl21)
</code></pre>
</section>
<section id="updating">
<h2>Updating</h2>
<pre><code class="lisp">
(ql:update-dist "cl21")
</code></pre>
</section>
</article>
</div>
<footer>
<small>© Eitaro Fukamachi</small>
</footer>
<script type="text/javascript">
HighlightLisp.highlight_auto();
</script>
</body>
</html>