freenode/#lisp - IRC Chatlog
Search
15:40:58
Shinmera
I'm also happy to announce that another Lisp website is finished: http://studio.tymoon.eu/ https://github.com/Shirakumo/studio
16:05:55
pjb
drmeister: I'd suggest a network dump, to check if the message is transmitted (is it lost before sending or after receiving?)
16:08:19
drmeister
I have a tiny example now of a python program that sends a request and waits for a response and a common lisp script that waits for a request and sends a response. The common lisp script sends the response but the python script doesn't receive it.
16:09:59
drmeister
The common lisp script works in cando - I'm currently trying to get it to work in sbcl.
16:21:05
drmeister
That contains the stuff that I'm sending. What is the localhost.54007 ? Is that the python code sending this out on another port?
16:21:52
drmeister
Here is the output of the Common Lisp script ( I can post the script as well - but it is longish)
16:39:15
pjb
If you don't seen any other packet, then it means the problem is on the sending lisp side.
17:06:48
drmeister
I suspect the problem is the identities part - because I had to add code to deal with the non-string nature of zmq's default identities.
17:14:18
trittweiler
drmeister: if you can't see any outgoing packet from 127.0.0.1:9734, then dive into pzmq:send. Does that have any kind of meaningful return value? Maybe the data is waiting in a buffer, and needs to be flushed out
17:15:48
drmeister
The main detail to notice when reading the man page is the requirement for adding in a null (empty) message part between the identity routing information prepended to all messages and the message body containing the application-level data. This null message part is used as a delimiter to separate routing information from application-level data. When communicating to/from REQ/REP sockets, the routing information is silently
17:15:48
drmeister
processed by the framework up to the null message part; the framework then hands off the remaining message parts to your application for processing.
17:17:12
trittweiler
presumably, the python side is doing that automatically? If that's the case you can inspect the request to get an idea how null/empty is supposed to look at the wire
17:19:04
drmeister
The python side isn't doing that - because I don't send an identity - my understanding is that the Python side will create an identity of the form #(0 w x y z) where w x y z are octets that code for a 4-byte random value integer.
17:19:37
drmeister
I'm trying different combinations of null in the python and null in the Common Lisp.
17:21:03
drmeister
No combination of b'' in the python and "" in the common lisp appear to change the behavior.
17:30:09
Colleen
Function emptyp https://common-lisp.net/project/alexandria/draft/alexandria.html#index-emptyp-137
18:37:52
shka_
i think that's because arch put it into /usr/include/hwloc/cuda.h instead of /usr/include/cuda.h
22:23:50
cgay
My CL is very rusty... Is there a standard way to break very long string constants across multiple lines? Do I need to use concatenate, or (format nil "firstline~\nsecondline") ?
22:28:47
cgay
format seems a bit better because it removes leading whitespace on continuation lines.
22:29:44
pjb
You could put a reader macro on #\" such as """ starts a string that can include newlines and indents that don't belong to the string.
22:37:01
phoe
the human reader will be able to infer that it's a constant if he sees #.(format nil ...) anywhere in the code
22:39:29
cgay
this string is used in one place (a command-line flag help string). i wouldn't want a separate constant for it. ideally there would be real string syntax for this, but oh well.
22:39:51
pjb
cgay: you can implement your ideal real string syntax. Reader macros are made for that!
22:43:17
cgay
It sounds like a lint rule that certain organizations could turn on if they wanted to.
22:43:56
pjb
(defconstant +foo+ (vector 1 2)) (setf (aref +foo+ 0) 3) +foo+ #| --> #(3 2) |# is perfectly conforming.
22:44:12
pjb
What is constant, is the binding between the symbol +foo+ and the pointer to the mutable vector.
23:28:15
aeth
Would be nice to have immutability in CL. You can kind of fake that without optimizations with :read-only slots in structs assuming implementations respect that (idk if it's required), although it's only really easy to fake conses with structs
23:29:20
aeth
idk if extending sequences for types/immutability or extensible sequences (and put this in a library) would be easier to get implementations to support
23:30:44
aeth
Is directly accessing slots even portable on structs? That's probably good enough for having read-only
23:31:59
aeth
hmm, okay, so you at least can get immutable conses that way, assuming you can come up with a cons-as-struct representation that doesn't rely on writers (mine does)
23:37:35
aeth
If I had to redesign CL I'd add optional immutability to conses and arrays (and hash-tables?) and :element-types for cars/cdrs (separately because you might want the cdrs to be (or null your-typed-cons) in the case of a linked list) and hash-table keys/values (again, separately)
23:37:48
aeth
I'd write a CDR for that but so few people respect CDRs that I think the site has been down for years at this point
23:39:22
gendl
And i'm running with Java 9 on my Mac. The ABCL docs say it only works through Java 1.8. Is it not supposed to work with Java 9?
23:39:30
aeth
Afaik current typed conses are O(n) since no type information is stored in the cons itself, so verification is done over the whole list. Instead of being able to say :car-type integer :cdr-type (or null cons-of-integers) and just getting a linked list that can only hold integers. Then you'd be able to verify instantly
23:43:23
aeth
Yes, ideally arbitrarily many. I hate how :element-type in arrays has to be something like (unsigned-byte 8) or fixnum and can't just be (integer 0 42) separate of what's internally used to store them.
23:43:54
PuercoPop
aeth: yes, not having strings immutable by default is one of the criticisms Henry Baker makes to CL. Having them immutable by default would allow copy by reference in threads for example.
23:44:13
aeth
At the moment, type information is lost in data structures except for (maybe) :type in struct slots and (unportable except for bit and character/simple-character) specialized arrays
23:44:57
Bike
with arrays it wouldn't be quite as bad since using an extra word for the type isn't unexpected, but could still cause difficulties.
23:45:45
aeth
PuercoPop: The two flaws I see in CL data structures are the lack of immutability and the loss of most type information
23:46:01
aeth
The more type information the data structures themselves remember, the less you have to use THE, DECLARE, etc.
23:46:54
aeth
Bike: The compiler knows 42 is an integer, a fixnum, an (integer 42 42), etc. until it's stored into a data structure
23:47:55
Bike
you're talking about a RUNTIME tag. the compiler STILL wouldn't know if there were typed conses. the runtime could know that a slot is supposed to hold whatever type, but that would improve correctness, not efficiency.
23:49:06
aeth
Bike: for numbers and sequences it improves efficiency because of type-generic functions like + and MAP. If it knows it's an (integer 42 42) then it will use efficient arithmetic for most +, -, /, *, etc. because it will (probably) stay a fixnum. If it knows foo is a list, it uses a more efficient LENGTH/MAP, etc.
23:50:56
aeth
SBCL doesn't check at runtime in (+ 3 (aref foo 42)) if it's arefing an (unsigned-byte 8) array that it knows the type of (it might do a bounds check if it doesn't know the full type, including the length)
23:51:07
Bike
if the hash-table doesn't have a compile time known element type, it's just as efficient either way: right now, the runtime checks whether the gethash result is a fixnum. in your version, the runtime checks the stored element type in the gethash, and dispatches with arithmetic based on that.
23:51:43
Bike
with completely arbitrary runtime element types it could be less efficient, since it has to compute subtypep or something.
23:51:46
aeth
(defun foo (a) (declare ((simple-array (unsigned-byte 8) (43)) a)) (+ 3 (aref a 42))) ; efficient +
23:52:14
Bike
that's a compile time declaration. that is a separate concern from run time type information.
23:52:51
aeth
If a have a linked list that can only store foos, I can trust the user's input to only have foos because the compiler or runtime will error before that list is given to me.