I don’t know what it is about xml configuration files that simply turn me off learning a particular library or framework. For example, here is a Hibernate XML monstrosity.
I realize it all makes sense, but there is something terribly off-putting about xml. To me it’s a sign that the host language is not sufficiently dynamic [...]
Archives for the ‘lisp’ Category
If you look at it long enough, the tags disappear
Saturday, 22 August 2009
Clojure symbol counting
Tuesday, 2 June 2009
One of the little things I found enjoyable while trying out Clojure was discovering the merge-with command. After counting the each of the subbranch and collecting the results in dictionaries, the dictionaries were merged together.
clojure.core/merge-with
([f & maps])
Returns a map that consists of the rest of the maps conj-ed onto
the first. [...]
A plan for learning clojure
Tuesday, 2 June 2009
I had printed out the list of functions and macros in the Clojure API page, and it filled out two A4 pages. Where to start though? I walked the entire clojure and clojure contrib directory and counted the number of function calls. Here are the top stats.
sym count len
clojure.core/list 3872 17
quote 2749 5
defn 1757 4
clojure.core/seq 1481 16
clojure.core/concat 1480 19
= 1074 1
let 1042 3
is 885 2
. 836 1
if 826 2
defmethod 431 9
def 407 3
complex 377 7
defn- 376 5
fn 356 2
first 346 5
defmacro 298 8
clojure.core/apply 264 18
deftest 257 7
str 252 3
when 244 4
imaginary 238 9
recur 237 5
apply 229 5
instance? 220 9
nil 217 3
and 214 3
next 208 4
cl-format 206 9
fn* 197 3
ns 194 2
map 193 3
:use 187 4
list 184 4
1 181 1
count 178 5
+ 169 1
seq 167 3
reduce 165 6
are 148 3
cons 143 4
println 141 7
or 141 2
not 135 3
loop 133 4
thrown? 127 7
* 127 1
conj 125 4
print 124 5
nth 124 3
- 116 1
doseq 114 5
Now, I have a study-plan.
Incidentally, waterfront IDE is quite [...]
Learning Scheme macros
Saturday, 20 September 2008
Thanks to Will Donnely’s Primer on Syntax-Rules, I finally got a headstart with Scheme macros.
What I find interesting about Scheme macros is that it uses the ellipsis (…) very intuitively when expanding macros.
For instance
[code lang="Scheme"]
;Next line for Guile only
(use-syntax (ice-9 syncase))
(define-syntax repeat
(syntax-rules ()
((repeat a1 ...)
[...]
Scheme Syntax-Rules
Saturday, 13 September 2008
I have read the R5RS Spec a couple of times, but the section on syntax-rules makes dry reading, and I could never be bothered about figuring it out.
Now, if only computer science professors could learn to write like this teenager. Don’t you think Will’s tutorial on syntax-rules make the intention and usage clear?
Kudos, Will. [...]
On Declarative Languages
Monday, 28 July 2008
Domain specific languages (DSLs) are usually implemented as declarative languages, where the only data is expressed, and invariant rules are coded into the language interpreter itself.
Dave Herman has thought through some of the practicalities of using declarative languages, particular when a complex system has to be broken up into modules. This leads to problems like [...]
Continuation Sandwich
Sunday, 29 April 2007
An old post, but a good one (via Etymon):
Say you’re in the kitchen in front of the refrigerator, thinking about a sandwitch. You take a continuation right there and stick it in your pocket. Then you get some turkey and bread out of the refrigerator and make yourself a sandwitch, which is now sitting on [...]
Parallel Universes and Lara Croft
Wednesday, 11 April 2007
Field’s medallist winner Terence Tao explains how parallel universes and quantum mechanics can be possible by way of Tomb Raider.
In trying to come up with a classical conceptual model in which to capture these non-classical phenomena, we eventually hit upon using the idea of using computer games as an analogy. The exact choice of game [...]
Full Text Indexing in Ruby is Faster than Java
Wednesday, 22 November 2006
Jim Wiseman John Wiseman, who is porting Ferret to Lisp, reports on the blazing performance of Ferret.
(Ferret was originally a port of Lucene, but recent alteration to the file format has increased performence 5x over GCJ, and then the author ported to C to get an order of magnitude improvement.)
The moral of the story is [...]
ECL Patch accepted
Sunday, 3 September 2006
I patched ECL’s interpreter (which is written in lisp itself) to support restarts, and the patch was accepted.
Not bad for a Lisp newbie. (grin)
Lisp Usenet (almost) Wipes Newbie’s HD
Friday, 16 June 2006
What a contrast between lisp forums and python forums. Check out the following usenet thread.
A newbie after learning how to hello world in lisp, is given a snippet with the equivalent of “rm -rf /*” as a solution after posting a legitimate question on comp.lang.lisp.
View thread on google groups.
(defun reset-cluser ()
“Delete [...]
Hi amb
Wednesday, 31 May 2006
A colleague introduced me to the amb operator. The best reference is Teach Yourself Scheme in Fixnum days.
(define-macro amb
(lambda alts…
`(let ((+prev-amb-fail amb-fail))
(call/cc
(lambda (+sk)
,@(map (lambda [...]
Python Envy
Wednesday, 24 May 2006
GaryKing asks:
I’ve been looking at Ruby quite recently while working on Montezuma with John Wiseman on a port of Ferret (which is a ruby port of the java Lucene text indexing engine). I don’t see anything particularly special about Ruby; overall, it seems like another reinvention of the wheel with more syntax with which to [...]
Self-Describing Lisp
Saturday, 13 May 2006
Here’ s a list of documentation functions available over the LISP REPL
(describe #’foo)
(documentation #’foo t)
(apropos "foo")
(disassemble #’foo)
(symbol-plist ‘foo)
CLISP and Mel-base
Saturday, 13 May 2006
Unlike Python, Lisp doesn’t come with any standard libraries for SMTP client. The folks at #LISP on IRC suggested I try mel-base. It was a complete disaster. The way common lisp is, one can expect to spend more time fiddling with libraries than writing code.
asdf-install on clisp + windows
Saturday, 6 May 2006
Update 3 July 2007: Chris Done has provided a new guide.
Since clisp is the only viable free common lisp on Windows at the moment, and asdf-install is the most vibrant of all lisp distributed library solution, we need clisp and asdf-install to run properly. Lots of people have hit problems trying though:
This google groups thread [...]
Adventures with CLISP on Windows 2
Wednesday, 26 April 2006
I’m making little bits of headway with ASDF on Clisp (Windows).
Earlier I couldn’t get the asdf sources from Sourceforge via anonymous CVS checkout. The ASDF entry on CLiki is quite misleading in this regard. I suspect CVS has been turned off or never turned on in the project. The good news is that I [...]
Adventures with CLISP on Windows 1
Sunday, 23 April 2006
Here are some notes taken during a quick session with CLISP.
Indentation Based Lisp
Thursday, 16 February 2006
Paul Graham’s take on Lisp without the nail clippings is RTML, the templating language which powers Yahoo Store.
My-Name ()
TITLE "My Name Is"
BODY
TEXT "Hello, my name is "
LINEBREAK
IMAGE source RENDER text @name
[...]
Picking exotic languages
Friday, 10 February 2006
Dear colleague, and you intend to develop in a language that has lukewarm company support: don’t do it.
It’s hard enough debugging someone else’s code, and it is even harder debugging unfamiliar code written in someone else’s language, with an unfamiliar tool (like emacs) that I haven’t even installed on my workstation, with unfamiliar semantics (e.g. [...]