freenode/#lisp - IRC Chatlog
Search
4:34:41
edgar-rft
ealfonso, you can FMAKUNBOUND the LDB function in your Lisp code before you're dumping the image.
4:43:18
phoe
edgar-rft: I do not think he means #'LDB but rather he means SBCL's low level debugger.
6:14:24
phoe
Do I want to treat my RDBMS as plain old data store, and therefore have all logic on the Lisp side
6:15:43
phoe
I'll learn PL/PGSQL that way, and then end up writing the same in Lisp nonetheless because hell, I prefer to debug Lisp rather than to debug procedural SQL.
6:17:53
phoe
I was initially thinking about performance, but then remembered that premature optimization is the sqrt of all evil and it's easy to speculate about something that does not yet exist.
7:09:57
phoe
I need a Common Lisp utility that, given some kind of lambda list with annotated types, and a function's return value, will give me a valid DECLAIM FTYPE form.
7:11:14
phoe
Something like ((foo string) bar (baz (or symbol number))) (values t boolean) as input, and (function (string t (or symbol number)) (values t boolean)) as output.
10:35:30
elderK
Hey guys, I was wondering how people parse binary formats in CL. I've seen read-sequence?
10:39:19
pjb
elderK: notice that you can also specify the element-type, so you can read files bit by bit, or 3-bit by 3-bit, etc.
10:39:52
pjb
(but other than 8-bit by 8-bit and possibly bit-by-bit on current hardware, it's probably implementation dependent how the bytes are mapped to the files).
10:42:48
elderK
pjb: I just figure you'd need to create functions so that you could say, read-u32 from some arbitrary position in the blob that you've loaded.
10:43:55
phoe
you could read the code for https://github.com/rpav/fast-io to learn how it works - it has functions for {read,write}[u]{8,16,32,64,128}{-be,-le}
10:44:03
pjb
yeah, bit is not portable or useful. clall -r '(with-open-file (out (format nil "/tmp/foo-~A" (lisp-implementation-type)) :direction :output :if-exists :supersede :if-does-not-exist :create :element-type (quote bit)) (write-sequence #(1 0 1 1 0 1 0 0 1 1) out) (file-length out))' ; ls -l /tmp/foo-* ; for f in /tmp/foo-* ; do od -t x1 "$f" ; done
10:44:31
pjb
clisp writes bit by bit, but writes first a 32-bit little endian file-length (in number of bits). the other implementations write one bit per octet, which is useless.
10:45:06
pjb
This is why the usual advice is to use (unsigned-byte 8) as element-type, and format the binary file yourself, octet-by-octet.
10:46:57
phoe
AFAIR it's pjb's script that calls the following code with all CL implementations available on the machine
11:33:34
random9899
found some good youtube vids about lisp too https://www.youtube.com/channel/UCufkSSu1trzm9nB-jYOPuvw and http://www.uio.no/studier/emner/matnat/ifi/INF4820/h17/timeplan/index.html#2-2
15:58:29
jmercouris
here's the top of the makefile: https://gist.github.com/4de76bd2e6250b5a8d54588e50c60a45
15:59:04
pjb
jmercouris: http://www.talisman.org/~erlkonig/documents/commandname-extensions-considered-harmful
15:59:18
phenoble
I'm currently learning CL. Any recommended resources on learning CL debugging techniques? I finished Seibel's "Practical Common Lisp" today. Nothing about debugging in there.
16:01:03
pjb
You may have extensions on directory names, when they're "file packages", as implemented on NeXTSTEP/OpenStep/MacOSX/iOS.
16:01:06
beach
phenoble: Unfortunately, the debugging tools available for free Common Lisp implementations are not so great.
16:01:46
pjb
phenoble: I have a little tutorial for clisp debugging. https://www.cliki.net/TutorialClispDebugger
16:01:54
beach
phenoble: Start by putting (proclaim '(optimize (debug 3) (speed 0) (safety 3) (compilation=speed 0))) in your start-up file.
16:02:06
phenoble
beach, jmercouris: that's unfortunate. Though I got the impression that some "trace" functionality would be a thing in CL debugging?
16:02:42
pjb
phenoble: not all implementation implement the STEP operator, or starting a trace from the debugger. For this, have a look at my conforming cl-stepper.
16:03:04
beach
phenoble: Otherwise, you need to stick a (break) in the place where you want to stop, then C-c C-c to compile that function, then run your program.
16:03:48
beach
phenoble: From the backtrace, you can then find local variables, and you can use the SLIME inspector to inspect them.
16:04:56
beach
phenoble: Most of the time, though, you run the program until it fails, look at the backtrace. Figure out why things were called the way they were. Hit SPACE in front of your stack frames, look at variables, inspect, etc.
16:05:22
pjb
phenoble: the thing is that since we can easily just redefine a function while running the program, lisp debugging techniques are often source-based. You just edit the source of your function, adding print and break and other forms to help you debug it, re-evaluate the function, and go on executing.