freenode/#lisp - IRC Chatlog
Search
2:24:25
Xach
didi: i do it when i think someone might want to in-package to use no prefixes, but don't want to mess with implementation stuff. but it's also trivial to make a new package that uses PACKAGE
2:28:17
Ober
how do you get the line number of the offending error on sbcl when compiling and you hit the restarts/debugger?
2:30:46
didi
Oh, tip: it got nicer once I added (declaim (optimize (speed 0) debug safety)) to my ~/.sbclrc
2:37:59
Ober
rototilling a bunch of code back into a single file, but can't find the line where it's bombing on
2:54:07
loke
phoe: Seems to be as though he might be trying to redeclare a class from a standard class into a metaclass.
2:58:23
Ober
allegro built it fine, lw gave this error which seems more useful. Layout for class #<MANARDB:MM-METACLASS FILES 41B0C43E23> has changed from ((VALUE 0 8 MMAP-POINTER T) (IDX 8 8 MMAP-POINTER T))
3:12:23
drmeister
Ironclad generates a different MD5 digest than C++ code that I have and MD5 hash generators on the web - what am I doing wrong?
3:14:57
drmeister
The C++ code (My md5) and the MD5 calculator generate the same result. Ironclad - something different.
3:18:36
froggey
drmeister: I had a similar problem, it turned out my sin implementation wasn't accurate enough to build a table MD5 needed
3:28:16
phoe
drmeister: https://en.wikipedia.org/wiki/MD5 has the precomputed values, you could perhaps check if your sine gives you same hex numbers
3:38:23
drmeister
It's weird though - when calculate the integer value - it's fine. It's just when I convert it to a hex string that it zeros the last digits.
3:47:27
phoe
AFAIK you need to explicitly pass double-floats to sin, otherwise it pops out single floats that are not precise enough.
3:48:32
phoe
drmeister: (format nil "~x" (floor (* (expt 2 32) (sin (coerce 1.0 'double-float))))) ;=> "D76AA478"
4:02:13
drmeister
I wrote a function to generate the table and ran it in Clasp and Sbcl - I get the same results.
4:04:56
drmeister
(defun ccc () (let ((*print-base* 16)) (print (loop for i from 0 below 64 collect (truncate (* 4294967296 (abs (sin (float (1+ i) 0.0d0)))))))))
8:35:54
xificurC
when running a script with #!/usr/bin/sbcl --script is there a way to drop into a repl?
8:46:40
pjb
xificurC: so you have two choices: either call the repl toplevel at the end of the script (and use --script), or write a script to run sbcl without --script, but loading and running your lisp script.
8:54:29
pjb
it might be a good idea to wrap it in a handler-case if you want the script to keep control, and to redefine quit to exit sb-impl::toplevel-repl instead of killing sbcl if you want to take over after the repl.
9:03:37
easye
Lisp 101 question: how do I distinguish between a reference to proper list and a dotted list? The form (not (consp (cdr reference))) seems ridiculously non-terse, so I fear I am missing something basic.
9:05:12
pjb
You may use com.informatimago.common-lisp.cesarum.list:proper-list-p alexandria.0.dev:proper-list-p #+ccl ccl::proper-list-p
9:05:57
easye
pjb: ok, I guess that makes sense. Just thought there should be something in ANSI to do this. I was a bit surprised that LISTP acts as a complete synonym for CONSP.
9:06:36
pjb
Remember, lisp was implemented in 1960 on computers that were barely able to perform 1 million operations a second.
9:17:32
tfb
easye: distinguishing a proper list from something that isn't is non-trivial in general: is #1=(a b #1#) proper (no, but knowing it's not requires an occurs check)
9:20:06
easye
tfb: Yeah. I'm just having one of those moments of realizing my internal model of CONS structures needs some refreshing.
9:22:58
tfb
I spend my working life looking at a million lines of fortran and wondering much the same
9:24:52
easye
FORTRAN was my first language: studying a Decwriter printout of Colossal Cave and some of the Hollerith cards. Real fun for a pre-teen.
10:35:56
schweers
I have code which passes double-floats and '(unsigned-byte 64) values to helper functions and recieves them back. After reading about block compilation in the CMUCL manual I wanted to try it, but SBCL (which I use) removed support. So I put my helper functions into a LABELS form and put both DECLARE forms and defuns (which have preceding toplevel DECLAIM forms) into the LABELS form. I still get efficiency notes like th
10:38:02
schweers
one can specify a block of code which may consist of multiple functions, and specify which of them are callable from outside of the block. this means that the other functions can be implemented with local calls
10:38:14
pjb
Efficiency notes are just that. Nothing fundamentally wrong or erroneous. This only means that sbcl thinks that it could generate more efficient code if you did something else. But do YOU want to do something else?
10:38:49
pjb
schweers: well, by default all the functions in a single compilation unit can be called between them with local calls.
10:38:54
schweers
the CMUCL manual claims that block compilation can be used to pass non-descriptor values from and to funcions without boxing them
10:39:57
schweers
yet all calls to the helper functions in the labels form are known at compile time, so I’m confused about the notes
10:40:37
pjb
Now, you may want to add type declarations, and provide public API functions that will check-type the arguments to ensure the declarations are fullfilled.
10:41:21
pjb
If you have a lot of them, you can split them over several files, as long as you compile them in a with-compilation-unit. I don't know how to do that with asdf however.
10:48:14
schweers
is there something wrong with code of the following form: (labels ((helper (...) ...)) (defun foo (...) (helper ...)))
10:52:04
schweers
I thought I had to put the code in /local/ functions in order to utilize non-discriptor representations
10:53:15
Shinmera
I'm not sure I understand exactly what you want to do-- why not put the lables inside the defun if you want to share locals?
10:54:15
schweers
I have several “global” functions which use the same set of helpers which are not needed outside of these defuns
11:00:29
Shinmera
If you have non-tail recursion you can do local inlining to avoid the function-to-be-inlined to inline itself infinitely.
11:02:42
Shinmera
Or alternatively not declaiming it inline and using declare inline where you want it inlined. I think in that case it won't recursively inline.
11:03:36
schweers
or not inlining the recursive function itself but defining a wrapper function which can be declared inline?
11:08:16
pjb
schweers: there's nothing wrong, but it should be equivalent to (defun … (labels ((do-not-name-it-helper-or-anything-like-that …)) …))
11:08:49
pjb
schweers: the only downside of having defun not as a toplevel form, is that the compiler cannot make note that a function is defined, so it may issue undefined function warnings.
11:09:51
pjb
schweers: the only case where you would need to put defun in a non-toplevel labels, would be if your local functions would have to be used by several defun. Then you have to ask yourself seriously why not making them global functions.
11:11:28
schweers
pjb: that is exactly the situation I had. I’ve now declared the helper functions to inlined. I’m not entirely happy with the notes yet, but I’ll do some more testing etc before I continue banging at it.
11:12:13
pjb
You know that optimizing type declarations and notes, will give you only 1 or 2% improvement.
11:14:04
loke
pjb: actually, not always. My implementation of the simplex noise algorithm ended up 10× or so faster by adding delcarations.
11:14:17
Younder
pjb: the optimization structure for Lisp is hard to understand. Perhaps you could come up with some simple rules. Like don't cons up.
11:16:13
Younder
I seem to remember 40x penalty for using temporary list's in calculations. Estimates of cource
11:22:55
tfb
I think the first-order story about declarations is: it matters for float-intensive code
11:25:34
Younder
tfb, For float intensive, you need AFX or better still GPU. So tap into something like LAPACK
11:27:03
tfb
Younder: you don't (and you can trust me on this: I run float-intensive code on thousands of cores)
11:34:48
Younder
tfb: Are you telling me you are running computing intensive applications on a cluster entirely in Lisp?
11:38:06
tfb
Younder: No, sorry. All our HPC code is fortran. What I meant was that if you have float code which falls back to generic arithmetic that's often a factor of ~100, so if the system should be spending 1% of its time in float code, it's now spending half of it. So making sure float code doesn't fall back to generic arithmetic really matters if there is even a very small amount of it
11:41:07
Younder
Well I have tried a simulation of 65000 star galaxy similar to the Magellan cloud on my Titans
11:43:14
Younder
I studied physics in my time, and have a particular fondness for celestial mechanics.
11:57:43
Younder
My PI2's were spendt for a simulation of telephone central system. MPI and C again.
11:59:40
Younder
Cool though this is I have moved mostly into embedded comping these days. Designing a drone which is totally anonymous.
12:01:15
Younder
6 cameras, a NVidea TX1 and more C. Though RUST is coming up as a solid alternative.
12:04:48
Younder
A circuit boar with a Xilix FPGA implementation of G5 with a Digital Devices MEMS antenna on a M2 port with PCIe that will fit on a credit card is the current challenge.
12:06:08
Younder
But feel free to ignore me as I make to many grammatical and syntactical mistakes, being dyslexic
12:37:15
Xach
ASDF 3.3.1 reports fatal circular dependencies that ASDF 3.1.5 does not. I wonder if it's in error or something else.
12:38:06
Xach
hmm, the latter has asdf-system-connections, which is I think a pit of trouble these days.
12:46:33
Xach
dim: are you in any position to investigate and perhaps propose changes to simple-date to make things work again?
12:47:18
Xach
dim: I think the whole glue thing might be a candidate for removal and simplification at the expense of a little more cross-dependency.
12:52:14
Shinmera
Xach: I've been having even more issues with ASDF 3.3: https://github.com/Shinmera/qtools/issues/25
12:52:35
Shinmera
Something about invoking QL or ASDF while it's trying to load another system is messing it up
12:52:51
Shinmera
Haven't had time to investigate yet, but this was never a problem until the recent ASDF updates in SBCL.
13:02:12
dim
Xach: I could see about devoting some time to it... my gut feeling is that we have bugs in ASDF tho
13:04:52
dim
I'm not sure I've learnt enough CL to see about improving Postmodern yet... last I tried I sure wasn't there yet ;-)
13:06:57
Xach
I feel awful about giving neutral feedback about its impact. I didn't test properly or something.
13:07:41
dim
the only way to never make a mistake is to never do anything, as my mother would say ;-)
13:14:42
nickb
Hi. I'm trying to install sqlite3 on a Windows system using quicklisp. I know nothing about lisp, just need to build an application using it. I get an error: https://gist.github.com/anonymous/9d632dff0f9e26e84ba91458d3ff5eea (doesn't tell me much). Any advice?
13:16:10
tfb
Younder: rust looks like an interesting thing. But fortran is so embedded for the stuff we do I am sure it will live for ever, unfortunately
13:17:03
pjb
nickb: you would have to learn how the sqlite3 library is named on MS-Windows, and to know where it's stored, to configure cffi to find it there.
13:18:56
nickb
first 2 require at least some basic knowledge on how lisp works which I'm lacking as of now. Point me towards something to read please
13:39:59
knobo
When I do (select-dao 'some-postmodern-class) columns with null value is returned as :null. Can my slots be unbound in stead?
13:46:41
phoe
knobo: grepping the manual tells me not. You can try some manual processing of the returned daos if you really want it, as in, loop for all slot-values if :null then slot-makunbound.
13:48:08
nickb
pjb: CFFI should be able to find my sqlite3 libs. The only lib (sqlite3.dll) is in PATH, shouldn't that be enough?
13:50:24
Shinmera
Windows (unfortunately) just reports the library as missing if its dependencies can't be found, even if the library itself can be.
13:50:30
nickb
I can't tell; the only error I get when trying to install "sqlite3" is that the name is not resolved