Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Calling All Noobs: Mini RtL Survey

53 views
Skip to first unread message

Kenny Tilton

unread,
Jan 8, 2006, 4:29:58 PM1/8/06
to
So WTF? This used to be a nice, restful graveyard. Past few months have
gotten ridiculous. What are all you noobs doing here?

0. Hero worship: http://www-formal.stanford.edu/jmc/frames.html
1. Paul Graham
2. Peter Seibel
3. The Reddit Incident (nah, too recent)
4. Java finally got to me (and what took it so long)
5. http://wiki.alu.org/The%20Road%20to%20Lisp%20Survey
6. The Savages of comp.lang.lisp are good training for the Bulls of Pamplona
7. Other ________________________________________

thx,

kenny

ps. And stop stepping on my flowers

Creighton Hogg

unread,
Jan 8, 2006, 5:54:21 PM1/8/06
to

I got into Lisp a few months ago because of looking into
Genetic Programming and the writings of St. Graham the
Advocator. I don't even like alot of what he says, but damn
he can be persuasive.

Sylvain

unread,
Jan 8, 2006, 6:58:44 PM1/8/06
to
Creighton Hogg wrote:
> of St. Graham the
> Advocator. I don't even like alot of what he says, but damn
> he can be persuasive.

same here, I kinda cringe when he says you're no better
than dead when you are over 38 -- not quite in so many
words but that's the gist of it -- but that's how I got
interested too.

--Sylvain (a 'runner' and proud of it)

Markus Grueneis

unread,
Jan 8, 2006, 7:39:09 PM1/8/06
to
Kenny Tilton wrote:
> [...] What are all you noobs doing here?
>

Lurking.

> 0. Hero worship: http://www-formal.stanford.edu/jmc/frames.html
> 1. Paul Graham
> 2. Peter Seibel
> 3. The Reddit Incident (nah, too recent)
> 4. Java finally got to me (and what took it so long)
> 5. http://wiki.alu.org/The%20Road%20to%20Lisp%20Survey
> 6. The Savages of comp.lang.lisp are good training for the Bulls of
> Pamplona
> 7. Other ________________________________________

Definitly Seibel, as I haven't yet programmed in Java. Just wanted to
throw away old unused books, and suddenly noticed I already had the
dead-tree version of PCL lying around, full of dust. With some
compassion I put it where it should have gone long before, beside my
notebook.

Finally, there were no books to throw away, but now I've a reason to
complain about my day-to-day job.

nall...@gmail.com

unread,
Jan 8, 2006, 8:19:41 PM1/8/06
to
>7. Other ________________________________________

Common Lisp was my first language. I developed a stereo vision and a
natural language parsing algorithm with pen and paper not knowing what
programming was. (I had recently dropped out of the English department
of the local uni and was kind of searching for direction) I read on the
internet that there was this thing called "lisp" that people used for
"ai". So I bought a book on C and a book on lisp. Three days later I
took the book on C back, I had this immediate "oh shit" reaction to
lisp that I'd never gotten from anything else before.

Two later I took a week off of work and drove down to ILC 05 to see
what's up. I think the people I met and the things I saw people had
done have also had a huge effect.

>1. Paul Graham
>2. Peter Seibel

The book was ANSI Common Lisp. I bought PCL at ILC 05. Both were
excellent, IMHO

8. _______I_Didn't_Know_Any_Better___________________

Nick

Giorgos Keramidas

unread,
Jan 8, 2006, 8:47:02 PM1/8/06
to
Kenny Tilton wrote:
> So WTF? This used to be a nice, restful graveyard. Past few months
> have gotten ridiculous. What are all you noobs doing here?

Learning to #'walk ;-)

> 0. Hero worship: http://www-formal.stanford.edu/jmc/frames.html
> 1. Paul Graham
> 2. Peter Seibel
> 3. The Reddit Incident (nah, too recent)
> 4. Java finally got to me (and what took it so long)
> 5. http://wiki.alu.org/The%20Road%20to%20Lisp%20Survey
> 6. The Savages of comp.lang.lisp are good training for the Bulls of Pamplona
> 7. Other ________________________________________

7. A combination of being an Emacs user and having written my fair share
of personal .emacs customization stuff, reading the articles of Paul
Graham and the freely available copy of "On Lisp", the online
writings of Peter Norvig, a trip to San Francisco combined with an
afternoon of bookworm-fun at Border's, where I bought myself Peter
Seibel's PCL and a lot of lurking here and comp.lang.scheme, which
helped me learn to appreciate the posts of a few select folks.

Eli Gottlieb

unread,
Jan 8, 2006, 9:09:16 PM1/8/06
to
Read Graham and had a copy of "Lisp: A Gentle Introduction to Symbolic
Computation" from my parents' university days lying around, so I decided
to learn this "most powerful language ever". Bought "Practical Common
Lisp" on paper and have been tinkering since.

John Thingstad

unread,
Jan 9, 2006, 2:44:57 AM1/9/06
to
On Sun, 08 Jan 2006 22:29:58 +0100, Kenny Tilton
<NOktil...@nyc.rr.com> wrote:

Definatly the reddit incident..
I'm trying out kpax right now!
Really cool.. (http://homepage.mac.com/svc/)
Also read his report.

--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/

micromoog

unread,
Jan 8, 2006, 8:43:25 PM1/8/06
to


My eventual goal is to learn Common Music
(http://commonmusic.sourceforge.net), which is a set of Lisp libraries.
Properly learning Lisp itself has been so interesting, though, that
I've yet to return to the original task.

Paul Graham's essays helped too.

I don't know if you use Reddit (collective scream), but the "Hot" list
has been carrying a number of Lisp- and functional-programming-related
articles pretty much every day. And I don't think this has anything to
do with the language it was originally written in ;) There does indeed
seem to be a general increase in interest in Lisp.

GP lisper

unread,
Jan 9, 2006, 3:10:11 AM1/9/06
to
On Sun, 08 Jan 2006 21:29:58 GMT, <NOktil...@nyc.rr.com> wrote:
> What are all you noobs doing here?
>
> 7. Other ________________________________________

The 15 year old software I wanted to run was written in near ANSI
lisp. Now it is too late to turn back...


--
If you don't like LOOP, how do you feel about DOLIST ?

nall...@gmail.com

unread,
Jan 8, 2006, 10:43:39 PM1/8/06
to
>Two later I took a week off of work and drove down to ILC 05 to see
>what's up.

Two [months] later I took a week off of work and drove down to ILC 05


to see
what's up.

;)

nick

jos...@corporate-world.lisp.de

unread,
Jan 9, 2006, 4:29:48 AM1/9/06
to

micromoog schrieb:

> My eventual goal is to learn Common Music
> (http://commonmusic.sourceforge.net), which is a set of Lisp libraries.
> Properly learning Lisp itself has been so interesting, though, that
> I've yet to return to the original task.

Then don't miss the excellent book 'Notes from the Metalevel' by
Heinrich K. Taube,
which explains Common Music usage in depth. It also comes with
a CDROM with the examples as Lisp sources. A 'must have' for any
serious Common Music user.

Kenny Tilton

unread,
Jan 9, 2006, 4:50:47 AM1/9/06
to
GP lisper wrote:
> On Sun, 08 Jan 2006 21:29:58 GMT, <NOktil...@nyc.rr.com> wrote:
>
>>What are all you noobs doing here?
>>
>>7. Other ________________________________________
>
>
> The 15 year old software I wanted to run was written in near ANSI
> lisp. Now it is too late to turn back...
>
>

the punch line would be if you ended up tossing the 15 year-old software
but kept on using the language in which it was written.

:)

kt

Ulrich Hobelmann

unread,
Jan 9, 2006, 4:56:59 AM1/9/06
to
GP lisper wrote:
> On Sun, 08 Jan 2006 21:29:58 GMT, <NOktil...@nyc.rr.com> wrote:
>> What are all you noobs doing here?
>>
>> 7. Other ________________________________________
>
> The 15 year old software I wanted to run was written in near ANSI
> lisp. Now it is too late to turn back...

Hehe, sounds like the ultimate trap. Just like Unix lured us all into
using C, and Windows made it C++. The Mac sports ObjC, so I guess we
have to wait for Movitz ;)

--
the bottom line is that a JavaSchool that won't teach C and won't teach
Scheme is not really teaching computer science, either. -- Joel Spolsky

micromoog

unread,
Jan 9, 2006, 10:18:58 AM1/9/06
to
jos...@corporate-world.lisp.de wrote:
> micromoog schrieb:
>
> > My eventual goal is to learn Common Music
> > (http://commonmusic.sourceforge.net), which is a set of Lisp libraries.
> > Properly learning Lisp itself has been so interesting, though, that
> > I've yet to return to the original task.
>
> Then don't miss the excellent book 'Notes from the Metalevel' by
> Heinrich K. Taube,
> which explains Common Music usage in depth. It also comes with
> a CDROM with the examples as Lisp sources. A 'must have' for any
> serious Common Music user.
>

I just gave it to myself for Christmas :) As soon as I get through _A
Gentle Introduction to Symbolic Computation_, I plan to delve in. I've
been cracking it open now and then to random pages, and so far every
one has seemed way too much fun.

Will McCutchen

unread,
Jan 9, 2006, 12:02:32 PM1/9/06
to
> So WTF? This used to be a nice, restful graveyard. Past few months have
> gotten ridiculous. What are all you noobs doing here?

Blame it on Paul Graham for the salespitch and Peter Seibel (and
Practical Common Lisp) for making it look understandable enough.

Eli Gottlieb

unread,
Jan 9, 2006, 12:39:35 PM1/9/06
to
Excuse us for wanting to learn a new language!

Philippe Lorin

unread,
Jan 9, 2006, 1:02:19 PM1/9/06
to
Kenny Tilton wrote:
> So WTF? This used to be a nice, restful graveyard. Past few months have
> gotten ridiculous. What are all you noobs doing here?

I really don't have a clue. As to why I *wasn't* here, I mean. It took
me far too long to recognize the merits of Lisp as I kept greenspunning
away with C and Java. I finally came because I was so tired of it that I
was looking at any possible exit. I was considering how Python didn't
quite fill the bill when I met a nice Lisp hacker who managed to
convince me that all I desired and missed was already there waiting for
me in Lisp. He was right.


> 1. Paul Graham
> 2. Peter Seibel

Both helped a lot.

Other reasons:
- I was infuriated to see that several music programming languages were
based on Lisp. Why Lisp!? I wanted to try them. (I've not yet.)
- I was exposed to the Holy Emacs.

Giorgos Pontikakis

unread,
Jan 9, 2006, 2:09:53 PM1/9/06
to
I had been programming in fortran for years, and I felt there should be

a better way to program a computer. Tried to learn C and C++ for a
while, but this was as boring as it gets.

Then, while working in a job unrelated to programming, and having
few things better to do in my free time:

-- With Graham's articles my heart started beating quiclky.
-- With SICP I fell in love.
-- With Seibel's and Graham's books I got married (with a
beautiful but very demanding wife).
-- Now, trying to write a real (numerical) app is like expecting
a child.

Giorgos

Kenny Tilton

unread,
Jan 9, 2006, 9:25:50 PM1/9/06
to

Thanks to all the respondents.

The reasons are no different than what we learned from the original survey.

The winner and STILL champeeeen, Paaauuullll Graham. Not the
word-of-mouth spike I was suspecting and kinda hoping for... well, hang
on, in a way:

correct me if I am wrong, but I think blogging explains the upsurge. And
blogging is done by everyday hackers as well as published certified
gurus. So it is kinda word of mouth.

Yes? No? ie, Yeah, it is still PG, but more people are /reading/ PG and
others?

kenny

GP lisper

unread,
Jan 9, 2006, 9:32:13 PM1/9/06
to

Oh, I've kept using CL, with many thanks to you along the way. I
won't toss that software, it's a bit too valuable, but I do know how
improve it now.

GP lisper

unread,
Jan 9, 2006, 9:40:49 PM1/9/06
to
On Mon, 09 Jan 2006 10:56:59 +0100, <u.hob...@web.de> wrote:
> GP lisper wrote:
>> On Sun, 08 Jan 2006 21:29:58 GMT, <NOktil...@nyc.rr.com> wrote:
>>> What are all you noobs doing here?
>>>
>>> 7. Other ________________________________________
>>
>> The 15 year old software I wanted to run was written in near ANSI
>> lisp. Now it is too late to turn back...
>
> Hehe, sounds like the ultimate trap.

It was, but it helped that there was a published paper that pretty
much lined me up pointing at lisp, after previously trying with
another language. That paper+code was good enough to see me thru the
effort of 'learning lisp' after I recognized that lisp is orthogonal
to every other language I've learned. After that, it was too late and
lisp is clearly the last language I will ever learn. As basically an
assembly language programmer, it's scary nowdays to start thinking
(sometimes) in CLOS.

Ties Stuij

unread,
Jan 10, 2006, 4:00:26 AM1/10/06
to
> The reasons are no different than what we learned from the original survey.
> The winner and STILL champeeeen, Paaauuullll Graham.

well i for one am glad PG is mad about Lisp. i'd be doing some real
frustrated programming if he was a BASIC zealot.

Rob Warnock

unread,
Jan 11, 2006, 1:40:13 AM1/11/06
to
GP lisper <spam...@clouddancer.com> wrote:
+---------------

| As basically an assembly language programmer, it's scary nowdays
| to start thinking (sometimes) in CLOS.
+---------------

You want scary? I'll give you scary! Try peeking & poking hardware
registers from within CMUCL, heh-heh! MMAP some hardware into your VM
and then do (setf (system:sap-ref-32 (system:int-sap addr) 0) new-value)
[which in C is "*((u32*)(addr)+0) = new-value"]. I have a whole toolkit
of such low-level hacks that I use to do user-mode debugging of hardware
at my current POE.

Long ago [1992] at a PPOE, I did it in Tcl, with a C bolt-on (DSO) for
the low-level stuff. Then I moved to SCM, then to MzScheme, and now
finally to CMUCL -- which turns out to be able to do the whole thing
inside the language, without the grotty C DSO add-on. [Though if you
*need* a grotty DSO add-on for something, CMUCL can handle that, too.]


-Rob

-----
Rob Warnock <rp...@rpw3.org>
627 26th Avenue <URL:http://rpw3.org/>
San Mateo, CA 94403 (650)572-2607

Edi Weitz

unread,
Jan 11, 2006, 4:14:10 AM1/11/06
to
On Wed, 11 Jan 2006 00:40:13 -0600, rp...@rpw3.org (Rob Warnock) wrote:

> You want scary? I'll give you scary! Try peeking & poking hardware
> registers from within CMUCL, heh-heh! MMAP some hardware into your
> VM and then do (setf (system:sap-ref-32 (system:int-sap addr) 0)
> new-value) [which in C is "*((u32*)(addr)+0) = new-value"]. I have a
> whole toolkit of such low-level hacks that I use to do user-mode
> debugging of hardware at my current POE.

Sounds interesting. Do you have plans to make that publicly
available?

Cheers,
Edi.

--

Lisp is not dead, it just smells funny.

Real email: (replace (subseq "spam...@agharta.de" 5) "edi")

Rob Warnock

unread,
Jan 11, 2006, 6:01:57 AM1/11/06
to
Edi Weitz <spam...@agharta.de> wrote:
+---------------

| rp...@rpw3.org (Rob Warnock) wrote:
| > You want scary? I'll give you scary! Try peeking & poking hardware
| > registers from within CMUCL, heh-heh! MMAP some hardware into your
| > VM and then do (setf (system:sap-ref-32 (system:int-sap addr) 0)
| > new-value) [which in C is "*((u32*)(addr)+0) = new-value"]. I have a
| > whole toolkit of such low-level hacks that I use to do user-mode
| > debugging of hardware at my current POE.
|
| Sounds interesting. Do you have plans to make that publicly available?
+---------------

I guess I could put up the very lowest-level stuff (~150 lines), but:

1. It's more a set of patterns than a true "module". It all loads
into the "CL-USER" package, since that's where I usually work.

2. I don't have a fully fleshed-out example of how to use it for
something serious that's not proprietary to some current or
previous employer [most real applications involve page after page
of symbolic hardware register locations and bit definitions!].

3. The low-level stuff isn't very useful if you don't have any
interesting mmap'able hardware lying around you want to poke at... ;-}

4. If applied to introspection of CMUCL itself [I've been using it
for some of that lately], much of it is *NOT* GC-safe. You have
to be very sure you know what you're doing, and sometimes need
to do a (GC :FULL T) before starting a sequence of operations
[or maybe wrap a SYSTEM:WITHOUT-GCING around it].

5. Calling MAKE-LISP-OBJ with a bad argument can easily crash CMUCL,
and maybe your system.

6. You have to un CMUCL as root to mmap I/O memory space. Running
CMUCL as root can crash your system. YOU HAVE BEEN WARNED!

But if you really think anyone else would find it useful... ;-} ;-}

Most of it is just abbreviations and shortcuts to facilities
that are already in CMUCL for anyone who looks at the source,
e.g., MAKE-LISP-OBJ is just (IMPORT 'KERNEL:MAKE-LISP-OBJ);
R32 and W32 are just SYSTEM:SAP-REF-32 wrappers:

(defun r32 (addr)
(declare (optimize (speed 3) (debug 0) (safety 0)))
(system:sap-ref-32 (system:int-sap addr) 0))

(defun w32 (addr &rest values)
(declare (optimize (speed 3) (debug 0) (safety 0)))
(loop for i fixnum from 0 by 4
and v of-type (unsigned-byte 32) in values
do (setf (system:sap-ref-32 (system:int-sap addr) i) v))
(values))

R8/W8/R16/W16 are similar, and D32 (formerly named DUMP32) is just
a loop around R32 & FORMAT. My MMAP is just a thin wrapper around
UNIX:UNIX-MMAP with a slightly simplified calling sequence for the
cases I mostly use, a typical use being (MMAP "/dev/mem" PCI-BUS-ADDRESS T)
[where the PCI bus address is where some device register got mapped
by the BIOS, which on Linux you find out *manually* with "lspci"]:

(defun mmap (file offset length &optional write-p)
(let* ((ofs32 (if (zerop (logand offset #x80000000))
offset
(- offset #x100000000))) ; Fake up a "(signed-byte 32)"
(mode (logior #+linux unix::O_SYNC ; Not on BSD (*sigh*)
(if write-p unix:O_RDWR unix:O_RDONLY)))
(fd (unix:unix-open file mode 0)))
(if (not fd)
(error "Can't open ~s: ~s" file (unix:get-unix-error-msg))
(unwind-protect
(let ((mode (logior unix:PROT_READ
(if write-p unix:PROT_WRITE 0))))
(system:sap-int
(unix:unix-mmap nil length mode unix:MAP_SHARED fd ofs32)))
(unix:unix-close fd)))))

Is this level stuff really interesting to others?

Edi Weitz

unread,
Jan 11, 2006, 6:07:01 AM1/11/06
to
On Wed, 11 Jan 2006 05:01:57 -0600, rp...@rpw3.org (Rob Warnock) wrote:

> But if you really think anyone else would find it useful... ;-} ;-}

Hehe, thanks.

> Is this level stuff really interesting to others?

Not immediately. But I have a project in preparation where this might
turn out to be useful. And, anyway, it's always nice to know what's
already out there... :)

Thanks,

John Thingstad

unread,
Jan 11, 2006, 6:29:45 AM1/11/06
to
On Wed, 11 Jan 2006 12:01:57 +0100, Rob Warnock <rp...@rpw3.org> wrote:


>
> (defun w32 (addr &rest values)
> (declare (optimize (speed 3) (debug 0) (safety 0)))
> (loop for i fixnum from 0 by 4
> and v of-type (unsigned-byte 32) in values
> do (setf (system:sap-ref-32 (system:int-sap addr) i) v))
> (values))
>

Speaking of which the type declarations in the loop variable really
interested me. If fills a whole which declare can't cover.
But it dosn't seem to work in LspWorks.
Is this a SBCL spesific addition?

Edi Weitz

unread,
Jan 11, 2006, 7:02:39 AM1/11/06
to
On Wed, 11 Jan 2006 12:29:45 +0100, "John Thingstad" <john.th...@chello.no> wrote:

> On Wed, 11 Jan 2006 12:01:57 +0100, Rob Warnock <rp...@rpw3.org> wrote:
>
>> (loop for i fixnum from 0 by 4
>

> Speaking of which the type declarations in the loop variable really
> interested me. If fills a whole which declare can't cover.
> But it dosn't seem to work in LspWorks.

Why do you think that?

CL-USER 11 > (pprint (macroexpand '(loop for i below 4 collect i)))

(BLOCK NIL
(MACROLET ((LOOP-FINISH () '(GO #:|end-loop-7571|)))
(LET ((#:|to-7574| 4) (#:|by-7575| 1) (I 0))
(LET ((#:|accumulator-7572| (LIST NIL)))
(DECLARE (TYPE LIST #:|accumulator-7572|))
(LET ((#:|aux-var-7577| #:|accumulator-7572|))
(TAGBODY (PROGN (WHEN (OR (>= I #:|to-7574|)) (GO #:|end-loop-7571|)))
#:|begin-loop-7570| (SETQ #:|aux-var-7577| (LAST (RPLACD #:|aux-var-7577| (LIST I))))
(PROGN
(LET ((#:|temp-7576| (+ I #:|by-7575|))) (SETQ I #:|temp-7576|))
(WHEN (OR (>= I #:|to-7574|)) (GO #:|end-loop-7571|)))
(GO #:|begin-loop-7570|)
#:|end-loop-7571| (RETURN-FROM NIL (CDR #:|accumulator-7572|))))))))

CL-USER 12 > (pprint (macroexpand '(loop for i fixnum below 4 collect i)))

(BLOCK NIL
(MACROLET ((LOOP-FINISH () '(GO #:|end-loop-7579|)))
(LET ((#:|to-7582| 4) (#:|by-7583| 1) (I 0))
(DECLARE (TYPE FIXNUM I)) ;; <------- LOOK HERE
(LET ((#:|accumulator-7580| (LIST NIL)))
(DECLARE (TYPE LIST #:|accumulator-7580|))
(LET ((#:|aux-var-7585| #:|accumulator-7580|))
(TAGBODY (PROGN (WHEN (OR (>= I #:|to-7582|)) (GO #:|end-loop-7579|)))
#:|begin-loop-7578| (SETQ #:|aux-var-7585| (LAST (RPLACD #:|aux-var-7585| (LIST I))))
(PROGN
(LET ((#:|temp-7584| (+ I #:|by-7583|))) (SETQ I #:|temp-7584|))
(WHEN (OR (>= I #:|to-7582|)) (GO #:|end-loop-7579|)))
(GO #:|begin-loop-7578|)
#:|end-loop-7579| (RETURN-FROM NIL (CDR #:|accumulator-7580|))))))))

> Is this a SBCL spesific addition?

It can be found in the ANSI spec. (Besides, Rob's code was for CMUCL
and not for SBCL, IIRC.)

Rob Warnock

unread,
Jan 11, 2006, 7:04:28 AM1/11/06
to
John Thingstad <john.th...@chello.no> wrote:
+---------------

| Rob Warnock <rp...@rpw3.org> wrote:
| > (defun w32 (addr &rest values)
| > (declare (optimize (speed 3) (debug 0) (safety 0)))
| > (loop for i fixnum from 0 by 4
| > and v of-type (unsigned-byte 32) in values
| > do (setf (system:sap-ref-32 (system:int-sap addr) i) v))
| > (values))
|
| Speaking of which the type declarations in the loop variable
| really interested me. If fills a whole which declare can't cover.
| But it dosn't seem to work in LspWorks. Is this a SBCL spesific addition?
+---------------

Nope, it's right in the CLHS:

http://www.lispworks.com/documentation/HyperSpec/Body/06_ai.htm
6.1.9 Notes about Loop

Types can be supplied for loop variables. It is not necessary to
supply a type for any variable, but supplying the type can ensure
that the variable has a correctly typed initial value, and it can
also enable compiler optimizations (depending on the implementation).

I'm using CMUCL, but I suspect SBCL is similar. And CLISP has no
problem with it.

Various sub-forms can take a TYPE-SPEC, though the "for-as-arithmetic"
sub-form is probably the most common usage:

http://www.lispworks.com/documentation/HyperSpec/Body/m_loop.htm#loop
...
with-clause::= with var1 [type-spec] [= form1]
{and var2 [type-spec] [= form2]}*
...
numeric-accumulation::= {count | counting | sum | summing | }
maximize | maximizing | minimize | minimizing
{form | it} [into simple-var] [type-spec]
...
for-as-arithmetic::= var [type-spec] for-as-arithmetic-subclause
...
for-as-in-list::= var [type-spec] in form1 [by step-fun]

for-as-on-list::= var [type-spec] on form1 [by step-fun]

for-as-equals-then::= var [type-spec] = form1 [then form2]

for-as-across::= var [type-spec] across vector

UNSIGNED-BYTE is also standard:

http://www.lispworks.com/documentation/HyperSpec/Body/t_unsgn_.htm

What Lispworks *might* not have is (UNSIGNED-BYTE 32) as a type
you can use in LOOP. Or it might require the optional OF-TYPE in
the FIXNUM declaration: Try replacing the "FOR I FIXNUM ..." with
"FOR I OF-TYPE FIXNUM ...". If that doesn't fix it, I'd file a bug.


-Rob

p.s.: The SYSTEM:SAP-REF-32 & SYSTEM:INT-SAP functions above
*are* unique to CMUCL, but that wasn't what you asked about.

Thomas F. Burdick

unread,
Jan 11, 2006, 10:14:52 AM1/11/06
to
rp...@rpw3.org (Rob Warnock) writes:

> p.s.: The SYSTEM:SAP-REF-32 & SYSTEM:INT-SAP functions above
> *are* unique to CMUCL, but that wasn't what you asked about.

Well, CMUCL and SBCL, and possibly Scieneer. They're probably common
to all SPICE-derived Lisps, though those three are probably the only
ones surviving.

--
/|_ .-----------------------.
,' .\ / | Free Mumia Abu-Jamal! |
,--' _,' | Abolish the racist |
/ / | death penalty! |
( -. | `-----------------------'
| ) |
(`-. '--.)
`. )----'

John Thingstad

unread,
Jan 11, 2006, 7:14:44 PM1/11/06
to
On Wed, 11 Jan 2006 13:02:39 +0100, Edi Weitz <spam...@agharta.de> wrote:

> (pprint (macroexpand '(loop for i fixnum below 4 collect i)))

Yes. Funny.. It seems to work with you example.
I tried of-type (integer 32) and that worked too.
Can't see why it didn't work with my code.
Anyhow thanks for the replies.

Ivan Boldyrev

unread,
Jan 12, 2006, 1:12:22 AM1/12/06
to
On 9351 day of my life Rob Warnock wrote:
> 6. You have to un CMUCL as root to mmap I/O memory space. Running
> CMUCL as root can crash your system. YOU HAVE BEEN WARNED!

Can (unix:unix-setuid +BLA-BLA-BLA+) after mmap'ing help?

--
Ivan Boldyrev

Today is the first day of the rest of your life.

James Bielman

unread,
Jan 12, 2006, 8:51:13 AM1/12/06
to
Edi Weitz <spam...@agharta.de> writes:

> On Wed, 11 Jan 2006 00:40:13 -0600, rp...@rpw3.org (Rob Warnock) wrote:
>
>> You want scary? I'll give you scary! Try peeking & poking hardware
>> registers from within CMUCL, heh-heh! MMAP some hardware into your
>> VM and then do (setf (system:sap-ref-32 (system:int-sap addr) 0)
>> new-value) [which in C is "*((u32*)(addr)+0) = new-value"]. I have a
>> whole toolkit of such low-level hacks that I use to do user-mode
>> debugging of hardware at my current POE.
>
> Sounds interesting. Do you have plans to make that publicly
> available?

FWIW, the CFFI library is largely implemented in terms of a low-level
interface like this. It could be useful for doing this sort of
unsavory pointer manipulation in multiple implementations (but heed
its pre-release status!).

There is also a draft addition to the spec for doing block copies from
Lisp vectors to pointers and vice versa (falling back to loops and
single-element access if necessary).

Rob's expression above looks like this in CFFI:

(setf (mem-ref (make-pointer addr) :int) 0)

Each of the CFFI backends has compiler macros that open-code MEM-REF
directly as an SAP-REF-32 (or the equivalent) when the type is
constant.

James

Robert Uhl

unread,
Jan 12, 2006, 6:36:35 PM1/12/06
to
Kenny Tilton <NOktil...@nyc.rr.com> writes:

> So WTF? This used to be a nice, restful graveyard. Past few months

> have gotten ridiculous. What are all you noobs doing here?
>
> 1. Paul Graham

First man I've read in a long while to take Lisp seriously (also esr, of
all men!).

> 2. Peter Seibel

PCL was an eye-opener; after that I started trying to convert a few of
my rainy-0day projects to CL. The rest is, if not history, at least a
tolerably amusing farce...

--
Robert Uhl <http://public.xdi.org/=ruhl>
Don't quote laws to us. We carry swords.
--Ptolemy Magnus, circa 50 BC

Peter Seibel

unread,
Jan 13, 2006, 1:09:16 AM1/13/06
to
Kenny Tilton <NOktil...@nyc.rr.com> writes:

> Kenny Tilton wrote:
>> So WTF? This used to be a nice, restful graveyard. Past few months
>> have gotten ridiculous. What are all you noobs doing here?
>> 0. Hero worship: http://www-formal.stanford.edu/jmc/frames.html
>> 1. Paul Graham
>> 2. Peter Seibel
>> 3. The Reddit Incident (nah, too recent)
>> 4. Java finally got to me (and what took it so long)
>> 5. http://wiki.alu.org/The%20Road%20to%20Lisp%20Survey
>> 6. The Savages of comp.lang.lisp are good training for the Bulls of
>> Pamplona
>> 7. Other ________________________________________
>> thx,
>> kenny
>> ps. And stop stepping on my flowers
>
> Thanks to all the respondents.
>
> The reasons are no different than what we learned from the original survey.
>
> The winner and STILL champeeeen, Paaauuullll Graham.

I wuz robbed!

-Peter

--
Peter Seibel * pe...@gigamonkeys.com
Gigamonkeys Consulting * http://www.gigamonkeys.com/
Practical Common Lisp * http://www.gigamonkeys.com/book/

Rob Warnock

unread,
Jan 13, 2006, 2:53:58 AM1/13/06
to
Ivan Boldyrev <boldyre...@cgitftp.uiggm.nsc.ru> wrote:
+---------------

| Rob Warnock wrote:
| > 6. You have to un CMUCL as root to mmap I/O memory space. Running
| > CMUCL as root can crash your system. YOU HAVE BEEN WARNED!
|
| Can (unix:unix-setuid +BLA-BLA-BLA+) after mmap'ing help?
+---------------

Not really, since mainly it's what you do with the MMAP'd area
that's potentially dangerous [regardless of which UID you do it
with]. E.g., if you reset a PCI device and don't restore the BARs
(or don't restore them correctly!) before the next time the O/S
touches that device... *BOOM!*

Rob Warnock

unread,
Jan 13, 2006, 3:34:04 AM1/13/06
to
James Bielman <jam...@jamesjb.com> wrote:
+---------------

| > rp...@rpw3.org (Rob Warnock) wrote:
| >> You want scary? I'll give you scary! Try peeking & poking hardware
| >> registers from within CMUCL, heh-heh! MMAP some hardware into your
| >> VM and then do (setf (system:sap-ref-32 (system:int-sap addr) 0)
| >> new-value) [which in C is "*((u32*)(addr)+0) = new-value"]. I have a
| >> whole toolkit of such low-level hacks that I use to do user-mode
| >> debugging of hardware at my current POE.
|
| FWIW, the CFFI library is largely implemented in terms of a low-level
| interface like this. It could be useful for doing this sort of
| unsavory pointer manipulation in multiple implementations...
+---------------

Yes, possibly, if anybody wanted to do it with multiple implementations.
In my experience, when doing really low-level stuff like this one tends
to pick one implementation and stick with it unless some really major
problem pushes you off it.

But you might be right if one comes at it from a different angle.
I view such low-level hacks not so much as a "library" as a "pattern"
[in the Gabriel/Alexander sense, not in the GoF "pattern=class" sense].
I've implemented "r32/w32/dump32/mmap/mpin/etc." in Tcl, SCM, MzScheme,
and CMUCL. [So far...] Yes, there might be a group of CL's for which
CFFI is a useful implementation technique for this pattern. But the
usefulness of the pattern (INHO) is broader than any single FFI or
even any single language.

+---------------


| Rob's expression above looks like this in CFFI:
| (setf (mem-ref (make-pointer addr) :int) 0)

+---------------

Uh... Not quite. Look again at what I wrote. CMUCL's SYSTEM:SAP-REF-32
takes *two* arguments, a SAP and a fixnum offset. I think you probably
meant this:

(setf (mem-ref (make-pointer (+ addr 0) :int) new-value)

or given the constant 0, this:

(setf (mem-ref (make-pointer addr) :int) new-value)


-Rob

p.s. When I said "my current POE" above, I merely meant that I'm
doing user-mode debugging of hardware there recently with CMUCL.
But I've been doing user-mode debugging of hardware & user-mode
driver development as long as I've been in computing, all the
way back to 1970 on a PDP-10! Some of the user-mode drivers even
*stayed* in user mode, never making it into the kernel [no need].
(But the PDP-10's "user-mode I/O" and "realtime" features were
quite advanced. Unix/Linux could *still* learn from them...)

James Bielman

unread,
Jan 13, 2006, 4:04:01 AM1/13/06
to
rp...@rpw3.org (Rob Warnock) writes:

> +---------------
> | Rob's expression above looks like this in CFFI:
> | (setf (mem-ref (make-pointer addr) :int) 0)
> +---------------
>
> Uh... Not quite. Look again at what I wrote. CMUCL's SYSTEM:SAP-REF-32
> takes *two* arguments, a SAP and a fixnum offset. I think you probably
> meant this:
>
> (setf (mem-ref (make-pointer (+ addr 0) :int) new-value)
>
> or given the constant 0, this:
>
> (setf (mem-ref (make-pointer addr) :int) new-value)

Ah whoops, sorry, I missed NEW-VALUE somehow... MEM-REF takes an
optional offset as well:

(setf (mem-ref (make-pointer addr) :int 0) new-value)

James

John Thingstad

unread,
Jan 13, 2006, 6:20:15 PM1/13/06
to
On Fri, 13 Jan 2006 09:34:04 +0100, Rob Warnock <rp...@rpw3.org> wrote:

For the record all Common Lisp's provide 1+..

Ivan Boldyrev

unread,
Jan 14, 2006, 4:45:15 AM1/14/06
to
On 9353 day of my life Rob Warnock wrote:
> Ivan Boldyrev <boldyre...@cgitftp.uiggm.nsc.ru> wrote:
> +---------------
> | Rob Warnock wrote:
> | > 6. You have to un CMUCL as root to mmap I/O memory space. Running
> | > CMUCL as root can crash your system. YOU HAVE BEEN WARNED!
> |
> | Can (unix:unix-setuid +BLA-BLA-BLA+) after mmap'ing help?
> +---------------
>
> Not really, since mainly it's what you do with the MMAP'd area
> that's potentially dangerous [regardless of which UID you do it
> with]. E.g., if you reset a PCI device and don't restore the BARs
> (or don't restore them correctly!) before the next time the O/S
> touches that device... *BOOM!*

But it is dangerous with any programming language. Why "CMUCL as root
can crash your system"? Anything as root can crash it :)

--
Ivan Boldyrev

Perl is a language where 2 x 2 is not equal to 4.

Rob Warnock

unread,
Jan 15, 2006, 3:24:22 AM1/15/06
to
Ivan Boldyrev <boldyre...@cgitftp.uiggm.nsc.ru> wrote:
+---------------
| But it is dangerous with any programming language. Why "CMUCL as
| root can crash your system"? Anything as root can crash it :)
+---------------

Just so. ;-}

0 new messages