binghe changed the topic of #lisp to: Common Lisp, the #1=(programmable . #1#) programming language <http://cliki.net/> logs:<https://irclog.whitequark.org/lisp, http://ccl.clozure.com/irc-logs/lisp/> | SBCL 1.4.0, CMUCL 21b, ECL 16.1.3, CCL 1.11.5
jstypo has quit [Remote host closed the connection]
pagnol has joined #lisp
Patternmaster has joined #lisp
nickyname has joined #lisp
Kundry_Wag has joined #lisp
markong has quit [Ping timeout: 256 seconds]
EvW has quit [Ping timeout: 255 seconds]
aeth has quit [Ping timeout: 240 seconds]
Kundry_Wag has quit [Ping timeout: 268 seconds]
aeth has joined #lisp
attila_lendvai has joined #lisp
attila_lendvai has joined #lisp
attila_lendvai has quit [Changing host]
z3t0 has quit [Remote host closed the connection]
z3t0 has joined #lisp
Achylles has quit [Ping timeout: 240 seconds]
z3t0 has quit [Ping timeout: 240 seconds]
smurfrobot has joined #lisp
warweasle has joined #lisp
kark has joined #lisp
mareskeg has joined #lisp
mareskeg has quit [Client Quit]
smurfrobot has quit [Ping timeout: 248 seconds]
mareskeg has joined #lisp
FreeBirdLjj has joined #lisp
slyrus has joined #lisp
al-damiri has quit [Quit: Connection closed for inactivity]
FreeBirdLjj has quit [Ping timeout: 276 seconds]
mareskeg has quit [Quit: mareskeg]
pagnol has quit [Ping timeout: 264 seconds]
willmichael has quit [Ping timeout: 256 seconds]
fikka has quit [Ping timeout: 265 seconds]
pierpa has quit [Quit: Page closed]
fikka has joined #lisp
arescorpio has joined #lisp
JenElizabeth has joined #lisp
JenElizabeth has quit [Remote host closed the connection]
JenElizabeth has joined #lisp
smaster has quit [Ping timeout: 248 seconds]
fikka has quit [Ping timeout: 256 seconds]
willmichael has joined #lisp
smaster has joined #lisp
JenElizabeth has quit [Remote host closed the connection]
Tobbi has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
smaster has quit [Ping timeout: 240 seconds]
Cymew has joined #lisp
Chream_ has joined #lisp
pagnol has joined #lisp
Amplituhedron has joined #lisp
Kundry_Wag has joined #lisp
Cymew has quit [Ping timeout: 240 seconds]
Kundry_Wag has quit [Ping timeout: 240 seconds]
nowhereman_ has joined #lisp
mlf|2 has joined #lisp
nowhere_man has quit [Ping timeout: 265 seconds]
mlf has quit [Ping timeout: 240 seconds]
lnostdal has quit [Ping timeout: 255 seconds]
dieggsy has joined #lisp
willmichael has quit [Ping timeout: 256 seconds]
smaster has joined #lisp
JenElizabeth has joined #lisp
willmichael has joined #lisp
sjl has quit [Quit: WeeChat 1.9.1]
SuperJen has joined #lisp
JenElizabeth has quit [Ping timeout: 240 seconds]
lnostdal has joined #lisp
Arcaelyx has joined #lisp
Mr_Tea has joined #lisp
<Mr_Tea> hello how do I paste code snippets, do I use something like pastebin or just put it here?
<Xach> Mr_Tea: something like pastebin. i use gists on github myself.
Arcaelyx has quit [Ping timeout: 260 seconds]
orivej has quit [Ping timeout: 248 seconds]
TMA has quit [Ping timeout: 256 seconds]
slyrus has quit [Ping timeout: 240 seconds]
<Mr_Tea> I was working through the lisp koans and I feel like my imperative is showing for the greed scoring function https://gist.github.com/anonymous/f062020faa8c01a4cd31d910c7f46e37/ is there a more lispy way of doing this?
<Xach> Mr_Tea: it would help if you described what the function is supposed to do
<Xach> Mr_Tea: but, a couple things. You don't need the SCORE variable at all - the final form can be (+ <count-1 stuff> <count-5 stuff>)
<Xach> Mr_Tea: also, (truncate (/ x y)) can often be replaced by (truncate x y), and you can do that in your function.
<Xach> and with multiple values you can get the truncation and the remainder in one operation, too...
<Xach> I don't know the spec of what it's supposed to accomplish, though.
python476 has quit [Read error: Connection reset by peer]
<Mr_Tea> can loop count multiples?
Amplituhedron has quit [Ping timeout: 240 seconds]
vtomole has joined #lisp
attila_lendvai has quit [Quit: Leaving.]
<Mr_Tea> thanks
Chream has quit [Ping timeout: 264 seconds]
<Mr_Tea> loop is so weird its like a programming language just for looping
<wmannis> There is also a count function (though I don’t know if you’ve been instructed not to use that).
Kundry_Wag has joined #lisp
<Mr_Tea> that makes it so much easier
<Mr_Tea> whoa
<wmannis> This is worth a read, too: http://www.gigamonkeys.com/book/collections.html
<stacksmith> all of gigamonkeys is worth a read, really.
<Mr_Tea> sweet
<stacksmith> Common Lisp Recipes is a really good reference as well, with lots of examples of how to do things.
Kundry_Wag has quit [Ping timeout: 256 seconds]
<stacksmith> Mr_Tea: btw, loop is not 'like a programming language for looping', but literally that, aka DSL (domain specific language).
Arcaelyx has joined #lisp
<Mr_Tea> I gotta go thanks for the help
Mr_Tea has quit [Remote host closed the connection]
manwhowouldbekin has joined #lisp
igemnace has joined #lisp
<aeth> Is loop (without any embeded Lisp forms) Turing complete?
smaster has quit [Ping timeout: 265 seconds]
d4ryus1 has joined #lisp
d4ryus has quit [Ping timeout: 240 seconds]
warweasle has quit [Quit: Leaving]
lnostdal_ has joined #lisp
shifty has joined #lisp
impulse has quit [Ping timeout: 256 seconds]
lnostdal has quit [Ping timeout: 255 seconds]
Oladon has joined #lisp
wmannis has quit [Quit: wmannis]
smaster has joined #lisp
lnostdal_ has quit [Ping timeout: 255 seconds]
smaster has quit [Ping timeout: 256 seconds]
krwq has joined #lisp
pagnol has quit [Ping timeout: 240 seconds]
<stylewarning> Does anybody have thoughts about printing some noise at compile time?
<stylewarning> I have something that will take long to compile and I'd like to let the user know.
<Bike> like in a macro or something? you could print a dot or something every so often, if *compile-print* is t
lnostdal_ has joined #lisp
<stylewarning> Bike: Totally forgot about *COMPILE-PRINT*. Thanks!
nowhere_man has joined #lisp
Kundry_Wag has joined #lisp
<stylewarning> Maybe even *COMPILE-VERBOSE*
<k-hos> I do all that work to compile llvm
<k-hos> and then the first fucking file of cereal errors out
nowhereman_ has quit [Ping timeout: 256 seconds]
<k-hos> ... wrong chat
Kundry_Wag has quit [Ping timeout: 256 seconds]
nickyname has quit [Ping timeout: 256 seconds]
rumbler31 has quit [Remote host closed the connection]
Chream_ has quit [Ping timeout: 248 seconds]
Kundry_Wag has joined #lisp
milanj has quit [Quit: This computer has gone to sleep]
smaster has joined #lisp
Kundry_Wag has quit [Ping timeout: 260 seconds]
willmichael has quit [Read error: Connection reset by peer]
willmichael has joined #lisp
sabrac has quit [Remote host closed the connection]
wxie has joined #lisp
Kaisyu has joined #lisp
raynold has joined #lisp
wxie has quit [Quit: Bye.]
marusich has joined #lisp
tankrim has quit [Remote host closed the connection]
tankrim has joined #lisp
willmichael has quit [Ping timeout: 248 seconds]
<beach> Good morning everyone!
Chream_ has joined #lisp
<jack_rabbit> o/
voidlily has joined #lisp
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
sabrac has joined #lisp
willmichael has joined #lisp
voidlily_ has joined #lisp
whoman has quit [Ping timeout: 248 seconds]
schoppenhauer has quit [Ping timeout: 248 seconds]
terpri has quit [Ping timeout: 240 seconds]
schoppenhauer has joined #lisp
voidlily has quit [Ping timeout: 256 seconds]
Oladon has quit [Quit: Leaving.]
willmichael has quit [Read error: Connection reset by peer]
willmichael has joined #lisp
dddddd has quit [Remote host closed the connection]
igemnace has quit [Quit: WeeChat 2.0.1]
willmichael has quit [Ping timeout: 256 seconds]
igemnace has joined #lisp
nopolitica has quit [Ping timeout: 264 seconds]
Bike has quit [Quit: Lost terminal]
mlf|2 has quit [Ping timeout: 240 seconds]
manwhowouldbekin has quit [Ping timeout: 276 seconds]
willmichael has joined #lisp
saki has quit [Quit: saki]
saki has joined #lisp
arescorpio has quit [Excess Flood]
ThUnD3R256 has joined #lisp
vtomole has quit [Quit: Page closed]
<aeth> hmm... apparently check-type works on accessors
<aeth> I guess that makes sense. It probably just setfs it
<aeth> Should I do all of my verification for a class in initialize-instance because :type is implementation-specific (and in some implementations debug-level-specific)? I can just call a check-foo helper function, and check-type will allow correct values to be set.
<aeth> (Also, some things are more complicated than just types.)
<loke> aeth: CHECK-TYPE works on any PLACCE
<loke> (check-type string (car foo))
willmichael has quit [Ping timeout: 276 seconds]
milanj has joined #lisp
willmichael has joined #lisp
vtomole has joined #lisp
<vtomole> What resources do you recommend for learning how to write a static type checker?
<beach> For Common Lisp?
<vtomole> Well, I want to implement one in Common lisp. But for a toy language.
<beach> Well, then it depends a lot on the type system for that language.
<beach> Some languages have manifest typing, so those are easy to check, because every variable and expression has a declared type.
<vtomole> Just something very simple. Beginner stuff like "int x = 2; 2 + 3.0;" throws an error because 3.0 is not an int. I'm guessing that is the manifest typing you are talking about.
<beach> Other languages, like Caml, use type inference and they reject badly typed programs, so they can use something like Hindley-Milner techniques.
smaster has quit [Ping timeout: 248 seconds]
<beach> Yes, it is.
<beach> You just tag every expression with a type. Either a declared type in the case of a variable, or inferred type if it is a constant.
Mr_Tea has joined #lisp
<beach> Then you check the sub-expression of operators, such as +, to see whether they conform to the rules you have decided for your language, and you label the expression of that operator with its type, based on the arguments.
<Zhivago> vtomole: One way to start thinking about it is -- what would it look like if for every function I had a version for every possible combination of parameter and output type?
Kundry_Wag has joined #lisp
<Zhivago> vtomole: (e.g., reducing it to a manifest type system)
<vtomole> Ah. Sure. Thanks.
<Zhivago> Then you can think about how you might compress that down to something reasonable by generalizing types where it has no semantic impact.
<Zhivago> And having done that, start again from the beginning. :)
Kundry_Wag has quit [Ping timeout: 260 seconds]
<Mr_Tea> is there any offline terminal based CL documentation?
<aeth> oooh, I just figured out a flaw with my check-type scheme
<aeth> it works for with-accessors (obviously) but it also obviously doesn't work with local non-accessor bindings of things, like let or destructuring-bind
<aeth> Since if you do a check-type on a destructuring-bind it will gladly update the local value... in a lexical scope that will soon be discarded. And not in the list itself. So, dangerously, you might think you corrected something that was not corrected.
<aeth> e.g. (let ((foo (list 1 2 3))) (destructuring-bind (a b c) foo (declare (ignore b c)) (check-type a string) a (values a foo)))
rumbler31 has joined #lisp
willmichael has quit [Ping timeout: 248 seconds]
Mr_Tea has quit [Ping timeout: 256 seconds]
vtomole has quit [Ping timeout: 260 seconds]
tankrim has quit [Remote host closed the connection]
sjl has joined #lisp
tankrim has joined #lisp
emaczen has quit [Read error: Connection reset by peer]
rumbler31 has quit [Ping timeout: 276 seconds]
sjl has quit [Ping timeout: 248 seconds]
saki has quit [Ping timeout: 256 seconds]
simplegauss has joined #lisp
Mr_Tea has joined #lisp
willmichael has joined #lisp
fikka has joined #lisp
<stylewarning> Can this be valid & used by the compiler if these are in the same compilation unit: (defstruct A (x nil :type B)) (defstruct B (x nil :type A))
<stylewarning> Or is that outside the spec and the :type's need to be known at definition time?
smurfrobot has joined #lisp
smurfrobot has quit [Ping timeout: 268 seconds]
marusich has quit [Ping timeout: 256 seconds]
marusich has joined #lisp
smurfrobot has joined #lisp
smaster has joined #lisp
<beach> stylewarning: For one thing, NIL would not be of the right type, unless I misunderstand your example.
<stylewarning> NIL isn't correct, but the spec says that doesn't need to be evaluated
<beach> Otherwise I think it works.
<stylewarning> in fact, I suppose it's perfectly valid to have (defstruct whoa (x (make-obj-of-type-nil)) :)
smurfrobot has quit [Ping timeout: 252 seconds]
<stylewarning> for some value of "valid" (which is also maybe of type nil :D)
<beach> "If a defstruct form appears as a top level form, the compiler must make the structure type name recognized as a valid type name in subsequent declarations..."
damke has joined #lisp
smaster has quit [Ping timeout: 240 seconds]
<beach> Oh, but you have a forward type.
<stylewarning> Right
<aeth> stylewarning: I often use (or null foo) as a type
<beach> That might be more problematic. I don't think structures have anything comparable to FORWARD-REFERENCED-CLASS.
<stylewarning> aeth: me too
<stylewarning> beach: it seems like a reasonably harmless extension to CL to support such a thing in some way
damke_ has quit [Ping timeout: 264 seconds]
willmichael has quit [Read error: Connection reset by peer]
BitPuffin has joined #lisp
<beach> stylewarning: Sure, and maybe some implementations do.
willmichael has joined #lisp
marusich has quit [Ping timeout: 256 seconds]
<beach> stylewarning: Did you submit your papers to ELS yet?
<stylewarning> beach: Not yet; I'm definitely taking advantage of the extension.
marusich has joined #lisp
<beach> OK. Because I don't recall having seen any. But you do intend to submit, right?
<stylewarning> Yes, hopefully 3 co-authored papers
<beach> Excellent!
<beach> You know my rule, right? When the paper is ACCEPT-able, you submit. I.e. when you think that further work will not influence the decision by the program committee, you can submit.
<stylewarning> Yep, that's the guideline I'm following. No point in trying to perfect a paper before acceptance.
<beach> Exactly. If it is rejected, it would be wasted effort.
<stylewarning> beach: I do fear that some of these are maybe pushing the scope of the conference tho
willmichael has quit [Ping timeout: 240 seconds]
<beach> I see.
<beach> My favorite coauthor has had papers like that accepted in the past. But there were fewer submissions at the time.
<Mr_Tea> I would love some pointers on how to improve this https://gist.github.com/c853470979a3705ec2e668b08f1f7d13 it was a lot of fun to write :)
<beach> Mr_Tea: The code has several problems.
<beach> Your naming is not great: calc, kv, di, re, hash.
<beach> Comments at the top level should start with three semicolons.
Kundry_Wag has joined #lisp
<beach> You have a useless newline after COND. Wasting vertical space is impolite to the person maintaining your code.
terpri has joined #lisp
<beach> Since you are comparing to constant numbers in COND, you are better off using CASE.
<beach> That's a very general rule in programming: Use the most specific construct that will do that job.
<beach> The DOLIST can be replaced by LOOP.
fourier has joined #lisp
<beach> (loop for kv in hash sum (calc kv))
<beach> Then you don't need the lexical variable sum.
<beach> You have a useless newline after the HASH lexical variable.
<beach> You could probably avoid creating the list in HASH by doing that calculation in the loop.
marusich has quit [Ping timeout: 248 seconds]
Chream_ has quit [Read error: Connection reset by peer]
Kundry_Wag has quit [Ping timeout: 240 seconds]
<beach> (loop for i from 1 to 6 sum (calc (cons i (count i dice)))) something like that.
<beach> Replacing COND by CASE also avoids evaluating (CAR KV) multiple times.
marusich has joined #lisp
mathrick has quit [Ping timeout: 256 seconds]
<beach> I think that will suffice for now.
Chream_ has joined #lisp
fourier has quit [Ping timeout: 256 seconds]
<Mr_Tea> wow that was awesome thanks beach just what I was looking for
Karl_Dscc has joined #lisp
<beach> Oh, and you don't write (setf sum (+ sum ...)). You write (incf sum ...)
<beach> Though here you don't need it of course.
<beach> Again, it's the rule of using the most specific construct.
<beach> Mr_Tea: Sure, good luck.
<Mr_Tea> in the cond I have to check if the first value is 1 or 5, or if the count of any other value is equal to 3 and I'm having trouble fitting that into case
marusich has quit [Ping timeout: 256 seconds]
marusich has joined #lisp
simplegauss has quit [Ping timeout: 256 seconds]
burton` has joined #lisp
flamebeard has joined #lisp
ThUnD3R256 has quit [Quit: Leaving]
mathrick has joined #lisp
ome has joined #lisp
fikka has quit [Ping timeout: 268 seconds]
<krwq> is there a way to get unique object id (or something like pointer) without using hash-table?
<mfiano> What is a unique object id?
<Zhivago> Counting is popular.
LocaMocha has joined #lisp
<mfiano> oleo: btw, there is a quite large error in that hyperspec page
<krwq> mfiano: some unique number per object, Zhivago: but that requires hash-table
<beach> Mr_Tea: (case (car kv) (1 ...) (5 ...) (3 ...) (t 0))
<Zhivago> No, it merely requires a counter.
<krwq> i'd like to avoid any locking
<krwq> Zhivago: how would you do that?
<mfiano> beach: He needs to check the cdr for 3
<beach> Oh, sorry.
<Zhivago> (setf (unique-id x) (incf *last-id*)) ; approximately.
<beach> I missed the cdr.
<aeth> Zhivago: not thread safe, though
<Zhivago> Easy enough to do lock-free if that's an issue.
<krwq> Zhivago: I mean unique per object not unique number
<mfiano> Do you absolutely need a nintegral value?
<Zhivago> That is unique per object.
<mfiano> an integral?
<beach> Mr_Tea: OK, so maybe CASE won't do here. However, you can make CALC have two parameters. Then you can avoid the CONS, the CAR and the CDR.
d4ryus1 is now known as d4ryus
<mfiano> krwq: What is the use case and why the restriction on a number?
fikka has joined #lisp
<krwq> mfiano: I need to pass number to C and will get the same number back in a callback
<krwq> mfiano: not necessarily a number though - anything 64bit
quazimodo has quit [Ping timeout: 260 seconds]
<krwq> Zhivago: I'm not sure how to use that - what is unique-id?
<Zhivago> Just a special variable that is incrementable.
<Zhivago> e.g., (defvar *unique-id* 0)
<aeth> unique-id is an accessor, *last-id* is a global special variable
<Zhivago> Oh, yes :)
<aeth> an accessor is basically anything with a defined setf (writer) and (and/or?) reader
ludston_ has quit [Quit: -a- Connection Timed Out]
<krwq> Zhivago: but I can't modify object definition
ludston has joined #lisp
<krwq> i mean can't modify class
Arcaelyx has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<krwq> this needs to work with builtin classes as well
<Zhivago> That's an issue you can resolve in the implementation of unique-id.
mishoo has joined #lisp
<krwq> how would I do that for string?
<krwq> so let's say i do (defgeneric unique-id (obj)) and then (defmethod unique-id ((obj string)) (??? obj))
<aeth> accessors don't have to really do anything except have the syntax (foo x) and (setf (foo x) y), and even that is only necessary if you want to use with-accessors afaik and not a strict requirement
<aeth> They can be methods, functions, whatever.
<aeth> You could store everything in a global hash table, maybe? Very hacky.
<aeth> Weak hash tables exist, in some implementations
<mfiano> aeth: accessors as far as the standard is concerned can read OR write (or both). accessors in terms of defclass do both
<krwq> my original question asked about no hash-tables since I want to make it thread safe this will be a bottleneck
<aeth> ah, right
<mfiano> aeth: the standard, iirc, defines an accessor as something that accesses a place, and access refers to a read or write.
<aeth> thread safe is an issue
vlatkoB has joined #lisp
<aeth> I wouldn't personally use globals in a multithreaded application at all.
<krwq> how does eq compare? can I get reference it uses to compare?
<Zhivago> You might also be interested in SXHASH.
<Zhivago> EQ compares using magic.
<krwq> aeth: ok then how do you provide unique id without global?
mikecheck has joined #lisp
<krwq> Zhivago: but sxhash would mostly work.. until first collision isn't it?
<aeth> krwq: You're probably not going to like my solution for avoiding globals. I basically take what would be a global and pass it as a parameter, so I lose general purposeness. (defun foo () ...) becomes (defun foo (would-have-been-a-global) ...)
<aeth> The accessor will also have an extra parameter, probably.
<krwq> aeth: the problem is that I need to give the object to C and get it back later
smaster has joined #lisp
<Zhivago> krwq: Pretty much, but it may make the problem smaller.
<Zhivago> That doesn't require a globally unique identifier.
<Zhivago> It just requires a temporarily unique return address on the envelope.
<Zhivago> And since the return address will be determined on the C side, just have C tell you what it is when you post it to C.
<Zhivago> Then you can just convert the C pointer to an integer or something and compare that with what comes back.
<Zhivago> (Or if you're passing a pointer to C, just remember the pointer, and use that)
Karl_Dscc has quit [Remote host closed the connection]
<krwq> Zhivago: not sure how would that work. I got lisp-func which is called from C with int64 arg and other lisp2-func which gives it a number. at one point lisp-func is being called with an int64 arg and I need to figure out which object it is talking about
<Zhivago> See the 'gives it a number'?
smaster has quit [Ping timeout: 252 seconds]
<Zhivago> Have whatever produces the number to give for an object remember the number it gave (ideally by recomputation, otherwise by retention).
Kundry_Wag has joined #lisp
<Zhivago> Then ask it what the corresponding object is when you get the number back.
<krwq> Zhivago: I do that with hash-table right now and a lock
<aeth> Unless you're doing things simultaneously or saving things across CL sessions, you could use an internal timestamp like (get-internal-real-time) or (get-internal-run-time) but that wouldn't be sufficient in some cases because you probably move faster than internal-time-units-per-second. Possibly useful if combined with another method. And probably not as good as Zhivago's idea.
mlf has joined #lisp
<krwq> when I write code in C directly I can pass a pointer to a struct and then my callback knows which object it is without any lookup
<krwq> but in lisp I don't have a notion of pointer to lisp objects
<Zhivago> Aren't you generating pointers for lisp objects to pass to C?
<aeth> Garbage collection. The object could move in memory if it's compacting, can't it?
<krwq> Zhivago: I do create unique ids with consecutive numbers
<Zhivago> If you can create pointers to lisp objects it needs to support pinning.
Tobbi has joined #lisp
<Zhivago> The question I would ask first is -- is there a reason that the sender and receiver can't always be on the same thread?
<Zhivago> If they can, then you can just have one sender/receiver per thread without contention.
<krwq> Zhivago: the problem is that C is controlling the loop which calls back
Kundry_Wag has quit [Ping timeout: 268 seconds]
<Zhivago> What you could do is to break up the problem into a post-office / item code.
<aeth> Zhivago: could there still be an issue if it ceases to be a pointer and becomes an integer derived from the pointer, though?
<krwq> Zhivago: not sure what does that mean
<Zhivago> How many threads is the C code running?
<krwq> Zhivago: not sure - not well documented - likely whatever number of processors I have - I have a way to force single thread which I currently do but I'd like to eventually switch to multithreaded
<krwq> Zhivago: it won't be feasible without it
<Zhivago> Fair enough -- might as well lock then -- so what's the problem with your current solution?
<krwq> Zhivago: the lock will likely be called a lot of times so expecting some overhead there but might be prematurely optimizing here - I was wondering if CL might have something like UNIQUE-ID or somethng along these lines
<krwq> I'll ignore the subject for now until it hits me then :)
<Zhivago> Simple answer is -- not portably.
willmichael has joined #lisp
<krwq> thanks Zhivago and aeth at least good to know I'm not missing anything obvious
<phoe> or, depending on how unique your unique-id needs to be
<phoe> you can just symbol-name of gensym
<krwq> phoe: I think it will take a while until I overflow 64bit number
<phoe> or (defun uid () (gensym) *gensym-counter*) for an ugly hack
<phoe> krwq: yep, it'll be a long while
<krwq> phoe: I'll wait with solution until then :) not sure if it's a good idea to have easily predictable ids in potentially insecure environment as well but will ignore that as well for now until it becomes a problem
orivej has joined #lisp
simplegauss has joined #lisp
<aeth> phoe: nice solution
mishoo has quit [Ping timeout: 252 seconds]
<aeth> phoe: I'm guessing *gensym-counter* has to be thread safe?
<phoe> aeth: it's a hack.
<aeth> phoe: it's not a hack, it's repurposing someone else's hard work
<phoe> aeth: I have actually no idea if (gensym) is thread safe.
<aeth> if gensym's number has to be unique, then you now have a unique number
<phoe> I can imagine this not being thread safe.
scymtym has quit [Ping timeout: 268 seconds]
<aeth> *gensym-counter* might not sync properly until (gensym) is called or something, though
<phoe> yep.
<aeth> So you might have to use the symbol-name
* beach strongly recommends that people program in Common Lisp instead of C.
<phoe> beach: I'm not touching C. I'm brainstorming a little bit for the guys who do though.
<beach> I wasn't referring to you.
<beach> I wonder what fraction of the utterances in #lisp have to do with trying to use something other than Common Lisp.
stacksmith has quit [Ping timeout: 268 seconds]
thallia has quit [Ping timeout: 240 seconds]
<phoe> beach: I don't think it's different compared to other languages. I can imagine a large part of a programming language's IRC traffic being devoted to interfacing between that language and something else that's written in a different language.
fikka has quit [Ping timeout: 256 seconds]
<aeth> phoe: And that's probably because it's hard and sometimes has to violate language idioms
<beach> phoe: Somehow that doesn't make me feel reassured.
<phoe> beach: it's not meant to make anyone feel reassured.
<beach> Just saying.
<phoe> It's usually mentioned because someone is trying to bridge two different things together for some reason.
thallia has joined #lisp
<phoe> aeth: I can imagine, someone trying to bridge something in C that can fire unicorns into space as side effects to an application written in Haskell for example that contains side effects to the minimum.
<phoe> That's the cost of having a real, real lot of programming languages used.
<beach> phoe: I mostly don't care how people spend their time. But I care about what is discussed in an IRC channel dedicated to Common Lisp.
<phoe> beach: as much as I agree, "interfacing CL with X" is a topic concerning CL.
<beach> Maybe I should go somewhere else then.
<krwq> #pure-lisp
<phoe> I don't think so. So far #lisp has been spacious enough, in my opinion.
manualcrank has quit [Quit: WeeChat 2.0.1]
<phoe> But then again, dunno, #lispffi could perhaps become a thing if enough people decide that it should.
<phoe> I can't say for myself here, I'm a way too small part of the Lisp community.
<jackdaniel> fwiw I don't see a problem with discussing other languages if the discussion is related to CL one way or another
<beach> phoe: I seem to be the outlier here, at least if my impression about the fractions of utterances is correct, so the #pure-lisp idea seems closer to a solution to my problem.
<beach> ... and jackdaniel just provided another data point supporting that idea.
<mfiano> I am neutral, though I do share beach's concern with regard to the increasing bridging of C code when often times it'd be easier to write in portable CL, and easier to maintain
ebrasca has quit [Remote host closed the connection]
<aeth> Any graphical application is going to have to FFI at some point unless CL builds in graphics/GUI/sound/input/etc. (moving the burden to implementors) or it's a soundless CLX application or it's for Mezzano. It would be nice to contain it to as few libraries as possible, though.
fikka has joined #lisp
Jen has joined #lisp
<beach> mfiano: Plus, if more people did that, there would be more shared code available, as opposed to now, where every person basically has the same problems over and over again.
<jackdaniel> mfiano: right, I agree with the sentiment, but if we refuse to talk about ffi, then there is no space to convince people. not speaking about bad practices doesn't make them disappear (sometimes even contrary, they are more frequent)
<mfiano> I understand completely. I just feel FFI is abused often
mishoo has joined #lisp
SuperJen has quit [Ping timeout: 256 seconds]
<jackdaniel> also there is this other side of the coin - we could put many non-CL libraries to good use given careful glueing and good interface on top of it (instead of reinvening the wheel due to NIH syndrome). I believe that each case needs a good call what is better or what has higher chance of success
<beach> jackdaniel: There is a big difference between "a large fraction of the utterances" and "refusing all such utterances". All I am trying to do here is to encourage people to adopt the spirit of Freenode and of #lisp, i.e. rather than everyone struggling with his or her individual FFI application, occasionally taking a break, and write a Common Lisp library that can be shared with others.
varjag has joined #lisp
ludston has quit [Ping timeout: 256 seconds]
<beach> jackdaniel: That is a very good idea.
smurfrobot has joined #lisp
vutral has quit [Ping timeout: 374 seconds]
fikka has quit [Ping timeout: 265 seconds]
Xof has joined #lisp
vutral has joined #lisp
Cymew has joined #lisp
willmichael has quit [Ping timeout: 240 seconds]
sbryant has quit [Ping timeout: 240 seconds]
<beach> jackdaniel: And notice how your excellent idea was met with... silence.
ludston has joined #lisp
sbryant has joined #lisp
* loke is reading the scrollback, looking for JD's excellent idea.
<jackdaniel> beach: I'm not the one who makes the call what is more probably to succeed - it's the developer who puts his effort to grow the ecosystem (and he may be wrong - that's how you hone your good call)
<loke> beach: What are you referring to precisely?
dmiles has quit [Ping timeout: 248 seconds]
smurfrobot has quit [Ping timeout: 256 seconds]
<beach> loke: I am discouraged because so many discussions are about FFI rather than about Common Lisp. So jackdaniel suggested that, rather than each person having FFI problems, or each person having to rewrite everything in Common Lisp, an intermediate solution would be for people to write high-quality Common Lisp wrappers for common foreign code.
<jackdaniel> I'm not a proponent of grand designs implemented by minions, but I do acknowledge that they have strong points over chaotic decentralized effort
<loke> beach: I see your point.
<aeth> jackdaniel: I'm a proponent of grand designs. The concepts tend to be good. It's the execution that's often lacking, perhaps because they are usually implemented by minions, as you said.
<loke> Personally, I'm not sure I agree completely with either of you :-)
<jackdaniel> right, I don't have strong opinion either. hopefully I'm doing my fair share to make things better :) that said, I need to go, later \o
<beach> See you jackdaniel.
<mfiano> beach: What is more disappointing to me is the fraction of libraries that are no longer maintained. Countless CL projects just seem to either go unmaintained, or were only created to just be pushed to GitHub and instantly abandoned.
smurfrobot has joined #lisp
tankrim has quit [Remote host closed the connection]
tankrim has joined #lisp
fikka has joined #lisp
Kundry_Wag has joined #lisp
<beach> mfiano: I see what you mean. Though I use GitHub as my backup. Not everything I put there is meant to be a self-contained project.
<beach> mfiano: Though perhaps I should state that fact in the README in order to avoid confusion.
<beach> Perhaps that is not how GitHub is supposed to be used.
Kevslinger has quit [Quit: Connection closed for inactivity]
dmiles has joined #lisp
<mfiano> I wasn't referring to yours. I just feel CL libraries in general are like that. It doesn't help they often have a low bus factor either.
figurehe4d has joined #lisp
<beach> Oh, but I have some of the kind you are referring to, so I suspect that others do too. I think that might be inevitable. But yeah, we need a way to distinguish such projects from the ones that are meant to be used.
smurfrobot has quit [Ping timeout: 255 seconds]
Kundry_Wag has quit [Ping timeout: 255 seconds]
<krwq> what about some meta project to make it easier to discover other lisp projects
<krwq> we could use tags or some other idea to tag project with what it does and how pure it is
<aeth> There could be collections, frameworks, etc.
<krwq> so i.e. you could eventually do something like (ql-search:find-by-tags :jpg) and it would point you to couple of project you could quickload
<easye> An active curation of CL https://github.com/CodyReichert/awesome-cl
schweers has joined #lisp
<krwq> we could make clim UI
<aeth> easye: Not very active!
<aeth> easye: It lists far too many things!
<aeth> e.g. it lists GCL as an implementation!
<easye> aeth: I am sure the developer accepts pull requests.
<aeth> Part of curation is saying no.
<easye> Agreed on the no part of editing.
<easye> But being a good editor usually proves to be very tough.
<krwq> I'd go with voting and reputation system for libraries that would trigger some competiveness for quality
<aeth> easye: Imo, that Github project is too ambitious. It lists too many domains and the author can't know what's junk and not in all of those domains.
<aeth> Curation is probably better in smaller areas.
<aeth> e.g. just web or just graphics
<krwq> the other idea we might add some statistics to QL and auto-generate what's the most popular
<beach> mfiano: I added a README for Claire: https://github.com/robert-strandh/Claire :)
<mfiano> Nice
<krwq> that should be our curated list
<aeth> CLISP is higher than I thought and ECL is lower than I thought
<aeth> "Scieneer: 0" ouch
<dmiles> oops
<mfiano> beach: To be honest I had you in mind for the opposite. I mean SICL devotion
<mfiano> and secondclimacs last i checked, etc
<beach> mfiano: I see. Yes, those are definitely not abandoned.
* easye waves to dmiles.
<beach> I agree that there needs to be some list of Common Lisp projects together with some indication of quality. Many newbies get it wrong and try to use suboptimal libraries. The only existing solution is to come here and ask for advice.
* dmiles waves back
<beach> But I think, in practice, such a list would be hard to compile and to get consensus about.
<dmiles> what languagees have a good library reputation already?
<krwq> beach: that's why I'm saying voting and reputation
<mfiano> beach: That would be nice. I think the same list should note their shortcomings as well to clearly see improvements that can be submitted by the community
ludston has quit [Read error: Connection reset by peer]
<aeth> dmiles: languages with a good reputation for libraries?
<krwq> if we add UI and make people vote and document in there
<dmiles> hehe i meant library repulatation system*
<beach> Several good ideas here.
<aeth> dmiles: well Python and Perl tend to be the standard examples for libraries
<aeth> Or at least they used to be, I'm not sure how things are these days
<krwq> that would be also a good proof of concept for clim project
<aeth> I stopped caring about other languages when I found CL
<krwq> same
ludston has joined #lisp
<aeth> s/for libraries/for how to handle libraries/
<krwq> but got rid off quite some experience in other language
<krwq> so a little backward step for a while
<mfiano> Another problem with such a list is everyone would vote for their own NIH library
<krwq> either way I think it would be beneficial for everyone to create a project for making it easier to reuse other peoples' effor
<dmiles> ussually such a repuation system would have to come from a package manager like quicklisp
<krwq> mfiano: that's not bad - if someone is considered a good contributor he's likely to recommend something good
<aeth> Here's an attempt at package curation in Perl that I think might bundle/install all of those libraries: https://metacpan.org/pod/Task::Kensho
<krwq> so reputation should work fine
<mfiano> Lisp and NIH. I'm going to be quiet now. I am sounding like one with extreme dislike for CL and that is far from the case
<aeth> I guess CPAN supports meta-packages or something? Maybe Quicklisp could have that concept?
<easye> The current abstraction for Quicklisp metapackage might be the bundle.
<krwq> wouldn't that be just creating an empty system with dependencies?
<easye> The libraries one may obtain from Quicklisp itself is a "bundle" or a "dist". One can have more than one dist.
<easye> err "libraries one has available to obtain"
<easye> err "One can have more than one dist available in a given Quicklisp installation"
* easye goes to drink more coffee.
<krwq> what's the dist definition? source for the package? (i.e. fork?)
<easye> a dist is a set of ASDF definitions, and the recipe to get the source artifacts downloaded and available for CL:LOAD
<krwq> in my case I usually fork libraries I plan to extensively use in case someone makes a breaking change/removes repo or I need to make a quick fix without sending a patch
<easye> There is a primary dist, called "Quicklisp" which references all the possible symbols that QL:QUICKLOAD knows how to retrieve.
<easye> But one may add new systems/symbols by adding another dist.
<krwq> easye: so how would I share some systems with quicklisp I have forked and patched without creating a conflict?
<easye> You host the metadata for a new dist, as well as the source artifacts that they refer to.
<krwq> can you inherit other dist and patch only selected libraries?
heisig has joined #lisp
<easye> (For ELS 2016, I think I installed a dist created by Shimera(?) that collected a bunch of libraries that weren't in Quicklisp, but it doesn't seem to be on the computer I am on, so I can't find a URI for an example)
Mr_Tea has quit [Remote host closed the connection]
<krwq> btw is ELS also on-line? I'm not going to be able to attend it
<krwq> i mean physically
<beach> Now here is a project that would be almost universally useful, and it is somewhat in the spirit of what jackdaniel suggested: http://metamodular.com/POSIX-API/
<beach> It is also great because it consists of 100 or so independent pieces, so that collaboration is very easy.
<easye> krwq: I have long wanted to do that for ABCL. The Quicklisp "dist" mechanism is still "under development", but adding such an ordering and patching over dependencies in Quicklisp systems with special needs (like running in the JVM) would be of interest to me.
<krwq> beach: I assume this will also cover windows? Im not using at home but will definitely need it for any user app
<jackdaniel> beach: this description looks very much like an abstract of osicat library (https://github.com/osicat/osicat) - and it covers windows to some extent
<phoe> beach: s/Ossicat/osicat/
<beach> phoe: Thanks.
<phoe> beach: you may also hyperlink the github link that jackdaniel just posted
<krwq> phoe: osicat is problematic
<beach> krwq: Again, I am sticking to the spirit of Freenode, so no commercial OSes are mentioned.
<phoe> krwq: c'mon, I'm just correcting typos right now ;)
<beach> jackdaniel: I misspelled it, but I explicitly mention Osicat.
<krwq> phoe: I mean that there are a lot of gaps and there is no abstraction for i.e. swapping underlying file system
<fe[nl]ix> beach: keep in mind that that actual POSIX is minimal and far from sufficient
<phoe> krwq: yes.
<dmiles> re POSIX-API .. <- surprised this is FFI and not "trival"
<beach> fe[nl]ix: Yes, I was thinking of all of Linux.
<jackdaniel> yes you did
<krwq> beach: like redhat?
* dmiles just brings that up since each impl impls at least 89% of that POSIX-API already ;\
<beach> krwq: Not sure I understand your question.
<jackdaniel> krwq: more like interface provided by, say, glibc
<krwq> beach: redhat is commercial
<phoe> krwq: but based on free software
<jackdaniel> redhat is linux distribution which "just" bundles some specific software versions
<fe[nl]ix> beach: I started IOlib with the same intentions then realised that many useful syscalls are outside POSIX, and even struct fields are OS-specific
<phoe> krwq: they essentially are a support company who accidentally supports only the linux distro that they ship.
Chream_2 has joined #lisp
<beach> fe[nl]ix: Yes, that would have to be taken into account.
<krwq> phoe: jackdaniel: beach: but the point is that for any syscall library to be useful it needs to support as many popular oses as possible and that includes windows and OSX
saki has joined #lisp
* dmiles entire police record consits of installing redhat cd-rom at bookstore in 1996
<pjb> :-)
<jackdaniel> krwq: as mentioned, osicat supports windows (to some degree limited by what windows as os allows) and osx is a posix system
scymtym has joined #lisp
<beach> krwq: I write free software. Therefore, people can take it and add support for whatever OS they like. That doesn't mean I myself am going to add such support. I use as little commercial software as I can.
<krwq> jackdaniel: last time I checked osicat couldn't handle symlinks correctly and didn't support shell execute with arguments as a list
<jackdaniel> krwq: check out in your favourite search engine what POSIX is
Chream_ has quit [Read error: Connection reset by peer]
simplegauss has quit [Read error: Connection reset by peer]
Chream_2 has quit [Read error: Connection reset by peer]
Chream_ has joined #lisp
simplegauss has joined #lisp
<krwq> jackdaniel: do you expect me to read the whole spec or what? I'm a fan of usefulness over ideology
<beach> krwq: And I deeply resent statements such as "for ... to be useful it needs to support [commercial software]". First, I discourage the use of commercial software. Second, I think it is factually wrong. There are many people (though perhaps not you) that use free software almost exclusively.
Chream_2 has joined #lisp
<krwq> beach: try to explain to my mum that she needs linux to use the app I wrote for her
<beach> krwq: I do not expect your mother to use the POSIX library.
<easye> Talking to *your* mum is not @beach's job.
smurfrobot has joined #lisp
<krwq> beach: I expect her to use the library and if I can't write an app for a family member then it's not by my definition anything useful
<beach> krwq: I am allowed to target whatever user group I like. It is just to bad if your mother is not part of it. Not my problem though.
<jackdaniel> krwq: honestly I didn't expect you to do nothing, yet I've *hoped* you could provide something more useful remarks than: "it didn't work for me, so it is problematic, hence not worth using"
<jackdaniel> you are free to improve osicat wrt Windows support (if you know how of course) and to add missing syscals like execve, execvp etc
<beach> krwq: And, for the record, I don't share your definition of "useful".
Chream_ has quit [Ping timeout: 256 seconds]
<easye> Utility is as usefullness does ...
<jackdaniel> moreover you are free to provide a compfy abstraction over it very much like run-program in many implementations
<krwq> jackdaniel: I gave you two examples: symlinks and calling a command with arguments as a list
<jackdaniel> symlinks where - on Linux or on Windows? (hint: Windows doesn't have symlinks)
ome has quit [Quit: Connection closed for inactivity]
<krwq> jackdaniel: windows does have symlinks
<easye> What's the current hotness for slicin' and dicin' bash one liners into UIOP:RUN-PROGRAM? I've got a bunch of stuff I keep repeating, like
<jackdaniel> and as of execve - it is not part of the library, but *it could be* (given you have incentive to implement run-program)
<easye> (uiop:run-program "mkdir -p ~/.config/common-lisp/source-registry.conf.d/ && cp ~/work/emotiq/etc/emotiq.conf ~/.config/common-lisp/source-registry.conf.d/")
<easye> That I would like to share an abstraction with.
<pjb> krwq: MS-Windows doesn't have symlinks.
<pjb> krwq: MS-Windows has something that ressemble macOS aliases, but worse.
<dmiles> Widnows only has Hardlinks
<pjb> (and knowing that macOS aliases combine the defects of both hard links and sym links…)
<easye> For symbolic link abstractions, I just shell out to Windows for ABCL.
<dmiles> (hardlinks for dirrectories that is)
<pjb> again, the worst of the worse…
smurfrobot has quit [Ping timeout: 260 seconds]
<krwq> basic scenarios are fine
<pjb> If I do ls from cygwin and see files named .lnk I don't call that symlinks!
<krwq> i never used them from cygwin or have any clue what it does
<easye> pjb: agreed that it ain't a symlink, but it shares some properties i.e. it needs resolution with symlinks.
<dmiles> and before vista windows had NTFS junction points
<pjb> But then, I remained with MS-Windows 7, so perhaps they added something.
<jackdaniel> krwq: OK, you do it: osicat-src/windows/windows.lisp, exported abstractions are in osicat-src/src/osicat.lisp. Since you clearly know what you need it's just a matter of adding support
<krwq> jackdaniel: i don't use windows at home and the only time I needed it - it didn't work for me - will consider porting next time I need it
<easye> So, there for a link, it should always be the case that CL:TRUENAME and CL:PROBE-FILE can be used to distinquish.
<krwq> but btw links to directiories don't work on linux as well
<easye> krwq: depends on your implementation.
<krwq> easye: of osicat?
<easye> No, what osicat is running on.
<krwq> ubuntu
<easye> no, sbcl, ccl, acl, etc.
<phoe> Lisp implementation.
<krwq> sbcl
<jackdaniel> easye: osicat doesn't map to running implementation (it uses ffi to perform syscalls)
<jackdaniel> so it behaves consistently across implementations
<jdz> I thought everything is a file in Unix, including directories.
<krwq> jdz: yes but path is not a file
<easye> I thought that Stellian tried to architecture it that way, but eventually had to implement some conditionals?
<jdz> (Sorry, not adding any value to the discussion; but a link is a kind-of a file, or directory, depending on what one wants to do with it).
* easye goes to check osicat source again.
smurfrobot has joined #lisp
<jackdaniel> check out file posix/unix.lisp for defsyscall's
<jdz> On the other hand, from the Common Lisp point of view, one can (should be able to) also operate on a link as a file or a directory.
<jdz> By having the last component in the file or directory.
<krwq> jackdaniel: I think it might be a matter of adding or removing slashes in the end but the point of abstraction is that I don't have to think if I did it correctly
<jdz> krwq: I think it is important to remember that CL's pathname operations don't need to touch the filesystem at all.
milanj has quit [Quit: This computer has gone to sleep]
<jackdaniel> and if you did it incorrectly (i.e you didn't add or remove some slashes n the end) then you have to think about it ;]
damke_ has joined #lisp
<krwq> jdz: they are also one of the biggest pains i've seen across all of the languages I've ever used
willmichael has joined #lisp
<jackdaniel> we yet have to develop the software capable of scrapping brain waves to understand the intention
<krwq> jackdaniel: nope you create directory-link and file-link functions which do the right thing always
<jdz> krwq: because no other language has ever attempted to abstract filesystem operations?
<krwq> or show error
<jackdaniel> (defsystem foo :depends-on (#:brain-scrapper))
<krwq> jdz: i get the idea that it was invented before filesystem was speced out properly
<krwq> but I think the notion of directory and file object is much easier
<jackdaniel> when I find some abstraction inconvenient I usually try to make a PR (and sometimes it just happens I'm simply ignorant - sadly)
<jdz> I thought just doing (declaim (optimize dwim)) would be sufficient.
damke has quit [Ping timeout: 264 seconds]
<krwq> i.e. see .NET FileInfo and DirectoryInfo - I'd say that's a pretty good and easy solution
figurehe4d has quit [Ping timeout: 276 seconds]
<krwq> not a fun of other abstractions there but files have decent abstraction
<jdz> krwq: Does it support file versions?
<krwq> jdz: which filesystem exactly supports file versions?
<jdz> Or symbolic links, for that matter.
milanj has joined #lisp
<jdz> krwq: ZFS AFAIK.
willmichael has quit [Ping timeout: 240 seconds]
<jackdaniel> for instance I could mix two different concepts: filesystem access and pathname support
<beach> VMS has file versions as I recall. Not sure VMS is still used, though.
<jackdaniel> which are two different things
<jackdaniel> (speaking of potential of being ignorant with my propositions)
sjl has joined #lisp
<jdz> jackdaniel: I agree. Have been very frustrated with languages where pathnames have to be handled using string concatenation.
shrdlu68 has joined #lisp
<krwq> jdz: symbolic links are a pain in .net but searching and enumerating files is always dwim
karswell has quit [Remote host closed the connection]
<jdz> krwq: Also, let's not conflate languages and libraries.
<krwq> I'm currently trying to abstract file system so might be able to combine git with any file system to create versioned file ssytem
karswell has joined #lisp
<krwq> lisp doesn't have virtual file systems which is a pain
<krwq> at least for me
<jdz> krwq: which _language_ does?
tankrim has quit [Remote host closed the connection]
<krwq> jdz: I think ruby and I've seen IsolatedFileStorage in .net but never tried so not sure if it works as i'd expect
tankrim has joined #lisp
<jdz> It's not the language, it's a library.
Jen has quit [Remote host closed the connection]
<jdz> Standard library sits somewhere in between.
<krwq> libraries make the language great - language by itself will always be just a language
sjl has quit [Ping timeout: 240 seconds]
<krwq> lisp does have the advantage of making it easier to write abstraction though
<krwq> but lacks libraries
<jdz> krwq: I have an issue with you saying "lisp doesn't have virtual file systems" instead of saying "there is no Common Lisp library for virtual file systems".
<phoe> ^
<jackdaniel> especially that there is ;-)
<mfiano> I think your time would be better spent looking around than spreading misinformation
<jackdaniel> it is called cl-fuse afair
<krwq> jackdaniel: have you tried it?
<phoe> C doesn't have virtual file systems either, neither does Python, Java, Haskell, Ruby, MATLAB or assembly
<jackdaniel> I totally agree with mfiano, I don't have *more* time to clear your misconceptions
<shrdlu68> krwq: Are you currently implementing a virtual filesystem in CL?
<krwq> shrdlu68: yes
ome has joined #lisp
<shrdlu68> krwq: Cool.
<krwq> it's not cool, i just wanted to implement something using it but ended up with implementing it
<jdz> krwq: also, NTFS most definitely has file versions.
<phoe> krwq: it's called yak shaving, and it's pretty common to do it while programming.
<shrdlu68> krwq: I meant that it's cool that you're implementing one, not the fact that you've had to implement one.
<jdz> I'm not even sure what it means to "implement a virtual file system".
<krwq> jdz: the point is so that I can use all operations I can do in CL but without having to physically use hard drive and being able to mount it physically as well
<shrdlu68> jdz: To write a library that facilitates the creation and access of virtual filesystems?
<jdz> 2 interpretations, and counting.
Kundry_Wag has joined #lisp
<krwq> jdz: he said the same as I did in different words
nika_ has joined #lisp
fikka has quit [Ping timeout: 268 seconds]
<jdz> In my understanding, physical and virtual are the counterparts.
willmichael has joined #lisp
<krwq> nope, you define abstraction for file system something which can be *easily* and quickly implemented
<krwq> and you provide a set of functions to mount and unmount it
<krwq> the other part is integrating that with CL
<krwq> which is more work as it will require hacking all implementations
<jdz> Why?
<krwq> jdz: i.e. sbcl is doing syscalls directly in its 200+ lines long open implementation
<krwq> there is no abstraction which I could plug into
<shrdlu68> krwq: You could use a CFFI layer.
<jdz> Well, you'll have to do your own 200+ syscalls in your own functions, right?
<krwq> shrdlu68: what do you mean? for fuse or do you mean something else
<jdz> krwq: you don't mean to replace implementation's file access code, do you?
Kundry_Wag has quit [Ping timeout: 260 seconds]
<jdz> At least as an initial goal.
<krwq> jdz: I meant to provide something like *file-system* dynamic var which if bound to something else than default value it will start using virtual file system instead of the physical one
<krwq> i mean everything in CL would
<phoe> you need to rewrite a huge chunk of CL for this.
<krwq> phoe: why not just open and couple of other things?
<phoe> hm, in fact yes
<krwq> I could reuse all of the streams they have and stuff for my default implementation
<phoe> yes, the stream layer can be reused.
<jdz> krwq: Oh, I'm starting to see what you're after. Good luck with ensuring CL's pathnames work on your VFS.
<phoe> you just need to rewrite what is beneath it.
<krwq> but each implementation does it differently so this will likely be painful
<phoe> yep.
<phoe> you go into the implementation-defined zone.
terpri has quit [Ping timeout: 240 seconds]
<krwq> my first version will likely just provide a set of similar APIs which you can alternatively use
<krwq> and not sure if will ever do that pluggin in part
<krwq> I will see how it goes
figurehe4d has joined #lisp
mlf has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
fikka has joined #lisp
<jdz> krwq: Have you considered using logical hosts instead of a magic special variable for this?
<krwq> I have never used CL's path abstraction for other thing that to write my simpler string based path abstraction :P (might have been bad decision when I started)
<krwq> jdz: what do you mean
<jdz> I meant logical pathnames, not logical hosts.
<phoe> someone said a thing up there about paths as concatenated strings
<jdz> krwq: You'd have an additional logical host VFS or something, similar to SYS, the semantics of which is implementation defined.
<jdz> clhs 19.3.1.1.1
<specbot> The Host part of a Logical Pathname Namestring: http://www.lispworks.com/reference/HyperSpec/Body/19_caaa.htm
<krwq> jdz: for filesystem implementation - yes will consider it - but I was talking about my own abstraction layer I spent a little time writing when learning CL
<krwq> jdz: will read about it - might simplify stuff
milanj has quit [Quit: This computer has gone to sleep]
<krwq> I'm not a fan of how CL named path related functions - I can't ever remember them
<krwq> in my abstraction I've prefixed every path related function with path-
willmichael has quit [Ping timeout: 256 seconds]
Xal has quit [Ping timeout: 264 seconds]
<krwq> with path+ for concatenation being exception
<jdz> "Concatenaton"? And not merging?
<phoe> krwq: Lisp pathnames are one of the most alien things of all of CL
<krwq> jdz whatever you call it
<phoe> it takes some time to get them, but they're pretty decent afterwards.
<krwq> I ended up using strings everywhere and if it ends with / it is a directory and if not it is a path to a file
<phoe> which might fail you
<phoe> "/usr" is definitely a directory
<jdz> Sometimes reimplementing something is the best way to understand that thing.
Xal has joined #lisp
<krwq> i have set of functions prefixed with file- and directory- so that i can never misuse
<krwq> and for directories it will automatically add slash
wxie has joined #lisp
<krwq> so i.e. my version of file-exists will return false for /usr
<krwq> because it is a directory
<krwq> probe-file will return t regardless if it is a file or dir
<jdz> But what if it is a symbolic link?
<krwq> jdz: I do not care about that for directories
<jdz> Really?
<krwq> as long as I can write files there
<jdz> No, what if you want to move it?
<jdz> Well, bad example.
<krwq> I haven't done that but I'd likely error then
<jdz> Make a copy is a better example.
<jdz> One might want to copy a link, or the contents of the directory. Both are valid operations.
<krwq> jdz: directory-copy technically should fail but I have never failed
<krwq> s/failed/tried
<krwq> wtf
<krwq> I do not have abstraction for directory-copy though
<krwq> i never had to use it
<jdz> And then there's the case of target location being on a different filesystem (different mount point).
<krwq> jdz: why is that a problem
mikecheck has left #lisp ["part"]
terpri has joined #lisp
<jdz> Might not be a problem in this case, but it is a problem with hard links.
<krwq> are we talking about my vfs or my libraries right now
smurfrobot has quit [Remote host closed the connection]
<krwq> for my file system I'll strive to do it correctly
<jackdaniel> so it is yet another scratch-my-itch effort? because you know - someone will come and claim, that your abstraction is not sufficient for him, and will create a very similar project (instead of contributing to yours)
<krwq> my current libraries were just hacked together because i needed them atm
willmichael has joined #lisp
<krwq> jackdaniel: the probem with changing existing libraries is back compat
orivej has quit [Ping timeout: 264 seconds]
figurehe4d has quit [Remote host closed the connection]
<jdz> jackdaniel: That's approximately what I'm trying to arrive at: no matter what subset of file system semantics one chooses, the abstraction will fail soon enough. Case in point: CL's pathnames.
igemnace has quit [Read error: Connection reset by peer]
figurehe4d has joined #lisp
simplegauss has quit [Ping timeout: 248 seconds]
<krwq> jdz: I'll consider CL pathnames and have not rejected them but for current testing will use strings and then will see if it makes sense to convert
<krwq> current implementation doesn't have any paths except for internal use
<jdz> I find CL's pathnames very nice and convenient for pathname operations, not file system access per se.
<krwq> it only has resolving child name
<krwq> i bet CL already has that
willmichael has quit [Ping timeout: 256 seconds]
<krwq> jackdaniel: i have considered cl-fuse btw. the reason I have rejected it was: no clear place to contribute, no documentation, linux specific, not found any clear abstraction over fs - with the first reason being main
<krwq> even the link in here doesn't work: https://www.cliki.net/cl-fuse
tokik has quit [Ping timeout: 276 seconds]
<jackdaniel> 30s of looking yields: https://common-lisp.net/project/cl-fuse/
<jdz> FUSE is by definition Linux-specific, no?
<jackdaniel> so you could: update cliki page and write to Michael
<Shinmera> Good luck writing device drivers on Windows
vhost- has quit [Ping timeout: 264 seconds]
tokik has joined #lisp
<krwq> jdz: yes but file system isn't
<Shinmera> especially with lisp
willmichael has joined #lisp
<krwq> Shinmera: i can ask guys at work, don't think that will be an issue - rather a slight PITA
shka has joined #lisp
<shka> yo
vhost- has joined #lisp
<shka> there was some kind of lisp system to make flamegraphs from sbcl statistical profiler output but i can't seem to find it now
<shka> can anybody help me, please?
<krwq> jackdaniel: will consider again
ThUnD3R256 has joined #lisp
<scymtym> shka: i made a prototype for clim but it depends on changes to sbcl i didn't manage to integrate yet: https://techfak.de/~jmoringe/clamegraph3.png . i also hacked https://techfak.de/~jmoringe/simple-flame-graph.lisp for use with the flamegraph.pl script at one point, but i don't know whether it still works
<scymtym> this is probably a better screenshot: https://techfak.de/~jmoringe/clamegraph2.png
TMA has joined #lisp
<wxie> krwq: To test whether a file exists in the file system corresponding to a pathname designator--a pathname, namestring, or file stream--you can use the function PROBE-FILE.
<phoe> wxie: he knows about it
<wxie> ok
<krwq> wxie: the problem with that is (probe-file #p"/usr") is non-nil
<krwq> wxie: and technically directory is not a file
<krwq> or is it
<krwq> depends who defines what file is
<krwq> in my eyes it is not or only as an implementation detail
<wxie> krwq: so you want to check if a #P is empty?
<krwq> wxie: i got this solved already but was just pointing out that probe-file does not check if file-exists correctly because it it non-nil when you pass directory
<krwq> it returns*
<wxie> ok
<krwq> wxie: in my eyes this information is compeltely useless unless it tells me which one it is
<jdz> (directory-pathname-p (probe-file #p"/usr"))
<krwq> or meybe it even does but those names in CL are hard to remember
<krwq> jdz: it's in cl-fad though - I need to relearn paths in lisp and see if it will make sense to convert my code to them or if there are still things I don't like
<oleo> in linux everything is a file.....
<jdz> oleo: Isn't that Plan9?
<beach> oleo: No it isn't. Statements like that are usually meaningless.
<krwq> oleo: everything is data
<krwq> oleo: not trying to say anything but just making a point
<krwq> the thing is that when I started with CL there were too many new concepts too learn at the same time to even try to embrace pathnames in lisp - it was too much and pathname as string is easier to use when you start
<pjb> oleo: in unix. But actually, no. Not since open read and write don't work on directory entries anymore. You have to use opendir and readdir, and writedir doesn't exist. (use normal creat, link, unlink).
<beach> pjb: It is even easier to refute than that. The error code returned by system calls is not a file either.
<pjb> So while directories were dangerously files in early unix, they're not anymore and have not been for a long time. I wonder, if they still were when CL was standardized!
<beach> Probably the same in plan 9 by the way.
<beach> Statements like that, when scrutinized and corrected, usually deteriorate into "everything that is a file is a file"
<krwq> I'll be going and will give you some rest of these conversations :)
<krwq> see you!
<oleo> hmmm ok
<beach> ... just like "everything is an object", by the way.
krwq has quit [Remote host closed the connection]
<Shinmera> beach: Everything that is true is true after all
<beach> Yeah, and what will be will be.
<beach> Business is business too.
<dim> pet peeve of mine: on unix a filename isn't a string, it's a byte array terminated with a NUL character; it means there's no way to apply any encoding notion to a filename even on current modern linux file systems
<schweers> dim: is this different on other OSes?
<jackdaniel> beach: I think that statements are meaningful (though may be slightly incorrect at times) - it is a mental shortcut for saying: almost anything in the <system> adheres to the <principle> in contrary to other <systems>
<jackdaniel> s/statements/such statements/
wxie has quit [Remote host closed the connection]
<jackdaniel> s/anything/everything/
<dim> schweers: windows NTFS has UFT-16 file names
<jackdaniel> but I think we had this discussion in the past :-)
<dim> jackdaniel: but then again you fall into the classics of how the brain actually works, that I don't know the name of the phenomenon, so I will provide with a meaningless example
simplegauss has joined #lisp
<beach> jackdaniel: We have, yes. Perhaps "this system is very orthogonal" would be better.
<dim> if I tell you every red car owner drives irresponsibly and you'd believe me, then everytime a red car is doing something wrong that will reinforce the notion, and everytime a red car is driven responsibly you will be like “well doesn't really count does it?”
quazimodo has joined #lisp
<schweers> dim: confirmation bias?
<schweers>
hhdave has joined #lisp
<dim> so “everything is a file” and then any example of “not this thing” will be like “yeah well, doesn't really count” or “this can't be a file anyway”
smurfrobot has joined #lisp
<dim> schweers: might be the right term, thanks!
<jdz> dim: cognitive dissonance?
<beach> dim: So, it boils down to what I said "every file is a file".
<schweers> I think cognitive dissonance fits better in this context
<Shinmera> beach: Side note, I'm writing a paper for ELS after all. Would you still have time to read through it before the deadline? I plan on it being no more than two pages, hopefully.
<beach> Shinmera: I think that's doable. I will have house guests from tomorrow on beyond the deadline, but I typically work when everyone is asleep, so go ahead.
<jackdaniel> dim: yes, I'm just saying that such statement like "everything is a file", while is slitghtly incorrect gives a good mental picture of the general philosophy surrounding the system and is well understood even by people who had very little experience with (say) UNIX, because they are, say, Windows users
<Shinmera> beach: Alright, thank you very much in advnce
<Shinmera> *advance
<Shinmera> If everything goes well I'll be done today.
<dim> beach: exactly
<beach> Shinmera: Anytime.
<dim> jackdaniel: make sense too, sure, I like the quote that “every model is wrong, some of them are still useful”
<beach> dim: I am glad I am not alone in trying to be precise in this matter.
<jackdaniel> because it is easier to say: every expression returns a value in lisp, so you can say (let ((a (if bam 1 2))) …) than explaining: most expressions return value in lisp, and those which doesn't does not, because it is a matter of syntax (i.e you can't assing block because it is always atom inside tagbody (tagbody is a construct (and it must be that way because))))))))) ;-)
<jackdaniel> s/assing block/assign tag/
<jackdaniel> nice quote btw
<jackdaniel> my point in general is that incorrect statements like "everything is a file" have more meaning than "every file is a file" because they have (contextual) information, that "almost every object is a file" in contrary to "objects are either files or something else"
<_death> Metaphors We Live By
saki has quit [Ping timeout: 256 seconds]
haruka has joined #lisp
orivej has joined #lisp
<jdz> dim, schweers: Looking it up it seems "cognitive bias" and "rationalization" are even more closer [than cognitive dissonance].
orivej has quit [Ping timeout: 256 seconds]
Achylles has joined #lisp
damke has joined #lisp
damke_ has quit [Ping timeout: 264 seconds]
<shka> scymtym: well, i can't wait to use it!
<shka> it looks pretty good
<shka> i seriously should write a CLIM program myself..
<shka> scymtym: can you provide any hint on when SBCL will accept your changes, please?
nullman has quit [Ping timeout: 255 seconds]
nullman has joined #lisp
Kundry_Wag has joined #lisp
pjb has quit [Ping timeout: 240 seconds]
<scymtym> shka: i can perform the changes myself. the problem is finding the time to do it
Kundry_Wag has quit [Ping timeout: 248 seconds]
vtomole has joined #lisp
milanj has joined #lisp
Amplituhedron has joined #lisp
shrdlu68 has quit [Ping timeout: 256 seconds]
shrdlu68 has joined #lisp
tankrim has quit [Remote host closed the connection]
tankrim has joined #lisp
markong has joined #lisp
nirved has joined #lisp
shrdlu68 has quit [Ping timeout: 260 seconds]
_cosmonaut_ has joined #lisp
<shka> scymtym: i understand, well, I just want to say that this looks truely awesome and I would love to use it!
pjb has joined #lisp
shrdlu68 has joined #lisp
ome has quit [Quit: Connection closed for inactivity]
raynold has quit [Quit: Connection closed for inactivity]
jmercouris has joined #lisp
attila_lendvai has joined #lisp
shrdlu68 has quit [Ping timeout: 256 seconds]
simplegauss has quit [Ping timeout: 248 seconds]
nowhereman_ has joined #lisp
papachan has joined #lisp
nowhere_man has quit [Ping timeout: 240 seconds]
shrdlu68 has joined #lisp
shrdlu68 has quit [Client Quit]
<jmercouris> Shinmera: you said that connections are two way, but can a server send a message to a client without a client first requesting it?
<jmercouris> e.g. isn't it necesitated for two-way communication that both programs act as both client and server?
<Shinmera> Yes
<Shinmera> No
<Shinmera> A "server" is something that listens for connections. A "client" is something that initiates a connection.
<Shinmera> It has nothing to do with the direction of information, only with the direction of connection establishment.
<jmercouris> Ah okay
<jmercouris> that was really tripping me up
<jmercouris> thanks
<Shinmera> I have yet to see a protocol that does not involve both parties sending at least some data.
<jmercouris> All handshakes require some confirmation
<jmercouris> otherwise they wouldn't be handshakes right?
<Shinmera> Sure, but I meant even on a higher level than just the connection.
<Shinmera> HTTP for instance is not persistent, but the client still sends request data to the server.
<jmercouris> I have no idea, this domain is very vague and fuzzy for me
<jmercouris> since you've implemented a web application framework though, I'll take your word for it :D
<Shinmera> I feel like you're making things much more complicated than they are.
<jmercouris> Probably I am
<jmercouris> as far as I understand it I need to do usocket:socket-listen to basically reserve a port
<jmercouris> then I need to do usocket:socket-connect to get a usocket:stream-usocket
<jmercouris> then I can get a stream from that object with usocket:socket-stream
<jmercouris> I can write to that stream
<jmercouris> and then I can read from that stream if I do a usocket:socket-accept
<Shinmera> Uh
<Shinmera> Okey, so, you have two parties. One is the server, which does socket-listen, followed by a loop of socket-accept.
attila_lendvai has quit [Read error: Connection reset by peer]
angavrilov has joined #lisp
vtomole has quit [Ping timeout: 260 seconds]
<Shinmera> Whenever socket-accept returns, it returns a socket with a stream that you can use to exchange data with the client.
<jmercouris> Yeah, I'll have to do socket-accept on a bt thread right? beacuse it is blocking?
<Shinmera> Not necessarily. If all your application does is be a server, then the main listening can happen on thread 0.
<Shinmera> You'll usually want to spawn a thread for each client though, so for each socket returned by socket-accept.
attila_lendvai has joined #lisp
attila_lendvai has joined #lisp
attila_lendvai has quit [Changing host]
<Shinmera> Anyway, the client side does socket-connect and receives a socket with a stream to exchange data with the server.
<phoe> Either a thread for each client, or a set of workers that wake up whenever there is any activity on any socket.
<Shinmera> Typically you'll use the sockets you get on either side to enter a read loop that receives data and reacts to it.
<jmercouris> so the server, cannot write, except for when clients connect to it?
<phoe> jmercouris: correct
<Shinmera> Well where would it write to?
<phoe> what would it write to if there are no clients?
<phoe> the server socket is there just for accepting connections, it does not have an associated stream.
<phoe> since there is nowhere to write to.
<jmercouris> Yeah, that's what I was thinking
<Shinmera> If you use UDP you can do broadcasts but that's a whole other story so don't worry about it.
<jmercouris> So when a client connects and sends some data, how can the server react?
<phoe> by reading it
<phoe> it first can notice that a socket is active
<phoe> and then read from that socket
<phoe> so first #'usocket:wait-for-input and then read bytes from #'usocket:socket-stream
<jmercouris> so the server can also run usocket:socket-accept?
<jmercouris> ok
<phoe> the server *has* to run socket-accept
attila_lendvai has quit [Read error: Connection reset by peer]
<phoe> 1) server spawns a listening socket via socket-listen
<phoe> 2) client connects to the listening socket via socket-connect
<phoe> 3) server accepts the connection via socket-accept
<jmercouris> so something like (usocket:wait-for-input (usocket:socket-listen "127.0.0.1" 8080))
<phoe> 4) communication happens between the sockets returned from 2) and 3)
<phoe> jmercouris: nope
willmichael has quit [Read error: Connection reset by peer]
<phoe> wait-for-input socket-accept
willmichael has joined #lisp
attila_lendvai has joined #lisp
attila_lendvai has joined #lisp
attila_lendvai has quit [Changing host]
<jmercouris> phoe: I'm just wondering why in your example you have (defvar *client-2* (socket-accept (wait-for-input *server*)))
<phoe> wait, do I?
<phoe> then I probably screwed up, one sec
<jmercouris> so is *client-2* erroneously named?
<scymtym> jmercouris: socket-accept is like a factory (if that terminology helps) for sockets - each returned socket is connected to a specific client
drdo has quit [Ping timeout: 240 seconds]
<phoe> jmercouris: I screwed up, should be (socket-accept *server*)
<jmercouris> scymtym: that does help yes
dieggsy` has joined #lisp
<jmercouris> phoe: I've been reading this example for hours :D
<phoe> sorry :( I was stupid.
<jmercouris> something so trivial not clicking in my head lol
<jmercouris> nah, it's okay
oldtopman has quit [Ping timeout: 240 seconds]
Lord_of_Life has quit [Ping timeout: 240 seconds]
bigfondue has quit [Ping timeout: 255 seconds]
<jmercouris> is one steram only good for one message?
<jmercouris> must I keep making streams to accept new information?
<jmercouris> s/steram/stream
dieggsy has quit [Ping timeout: 240 seconds]
thinkpad has quit [Quit: lawl]
drdo has joined #lisp
rumbler31 has joined #lisp
nullman has quit [Ping timeout: 248 seconds]
nullman has joined #lisp
rumbler31 has quit [Ping timeout: 255 seconds]
Lord_of_Life has joined #lisp
oldtopman has joined #lisp
EvW has joined #lisp
bigfondue has joined #lisp
milanj has quit [Quit: This computer has gone to sleep]
thinkpad has joined #lisp
dieggsy` has quit [Remote host closed the connection]
haruka has quit [Read error: Connection reset by peer]
haruka has joined #lisp
nowolfer has quit [Ping timeout: 255 seconds]
fikka has quit [Ping timeout: 276 seconds]
Kundry_Wag has joined #lisp
Kundry_Wag has quit [Ping timeout: 256 seconds]
manwhowouldbekin has joined #lisp
rk[ghost] has quit [Ping timeout: 256 seconds]
rk[ghost] has joined #lisp
python476 has joined #lisp
rumbler31 has joined #lisp
comborico1611 has joined #lisp
nowhere_man has joined #lisp
nowolfer has joined #lisp
nowhereman_ has quit [Ping timeout: 256 seconds]
fikka has joined #lisp
Kevslinger has joined #lisp
jmercouris has quit [Ping timeout: 240 seconds]
jmercouris has joined #lisp
tankrim has quit [Remote host closed the connection]
tankrim has joined #lisp
dddddd has joined #lisp
milanj has joined #lisp
Colleen has quit [Remote host closed the connection]
quazimodo has quit [Ping timeout: 256 seconds]
Colleen has joined #lisp
willmichael has quit [Ping timeout: 256 seconds]
willmichael has joined #lisp
willmichael has quit [Read error: Connection reset by peer]
willmichael has joined #lisp
<jmercouris> Shinmera: whenever socket-accept returns, it returns a socket? I assume that is an internal term used by usocket, and not a new binding to an address/port yes?
rumbler31 has quit [Remote host closed the connection]
<jmercouris> aka a "usocket" object which has an associated stream
<jmercouris> actually nvm scratch that question
Kundry_Wag has joined #lisp
Bike has joined #lisp
haruka has quit [Ping timeout: 256 seconds]
Denommus has joined #lisp
warweasle has joined #lisp
manwhowouldbekin has quit [Quit: Leaving]
haruka has joined #lisp
<Shinmera> Yes, No.
<Shinmera> The socket you get on the server side is connected to the client over a port chosen by the TCP implementation.
<Shinmera> Either way, this is just detail stuff. Why do you need to know this?
<jmercouris> because the code still doesn't make sense to me
<jmercouris> let me play around with it a bit more and I'll post my code
nowhereman_ has joined #lisp
nowhere_man has quit [Ping timeout: 255 seconds]
mishoo has quit [Ping timeout: 256 seconds]
safe has joined #lisp
shifty has quit [Ping timeout: 256 seconds]
<jmercouris> alright
<jmercouris> so it turned out to work I think
<jmercouris> tell me if my variable names make sense
<jmercouris> if they do, then I understnd
aindilis has quit [Ping timeout: 256 seconds]
<jmercouris> interesting
attila_lendvai has quit [Read error: Connection reset by peer]
xorox90 has joined #lisp
<jmercouris> it seems I have to already do (read-line (usocket:socket-stream socket) before I can recieve any input
ThUnD3R256 has quit [Quit: Leaving]
<jmercouris> Or maybe that is just the first "read-line" which sends nil?
attila_lendvai has joined #lisp
attila_lendvai has joined #lisp
attila_lendvai has quit [Changing host]
attila_lendvai has quit [Read error: Connection reset by peer]
attila_lendvai has joined #lisp
Kundry_W_ has joined #lisp
Kundry_Wag has quit [Read error: No route to host]
attila_lendvai has quit [Read error: Connection reset by peer]
Kundry_Wag has joined #lisp
attila_lendvai has joined #lisp
attila_lendvai has quit [Read error: Connection reset by peer]
Kundry_W_ has quit [Ping timeout: 256 seconds]
attila_lendvai has joined #lisp
attila_lendvai has joined #lisp
attila_lendvai has quit [Changing host]
<Shinmera> jmercouris: I'm busy with my paper right now but I can write you a simple, clear example later
<schweers> seems like usocket covers lots of the steps one has to do in C. Like create a socket in the first place, or bind it.
<jmercouris> Shinmera: np, good luck with your paper
Kundry_Wag has quit [Remote host closed the connection]
<schweers> jmercouris: I’ve never worked with usocket, but according to the documentation, WAIT-FOR-INPUT returns a list of sockets as its primary value, while SOCKET-ACCEPT wants a socket (not a list).
lnostdal_ has quit [Remote host closed the connection]
lnostdal_ has joined #lisp
dilated_dinosaur has quit [Remote host closed the connection]
rumbler31 has joined #lisp
DemolitionMan has joined #lisp
<DemolitionMan> hi
<DemolitionMan> please help
<beach> Hello DemolitionMan.
<DemolitionMan> I need help to plot a single point with cl-plot, from documentation I used plpoin, but it needs a code for the symbol to print at the coordinates... But I need a single point to be drawed
<DemolitionMan> :(
<beach> What happens instead?
<DemolitionMan> I have the symbol placed at the coordinates, which is correct
<DemolitionMan> but I need something that actually plots the point and stop!
<beach> The documentation is pretty skimpy.
Kundry_Wag has joined #lisp
<DemolitionMan> for example
<DemolitionMan> if I use (cl-plplot-system:plpoin x y 0)
attila_lendvai has quit [Read error: Connection reset by peer]
<DemolitionMan> I have nothing plotted
willmichael has quit [Ping timeout: 276 seconds]
<beach> Did you do SHOW or SAVE as the README suggests?
Kundry_Wag has quit [Remote host closed the connection]
attila_lendvai has joined #lisp
Kundry_Wag has joined #lisp
<DemolitionMan> beach: which README?
attila_lendvai has quit [Read error: Connection reset by peer]
<rumbler31> or try vgplot
<beach> Or the CLIM listener.
<DemolitionMan> beach: no, the diagram is showed in a window, but no points in it! (using plpoin x y 0)
smaster has joined #lisp
attila_lendvai has joined #lisp
attila_lendvai has joined #lisp
attila_lendvai has quit [Changing host]
<beach> DemolitionMan: Maybe I am misunderstanding the README, but it says to do SHOW or SAVE to actually see the result.
makomo has quit [Ping timeout: 256 seconds]
<beach> Do you have to use cl-plot?
<beach> If not, I recommend the CLIM listener: http://metamodular.com/clim-listener.png
<beach> It drew the point right away.
fikka has quit [Ping timeout: 240 seconds]
Arcaelyx has joined #lisp
attila_lendvai has quit [Read error: Connection reset by peer]
<Shinmera> Alright, paper draft is done. If anyone would like to offer their time to read through it and provide feedback, I'd be most thankful. https://github.com/Shinmera/talks/blob/master/els2018-glsl-oop/paper.pdf
sabrac has quit [Ping timeout: 248 seconds]
<flip214> Shinmera: I'm on it.
<Shinmera> Thank you!
<flip214> feedback via mail.
<Shinmera> Sure.
aindilis has joined #lisp
sabrac has joined #lisp
mishoo has joined #lisp
attila_lendvai has joined #lisp
attila_lendvai has joined #lisp
attila_lendvai has quit [Changing host]
fikka has joined #lisp
<jmercouris> schweers: so you are saying it should just be (usocket:socket-accept *server*)?
attila_lendvai has quit [Read error: Connection reset by peer]
<schweers> depends on what you want to do. In this specific example, you should be able to get away with this. You don’t have to wait for the server socket to become readable in order to accept it, as accept() will block anyway.
attila_lendvai has joined #lisp
attila_lendvai has joined #lisp
attila_lendvai has quit [Changing host]
<schweers> Unless you want to use non-blocking I/O, but I don’t know how well usocket and friends cope with that.
DonVlad has joined #lisp
<schweers> but take anything I tell you about usocket with a grain of salt: I didn’t use usocket much myself
<schweers> how familiar are you with how sockets work on unix?
<jmercouris> I'm much more familiar with unix domain sockets
<jmercouris> I don't know anything about these style of sockets until about 4 days ago
attila_lendvai has quit [Read error: Connection reset by peer]
<schweers> Don’t you have to call bind and listen on unix sockets too?
<jmercouris> I had extremely vague cursory knowledge from working on web apps, but nothing like what I've learned about
<jmercouris> schweers: I'm not sure, I always used some lib
<jmercouris> implementation details were pretty well hid from me
<schweers> how familiar are you with C?
<jmercouris> so yeah, I'm still learning a lot about this stuff
<schweers> If you are, man 7 socket might be a good resource
<jmercouris> C, I am only mildly familiar, like very beginner level
attila_lendvai has joined #lisp
attila_lendvai has joined #lisp
attila_lendvai has quit [Changing host]
<jmercouris> I worked with it a lot in the past, but I've forgotten everything
comborico1611 has left #lisp [#lisp]
fikka has quit [Ping timeout: 248 seconds]
<schweers> should be enough
<rumbler31> you don't need to be that familiar with the c socket api to understand how to use usocket
attila_lendvai has quit [Read error: Connection reset by peer]
<schweers> Don’t know. I am more familiar with the C way of working with sockets, than from any other language, so I kind of take that knowledge for granted.
<schweers> Don’t mistake me for an expert in this, though
<rumbler31> the salient points are that a socket is uniquely identified by an ip and port, you need two to communicate
<jmercouris> that much I know :D
attila_lendvai has joined #lisp
attila_lendvai has quit [Changing host]
attila_lendvai has joined #lisp
<rumbler31> a tcp port is usually exposed to users as a stream object, udp sockets usually expose buffers
<schweers> And you also know that accept on the server together with connect in the client create a new socket in the server process?
<schweers> which is tied to one client
<schweers> i.e. a server socket creates new sockets as clients connect
<jmercouris> this I also know yes
<rumbler31> from that new socket on the server, you can discover the incoming client's own port
<jmercouris> it was said above by Phoe or Shinmera, I can't remember which
<rumbler31> after that, normal stream operations on the socket's stream behave like other streams, although you'll probably want to handle socket conditions, I suppose just like you would file error conditions
attila_lendvai has quit [Read error: Connection reset by peer]
sjl has joined #lisp
flamebeard has quit [Quit: Leaving]
<flip214> Shinmera: mail should've arrived.
<rumbler31> one point that I didn't realize until recently is that udp datagrams are often larger than a single packet, the low level stack will stitch the packets together, and only if it knows it has a complete datagram will it deliver it up the stack, so you get the whole datagram or nothing
<Shinmera> flip214: Got it, thanks
<jmercouris> I finally understand how to use usocket
<schweers> Which is something I’d rather avoid. Beats the whole idea behind UDP if you ask me.
<jmercouris> maybe I should write a tutorial
<jmercouris> it'll probably be full of mistakes though
<jmercouris> perhaps I'd better not :D
<Shinmera> jmercouris: writing you an example now
attila_lendvai has joined #lisp
attila_lendvai has joined #lisp
attila_lendvai has quit [Changing host]
<jmercouris> Shinmera: ok, thank you
csaurus has joined #lisp
Amplituhedron has quit [Ping timeout: 256 seconds]
nika_ has quit [Ping timeout: 276 seconds]
<flip214> Shinmera: you're welcome!
<rumbler31> schweers: what?
<schweers> can anyone else here load optima into ecl?
<schweers> rumbler31: packet fragmentation in UDP kind of defeats the purpose of having control over the packets.
<rumbler31> what do you mean "having control of the packets"
<schweers> knowing what exactly is in a packet, how many are sent, etc.
attila_lendvai has quit [Read error: Connection reset by peer]
<rumbler31> so packet != datagram
<flip214> minion: memo for Fare: If you're interested in QUUX-HT becoming unresponsive, here's a reproducer: https://pastebin.com/rHreii1z
<minion> Remembered. I'll tell Fare when he/she/it next speaks.
<rumbler31> so you never have control of the packets, only the datagrams (a distinction I only recently realized I needed to make)
<flip214> yeah, setting the "don't fragment" bit helps here a bit. Though you'll need to know (or find out) the PMTU by yourself...
Cymew has quit [Remote host closed the connection]
<schweers> I may be wrong, but I believe one has control over packet, at least when one ensures they are not too large.
<rumbler31> its not possible to... specify that a datagram shouldn't be fragmented
<rumbler31> yea but thats the whole point, you only need to ensure that they "aren't too large" if you're discovering that your network is introducing frame errors
<Shinmera> Ughhh
<rumbler31> which is usually unlikely
<Shinmera> why did plaster have to break now
attila_lendvai has joined #lisp
attila_lendvai has joined #lisp
attila_lendvai has quit [Changing host]
<rumbler31> Shinmera: because its the last thing you need right now? ;-)
safe has quit [Read error: Connection reset by peer]
<Shinmera> yes
<schweers> rumbler31: I think you’re right, it seems I was misremembering something
<rumbler31> so yes, your choice of datagram size is affected by the quality of your network
scymtym has quit [Ping timeout: 255 seconds]
<rumbler31> but thats "technically true" whereas in reality this doesn't usually cause problems
<rumbler31> or rather I should say "is a condition that is rarely encountered"
rumbler3_ has joined #lisp
fikka has joined #lisp
<schweers> Anyway, I’m having trouble loading optima into ecl, is this a known issue? a quick google search didn’t give me much to work on.
<Xach> schweers: what happens when you try?
<schweers> Debugger received error of type: SIMPLE-ERROR
<schweers> Object (EQL CONS) is not a valid specializer
heisig has quit [Quit: Leaving]
<schweers> disclaimer: I normally don’t use ecl, I wanted to try if my code works there, in order to be less dependant on one or two implementations
attila_lendvai has quit [Read error: Connection reset by peer]
nika has joined #lisp
rumbler3_ has quit [Ping timeout: 255 seconds]
<phoe> schweers: wtf is (eql cons)
<phoe> what are you specializing on?
<schweers> I didn’t write optima, I’m just trying to use it.
<schweers> well, I do use it, but until now only on sbcl and ccl
orivej has joined #lisp
<phoe> schweers: are you able to post a backtrace?
attila_lendvai has joined #lisp
<phoe> or, if you use optima, are you able to macroexpand the match call and post it?
<schweers> working on it
dieggsy has joined #lisp
<schweers> I tried to use the current git version of optima, with the same problem
<phoe> uh
<phoe> I want a backtrace
<phoe> there is no backtrace there.
<schweers> uh, damn, you’re right
<phoe> are you able to load it in slime?
<schweers> I’ll try
<phoe> it should signal an error when compiling and land you in the debugger..
<phoe> and the debugger will have a backtrace.
<schweers> you do mean typing (asdf:load-system "optima") into a slime repl, right?
fikka has quit [Ping timeout: 255 seconds]
<schweers> huh. I’m not sure this will help, but I’ll create another pase
<phoe> schweers: yep
rippa has joined #lisp
Kundry_Wag has quit [Remote host closed the connection]
<schweers> full of gensyms :/
Chream_2 has quit [Read error: Connection reset by peer]
dilated_dinosaur has joined #lisp
Chream_ has joined #lisp
<phoe> ...so basically, optima does not compile on ECL.
<schweers> looks like it
<phoe> this looks like that
attila_lendvai has quit [Read error: Connection reset by peer]
<phoe> but (eql cons) is not (eql 'cons)
<schweers> aye
<phoe> can you post the /src/pattern.lisp of your optima somewhere?
<schweers> should be okay to put it on pastebin, right?
<phoe> schweers: yep
smaster has quit [Ping timeout: 264 seconds]
<Shinmera> jmercouris: https://plaster.tymoon.eu/view/716
<Shinmera> doesn't do cleanup and stuff when clients disconnect
<phoe> schweers: 450 looks the same, it has a (eql 'cons) and not (eql cons)
<phoe> schweers: I think you should ask on #ecl
<phoe> because this smells like a weird issue in a place where ecl and optima meet
attila_lendvai has joined #lisp
attila_lendvai has quit [Changing host]
attila_lendvai has joined #lisp
Arcaelyx has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<jmercouris> Shinmera: very nice, thank you!
<beach> Shinmera: flip214 is a good proofreader.
<beach> I am reading the article now.
nopf has joined #lisp
<Bike> does anyone know about building ecl? i have a weird failure, and if i'm reading the manual correctly there should be no problem...
<Shinmera> jmercouris: I can add proper client cleanup and stuff at the cost of introducing locks. If you can't figure it out on your own let me know and I'll revise it.
<Shinmera> beach: Good to hear :)
Amplituhedron has joined #lisp
<jmercouris> Shinmera: I think from here I should be pretty good, there's a lot to do on the objective-c side first, I just want them to say "hello world" to each other
<beach> Shinmera: The passive form is often tough, especially if the agent is left out.
<jmercouris> Bike: if you are building on OSX, it doesn't build latest version
<jmercouris> Bike: at least it didn't build on my machine, I had to download from server to compile
<jmercouris> not from the repository
<Bike> Oh... well, I got the same error a few months ago, but hm
<beach> Shinmera: "Shader code is attached to classes.." could either continue "which is good because then we don't have to do it", or "by us", and reader has no way of knowing.
<beach> Shinmera: So avoid the passive form unless there is good reasons to use it.
Arcaelyx has joined #lisp
<Shinmera> beach: Got it.
<beach> "until finally an image is produced" is fine, though.
<schweers> phoe: thanks, I’ve asked there. Now I just have to wait ;)
<beach> Shinmera: My (admittedly small) family says to avoid using "This" without some following reference, like "This limitation presents an issue..."
<Shinmera> beach: Gah! I must have missed one, and I even payed attention to that when I read through it again
<Shinmera> I missed multiple ones actually
* Shinmera is ashamed
fikka has joined #lisp
<beach> It is easy to miss. But that's why you have proofreaders. :)
<beach> "This differs ..." -> "Their approach differs..."
<beach> "from ours"
<beach> Very readable. Even though it is not my domain. The RELATED WORK section give a good impression.
<Shinmera> Great!
<beach> I would put "ifdef" in typewriter font.
<beach> "This means that.." -> "This use of preprocessor requests..."
fikka has quit [Ping timeout: 248 seconds]
<beach> "include" in typewriter font?
<beach> Another passive "a full parser for the GLSL language was implemented". Again, we do not know who the agent is. You? By the people who defined GLSL?
<Shinmera> Hah, I wish the latter was the case
<beach> Dangling participle: "Using the analysis...., matching variable declarations..."
<beach> "Using this, a wide variety..." -> "Using this technique, a wide variety..."
attila_lendvai has quit [Read error: Connection reset by peer]
attila_lendvai has joined #lisp
attila_lendvai has joined #lisp
attila_lendvai has quit [Changing host]
<beach> "A new metaclass is implemented..." passive voice without an agent.
juan-reynoso has joined #lisp
<beach> "Accompanied by this is" "this class"?
<Shinmera> Yes
<beach> Dangling participle: "Using the standard method combination, the behaviour..."
attila_lendvai has quit [Read error: Connection reset by peer]
<beach> If you are going to use "behaviour", I recommend you also write "colour".
<Shinmera> I do typically, except in code.
<Shinmera> I missed "coloring" though.
<beach> Yes.
attila_lendvai has joined #lisp
attila_lendvai has joined #lisp
attila_lendvai has quit [Changing host]
<beach> I don't understand the grammar of "The shader effects must be adapted to be modifying in order..."
<beach> maybe clarify a bit.
aindilis has quit [Ping timeout: 256 seconds]
karswell has quit [Remote host closed the connection]
Amplituhedron has quit [Ping timeout: 264 seconds]
<beach> "To facilitate this, ..."
<beach> Otherwise, I say "ship it".
varjag has quit [Quit: ERC (IRC client for Emacs 24.5.1)]
<beach> Shinmera: Any questions about my remarks?
<Shinmera> No, all clear and good remarks. Working on the revision.
<Shinmera> Thank you very much once again
<DemolitionMan> beach: done, I plotted a line over the same point
attila_lendvai has quit [Read error: Connection reset by peer]
attila_lendvai has joined #lisp
attila_lendvai has joined #lisp
attila_lendvai has quit [Changing host]
<beach> DemolitionMan: How did you solve it?
<beach> Shinmera: Pleasure. You can always buy me a beer at ELS.
stacksmith has joined #lisp
<DemolitionMan> beach: I plotted a zero length line
<Shinmera> beach: I thought you were more for wine? :)
<beach> DemolitionMan: Oh, I see.
<DemolitionMan> beach: from point (x y) to point (x y)
<beach> Shinmera: Sure, if you don't mind.
<beach> DemolitionMan: How strange.
<DemolitionMan> not at all
<beach> DemolitionMan: I am still tempting you with the CLIM listener: http://metamodular.com/clim-listener.png
<Shinmera> beach: flip214: Would you like to be mentioned in the acknowledgements?
<beach> Shinmera: Yes, he does. :)
<DemolitionMan> beach: lol
<beach> DemolitionMan: The CLIM listener is very useful for those small interactive test functions.
Arcaelyx has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Chream_ has quit [Ping timeout: 268 seconds]
<DemolitionMan> ...
Kundry_Wag has joined #lisp
mercourisj has joined #lisp
<DemolitionMan> beach: ok
fikka has joined #lisp
smaster has joined #lisp
jmercouris has quit [Ping timeout: 255 seconds]
<rumbler31> also vgplot
<rumbler31> if gnuplot is available on the system
orivej has quit [Ping timeout: 248 seconds]
Kundry_Wag has quit [Remote host closed the connection]
DemolitionMan has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
emacsoma` has joined #lisp
drewc has quit [Ping timeout: 265 seconds]
warweasle has quit [Quit: Need to leave for a while.]
Kundry_Wag has joined #lisp
raynold has joined #lisp
Achylles has quit [Ping timeout: 256 seconds]
xorox90 has quit [Quit: Connection closed for inactivity]
EvW has quit [Ping timeout: 255 seconds]
makomo has joined #lisp
Karl_Dscc has joined #lisp
Achylles has joined #lisp
nika has quit [Quit: Leaving...]
attila_lendvai has quit [Read error: Connection reset by peer]
Cymew has joined #lisp
wigust has joined #lisp
attila_lendvai has joined #lisp
attila_lendvai has joined #lisp
attila_lendvai has quit [Changing host]
varjag has joined #lisp
vibs29 has quit [Ping timeout: 240 seconds]
vibs29 has joined #lisp
scymtym has joined #lisp
attila_lendvai has quit [Read error: Connection reset by peer]
mercourisj has quit [Ping timeout: 248 seconds]
attila_lendvai has joined #lisp
attila_lendvai has joined #lisp
attila_lendvai has quit [Changing host]
mareskeg has joined #lisp
Cymew has quit [Ping timeout: 260 seconds]
smaster has quit [Ping timeout: 276 seconds]
hhdave has quit [Ping timeout: 248 seconds]
smaster has joined #lisp
attila_lendvai has quit [Read error: Connection reset by peer]
attila_lendvai has joined #lisp
attila_lendvai has joined #lisp
attila_lendvai has quit [Changing host]
LiamH has joined #lisp
LiamH has left #lisp [#lisp]
buyfn has joined #lisp
LiamH has joined #lisp
buyfn has quit [Remote host closed the connection]
epony has joined #lisp
attila_lendvai has quit [Read error: Connection reset by peer]
mareskeg has quit [Quit: mareskeg]
haruka has quit [Ping timeout: 248 seconds]
_cosmonaut_ has quit [Ping timeout: 248 seconds]
eschatologist has quit [Ping timeout: 264 seconds]
aindilis has joined #lisp
fikka has quit [Ping timeout: 256 seconds]
haruka has joined #lisp
smaster has quit [Ping timeout: 276 seconds]
smaster has joined #lisp
eschatologist has joined #lisp
Cymew has joined #lisp
mareskeg has joined #lisp
Cymew_ has joined #lisp
Cymew has quit [Ping timeout: 265 seconds]
mareskeg has quit [Client Quit]
attila_lendvai has joined #lisp
attila_lendvai has joined #lisp
attila_lendvai has quit [Changing host]
Cymew_ has quit [Ping timeout: 248 seconds]
jmercouris has joined #lisp
fikka has joined #lisp
drewc has joined #lisp
shka has quit [Ping timeout: 276 seconds]
attila_lendvai has quit [Read error: Connection reset by peer]
vtomole has joined #lisp
attila_lendvai has joined #lisp
Kundry_Wag has quit [Remote host closed the connection]
willmichael has joined #lisp
attila_lendvai has quit [Read error: Connection reset by peer]
fikka has quit [Ping timeout: 265 seconds]
lnostdal_ has quit [Ping timeout: 255 seconds]
attila_lendvai has joined #lisp
<aeth> I think I finally have a decent shader class (the rest of the file is still a mess, though): https://gitlab.com/zombie-raptor/zombie-raptor/blob/302de75034dfd3a3350de8fe2a31cd631cfa72d3/data/shader.lisp#L57-142
attila_lendvai has quit [Read error: Connection reset by peer]
razzy has quit [Ping timeout: 252 seconds]
moei has joined #lisp
attila_lendvai has joined #lisp
attila_lendvai has joined #lisp
attila_lendvai has quit [Changing host]
<aeth> I've noticed several things: (1) I could check everything I check in check-shader at compile time in the shader creation macro (afaik) instead of or in addition to during shader creation and (2) check-type on a destructuring-bind (or any local bind) is dangerous because it makes you think that you can correct it, but you're just correcting a temporary, soon-to-be-discarded lexical scope variable
<phoe> aeth: (assert (typep ...))
dieggsy has quit [Remote host closed the connection]
<phoe> that's for (2)
<phoe> this one does not provide a USE-VALUE restart for you.
jmercouris has quit [Ping timeout: 248 seconds]
<aeth> I could also check for equality and if the variables aren't equal at the end update them. The problem with that is that destructuring-bind can get really complicated.
razzy has joined #lisp
fikka has joined #lisp
Kaisyu has quit [Quit: Connection closed for inactivity]
Karl_Dscc has quit [Remote host closed the connection]
lnostdal_ has joined #lisp
safe has joined #lisp
attila_lendvai has quit [Read error: Connection reset by peer]
rumbler3_ has joined #lisp
attila_lendvai has joined #lisp
attila_lendvai has joined #lisp
attila_lendvai has quit [Changing host]
stacksmith has quit [Read error: Connection reset by peer]
warweasle has joined #lisp
epony has quit [Quit: QUIT]
rumbler3_ has quit [Ping timeout: 276 seconds]
stacksmith has joined #lisp
razzy has quit [Ping timeout: 276 seconds]
fikka has quit [Ping timeout: 256 seconds]
fikka has joined #lisp
butterthebuddha has quit [Max SendQ exceeded]
butterthebuddha has joined #lisp
Kundry_Wag has joined #lisp
razzy has joined #lisp
Kundry_W_ has joined #lisp
Kundry_Wag has quit [Read error: No route to host]
rk[ghost] has quit [Ping timeout: 268 seconds]
attila_lendvai has quit [Read error: Connection reset by peer]
stacksmith has quit [Quit: stacksmith]
rk[ghost] has joined #lisp
fikka has quit [Ping timeout: 256 seconds]
mlf has joined #lisp
fikka has joined #lisp
Naergon has quit [Ping timeout: 240 seconds]
Kundry_W_ has quit [Remote host closed the connection]
pareidolia has left #lisp [#lisp]
fikka has quit [Ping timeout: 268 seconds]
vtomole has quit [Ping timeout: 260 seconds]
Kundry_Wag has joined #lisp
haruka has quit [Ping timeout: 240 seconds]
willmichael has quit [Read error: Connection reset by peer]
willmichael has joined #lisp
haruka has joined #lisp
damke has quit [Ping timeout: 264 seconds]
damke has joined #lisp
fikka has joined #lisp
juan-reynoso has quit [Ping timeout: 256 seconds]
juan-reynoso has joined #lisp
<borodust> Xach: I missed one dependency for the lib i suggested to add to main quicklisp. Should I create a new issue or just putting info about it into existing issue (with libs that depends on it) is enough?
<Xach> was it the one i just got an email about?
<Xach> or a new one?
<borodust> that's probably it
<borodust> cl-muth thingie
<Xach> that's fine
<borodust> Xach: thanks, my apologies
stacksmith has joined #lisp
shrdlu68 has joined #lisp
vultyre has joined #lisp
<Xach> No problem
LocaMocha has quit [Ping timeout: 256 seconds]
BitPuffin has quit [Remote host closed the connection]
emacsoma` has quit [Remote host closed the connection]
papachan has quit [Quit: WeeChat 2.0.1]
jmercouris has joined #lisp
fikka has quit [Ping timeout: 248 seconds]
fikka has joined #lisp
python476 has quit [Read error: Connection reset by peer]
NJM8 has joined #lisp
<NJM8> Hello! I am reading through SICP and need some help on exercise 1.9. The goal is to compare the process of two different programs, one iterative and one recursive, but the code from the book seems to run forever. Can anyone help?
<bjorkint0sh> where's the code?
<Bike> that's scheme code, so #scheme might be more helpful.
<NJM8> Here is the code https://pastebin.com/XtCDCxkm
<NJM8> Thanks Bike, I'll ask over there
<Bike> both of those ought to halt
nowhereman_ has quit [Ping timeout: 256 seconds]
fikka has quit [Ping timeout: 265 seconds]
EvW has joined #lisp
<NJM8> That's what I thought when reading though but here is the result: https://pastebin.com/g323aGq6
smaster has quit [Read error: Connection reset by peer]
nowhere_man has joined #lisp
smaster has joined #lisp
<pjb> NJM8: however, you can do the exercisess in Common Lisp. Several people have done that (unfortunately, a nice blog with all the answers doesn't seem to exist anymore).
<pjb> NJM8: also, with CL, you don't have to add print for such questions: just use TRACE.
<Bike> Oh, wait. If you're redefining + that'll mess up the definitions of inc and dec.
vultyre has quit [Ping timeout: 255 seconds]
NJM8 has quit [Ping timeout: 260 seconds]
<pjb> NJM8: but notice that in CL, there's inc is called 1+ and dec is called 1-.
attila_lendvai has joined #lisp
<stacksmith> It was a sad day when MIT replaced 6.001 that used SICP with a Python class... We can celebrate 10 years of Lisp illiteracy this year, I believe.
<pjb> It was not exactly a replacement: scheme was still used for CS major. The Python class was for non-CS majors.
<pjb> But otherwise, agreed.
<oleo> lol
vultyre has joined #lisp
smaster has quit [Ping timeout: 268 seconds]
fikka has joined #lisp
milanj has quit [Quit: This computer has gone to sleep]
orivej has joined #lisp
<shrdlu68> Is there a way to compile all functions that call an inlined function when said inlined function is recompiled?
<pjb> Yes: (mapcar (function compile) all-functions-that-call-this-inlined-function)
<pjb> shrdlu68: You have to implement the mechanism yourself.
<pjb> It's funny to do!
<shrdlu68> Don't you mean fun?
<pjb> yes, sorry.
attila_lendvai has quit [Read error: Connection reset by peer]
attila_lendvai has joined #lisp
attila_lendvai has joined #lisp
attila_lendvai has quit [Changing host]
* stacksmith is picturing pjb laughing contageously and slapping his knee up while implementing a recompilation mechanism.
<|3b|> if M-x slime-who-calls (C-c C-w C-c) works, i think you can C-c C-k in the resulting list buffer to recompile everything it found (not automatic though, but implementation of slime-who-calls might help with implementing previous suggestion)
<Bike> i don't think it's going to work that well for inlined calls
<flip214> shrdlu68: if your ASDF has correct dependencies set, all required functions should get reloaded, too.
<flip214> and some more stuff, but who cares?
<stacksmith> It may be wise to wrap optimization-related declarations into a macro that makes them go away during development...
<Bike> but it does on sbcl... how about that.
attila_lendvai has quit [Read error: Connection reset by peer]
<_death> rm -rf ~/.cache/common-lisp
smaster has joined #lisp
attila_lendvai has joined #lisp
attila_lendvai has joined #lisp
attila_lendvai has quit [Changing host]
<stacksmith> If I had a dime for every time I had to remove .cache and .fasls I would have a few bucks now. Of course I shouldn't have screwed around prematurely optimising things that wound up thrown out anyway. But I am not that wise.
vlatkoB has quit [Remote host closed the connection]
angavrilov has quit [Remote host closed the connection]
<shrdlu68> |3b|: Nice, that works.
Cymew has joined #lisp
zaquest has quit [Quit: Leaving]
Cymew has quit [Ping timeout: 240 seconds]
python476 has joined #lisp
smurfrobot has quit [Remote host closed the connection]
simplegauss has joined #lisp
attila_lendvai has quit [Read error: Connection reset by peer]
attila_lendvai has joined #lisp
attila_lendvai has joined #lisp
attila_lendvai has quit [Changing host]
<flip214> anybody wants to debug a quux/lparallel/sbcl issue? I'm too tired (or too stupid, take your guess ;).
cromachina has joined #lisp
<phoe> flip214: just post it
milanj has joined #lisp
cromachina_ has quit [Ping timeout: 248 seconds]
<flip214> phoe: https://pastebin.com/5nmbABZf includes the reproducer, the stack traces, and my (failed?) expectations
fikka has quit [Ping timeout: 260 seconds]
<flip214> I'll go back reading some papers now - if you have any information, please just jot it down here, I'll read the scrollback tomorrow.
<flip214> Thank you very much!
<phoe> flip214: ROOT is an interesting function
<phoe> it seems to have an offending call to the division function
attila_lendvai has quit [Read error: Connection reset by peer]
<phoe> ...wait
<phoe> flip214: this is an expected behaviour
<phoe> of course
<phoe> e *is* 0
<flip214> phoe: the division-by-zero is expected, yes. I'm causing it with the "wrong" argument.
attila_lendvai has joined #lisp
<flip214> but this is just an example of an error that can happen; this one is easy to reproduce.
<phoe> so (/ 10 0) will signal an error
<phoe> and this is natural
<flip214> so you don't have to bother with ENOSPC or similar, harder-to-trigger problems.
<phoe> you are wondering about what happens when you do TRANSFER-ERROR?
attila_lendvai has quit [Read error: Connection reset by peer]
<flip214> phoe: the division-by-zero is expected. that the tcp socket hangs and quux becomes unresponsive is what I don't want.
<phoe> ...oooh, ouch
<phoe> I see, so it's much more complex than I expected.
<flip214> and there's a HANDLER-BIND in hunchentoot/util.lisp, but that doesn't seem to be used...
<flip214> great! So I could top your expectations ;)
<phoe> (:
<phoe> flip214: can you see the threads that are deadlocked?
python476 has quit [Read error: Connection reset by peer]
<phoe> are you able to #'interrupt-thread them with (lambda () (print-backtrace))?
<phoe> ...you could possibly interrupt all kernel workers for good's sake, you'll get all the traces with some of them being actually useful
attila_lendvai has joined #lisp
attila_lendvai has joined #lisp
attila_lendvai has quit [Changing host]
attila_lendvai has quit [Read error: Connection reset by peer]
attila_lendvai has joined #lisp
attila_lendvai has joined #lisp
DonVlad has quit [Quit: WeeChat 1.4]
epony has joined #lisp
fikka has joined #lisp
<flip214> phoe: I believe that the second error (posted in the same paste) simply kills the quux request dispatcher, and that this is the reason it stops working.
attila_lendvai has quit [Read error: Connection reset by peer]
damke_ has joined #lisp
fikka has quit [Ping timeout: 260 seconds]
damke has quit [Ping timeout: 264 seconds]
smaster has quit [Ping timeout: 248 seconds]
haruka has quit [Ping timeout: 256 seconds]
pierpa has joined #lisp
<phoe> flip214: I see.
orivej has quit [Ping timeout: 260 seconds]
attila_lendvai has joined #lisp
attila_lendvai has joined #lisp
attila_lendvai has quit [Changing host]
smurfrobot has joined #lisp
smurfrobot has quit [Remote host closed the connection]
smurfrobot has joined #lisp
nowhere_man has quit [Ping timeout: 255 seconds]
smurfrobot has quit [Remote host closed the connection]
haruka has joined #lisp
Kundry_Wag has quit [Remote host closed the connection]
smurfrobot has joined #lisp
Kundry_Wag has joined #lisp
attila_lendvai has quit [Read error: Connection reset by peer]
fikka has joined #lisp
smaster has joined #lisp
attila_lendvai has joined #lisp
smurfrobot has quit [Ping timeout: 256 seconds]
jmercouris has quit [Ping timeout: 240 seconds]
attila_lendvai has quit [Read error: Connection reset by peer]
attila_lendvai has joined #lisp
attila_lendvai has quit [Changing host]
attila_lendvai has joined #lisp
z3t0 has joined #lisp
Achylles has quit [Ping timeout: 256 seconds]
earl-ducaine has joined #lisp
attila_lendvai has quit [Read error: Connection reset by peer]
simplegauss has left #lisp ["ERC (IRC client for Emacs 25.3.1)"]
attila_lendvai has joined #lisp
attila_lendvai has joined #lisp
attila_lendvai has quit [Changing host]
warweasle has quit [Quit: rcirc on GNU Emacs 24.4.1]
Achylles has joined #lisp
Nouv has joined #lisp
stacksmith has quit [Ping timeout: 252 seconds]
dilated_dinosaur has quit [Remote host closed the connection]
<Nouv> Does macro expansion happen at compile time, or does every lisp implementation that supports macros also come with an interpreter built in?
<phoe> Nouv: at compile time.
<phoe> ...more or less.
<phoe> specifically, to compile Lisp code, you have to macroexpand all macros that are in it.
<phoe> Nouv: also, all Common Lisp implementations *must* support macros.
<Nouv> hm
<phoe> And some of them don't come with interpreters enabled by default. See SBCL that compiles everything by default.
<phoe> Some might not even have interpreters.
<Nouv> I'm quite confused haha
<phoe> What's confusing?
<Nouv> Just starting to study assembly at uni so wondering how everything works at a lower level
<phoe> Macros are quite far from assembly. (:
<Nouv> True
<Nouv> I'm working upwards :P
<Nouv> My dream is to build my own self hosting compiler
<Nouv> I've done lexer, parser, and interpreters for very simple languages before
<Nouv> but reasoning about compilers is quite different I've found
three3 has joined #lisp
<Xach> Nouv: "lisp in small pieces" is a very good book on the topic
<Xach> Nouv: the nice thing about lisp is you can skip the lexing and parsing by using the reader...
<Xach> "a" nice thing
<earl-ducaine> Nouv: you should take a look at Norvig's Paradigms of AI Programming
<three3> How to do a simple for loop in lisp?
<earl-ducaine> (paip)
<earl-ducaine> he includes a scheme compiler written in cl
<phoe> three3: (loop for i from 0 to 10 do (print i))
<Nouv> Xach Ah you can?
<phoe> Xach: yep, the Lisp reader does it for you.
<Nouv> xach: I wrote my basic language in java ... yeah, that wasn't a fun time haha
<Xach> Nouv: sure. the code reads as lists.
<phoe> we're in the land of S-expressions after all.
<phoe> code is data™
<Nouv> hm
<earl-ducaine> And has a very succinct description of 'compile' and 'interpretter' and the difference between the two
<Xach> the symbols suggests what needs to be done.
<Nouv> I guess I'm confused about
<Nouv> if code is data then what's the difference between macros and functions?
<phoe> Nouv: macros are functions from Lisp code to Lisp code
nowhere_man has joined #lisp
<phoe> a function is something that gets called normally, allocates some stuff on the stack, has return values, et cetera
<phoe> a macro is a function, except it is called at macroexpansion time, and its task is to transform some Lisp code into some other Lisp code
willmichael has quit [Ping timeout: 256 seconds]
<Nouv> hm
attila_lendvai has quit [Read error: Connection reset by peer]
<Nouv> I'm confused about where it happens though
<Nouv> when is macroexpansion time?
<pjb> during compilation, or during execution.
willmichael has joined #lisp
<pjb> Nouv: if you have doubts, you can use *macroexpand-hook* to see when.
fikka has quit [Ping timeout: 264 seconds]
attila_lendvai has joined #lisp
attila_lendvai has joined #lisp
attila_lendvai has quit [Changing host]
<Nouv> pjb: I'm not specifically using common lisp (the goal is to roll my own), so looking to understand the theory
<phoe> pjb: to be pedantic, it is always during compilation time.
<phoe> unless you manually call MACROEXPAND.
<k-hos> in cl if you attempt to read out of a strings bounds what happens? error? nil? garbage?
<phoe> k-hos: error
<phoe> a string is an array
<phoe> and reading out of array bounds is an error
ludston_ has joined #lisp
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
<k-hos> alright thanks
python476 has joined #lisp
<three3> phoe: Thanks
fikka has joined #lisp
ludston has quit [Ping timeout: 248 seconds]
<three3> How to write for loop in elisp without execute a function inside the loop?
<phoe> three3: elisp? you mean emacs lisp?
<three3> phoe: yes
<phoe> best ask on #emacs - here are the Common Lisp lands
<three3> ok
lonjil has quit [Ping timeout: 256 seconds]
ludston has joined #lisp
Karl_Dscc has joined #lisp
ludston_ has quit [Ping timeout: 268 seconds]
zooey has quit [Remote host closed the connection]
hiroaki has joined #lisp
zooey has joined #lisp
z3t0 has quit [Remote host closed the connection]
dieggsy has joined #lisp
stacksmith has joined #lisp
Guest61136 is now known as mrSpec
DBeepBeep has joined #lisp
mrSpec has quit [Changing host]
mrSpec has joined #lisp
z3t0 has joined #lisp
z3t0 has quit [Remote host closed the connection]
z3t0 has joined #lisp
<DBeepBeep> Hey, I need to free some resources in an external library when an object is no longer referenced.
shrdlu68 has quit [Ping timeout: 248 seconds]
<DBeepBeep> I can't quite find which method I need to define
dilated_dinosaur has joined #lisp
<DBeepBeep> Does anyone know offhand?
<phoe> DBeepBeep: sounds like you want to define a finalizer
<DBeepBeep> I do
<phoe> DBeepBeep: use the system trivial-garbage
<phoe> just remember not to close over the finalized object in the finalizer. this creates memory leaks.
<DBeepBeep> phoe: thanks. I tried finalize-instance, but that didn't seem to exist.
DBeepBeep has quit [Client Quit]
<phoe> be sure to test your finalizer with some simple print statement - (make-instance 'finalized-class) and then (trivial-garbage:gc :full t) until you see your print occurring.
<Xach> GC and finalization aren't standard
<phoe> yep, but they are cross-implementation enough.
epony has quit [Read error: Connection reset by peer]
epony has joined #lisp
Bike has quit [Ping timeout: 260 seconds]
<Xach> That's why there's no finalize-instance built-in
aindilis has quit [Read error: Connection reset by peer]
<|3b|> and remember that they may never be called, so try to free things manually as well if possible, and just use finalizer as a backup
rumbler31 has quit [Ping timeout: 248 seconds]
fikka has quit [Ping timeout: 240 seconds]
three3 has quit [Quit: Page closed]
smaster has quit [Ping timeout: 252 seconds]
fikka has joined #lisp
mishoo has quit [Ping timeout: 252 seconds]
Karl_Dscc has quit [Remote host closed the connection]
Kundry_Wag has quit [Remote host closed the connection]
wigust- has joined #lisp
wigust- has quit [Remote host closed the connection]
<k-hos> so what do I need to do if I want to use the same name for something that lisp uses already
<k-hos> for example 'stream'
<phoe> k-hos: shadow the symbols.
wigust has quit [Ping timeout: 260 seconds]
<k-hos> and that won't cause any problems in other libraries?
<|3b|> (and/or change what you want :p )
<|3b|> it is scoped to a package, so will only cause problems for code inside that package
<k-hos> ok thats what I am looking for
varjag has quit [Quit: ERC (IRC client for Emacs 25.2.1)]
<k-hos> thanks
smurfrobot has joined #lisp
smaster has joined #lisp
orivej has joined #lisp
<stacksmith> CLHS 11.1.1
<stacksmith> What the heck are modules?
Chream has joined #lisp
z3t0 has quit [Remote host closed the connection]
<phoe> stacksmith: something that was used for loading additional libraries in ancient times.
mareskeg has joined #lisp
<phoe> before the times of MK-DEFSYSTEM, even.
<phoe> clhs provide
<stacksmith> So provide and require are deprecated?
<phoe> "Notes: The functions provide and require are deprecated. "
smokeink has joined #lisp
<pjb> stacksmith: you have two cases: you're loading a system and you want to avoid loading twice the same file (or the same dependency). Then provide/require is a mechanism that could be used. However if you use it, the second case: you have loaded a system, made modifications in its sources, and now you want to load it again, to get the updates; it will fail if you used provide/require, since the system has already been provided, it
<pjb> stacksmith: so provive/require is rather useless, in the modern way of doing things.
<pjb> Instead, we use asdf to resolve the DAG of the dependencies and to ensure files and dependencies are loaded only once. Also, asdf is able to reload stuff when files have changed.
z3t0 has joined #lisp
z3t0 has quit [Remote host closed the connection]
<pjb> And of course, we use quicklisp which wraps over asdf, since systems are obtained from the internet nowadays, which was not something common (or at all automatic) when provide/require were invented.
z3t0 has joined #lisp
<pjb> Notice something funny: emacs lisp still uses provide/require.
willmichael has quit [Ping timeout: 256 seconds]
damke_ has quit [Ping timeout: 264 seconds]
ome has joined #lisp
willmichael has joined #lisp
<stacksmith> pjb: So as intended it worked because one rarely reloaded source files but rather worked in-image?
damke_ has joined #lisp
attila_lendvai has quit [Quit: Leaving.]
Bike has joined #lisp
LiamH has quit [Quit: Leaving.]
vultyre has quit [Ping timeout: 256 seconds]
haruka has quit [Read error: Connection reset by peer]
sjl has quit [Ping timeout: 240 seconds]
Kundry_Wag has joined #lisp
haruka has joined #lisp
csaurus has quit [Ping timeout: 256 seconds]
Kundry_Wag has quit [Ping timeout: 268 seconds]
smurfrobot has quit [Remote host closed the connection]
moei has quit [Quit: Leaving...]
smurfrobot has joined #lisp
aindilis has joined #lisp
fourier has joined #lisp
smurfrobot has quit [Ping timeout: 264 seconds]
Nouv has quit [Remote host closed the connection]
hiroaki has quit [Ping timeout: 248 seconds]
smaster has quit [Ping timeout: 256 seconds]
hel-io has joined #lisp
z3t0 has quit [Remote host closed the connection]
fourier has quit [Ping timeout: 248 seconds]
foom has joined #lisp