freenode/#lisp - IRC Chatlog
Search
21:56:28
AeroNotix
I think the idea of a "decentralised lisp term database" is a great idea. Not sure if one exists.
21:57:16
jmercouris
I think what would be really cool would be an open source graph database implementation in lisp
21:58:56
AeroNotix
no-defun-allowed: I just meant a distributed database that stored arbitrary terms.
22:02:41
AeroNotix
you call a function with a serialized FD. The FD doesn't exist on the system being read- it fails.
22:03:10
White_Flame
huh, so you don't prevent the handle itself from serializing, you just assume its usage will break?
22:03:32
jmercouris
I guess you need to support two types of objects, a node object, and a vertex object
22:04:04
jmercouris
but of course the hard part is persistence of the graph database, loading it into memory, and searching it
22:07:25
jmercouris
stylewarning: this works for any kind of object? what about objects that contain objects?
22:08:13
stylewarning
jmercouris: Nested objects are fine. If *print-circle* is respected, then you'll even get proper references
22:10:11
stylewarning
jmercouris: CL-STORE also is pretty useful to know about (https://common-lisp.net/project/cl-store/)
22:10:33
jmercouris
I was just thinking aloud about what one would need to do to make a graph database using CLOS
22:11:01
jmercouris
maybe you could even build it on top of an RBDMS to serve as your persistence mechanism
22:14:18
jmercouris
unless maybe there is some ext that can give you a unique identity hash or something for each object
22:14:45
aeth
stylewarning: EQ only differs from EQL with numbers and characters. In pratice, you'd only see EQ potentially differ in a 64-bit implementation for double floats and bignums and maybe characters. Where do you use this?
22:15:09
stylewarning
aeth: I use it when I want to indicate to the reader of my program that I care about equality of reference.
22:19:47
stylewarning
jmercouris: actually, you can abuse your way to defining eq. For instance, (defun my-eq (x y) (let ((l (list y t))) (getf l x)))
22:23:01
aeth
stylewarning: Problem solved: (defun my-eq* (x y) (let ((l (list y t))) (declare (dynamic-extent l)) (getf l x)))
22:23:43
aeth
113 byte disassembly (and a call to getf) instead of 32 bytes (with no calls) in SBCL, though
1:49:09
AeroNotix
With #'push & #'pop. The documentation suggests that it takes a `place' but I am kind of inferring it means a `place' that evaluates to a list. Am I wrong?
1:50:31
Bike
i called it "list" because that's usual, but it would work just as well with any other value
1:50:43
Bike
the arguments and values section even says "place---a place, the value of which may be any object."
1:51:22
no-defun-allowed
eg (push 'thing (first my-stacks)) will push 'thing to the first item of my-stacks
1:52:08
AeroNotix
I just expect that `place' is anything that is setf-able. Not that `place' means that it is setf-able AND requires to be of a certain type
1:52:23
AeroNotix
Though: "push prepends item to the list that is stored in place, stores the resulting list in place, and returns the list."
1:52:41
Bike
pop imposes an additional requirement since it returns the CAR of the value of the place.
1:53:05
AeroNotix
Bike: "push prepends item to the list that is stored in place, stores the resulting list in place, and returns the list."
1:53:39
AeroNotix
I expect with `place' it is any http://www.lispworks.com/documentation/lw71/CLHS/Body/05_a.htm
1:54:30
Bike
don't take the description text too literally. the macroexpansion is the easiest way to understand it.
1:54:58
AeroNotix
How can it say: "place---a place, the value of which may be any object." but then "push prepends item to the list that is stored in place, stores the resulting list in place, and returns the list."
1:57:43
Bike
push has no reason to impose a restriction that the value of the place is a list, so it doesn't
1:58:36
AeroNotix
Really the reason I was looking at the docs so deeply when it said "place" is that I wanted to call a set of functions push/pop
2:00:09
Bike
At macroexpansion time, it doesn't know the type of the value of the place (what a mouthful)
2:02:05
Bike
setf works on information it has at macroexpansion time, stuff like the ltieral form of the place
2:02:27
Bike
for a customizable push, you couldn't take advantage except to do setf in the first place, so you'd have (push x y) expand into (setf y (push-function x y))
2:02:41
Bike
and then push-function could be generic or whatever, but then you're missing out on some stuff
2:31:18
pjb
AeroNotix: pop on a non-list would signal an error thru car. But push wouldn't: it would just create a dotted-list.
2:40:57
AeroNotix
pjb: sure, I see the behaviour, it was the documentation that seemed that there was something more to it
3:24:08
White_Flame
AeroNotix: if you have a history in C, you can think of a 'place' sort of like an lvar
3:24:52
White_Flame
it's a syntactic expression that shows where to store something, not specifically evaluated for its value
3:25:18
White_Flame
(setf (car foo) 3) doesn't evaluate (car foo) and return its place, the shape of (car <parameter>) indicates where it's to be stored
3:26:18
White_Flame
(hmm, I'm wondering if I remember the term 'lvar' correctly. But basically whatever's to the left of the equals sign in C)
3:26:43
Bike
yeah, the main difference between lvalues and places in my mind is that i can understand places
3:28:00
White_Flame
I'm getting too long out of that world to be fully confident in specific analogies from it
3:28:45
Bike
i think the main problem with the analogy is that an lvalue is still a value, which a place doesn't have to correspond to (e.g. multiple values), but that's not a huge deal
3:29:46
White_Flame
AeroNotix: also, have fun reading up on locatives. They're sort of a parallel to pointers, as in it's a reference to a slot you can dereference & store
3:50:34
loke
pjb: is cll actually useful anymore? I check there once in a while and there are like 3 people posting there (if you exclude wj :-) )
3:51:13
pjb
loke: it's asynchronous, and you can include lots of code in a single message. So it would be more efficient than irc for a lot of stuff we do hereā¦
3:53:18
pjb
(setf (car foo) 3) can expand to (let ((val 3)) (rplaca foo val) val) in ccl: (macroexpand-1 '(setf (car foo) 3)) #| --> (ccl::set-car foo 3) ; t |#
3:53:35
loke
sthalik: Also note that CL's maths spec is more thorough than C's. For example, it defines complex results for trignometric operations and also support rationals.
3:54:24
loke
pjb: Well sure, I don't disagree with you there. But all the ability to type long messages aren't work much if there is no one read them. :-(
3:54:39
aeth
sthalik: I'm not sure if there's a copysign, but there's a signum, so you don't really need copysign
3:56:50
sthalik
aeth, can you paste the disassembly when specialized for float with speed no debug/safety+no prologue please?
3:58:55
aeth
It looks like the version of SBCL I'm using doesn't optimize signum for single-float (i.e. it calls the function, even though there's probably a simpler way)
4:22:23
drmeister
Does anyone use the pzmq messaging library? I have some questions I'd like to ask offline.
4:24:20
drmeister
I've got some request/reply messages that I am certain are absolutely correct - but zeromq is dropping them with no feedback.
4:32:11
sthalik
stupid C++ generates position-independent code, hence indirect addressing through rip
4:35:44
aeth
sthalik: bring this up in #sbcl when stassats is there and maybe stassats will do something about it
4:36:24
aeth
i.e. write something in CL (with type declarations) and disassemble it and complain about the resulting disassembly
4:39:01
loke
aeth: Then, even better, is to use DEFOPTIMIZER and DEFINE-VOP to make it use the proper instructions.
5:19:11
aeth
I think (defun copy-sign (magnitude sign) (declare (single-float magnitude sign)) (* (abs magnitude) (signum sign))) is the CL equivalent that is underoptimized but there might be something better.
5:41:52
White_Flame
you can use ffi to bit-cast integer mask operations on top of the floats, to implement the C-like asm solution
5:45:22
pjb
Yes, you can make your lisp program as brittle and erroneous and crash-prone as any C program.
5:50:31
White_Flame
it's not brittle. It's a word of lisp-owned foreign memory that always follows proper casting convention
9:25:13
Shinmera
Hoorah, Radiance 2.0 is now out. http://shirakumo.github.io/radiance/?t=2.0#1.0_-%3E_2.0