freenode/#lisp - IRC Chatlog
Search
16:18:42
Nilby
pjb: Yes, I agree it's not necessary, but still useful. I think it's basically game over for security if something can control Lisp code, but in some way beach's idea of top level first class environments is like having virtual lisp machines. I would like to think it could include hardware level protection, so that memory address and compiled code could still be safely modifiable.
16:26:06
pjb
Nilby: it is a choice: either you allow modifiable code, and then you need a system like unix with separate addressing spaces and crashes, or you prevent modifiable code, and even you prevent generating code vectors by random code, only compilers authorized by the system are allowed to produce code that is guaranteed not to crash, and then you can avoid the separate addressing space and use capabilities, environments and have bet
16:33:38
Nilby
I guess I'll have to wait for a portable with-lisp-vm that doesn't do something horrible like linux containers.
16:40:49
Nilby
_death: I don't feel like cgroups are simple: ls -R /sys/fs/cgroup/ | wc -l => over 6000!
17:05:33
Nilby
_death: I don't know, but looking linux/Documentation/cgroup*/*.txt I got disgusted by the complexity and stupidity of the formatted file based API
17:10:51
Nilby
I was actually considering how to wrap such a thing in Lisp without using foreign code above the kernel.
17:11:26
_death
I think at one point I looked at launching a qemu instance and communicating with it using zeromq
17:13:26
Nilby
That's much more sensible, but I have some dumb obsession with idea that I want 100% lisp code above the kernel.
17:49:23
Bike
ah, i suppose. "treated like a literal object at runtime" is a bit vague. i think it's mainly just emphasizing that the form is only evaluated once.
17:50:42
Bike
ltv is one of those things that didn't really make any sense to me until i implemented it
17:51:54
Bike
the really involved part is all the cycle detection and ordering of load time evaluations
17:52:09
Bike
it's kind of a lot of work for the compiler writer but programmers don't usually think about it
17:54:36
pjb
There's still ordering freedom left to the compiler. the order of the l-t-v forms is not specified IIRC.
18:01:44
_death
Bike: after thinking about it more, it's not just that it's evaluated once, but also that the object is returned as-is, not, say, copied (according to some definition of copied)
20:52:49
mfiano
Posted in #sbcl also, but does anyone know of a workaround to the compiler notes on SBCL for this simple function? I've been trying everything I can think of: https://gist.github.com/mfiano/66c0c1897c190e68438d405f604ddb20
21:02:47
mfiano
_death: I'm trying to rasterize a 3D cuboid volume to see which cubed grid cells it touches. Here is the real code https://gist.github.com/mfiano/eba07f48c2285a47fa0685713a1f2495
21:04:12
mfiano
Those #'map's are there because min1/max1 will be inputs to the function later on, and are required to be (simple-array single-float (3))
21:11:44
mfiano
Yes, the actual domain doesn't matter...just has to be small enough for the result to be fixnumable
21:12:35
mfiano
So is it the case that the 2-arity floor is just missing a transform, or is there a better reason it didn't work?
21:17:06
mfiano
It seems if I assert with (assert (< #.(float (expt -10f0 9) 1f0) x #.(float (expt 10f0 18) 1f0))) your version works. Curious why such the unsymmetrical domain
21:19:39
_death
well, (truly-the (unsigned-byte 32) (floor (the (single-float 0.0 65535.0) x) cell-size)) in the second gist (after fixing malformed syntax) seems to give no note
21:25:18
mfiano
(lambda (x) (declare ((u:f32 #.(expt -2f0 19) #.(expt 2f0 61)) x)) (floor (floor x) cell-size))
21:32:22
mfiano
Yeah i'm not sure what SBCL is doing. Should be 24 bits of precision and 128 bits of range
21:36:37
jmercouris
jackdaniel: why are there constant page loads in your demo? why not utilize ajax?
21:44:31
Krystof
I think SBCL is not being very smart about the fact that it includes 0, but you should probably exclude 0 if you can
21:45:09
Krystof
(declare (type (single-float (-1.0) (1.0)) x) (type (and (integer (0)) (unsigned-byte 8)) y)
21:46:53
scymtym
seems like a good time to plug https://github.com/scymtym/sbcl-ir-visualizer again. it shows derived types of intermediate results among other things
21:49:44
scymtym
jmercouris: both. you can type in a lambda expression and investigate how SBCL processes it under different optimization policies
21:49:46
jmercouris
It is a cool project, don't get me wrong, just wondering what intent you had when developing it
21:50:23
phoe
I'd place $5 that the intent was introspection into the SBCL compilation and IR generation process
21:53:05
scymtym
phoe is right since he described what the program does and i made it do that intentionally. but i'm not sure where this discussion is supposed to go
21:55:53
Krystof
or you can (trace :encapsulate nil sb-c::floor-derive-type-optimizer sb-c::floor-quotient-bound) to find what's not giving you the right answer
21:56:10
Krystof
SBCL is a bit conservative about its lower bound to floor in the presence of floating point arithmetic