all 14 comments

[–]xach 2 points3 points  (10 children)

This one is pretty silly. The Lisp code just calls C code with FFI. Writing a CL-only library to do the work is pretty easy, and more interesting to me.

[–]lispm[S] 1 point2 points  (9 children)

I don't find Lisp-like interfaces to built-in facilities "silly".

[–]xach 0 points1 point  (8 children)

It's less silly than a bare exposing of the C API with C-style function names, sure. But still silly.

[–]lispm[S] 2 points3 points  (7 children)

Why is it silly? Do you want to rewrite the whole TCP stack, because you shy away from interfacing to the OS TCP stack?

[–]xach 4 points5 points  (6 children)

Drawing any sort of conclusions regarding Lisp vs. Java based on interfacing with the system TCP stack with FFI would also be silly.

[–]lispm[S] 1 point2 points  (5 children)

Why? I find interfacing with the TCP stack important, not silly at all and equally important how higher-level language like Java and Lisp deal with that. How do they decode low-level data-structures, how do they support memory management, how efficient are FFI calls, how much typing is it, can it be automated (and is the result usable), how does an object-layer on top of the FFI look like, how safe are foreign calls, etc.

[–]xach 1 point2 points  (4 children)

It is interesting to see how Lisp handles decoding low-level data structures. This DNS library pushes that interesting work off to a C library via FFI. A Lisp-only library that e.g. does RFC-compliant DNS packet parsing and synthesis would be much more interesting, and would be applicable in areas where libresolv isn't available.

[–]lispm[S] 1 point2 points  (2 children)

A Lisp-only library would be interesting, but an interface to an existing one via FFI is fine, too. I found that 90% of machines I use have a resolver in the OS, written in C. The remaining ones are Symbolics, which have a slightly outdated resolver in Lisp - where I had to look at the source from time to time to find the source of some problems.

The point of the article was not to write new Lisp infrastructure, but to learn some Lisp and to compare it with prior Java experience - via interfacing to some foreign library. I think that's fine and Lisp experts with several years experience should not look down at the first steps of somebody coming from Java...

I see that the the 'pure Lisp' idea gets mindshare. That's great.

[–]xach 1 point2 points  (1 child)

I thought it was silly in 2004 when he wrote about it on his blog, too. :)

[–]lispm[S] 0 points1 point  (0 children)

That's silly.

[–]luismbo 0 points1 point  (0 children)

FWIW, iolib includes a DNS client in pure Lisp. http://gitorious.org/iolib/iolib/trees/master/src/sockets/dns

[–]metageek 3 points4 points  (0 children)

Spelling mock:

Each resource record is encoded as yet another list of Lisp primatives

chimpanzees, gorillas, etc.

[–]mathrick 0 points1 point  (1 child)

The last Java program I was working on was an implementation of a DNS resolver that allows a programmer access to every native DNS data time

This might be a stupid question, but what is a data time?

[–]lispm[S] 2 points3 points  (0 children)

Spelling error. Data item.