freenode/#lisp - IRC Chatlog
Search
14:33:14
ogamita
The spec also allows array-total-size-limit to be 1024, sbcl implementors still set it to a higher value…
14:33:19
jdz
ogamita: (sb-ext:restrict-compiler-policy 'safety 1) and you will live happily ever after.
14:49:44
shelvick
Has anyone run into this problem before with ironclad or nibbles? https://pastebin.com/bTVL8FNs
14:53:45
beach
semz: I am convinced that if you just add a few primitives to your Common Lisp implementation, then it becomes a perfect fit for system programming.
14:54:39
pfdietz
shelvick: nibbles uses internal SBCL things that change frequently, so don't expect recent versions to work with old SBCLs.
14:57:45
semz
embedded and kernel stuff, primarily. though admittedly the main motivation was more of a vague "let me get rid of C and its nonsense already"
14:59:27
beach
semz: Well, clearly full Common Lisp is probably too big for many embedded applications.
15:00:24
beach
semz: I am guessing you mean applications that must manipulate arbitrary addresses in arbitrary ways. In those cases, I think system programs written in C probably rely a lot on undefined behavior.
15:02:24
beach
semz: On the other hand, if we abandoned the silly (and very old) idea that an application program should have access to the full address space (including the stack) as if it had access to a raw computer, then we could write a very safe operating system using Common Lisp. But it would not have a "kernel" in the Unix sense of the term.
19:08:35
anamorphic
Hi, Is this the most effective way to convert a sequence of any kind of numbers to a one-dimensional array of double-floats? (let ((x-array (make-array length-x :element-type 'double-float))) (map-into x-array #'(lambda (value) (coerce value 'double-float)) x-sequence) ...)?
19:25:22
aeth
anamorphic: you might want to use the type (simple-array double-float (*)) instead of (vector double-float) in case the latter doesn't make it a simple-array
19:26:12
aeth
if it's simple, that means there's no fill-pointer and it's not adjustable (and maybe a few other things) so it's faster.
19:27:48
aeth
A vector is a 1D array. A simple-vector is a simple T vector. A simple-array is a simple array. There is no specialized simple-vector. There are specialized vectors, apparently, since pfdietz just defined one. This is a flaw in the standard imo
19:28:40
aeth
9 times out of 10 your simple-array is going to be a 1D array (i.e. a vector) but you have to use the more verbose multi-dimensional array syntax to talk about it
19:29:16
aeth
Usually you get around this by defining your own easier-to-type type if your code is filled with it.
19:40:52
aeth
(If simple-vector worked like everything else you could just say (simple-vector double-float) instead of (simple-array double-float (*)) since the size would be an optional argument at the end. But you can't.)
19:47:36
anamorphic
Yeah had noticed that about simple-vector. Is it a historical thing that it doesn't have a type specializer?
19:54:06
White_Flame
but yeah, I've been bitten by that as well in utf-8 and byte buffer conversions. One library uses simple-vector, the other uses simple-array, and they are not interchangeable; you need to copy the data to an object of the other type in order to bridge them
20:08:25
oni-on-ion
https://sirherrbatka.github.io/blog/2018/10/11/cl-data-structure-ranges-are-pretty-cool/
20:27:11
XachX
the 403 in that case really means "no object is here but i don't want to tell you that"
20:27:11
shelvick
Oh? interesting... I was doing something through qlot which has worked before up until maybe an hour ago
20:27:50
XachX
shelvick: https://beta.quicklisp.org/dist/quicklisp/2018-08-31/distinfo.txt is the normal pattern
20:30:54
aeth
If you use a simple-vector for octets then everything's 4x larger in memory (if 64 bit) and the compiler loses any chance at knowing what type it is when AREFing
20:43:10
aeth
(Oh, and the GC has to iterate through the T vector to see if anything's a pointer, doesn't it?)
22:16:51
White_Flame
oh, regarding the above discussion, the binary type mismatch was simple-array of bytes, vs vector of bytes
22:17:24
White_Flame
sb-ext:octets-to-string for example requires a specialized (vector (unsigned-byte 8))