The Hobbit Hole

In a hole there lived a hobbit. Not a nasty, dirty, wet hole, filled with the ends of worms and an oozy smell, nor yet a dry, bare, sandy hole with nothing in it to sit down on or to eat: it was a hobbit-hole, and that means comfort.

9/10/2009

Vibrams, Part 3

Filed under: General — bilbo @ 2:21 pm

It’s been a couple of weeks, and I haven’t run much, but I have put in a couple of good runs with the VFFs.

The first was a five mile run on 8/28. The run itself was fine, but I had the same pains as I did when first starting to run in the shoes. Not too surprising considering this was the longest run yet in the shoes.

On Monday this week I went for a 3 mile run on the treadmill. Really had no problems to speak of, other than my right ankle has been weak, almost feeling like it has just recovered from a bad twist or sprain.

This morning we went and hiked Mt. Pilchuck. It’s a pretty easy hike up 2700 feet over 2.7 miles. Lots of rocks though, so I decided to wear my normal running shoes rather than the VFFs. I’m glad I did, but that’s not really the interesting part. The interesting part is the jogging I was doing in the parking lot while waiting for everyone else to get down the mountain. As I was jogging around trying to keep warm, I noticed that it was hard for me to do the mid-foot strike I can easily, almost naturally, do while wearing the VFFs. Instead, I was running heel-to-toe. As I tried to adjust, it felt as if the rubber on the rear of the sole was weighing my heel down, so my foot was naturally striking at the heel.

9/4/2009

Essential Scheme

Filed under: Programming — bilbo @ 1:25 pm

For those who are involved, the process for R7RS has begun again. The R6RS standard didn’t leave many happy, so of course there is already heated debate starting on this standard.

One area that was readily agreed on is that Scheme needs to be split into 2 languages, a small language for academic purposes, a larger language for commercial/industrial programming.

There have been several threads going on about the different features that should be included, or excluded, from the small scheme. I thought about what was needed to be essential to a dialect for it to be considered scheme. As I was pondering this, a message from David Horn appeared on the r6rs-discuss mailing list that attempts to do what I was thinking of. I’ve reprinted it here for my own convenience, with formatting changes.

Essential Scheme is the minimal subset of the language expected to be supported by any Scheme system. It represents the fundamental and simple core of the language. It is lightweight at the semantic and implementation level. It is useful for research, prototyping, language experimentation, and understanding existing teaching materials. Its specification is comparable in size to research paper accounts of Scheme (i.e. much smaller than even R3RS).

Core
<variable>
(quote <datum>)
‘<datum>
<constant>
(<operator> <operand1> …)
(lambda <formals> <body>)
[includes dot patterns, body is sequence of one or more expressions.]
(if <test> <consequent> <alternate>)
(set! <variable> <expression>)

Derived
(cond <clause1> <clause2> …)
(let <bindings> <body>)
(letrec <bindings> <body>)
(begin <expression1> <expression2> …)

Programs
(define <variable> <expression>) …

Procedures

Booleans
(not obj)
(boolean? obj)

Equivalence predicates
(eqv? obj1 obj2)
(eq? obj1 obj2)
(equal? obj1 obj2)

Pairs and Lists
(pair? obj)
(cons obj1 obj2)
(car pair)
(cdr pair) ; and caar…cddddr
(null? obj
(list obj …)
(length list)
(append list1 list2)

Symbols
(symbol? obj)
(symbol->string symbol)
(string->symbol string)

Numbers
(number? obj) ;; Full tower is optional
(complex? obj)
(real? obj)
(rational? obj)
(integer? obj)
(zero? z)
(positive? x)
(negative? x)
(odd? n)
(even? n)
(exact? z)
(inexact? z)
(= z1 z2)
(< x1 x2)
(> x1 x2)
(< = x1 x2)
(>= x1 x2)
(max x1 x2)
(min x1 x2)
(+ z1 z2)
(* z1 z2)
(- z1 z2)
(/ z1 z2)
(abs z)
(quotient n1 n2)
(remainder n1 n2)

Characters
(char? obj)
(char=? char1 char2)
(char< ? char1 char2)
(char>? char1 char2)
(char< =? char1 char2)
(char>=? char1 char2)
(char->integer char)
(integer->char n)

Strings
(string? obj)
(string-length string)
(string-ref string k)
(string=? string1 string2)
(string< ? string1 string2)
(string>? string1 string2)
(string< =? string1 string2)
(string>=? string1 string2)
(substring string start end)
(string-append string1 string2)
(string->list string)
(list->string chars)

Vectors
(vector? obj)
(make-vector k)
(vector obj …)
(vector-length vector)
(vector-ref vector k)
(vector-set! vector k obj)
(vector->list vector)
(list->vector list)

Control features
(procedure? obj)
(apply proc args)
(map proc list)
(for-each proc list)
(call-with-current-continuation proc)

I’m not sure I agree with everything on the list, such as complex numbers being required for Scheme. Also, there doesn’t seem to be any provision for macros, so I would at least add defmacro. I won’t try to debate the merits of hygienic macros vs. lisp macros here, but I feel that defmacro would be easier to implement and to be more versatile, as things that are unrestricted generally are. Besides, hygienic macros can be implemented via defmacro.

Tags: ,