jackdaniel 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.5, CMUCL 21b, ECL 16.1.3, CCL 1.11.5, ABCL 1.5.0
robotoad has quit [Quit: robotoad]
it3ration has quit [Ping timeout: 244 seconds]
<elderK> Guys, is there any reason why (format nil "....") won't print anything?
<luis> fiddlerwoaroof: you said you had to patch CFFI and Osicat to get static linking working. Will you be sending pull requests?
<sjl> elderK: (format nil ...) returns the result as a string
<sjl> (format t ...) prints to stdout
<elderK> Ah, thank you
cylb has quit [Remote host closed the connection]
cylb has joined #lisp
<fiddlerwoaroof> luis, yeah
<nyingen_> Do we have any particular libs or idioms for spawning external processes and doing I/O with them?
<aeth> nyingen_: UIOP
<aeth> In particular, uiop:run-program or uiop:launch-program (the latter is newer and is capable of being async)
<aeth> You probably want (uiop:launch-program name :input :stream :output :stream) and then you call uiop:process-info-input and uiop:process-info-output to get the two streams
<aeth> Also useful: process-alive-p, terminate-process (if it hangs), and wait-process
<nyingen_> Cool, thanks
<nyingen_> I am writing some glue code. Last time I did this I switched to perl because CL's MySQL libs did not work for me. But this database is in sqlite, which I have used CL with before, so it should be all good
<nyingen_> Do you guys do any Erlang btw? I quite enjoyed working with it for IPC and stuff
nirved has quit [Quit: Leaving]
<elderK> Guys, is there a swap function built into CL?
jcowan has quit [Quit: Connection closed for inactivity]
<fiddlerwoaroof> Like in clojure? no
<sjl> elderK: swapping variables? rotatef
<fiddlerwoaroof> Some implementations provide CAS primitives
<Xach> elderK: what does swap do?
<elderK> Just swapping the bindings, I guess.
<Xach> elderK: sjl has the right of it
<elderK> Thank you :)
<fiddlerwoaroof> If you're expecting something like (swap (atom 0) '1+) => (atom 1), that doesn't exist
anewuser has joined #lisp
robotoad has joined #lisp
<Xach> shiftf is also fun
<Xach> and psetf
anniepoo_ has joined #lisp
<sjl> some day I'll find a use for shiftf
<sjl> psetf and rotatef are pretty handy though
<elderK> Another dumb question: If I have a structure instance, and I copy it is, is the copy deep?
<Bike> with copy-structure? no
<elderK> Thank you
<fiddlerwoaroof> deep copy is an underspecified problem
dale has quit [Quit: dale]
eddof13 has quit [Quit: eddof13]
jcowan has joined #lisp
charh has quit [Remote host closed the connection]
capisce has quit [Read error: Connection reset by peer]
ramus has quit [Ping timeout: 250 seconds]
Oddity has quit [Ping timeout: 245 seconds]
ramus has joined #lisp
<elderK> Guys, is there a better way to exit from inside a nested loop, other than using return-from?
<elderK> Like, I want to exit the nested loop as well as the loop it is inside.
Oddity has joined #lisp
jetchisel has joined #lisp
<Bike> what's wrong with returnfrom
orivej has joined #lisp
ryan_vw has joined #lisp
jack_rabbit has joined #lisp
jack_rabbit has quit [Remote host closed the connection]
emaczen has quit [Ping timeout: 276 seconds]
arescorpio has joined #lisp
oni-on-ion has quit [Read error: Connection reset by peer]
jack_rabbit has joined #lisp
stardiviner has joined #lisp
it3ration has joined #lisp
<elderK> Nothing - I was just checking that, well, there wasn't a better way :)
it3ration has quit [Ping timeout: 240 seconds]
<fiddlerwoaroof> There's also catch/throw
<fiddlerwoaroof> (catch 'foo (loop do (throw 'foo 1)))
<fiddlerwoaroof> That's probably not "better", though :)
<fiddlerwoaroof> clhs catch
stardiviner has left #lisp ["Killed buffer"]
<fiddlerwoaroof> And finally, you could use tagbody and go
<fiddlerwoaroof> Which is probably not better either
<fiddlerwoaroof> clhs tagbody
esrse has joined #lisp
<elderK> Thanks guys :)
<elderK> Darn. Equal doesn't compare arrays, like, deep. Makes sense but damn
<Bike> equalp does, tho
<elderK> :D Just found it, too. You beat me to it!
<elderK> Fantastic :)
fitzsim has quit [Read error: Connection reset by peer]
<elderK> I wonder if it's better to cache the exact dimensions of an array, rather than keep extracting it via array-dimensions
<elderK> Probaby I guess, since I keep having to destructure the resulting list.
cylb has quit [Ping timeout: 246 seconds]
arescorpio has quit [Remote host closed the connection]
arescorpio has joined #lisp
robotoad has quit [Quit: robotoad]
SaganMan has joined #lisp
megalography has joined #lisp
nly has quit [Read error: Connection reset by peer]
nly has joined #lisp
mfiano[m] has joined #lisp
Roy_Fokker has quit [Read error: Connection reset by peer]
robotoad has joined #lisp
<fiddlerwoaroof> elderK: equalp can be a bit surprising becaue (equalp #("asdf") #("ASDF)) => t
<fiddlerwoaroof> This is also mentioned in the nhplace article I linked above.
<loke`> EQUALP is probably the mose useless of functions in CL
<fiddlerwoaroof> Yeah, it really should be something like (EQUALP A B :TEST 'eql)
<fiddlerwoaroof> So you can override the recursively called equality function
jack_rabbit has quit [Ping timeout: 252 seconds]
<loke`> It's better to simply ignore its extentence since there are very close to zero cases where it does what you expect. And even in cases where you think it does what you expect, it doesn't.
<loke`> Doesn't alexandria have a well-defined recursives comparison function?
<fiddlerwoaroof> Or, perhaps more interestingly would be something like (== '(a 1) '(a 2) :key 'car :test 'eql) => t
<loke`> (that said, recursive comaprison is very hard to do “right”)
<loke`> (every #'identity (mapcar #'eql list1 list2))
<fiddlerwoaroof> Yeah, you can obviously compose other things
<fiddlerwoaroof> But, I think an equality function that worked on pairs of sequences and took a :key/:test pair like a bunch of other sequence functions would fit in nicely.
<fiddlerwoaroof> If you wanted to be _really_ general you could add an argument for a function that took each of the provided arguments and mapped them to sequences, which were then compared elementwise using :key/:test
<fiddlerwoaroof> But, I think the ultimate thing to realize, is that equality is highly domain-specific
jack_rabbit has joined #lisp
xkapastel has quit [Quit: Connection closed for inactivity]
<fiddlerwoaroof> luis: I wonder if it would be better to split the asdf parts of cffi into a new system
<fiddlerwoaroof> e.g. something like asdf-static-link
igemnace has quit [Quit: WeeChat 2.3]
SaganMan has quit [Quit: WeeChat 1.6]
arescorpio has quit [Remote host closed the connection]
<elderK> fiddlerwoaroof: I noticed that in the documentation.
<elderK> equalp uses char-equal for comparing strings, right? And that is case insensitive. char= /is/ case sensitive.
<elderK> so, equal compares strings element-wise, and does match case.
<elderK> equal compares strings elementwise, but is case insensitive.
<elderK> :)
<elderK> Seems like a nice gotcha
<rme> (equal "foo" "FOO")
<rme> oh, I misunderstood what you wrote.
<rme> never mind
<fiddlerwoaroof> elderK: yeah, which is why I've never really used equalp for anything, except as a hash-table test
<fiddlerwoaroof> (when I want a case-insensitive hash-table)
<elderK> Well, I'm sure it'll do the trick for comparing multidimensional arrays of symbols.
<elderK> But, yeah, I noticed that it would suck if, for example, you had an array of say, strings.
<elderK> rme: No problem :)
<elderK> Had quite a bit of fun today just, tinkering away on my first "not just screwing around" program in CL. I'll probably throw it all away - I'm learning more as I go.
<elderK> :P The CLHS can sure be tough to navigate at times.
<fiddlerwoaroof> It gets easier :)
<fiddlerwoaroof> It's not really intended to be beginner-level documentation, which partially accounts for its structure
<elderK> I'll get used to it. But, sometimes, it's like... you wind up in the glossary or in say, some docs for something but the important info you are looking for isn't in either place. Like, I was trying to learn more about &key and &optional parameters. defun just says "lambda list" So, glossary. "Ordinary lambda list." Glossary. Bounced around for ages, until I wound up in the right place :P
<elderK> fiddlerwoaroof: Yeah, I appreciate that :)
<elderK> As you said, it'll get easier, as I get experience traversing it :)
<fiddlerwoaroof> italicized links go to the glossary, which generally means I avoid clicking them unless I'm really interested in what a word means
<elderK> I do have a question regarding setf types. I've noticed that there is defsetf. But, in other projects, I swore I saw them using something like (defun (setf whatever) ...). Looking around in CLHS, I got a bit confused. Like, how do you define a setf expander?
<fiddlerwoaroof> clhs 1.4.1.1 helps
<fiddlerwoaroof> clhs 1.4.1.1
<fiddlerwoaroof> elderK: I usually use (defun (setf ...) ...)
<elderK> Any chance you could help me find the location in the CLHS where this is described?
<fiddlerwoaroof> clhs 5.1.2
<elderK> thank you
<fiddlerwoaroof> specifies the kinds of places
<elderK> Appreciate it :)
<elderK> Sometimes, I wind up referring to CLtL2, as a companion to the CLHS.
<elderK> Sometimes, it has more like, examples. Seemed more tutorially, but not /too/ tutorially, if you get my gist.
<fiddlerwoaroof> Yeah, that's sometimes useful
<fiddlerwoaroof> although it doesn't always match the standardized behavior
<elderK> Aye. I only use it to kind of get a better... grasp. When that's done, I zoom back to CLHS.
<elderK> Sometimes, CLtL2 seems easier to navigate.
<elderK> I need to find a way to have like, CLHS integrated into vim :P
<fiddlerwoaroof> I use dash for this (zeal on linux)
<elderK> Never heard of either?
<fiddlerwoaroof> I bind it to Command-Alt-\ and I have easily accessible documentation for everythign I need
<elderK> Oh wow, looks nice!
<fiddlerwoaroof> Emacs has a built-in version of this, but I never really use it.
<fiddlerwoaroof> s/built-in/package/
<elderK> :) Excuse me while I go build a package of zeal :D
<elderK> I can't believe I didn't know about this! It has docsets for all the things I use! This is *great*
<elderK> :D
<elderK> How is the quality of the docsets? Are they as good as say, CLHS from LispWorks?
<fiddlerwoaroof> the common lisp one is the hyperspec
Jachy has joined #lisp
<fiddlerwoaroof> most of them are just repackaged versions of the official docs
<elderK> Fantastic!
<elderK> Are you able to easily zoom the text?
<elderK> That's going to be important for me (I have terrible eyes)
<fiddlerwoaroof> I haven't used zeal recently
<elderK> Well, I'll build it and see.
<fiddlerwoaroof> But it works on osx
<fiddlerwoaroof> (in Dash)
<beach> Good morning everyone!
impulse has joined #lisp
<fouric> drmeister: in case you weren't aware of it already, here's another CLASP: https://www.radioeng.cz/fulltexts/2011/11_04_880_889.pdf
<beach> He knows.
<fouric> :thumbsup:
pierpal has quit [Quit: Poof]
pierpal has joined #lisp
<drmeister> fouric: Yes - I know of that.
<beach> When I name things, I try to introduce a different spelling, or at least verify that Google does not return anything interesting first.
<beach> Like Clordane, Climacs, Cluffer, TransClime.
anewuser has quit [Quit: anewuser]
<beach> Cleavir
<beach> Eclector
Bike has quit [Quit: Lost terminal]
<beach> I will make an exception with the second version of Gsharp. It will use a name that is in line with a long tradition for score editors: Clovetree.
<beach> There is Lilypond, Rosegarden already.
<no-defun-allowed> hah
<beach> Of course, I need to make sufficient progress on SICL first, so that I can hand it over to others. :)
<no-defun-allowed> true
sauvin has joined #lisp
<no-defun-allowed> has anyone written a program that tries to generate proofs (or new facts) given some facts?
<elderK> fiddlerwoaroof: The only problem with Zeal, for me, is the same problem with most things today that integrate CEF or Webkit in some way: It means I'm effectively running a zillion instances of a web browser. :|
<elderK> RAM use goes through the frickin' roof.
<no-defun-allowed> i know people have used programs to assist with proofs, but i think letting the program try to generate some itself would be faster
jack_rabbit has quit [Ping timeout: 252 seconds]
jack_rabbit has joined #lisp
<no-defun-allowed> beach (IRC): was G# the least used note on the internet when you named Gsharp?
<LdBeth> <no-defun-allowed "i know people have used programs"> #'no-defun-allowed: Prolog?
<no-defun-allowed> i thought about that but i haven't seen people generate new rules like that
<fiddlerwoaroof> elderK: yeah
<fiddlerwoaroof> no-defun-allowed: ACL2 is an automatic theorem prover
<fiddlerwoaroof> But it ends up being somewhat limited in what it can automagically prove
<no-defun-allowed> yeah, i'd like to be able to generate new rules somehow
<fiddlerwoaroof> Yeah, that's what the defthm form does
<fiddlerwoaroof> "The little prover" is a really interesting nice introduction to the underlying system
<LdBeth> ACL2 do automatic term rewrite, but itself is not able to make new rule
dddddd has quit [Remote host closed the connection]
<LdBeth> #'no-defun-allowed: in prolog you can define relations and ask what’s the relation between two term
<fiddlerwoaroof> A successfully proved theorem in ACL2 becomes a new rewrite rule
<LdBeth> Which mean you need to state it to ACL2 first
<fiddlerwoaroof> Sure, but you can't avoid stating some things to your theorem prover
<LdBeth> And it takes some effort to prove non trivial theorems
<fiddlerwoaroof> Yeah, I'm not aware of anything that makes proving theorems easy, thoguh
<fiddlerwoaroof> Prolog isn't really in the same class at all
<LdBeth> Prolog is Turing complete
<LdBeth> While Applicative Lisp isn’t
<fiddlerwoaroof> Sure, but that means that it can't prove theorems
<fiddlerwoaroof> Because of Rice's theorem
<LdBeth> So, I don’t think he want to prove anything yet
madrik has joined #lisp
<beach> no-defun-allowed: No, the origin of G# is different. It's not important anymore.
Oladon has quit [Quit: Leaving.]
<LdBeth> I though it would be Ab
<beach> Those are not the same in all tuning systems.
vlatkoB has joined #lisp
emaczen has joined #lisp
Inline has quit [Quit: Leaving]
<no-defun-allowed> yes, they're only the same in the --horrible and out of tune-- equal temperament tuning
<beach> Heh!
<beach> And even when they sound the same, they can not be interchanged in notation.
<no-defun-allowed> that's also true
<no-defun-allowed> (it's annoying that all the nice ratios like 3:2 for a perfect fifth are off)
<beach> I know what you mean.
nanoz has joined #lisp
<LdBeth> I reject my humanity
<elderK> Guys, question: How am I meant to parse: " defgeneric function-name gf-lambda-list [[option | {method-description}*]]"
<elderK> As far as I read that, it says we can have only /one/ option. But we can have zero or more method-descriptions.
<elderK> And both option, or method-description, are optional, obviously.
<elderK> But the CLHS states you can have multiple options - as long as each is specified once?
ryan_vw has quit [Ping timeout: 252 seconds]
robotoad has quit [Quit: robotoad]
orivej has quit [Ping timeout: 272 seconds]
VKraft has joined #lisp
msb has joined #lisp
robotoad has joined #lisp
igemnace has joined #lisp
<jackdaniel> is | alternative or exclusive alternative?
<jackdaniel> oh, that explains it
<beach> It is quite confusing, but I think if one takes the time to read it, it might become clear. :)
specbot has quit [Disconnected by services]
specbot has joined #lisp
kushal has quit [Ping timeout: 256 seconds]
micro has quit [Ping timeout: 246 seconds]
mrSpec has quit [Ping timeout: 246 seconds]
micro has joined #lisp
kushal has joined #lisp
voidlily has quit [Ping timeout: 264 seconds]
ryan_vw has joined #lisp
voidlily has joined #lisp
elfmacs has joined #lisp
_whitelogger has joined #lisp
<elderK> Thank you, beach :)
<beach> Anytime.
impulse has joined #lisp
impulse has quit [Client Quit]
ryan_vw has quit [Ping timeout: 260 seconds]
frgo has quit []
xkapastel has joined #lisp
sauvin has quit [Ping timeout: 240 seconds]
cupholder has joined #lisp
rozenglass has quit [Remote host closed the connection]
nly has quit [Read error: Connection reset by peer]
oni-on-ion has joined #lisp
<cupholder> I'm doing the exercises from Norvig's PAIP to learn CL, and noticed something weird. He says compilation makes functions 300+ times faster, but trying his "f" function on an input of a billion (to see the running time difference on a modern computer) gives me 4.919s for the interpreted version and 4.918 for the compiled version.
<cupholder>
<cupholder> To make sure I wasn't crazy, I wrote a basic recursive fibonacci function and timed it. It came out to 4.063s for the interpreted version and 4.064s for the compiled version. In both cases, I ran the function with the timer after defining it in the repl, entered (compile 'f) or (compile 'fib), and ran it again.
<cupholder> I'm using sbcl with Sly and Emacs 25.3.
robotoad has quit [Quit: robotoad]
<cupholder> (I ran "(time (fib 40))" both times)
robdog has quit [Ping timeout: 252 seconds]
robdog has joined #lisp
<oni-on-ion> hmm. should be a much larger difference there
<oni-on-ion> (there is essentially no difference, so far)
<fiddlerwoaroof> cupholder: most modern implementations always compile
voidlily has quit [Ping timeout: 276 seconds]
<cupholder> fiddlerwoaroof: Okay, that's what I was beginning to suspect.
<fiddlerwoaroof> in sbcl, sb-ext:*evaluator-mode* controls this
heisig has joined #lisp
<fiddlerwoaroof> (setf sb-ext:*evaluator-mode* :interpret) will skip the compiler
nirved has joined #lisp
<cupholder> The explicitly-compiled version runs with the same time on subsequent runs. Did SBCL produce a different binary for the same code? Is it non-deterministic?
<jdz> cupholder: you can see the generated code using DISASSEMBLE.
<jdz> cupholder: unless you change optimization settings the generated code does not change.
<cupholder> jdz: Thanks. How do I keep forgetting that?
<jdz> I don't know. I'd rather forget a thing or two now and then than one bit flip in my brain crash the whole thing.
sauvin has joined #lisp
deba5e12_ has quit [Ping timeout: 252 seconds]
voidlily has joined #lisp
deba5e12_ has joined #lisp
sauvin_ has joined #lisp
sauvin has quit [Ping timeout: 240 seconds]
kajo has quit [Ping timeout: 252 seconds]
sauvin_ is now known as Sauvin
voidlily has quit [Ping timeout: 276 seconds]
nly has joined #lisp
cylb has joined #lisp
varjag has joined #lisp
angavrilov has joined #lisp
VKraft has quit [Quit: Leaving]
jochens has joined #lisp
cylb has quit [Ping timeout: 268 seconds]
voidlily has joined #lisp
shka_ has joined #lisp
igemnace has quit [Quit: WeeChat 2.3]
igemnace has joined #lisp
<shka_> good morning
<beach> Hello shka_.
Tordek has quit [Quit: brb]
Tordek has joined #lisp
lavaflow has quit [Read error: Connection reset by peer]
lavaflow has joined #lisp
hhdave has joined #lisp
iomonad has quit [Quit: [1] 28823 segmentation fault (core dumped) weechat]
ogamita has joined #lisp
iomonad has joined #lisp
hhdave has quit [Ping timeout: 252 seconds]
hhdave has joined #lisp
eschatologist has quit [Ping timeout: 240 seconds]
marvin2 has quit [Ping timeout: 244 seconds]
madrik has left #lisp ["Holiday"]
Grauwolf has quit [Remote host closed the connection]
otwieracz has quit [Ping timeout: 264 seconds]
DGASAU has joined #lisp
buffergn0me has quit [Remote host closed the connection]
solyd has joined #lisp
ogamita has quit [Read error: No route to host]
otwieracz has joined #lisp
ogamita has joined #lisp
galdor has quit [Quit: WeeChat 2.2]
elfmacs has quit [Ping timeout: 252 seconds]
mkolenda has quit [Remote host closed the connection]
datajerk has quit [Quit: ZNC 1.7.1 - https://znc.in]
mkolenda has joined #lisp
galdor has joined #lisp
frgo has joined #lisp
igemnace has quit [Ping timeout: 244 seconds]
frgo has quit [Remote host closed the connection]
frgo has joined #lisp
frgo has quit [Ping timeout: 240 seconds]
datajerk has joined #lisp
igemnace has joined #lisp
nanozz has joined #lisp
nanoz has quit [Ping timeout: 240 seconds]
jochens has quit [Remote host closed the connection]
jochens has joined #lisp
jochens has quit [Read error: Connection reset by peer]
jochens has joined #lisp
frgo has joined #lisp
jochens has quit [Remote host closed the connection]
jochens has joined #lisp
frgo has quit [Ping timeout: 252 seconds]
jochens has quit [Ping timeout: 244 seconds]
beach has quit [Ping timeout: 252 seconds]
esrse has quit [Ping timeout: 252 seconds]
myrkraverk has quit [Ping timeout: 268 seconds]
nanozz has quit [Quit: Leaving]
marvin2 has joined #lisp
jmercouris has joined #lisp
<jmercouris> both logs are not working, can someone please remind me what I need to put in my SBCLRC to enable debugging?
pierpal has quit [Quit: Poof]
frgo has joined #lisp
<jackdaniel> this is so out of context I doubt anyone will be able to answer you
pierpal has joined #lisp
<jackdaniel> what is "enable debugging"? what logs? you'll get dropped in a debugger for unhandled errors without any magic things in sbclrc
<oni-on-ion> i can only find "how to disable debugger"
<jmercouris> sorry yes, I mean with regards to stepping through a restart after recompiling a function
<jmercouris> so, when a signal is raised (I think that's how you say it) and you get the debug menu, I want to be able to recompile the function and restart from a previous frame
<oni-on-ion> (declare (optimize (debug 3))) in sbclrc though, i've been suggested here before.
<jmercouris> without running proclaim debug optimize 3 in every new repl session
<jmercouris> there was someone who had posted a slightly different solution, I just can't find it in the logs :\
<jackdaniel> put (declaim (optimize (debug 3) (speed 0))) in .sbclrc
<jmercouris> I guess that will have to do for now, thank you
shka_ has quit [Quit: WeeChat 1.9.1]
<jmercouris> if I remember or find what that other user had posted, I will repost tot his channel
beach has joined #lisp
shka_ has joined #lisp
<oni-on-ion> (sb-ext:restrict-compiler-policy 'debug 3)
elderK has quit [Quit: Connection closed for inactivity]
myrkraverk has joined #lisp
jochens has joined #lisp
themsay has joined #lisp
m00natic has joined #lisp
jochens has quit [Remote host closed the connection]
jochens has joined #lisp
Bike has joined #lisp
jochens has quit [Remote host closed the connection]
jochens has joined #lisp
jcowan has quit [Quit: Connection closed for inactivity]
wanz has joined #lisp
ggole has joined #lisp
elfmacs has joined #lisp
moei has joined #lisp
v0|d has quit [Remote host closed the connection]
frgo has quit [Remote host closed the connection]
Bike is now known as Bicyclidine
cylb has joined #lisp
frgo has joined #lisp
<Xach> C-u C-c C-c does that on a form-by-form basis
jmercouris has quit [Ping timeout: 276 seconds]
solyd has quit [Ping timeout: 240 seconds]
kajo has joined #lisp
eschatologist has joined #lisp
mrSpec has joined #lisp
kajo has quit [Quit: From my rotting body, flowers shall grow and I am in them and that is eternity. -- E. M.]
charh has joined #lisp
ogamita has quit [Ping timeout: 252 seconds]
ogamita has joined #lisp
orivej has joined #lisp
DGASAU has quit [Read error: Connection reset by peer]
solyd has joined #lisp
DGASAU has joined #lisp
razzy has quit [Ping timeout: 268 seconds]
hjudt has quit [Ping timeout: 264 seconds]
nicksmaddog has joined #lisp
ogamita has quit [Read error: No route to host]
Kaisyu has quit [Quit: Connection closed for inactivity]
pierpal has quit [Quit: Poof]
pierpal has joined #lisp
frgo has quit [Remote host closed the connection]
frgo has joined #lisp
jetchisel has quit [Ping timeout: 272 seconds]
frgo has quit [Remote host closed the connection]
<Posterdati> hi
frgo has joined #lisp
igemnace has quit [Quit: WeeChat 2.3]
igemnace has joined #lisp
fikka has quit [Ping timeout: 246 seconds]
jochens has quit [Remote host closed the connection]
razzy has joined #lisp
jcowan has joined #lisp
jochens has joined #lisp
Bike has joined #lisp
<dim> ? (load "quicklisp.lisp")
<dim> [70916] Clozure CL kernel debugger: Killed: 9
<dim> ? for help
<dim> sigreturn returned
frgo has quit [Remote host closed the connection]
<Xach> yikes
<dim> sorry for pasting 4 lines, but well, looked harmless enough
<dim> that's with Welcome to Clozure Common Lisp Version 1.11-r16635 (DarwinX8632)! on macOS Mojave
<dim> when I tried 1.11.5 (from brew) I had the same
hjudt has joined #lisp
LiamH has joined #lisp
<jdz> dim: I think there's a release of ccl compatible with latest macOS, read something about those lines on the mailing list.
<jdz> "sudo installer -store -pkg ccl.pkg -target /" on the http://setf.clozure.com/~rme/ccl.pkg
igemnace has quit [Ping timeout: 276 seconds]
hjudt has quit [Quit: leaving]
elfmacs has quit [Ping timeout: 276 seconds]
frgo has joined #lisp
dddddd has joined #lisp
fikka has joined #lisp
astalla has joined #lisp
jochens has quit [Remote host closed the connection]
jochens has joined #lisp
shrdlu68 has joined #lisp
<dim> seems to work fine, thanks, but I need to learn how to use it from SLIME rather than with the integrated GUI
<shrdlu68> Just curious: any example of (widely-used) libraries as old as the language?
<shka_> shrdlu68: for young languages?
jochens has quit [Ping timeout: 268 seconds]
igemnace has joined #lisp
warweasle has joined #lisp
<jdz> If it's about Common Lisp, then iterate predates CL (year 1990, http://dspace.mit.edu/handle/1721.1/41498?show=full).
<jdz> Series and Screamer would also be similar, but not sure they're "widely-used").
dddddd has quit [Remote host closed the connection]
jochens has joined #lisp
<antoszka> what's Screamer? Never heard of.
<shka_> antoszka: non-deterministic programming and value space search
<shka_> and restertable computations
<antoszka> Got any links handy?
<shka_> via code walking
<shka_> this video is pretty good
nanoz has joined #lisp
<pfdietz> I'm grumpy about ITERATE. It doesn't work with COVER. Hacking COVER to make it work with it is on my to-do list.
jochens has quit [Ping timeout: 252 seconds]
<shka_> pfdietz: iterate is more complicated then it should be
<shka_> i think that Shinmera had a better idea with FOR
<astalla> There's also my "doplus" library that predates FOR: https://bitbucket.org/alessiostalla/doplus/wiki/Home
<astalla> I should probably move it to Github and do a proper 1.0 release.
Kundry_Wag has joined #lisp
nsrahmad has joined #lisp
sjl_ has joined #lisp
sjl_ has quit [Client Quit]
sjl_ has joined #lisp
jochens has joined #lisp
<Posterdati> please, does iolib is patched to work on OpenBSD?
<Posterdati> please, is iolib being patched to work on OpenBSD?
frgo has quit [Remote host closed the connection]
dale_ has joined #lisp
frgo has joined #lisp
dale_ is now known as dale
<Posterdati> I submitted a version which actually works, but no answer...
Kundry_Wag has quit [Ping timeout: 240 seconds]
rippa has joined #lisp
xrash has quit [Ping timeout: 268 seconds]
shrdlu68 has quit [Quit: WeeChat 2.2]
hjudt has joined #lisp
rozenglass has joined #lisp
frgo has quit [Remote host closed the connection]
frgo has joined #lisp
anamorphic has joined #lisp
frgo has quit [Ping timeout: 240 seconds]
nsrahmad has quit [Remote host closed the connection]
eschulte has quit [Ping timeout: 240 seconds]
heisig has quit [Quit: Leaving]
fikka has quit [Ping timeout: 268 seconds]
ogamita has joined #lisp
razzy has quit [Ping timeout: 268 seconds]
Inline has joined #lisp
astalla has quit [Ping timeout: 244 seconds]
ogamita has quit [Read error: No route to host]
ogamita has joined #lisp
frgo has joined #lisp
eschatologist has quit [Quit: ZNC 1.7.1+deb2 - https://znc.in]
eschatologist has joined #lisp
ggole has quit [Quit: ggole]
frgo has quit [Remote host closed the connection]
frgo has joined #lisp
jmercouris has joined #lisp
wanz has quit [Quit: wanz]
cupholder has quit [Ping timeout: 276 seconds]
Zaab1t has joined #lisp
fikka has joined #lisp
eschulte has joined #lisp
eddof13 has joined #lisp
eddof13 has quit [Client Quit]
ogamita has quit [Read error: No route to host]
jetchisel has joined #lisp
asarch has joined #lisp
ogamita has joined #lisp
cylb has quit [Remote host closed the connection]
cylb has joined #lisp
eddof13 has joined #lisp
SaganMan has joined #lisp
shka_ has quit [Quit: WeeChat 1.9.1]
Inline has quit [Remote host closed the connection]
nanoz has quit [Ping timeout: 268 seconds]
Inline has joined #lisp
kingcons has left #lisp ["ERC (IRC client for Emacs 26.1)"]
jack_rabbit has quit [Ping timeout: 252 seconds]
ogamita has quit [Quit: Good night!]
robotoad has joined #lisp
varjag has quit [Quit: ERC (IRC client for Emacs 25.2.2)]
it3ration has joined #lisp
Demosthenex has quit [Ping timeout: 264 seconds]
Demosthenex has joined #lisp
jetchisel has quit [Ping timeout: 252 seconds]
nly has quit [Read error: Connection reset by peer]
Guest70792 has quit [Ping timeout: 252 seconds]
jetchisel has joined #lisp
razzy has joined #lisp
optikalmouse has joined #lisp
shka_ has joined #lisp
<shka_> good evening
it3ration has quit [Ping timeout: 272 seconds]
<beach> Hello shka_.
nanoz has joined #lisp
<beach> HAH! "A key concept in all operating systems is the /process/." From Tanenbaum and Bos: Modern Operating Systems.
<shka_> oh the arrogance
<beach> Yeah. :)
<beach> I had hoped Tanenbaum would have a more enlightened view. Oh well.
<shka_> "mr Tanenbaum, just like you have passed judgment on operating system design, i have come to pass judgment on you!"
<beach> Though, he might be forgiven, since the book restricts the domain to "modern" operating systems. :)
<shka_> well, in that case, word "capability" seems to be even more important
<beach> It reminds me of when I was a child and my parents were forced to replace their gas stove with an electric one (which of course is much worse, at least with the design at the time). My mother said "well, I guess it's more modern".
<beach> Ever since, when I hear or read the word "modern", I jump.
razzy has quit [Remote host closed the connection]
razzy has joined #lisp
slac-in-the-box has joined #lisp
solyd has quit [Quit: solyd]
<shka_> beach: i guess you had hard time during popularity of "Modern Talking" band ;-)
DGASAU has quit [Ping timeout: 276 seconds]
<jackdaniel> why were they forced to change it to something worse though?
slac-in-the-box has quit [Ping timeout: 245 seconds]
SaganMan has quit [Quit: WeeChat 1.6]
lumm has joined #lisp
DGASAU has joined #lisp
razzy has quit [Ping timeout: 268 seconds]
<beach> I must have missed that band.
<beach> Oh, pop music. Not my thing.
rozenglass has quit [Remote host closed the connection]
hhdave has quit [Ping timeout: 244 seconds]
slac-in-the-box has joined #lisp
nanoz has quit [Quit: Leaving]
fikka has quit [Ping timeout: 245 seconds]
jmercouris has quit [Remote host closed the connection]
<jcowan> Well, it depends on how they define "process". I don't want to see everything in the system put into one great big event loop for all applications simultaneously, like the Mesa OS from Xerox did.
<jcowan> or 16-bit Windows, more modernly
jochens has quit [Remote host closed the connection]
jochens has joined #lisp
fikka has joined #lisp
slac-in-the-box has quit [Ping timeout: 246 seconds]
rumbler31 has joined #lisp
jochens has quit [Ping timeout: 245 seconds]
razzy has joined #lisp
m00natic has quit [Remote host closed the connection]
rumbler31 has quit [Remote host closed the connection]
razzy has quit [Ping timeout: 252 seconds]
Essadon has joined #lisp
Sauvin has quit [Remote host closed the connection]
slac-in-the-box has joined #lisp
<LdBeth> Good morning
hhdave has joined #lisp
<anniepoo_> morning
hhdave has quit [Client Quit]
<slac-in-the-box> (let ((greeting "good morning")) (format t "~a" greeting))
josh5tone has joined #lisp
Kundry_Wag has joined #lisp
<jackdaniel> (princ "good evening")
MichaelRaskin has joined #lisp
Kundry_Wag has quit [Ping timeout: 246 seconds]
<slac-in-the-box> (pprint "lol")
<anniepoo_> :- writeln(mornin).
<anniepoo_> oops, ww
<anniepoo_> 8cD
<sjl> anyone want to review this terrible thing I wrote on my lunchbreak http://paste.stevelosh.com/fdce3e2e7518439e6ab2bb4ee89598e8a743bc13
<sjl> use case is solving largest common substring for N strings, without implementing fully generalized suffix trees (which I could not do in one lunchbreak)
<sjl> there must be an easier way to do this
<shka_> oh wow
<beach> "Associated with each process is its /address space/, a list of memory locations from 0 to some maximum, which the process can read and write. The address space contains the executable program the program's data, and its stack."
<anniepoo_> I see a serious issue - you're doing this on your lunch break, which weakly implies you're not writing lisp code during work work time....
<anniepoo_> 8cD
<sjl> Hah, unfortunately this is true.
<shka_> sjl: could you please don't use (unless (when over everything ?
<beach> That is good.
<shka_> common lisp has and
<sjl> shka_: well, I'd need (and (not (minusp index)) (= ...))
<shka_> yeah
Kundry_Wag has joined #lisp
Kundry_Wag has quit [Remote host closed the connection]
<beach> sjl: the DO clause does not need a PROGN.
<shka_> or use predicate from alexandria
<sjl> Not sure that's more readable, at least to me. I tend to think of the first unless as "check if you've fallen off the array" and the when as checking if you've ticked over a bound.
<shka_> when non-negative-integer-p
<sjl> beach: Oh, you can just :do x y?
<beach> Yes.
<Xach> sjl: yes
<sjl> or do you mean :do x :do y
<sjl> huh
<beach> No
<beach> do x y
<josh5tone> or #'plusp?
<sjl> gotten too used to iterate, I guess
<sjl> josh5tone: plusp won't work for zero
<josh5tone> ah, noted
it3ration has joined #lisp
<shka_> sjl: is last ever used here?
solyd has joined #lisp
<sjl> shka_: yes, as the default value in the fletted function
<shka_> oh, i see
<shka_> ok
<sjl> Maybe I'll just turn the loop into a dotimes instead
varjag has joined #lisp
igemnace has quit [Quit: WeeChat 2.3]
slac-in-the-box has quit [Ping timeout: 245 seconds]
v0|d has joined #lisp
solyd has quit [Remote host closed the connection]
fikka has quit [Ping timeout: 246 seconds]
jruchti has quit [Ping timeout: 252 seconds]
igemnace has joined #lisp
it3ration has quit [Ping timeout: 245 seconds]
jruchti has joined #lisp
pierpal has quit [Ping timeout: 240 seconds]
<shka_> sjl: this macrolet probably should be just another function in labels i think
<shka_> you can declaim inline it if you want though
<shka_> declare actually
<shka_> since it is local
<sjl_> shka_: that wouldn't work for the (setf (iref ...))
<sjl_> and I was too lazy to define a setf function for it too
<shka_> heh, ok
Oladon has joined #lisp
razzy has joined #lisp
v0|d has quit [Remote host closed the connection]
Oladon has quit [Read error: Connection reset by peer]
pierpal has joined #lisp
Oladon has joined #lisp
fikka has joined #lisp
pfdietz1 has joined #lisp
pfdietz has quit [Remote host closed the connection]
pfdietz1 is now known as pfdietz
pierpal has quit [Ping timeout: 252 seconds]
pfdietz has quit [Ping timeout: 252 seconds]
<jcowan> beach: thanks
pfdietz has joined #lisp
vlatkoB has quit [Remote host closed the connection]
vlatkoB has joined #lisp
<anamorphic> How do I find out the default --dynamic-space-size in sbcl? It's platform dependent, but don't know where to look for x86_64
pierpal has joined #lisp
vlatkoB has quit [Read error: Connection reset by peer]
<shka_> anamorphic: dynamic-space-size [sb-ext]
vlatkoB has joined #lisp
<Posterdati> hi
froggey has quit [Read error: Connection reset by peer]
froggey has joined #lisp
<anamorphic> Cool thanks. it was ~1G... now to look for how I'm exhausting that. Seems like penty of space
dddddd has joined #lisp
<Posterdati> please help, I'm trying to run a simple client/server ssl test using iolib/sockets and cl+ssl, but the server gave me ssl-error-zero-return while creating the ssl server stream... Any hints? Thanks!
lumm has quit [Ping timeout: 252 seconds]
<anamorphic> Posterdati: should probably paste a minimum example
<Posterdati> anamorphic: ok
<Posterdati> server --> https://pastebin.com/1iDqxh91
<Posterdati> client --> https://pastebin.com/FW94Jn59
<jasom> sbcl's GC is throughput optimized, so you can have a lot of garbage before a full-gen GC happens.
pierpal has quit [Ping timeout: 240 seconds]
<fe[nl]ix> Posterdati: first test the server with the openssl command line client
<Posterdati> ok
<Posterdati> how?
rpg has joined #lisp
<fe[nl]ix> Posterdati: openssl s_client -help
<Posterdati> ok
<Posterdati> thanks
<Posterdati> fe[nl]ix: I have few suggestions for you on iolib on openbsd :)
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
<fe[nl]ix> you can send patches
<fe[nl]ix> but I don't use openbsd
lumm has joined #lisp
<Posterdati> can you add these to iolib?
DS9Soft has joined #lisp
<DS9Soft> How do I get a system defined with ASDF and named foo/bar in a file named foo-bar.asd get loaded from another system? QuickLisp doesn't seem to recognize the system as it uses /
DS9Soft is now known as sbenitezb
<anamorphic> sbenitezb: I think asdf > 3 treats things with / in them specially
astalla has joined #lisp
<anamorphic> "secondary systems"
<sbenitezb> thanks, apparently only the primary system can be resolved to its own .asd file, which sucks
<fe[nl]ix> Posterdati: what do you mean ?
Oladon has quit [Quit: Leaving.]
<jasom> sbenitezb: either call it foo-bar and put it in foo-bar.asd or call it foo/bar and put it in foo.asd
<flip214> beach: could you get your gitlab.c-l.n password resetted?
<Posterdati> fe[nl]ix: I added some code for openbsd, mostly constants
<jasom> sbenitezb: alternatively you can do asdf:load-asd on the asd file and then the system will be found.
<Posterdati> fe[nl]ix: I used openssl s_client and the server answered with the right certificate, the client I programmed did not verify the certificate!
<sbenitezb> jasom: thanks, I'll see what I can do. I actually don't like foo/bar much, but looks like a better subsystem separator
p_l has quit [Ping timeout: 252 seconds]
johs has quit [Ping timeout: 252 seconds]
avicenna has quit [Ping timeout: 252 seconds]
<jasom> sbenitezb: / was decided upon because it can't appear in a filename on most systems.
banjiewen has quit [Read error: Connection reset by peer]
<jasom> and it's already naturally a path separator in the unix world.
sz0 has quit [Ping timeout: 252 seconds]
billstclair has quit [Ping timeout: 252 seconds]
banjiewen has joined #lisp
<sbenitezb> ha, it would even make more sense to have subsystems using / as separator and then each in their own directory
billstclair has joined #lisp
avicenna has joined #lisp
p_l has joined #lisp
<sbenitezb> well that's what I'm trying to do, but those systems are not recognized automatically
johs has joined #lisp
sz0 has joined #lisp
spal has quit [Ping timeout: 252 seconds]
snits has quit [Ping timeout: 245 seconds]
snits has joined #lisp
spal has joined #lisp
Zaab1t has quit [Quit: bye bye friends]
lumm has quit [Quit: lumm]
lumm has joined #lisp
|3b| has quit [Remote host closed the connection]
|3b|` has joined #lisp
lumm has quit [Read error: Connection reset by peer]
lumm has joined #lisp
iomonad has quit [Ping timeout: 240 seconds]
pjb has joined #lisp
lumm has quit [Ping timeout: 252 seconds]
it3ration has joined #lisp
angavrilov has quit [Read error: Connection reset by peer]
Oladon has joined #lisp
fikka has quit [Ping timeout: 268 seconds]
<Posterdati> fe[nl]ix: worked!
<Posterdati> fe[nl]ix: thanks for the hint to use openssl s_client
fikka has joined #lisp
optikalmouse has quit [Quit: optikalmouse]
void_pointer has joined #lisp
elderK has joined #lisp
<elderK> Hey guys. I was wondering what the CL equivalent of C's do { ... } while is?
<elderK> I've been looking at Practical Common Lisp part on Loop, and stuff. But, I can't see any obvious... equivalent.
<flip214> beach: if you need your password resetted, I might now be in a position to help.
<void_pointer> (do () (end-test-form) stuff)
<void_pointer> elderK: I think that is pretty close to C's do while. I don't use that construct in C, so I might be a bit rusty on it, but it is like while but evaluates the condition at the end rather than the beginning
<elderK> Thank you void_pointer. Is there a loop-based equivalent?
<void_pointer> wait, just realized, what I wrote checks the end condition in the beginning. Easy way to fix it is to have
<elderK> I'm having fun tinkering away :)
<sjl_> (loop :do ... :while ...)
chumphries has joined #lisp
<void_pointer> (do ((first-iteration t nil)) ((and (not first-iteration) (end-test-form))) stuff)
<void_pointer> elderK: there definitely is
<elderK> Why :do vs do?
<sjl_> personal preference
<sjl_> I like how keywords make the loop syntax stand out more
<elderK> Fair enough :)
<sjl_> other people don't though
<elderK> Thank you
<void_pointer> also, makes the keywords show up on emacs more clearly
<void_pointer> and other editors
<void_pointer> really helps when you have complicated loop constructs
<void_pointer> with complicated variable initialization and stepping (especially common when you specify a variable's type)
<elderK> I'm having a hard time like, naming things. I'm so used to different... languages.
<elderK> Like, I have a structure called world, it represents the world state. It's dumb, it just contains an array of a certain format.
<elderK> But I'm not sure how to name the things that mess with it.
<elderK> When to prefix a function with world-, when to not.
<elderK> What to call accessors, etc.
<sjl_> Different people have different opinions there too
<elderK> I'll learn - but right now, these simple things are challenging :)
<josh5tone> when I get naming paralysis, I just name 'em wrong, and see how long it takes for me to figure out why
<sjl_> I read something somewhere making the argument against the foo-... prefixes... I wonder if I can find it.
vlatkoB has quit [Remote host closed the connection]
<void_pointer> a lot of it depends on just how many other symbols are in the package
<void_pointer> if that is the only object in the package, you can more easily get away with dropping prefixes
<elderK> Well, for instance, say I want to access the state of a cell in the world. I simply had "cell-state", then I had "world-cell", now I have "world-cell-state"
<void_pointer> if there are many kinds, then prefixes can sometimes be the only easy way to avoid clashes
<elderK> All of them feel off.
<elderK> I even just had "cell"
<elderK> (cell world x y)
<elderK> But that felt off :P
<elderK> Also thought of simply: world-state. But that makes you think of the state of the entire world, not just one cell in it.
* elderK shrugs
vlatkoB has joined #lisp
<elderK> Naming is hard :P
<Xach> I like to use un-prefixed names. If multiple objects can reasonably work with STATE, that's good. If the argument lists aren't compatible, I try to find a different name, or use different packages.
<elderK> In the C++ version of this, the world class had a method "get_state"
shka_ has quit [Ping timeout: 252 seconds]
<elderK> Well, these all operate on world alone. They are not meant to be generic in any way.
<elderK> They are also all in the "epidemic" package, which contains this stuff.
<Xach> elderK: right. the world class acts as the namespace, too.
kajo has joined #lisp
<elderK> I'm sorry, I don't quite understand?
<elderK> I understand that a method specialized on some type, is used for that type when you invoke the generic with an argument of that type?
<Xach> elderK: in c++ and many other languages you prevent name clashes by using classes as the way to separate names.
<elderK> Yup
<Xach> in lisp packages separate names.
<elderK> Also to group them, though. You know for instance, that these methods are to be used only on "world", since they are methods.
<Xach> i personally like not conflating class design with name organization.
<elderK> Where as here, if I just have "get-state", even if it's in my package,
<elderK> Well, what is it getting the state of?
<Xach> The object that is its argument.
<elderK> I guess documentation comes in here?
varjag has quit [Remote host closed the connection]
<elderK> Aye, so (get-state world x y).
sbenitezb has quit [Quit: Textual IRC Client: www.textualapp.com]
<elderK> Also: Math finals today.
<elderK> :P A few hours from now.
<elderK> Lisp as relaxation aid :)
<Xach> I wouldn't use GET-, personally.
<elderK> What would you use?
<Xach> (state object x y). Or maybe (state-at object x y)
<Xach> I'd expect something named STATE to take a single argument and return some state object. The extra stuff makes me think a more specific name would help.
<sjl_> that makes the setf form read nicer: (setf (state world 10 24) foo)
<sjl_> though gethash is a built-in example of the opposite
<elderK> Also, I've been littering my code with lots of check-types.
<elderK> Mostly to stop myself from making stupid mistakes.
<Xach> it's not an unconditional benefit
<sjl_> some day I'm just going to (defmacro href (hash-table key &optional value) `(gethash ,key ,hash-table ,value)) and be done with it.
<fe[nl]ix> Posterdati: send me a pull request on Github
<elderK> I imagine there is some cost associated with them.
<Xach> elderK: yeah, like making things harder to change later.
Roy_Fokker has joined #lisp
<elderK> Good point.
<Posterdati> fe[nl]ix: if you want support on OpenBSD I can help you!
<elderK> I didn't consider that factor.
<elderK> It'd make refactoring a pain in the ass if you change the types of tuff
<Xach> elderK: right. some people find it very much worth it
<elderK> I imagine you'd use them at a "public API". Internal functions, not so much
<cgay> Some people check types at API boundaries but not so much for internal code.
<cgay> ^
<Xach> parallel thinking
<elderK> :D
moei has quit [Quit: Leaving...]
<elderK> I had a question. Now I have forgotten. Damn :P
<elderK> Ah, yes.
vlatkoB has quit [Remote host closed the connection]
<elderK> I would ask for comments about a certain function, but, I think I'll just write it all up, finish it, and ask for a critique on the entire thing :)
<Xach> i had a thing i made where i had a bunch of functions that acted on an object and it turned out for most of it i really only needed the name of the thing to do most of the work, so i was glad i didn't make specialized methods or a lot of type checks. i could treat the string name as the object and save some work.
<elderK> Yeah, I understand.
<elderK> :)
nicksmaddog has quit [Quit: Leaving]
<elderK> It's a good point, definitely something to consider.
<elderK> Even if you used check-type a ton, couldn't you use like, deftype to kind of decouple the real type from the name you use for that type? Kind of like using or typedef in C++?
<asarch> One stupid question: Can you connect Slime in one PC to a SBCL session in another different host?
<oni-on-ion> yep
<oni-on-ion> not stupid question also
DGASAU has quit [Ping timeout: 260 seconds]
<asarch> Thank you!
<asarch> How would you that?
Kundry_Wag has joined #lisp
<Xach> asarch: when i did it, i used an ssh tunnel. there is some fiddling with filename translation required to get things to work properly. (i think the specifics are in the manual but i haven't checked recently)
<Xach> asarch: i found it to be a bit painful when i tried it several years ago so i usually edit on remote slimes with remote emacses.
terminal625 has joined #lisp
Kundry_Wag has quit [Ping timeout: 268 seconds]
<oni-on-ion> just connect. ask your network admin for any troubles with that
<oni-on-ion> when sbcl or impl runs swank and server, slime can connect considering version compat
<oni-on-ion> its always worked for me, not much special things. ssh like xach says for if you have a proper secure network setup. =)
<oni-on-ion> (which one would already know how to set up, else would have a network admin whom to ask.)
<asarch> Thank you
slac-in-the-box has joined #lisp
<asarch> Thank you very much guys :-)
Oladon has quit [Quit: Leaving.]
DGASAU has joined #lisp
<elderK> :P I wish I had a better name for "for-each-neighbouring-cell"
<elderK> :P
<elderK> Maybe for-each-adjacent-cell
<cgay> doing-adjacent-cells is another possibility. not sure if it's better.
<edgar-rft> elderK: sounds as if you live in a jail
Kundry_Wag has joined #lisp
<asarch> Another stupid question: Is SBCL a distributed environment (this SBCL can use that SBCL capabilities)?
<elderK> edgar-rft: Heh :P
<elderK> Well, I do have an exam later. So, kinda :P
<elderK> For three hours, I'll be a prisoner :P
<no-defun-allowed> good luck elderK (IRC)
<sjl_> map-neighbors
<sjl_> or do-neighbors
|3b|` is now known as |3b|
rozenglass has joined #lisp
<elderK> Thanks no-defun-allowed.
<elderK> I'm trying to be all zen about it.
<elderK> :P trying.
hhdave has joined #lisp
<elderK> Thanks sjl_.
<elderK> I thought of map, but it's not producing any output. Just, calling a function on each adjacent cell.
Kundry_Wag has quit [Ping timeout: 252 seconds]
rpg has quit [Ping timeout: 260 seconds]
<elderK> Is the form something? okay for predicates in CL? Or should it be somethingp
<elderK> ?
<sjl_> Personal preference. Common Lisp itself uses `p`, some folks prefer `?`
<sjl_> as long as you don't do my personal pet peeve of calling a boolean parameter somethingp I'm happy
<elderK> Sweet :)
<cgay> elderK: then you'll have to decide between 'p' and '-p' :)
Bike has quit []
<elderK> I like the ? :)
<elderK> Got used to that in Scheme :)
<pjb> There's a rule to choose between p and -p.
<pjb> When the predicate name is a single noun, p; when it's several-nouns, -p.
<pjb> and string-equalp is not an exception: it's the equalp of string.
<elderK> So, when do you choose something-equalp vs something-equal vs something= ?
<void_pointer> The first if you mean equalp equality, the second if you mean equal equality, and = if you mean numeric equality.
<void_pointer> Which are quite different things in CL
<void_pointer> Scheme as well.
<void_pointer> Honestly, I like the naming conventions in Scheme more for the most part
ivan4th has joined #lisp
<void_pointer> Especially the convention for ? for predicates and ! for anything that mutates its arguments
<aeth> void_pointer: There's one problem with the naming conventions in Scheme. Because they improved the names (e.g. map instead of mapcar) that means that good names aren't available (i.e. a sequence-generic map cannot be called map in Scheme)
<void_pointer> aeth: never thought about that but you are right
<aeth> Additionally... CL requires you to help the compiler out if you want efficient array/sequence code. Scheme wants to keep dynamic typing at maximum efficiency which means no generic aref... which also means instead of one type declaration you have potentially dozens of de-facto declarations right there in the foo-ref name.
<aeth> (For numbers, even Scheme can't avoid generic procedures)
<void_pointer> numbers are notoriously difficult
<aeth> In Scheme you could have stuff like ub8-ref instead of just declaring the array once as (unsigned-byte 8)
anamorphic has quit [Quit: anamorphic]
anamorphic has joined #lisp
anamorphic has quit [Client Quit]
anamorphic has joined #lisp
anamorphic has quit [Client Quit]
<elderK> Is there a way to create an array without initializing the elements?
pierpal has joined #lisp
<elderK> Like, I'm going to fill them right after I create it.
<aeth> (Technically you do (simple-array (unsigned-byte 8) (*)) in CL... But inconvenient syntax like that can always be fixed with macros.)
anamorphic has joined #lisp
anamorphic has quit [Client Quit]
<void_pointer> Reminds me, I've been trying to get half decent array math performance. If I have two arrays that are for sure the same size with the same type which is known to be (unsigned-byte 32) and then doing an element-wise multplication in place. I can't seem to get more than 70 M/s out of SBCL on my computer even with declarations so far.
anamorphic has joined #lisp
anamorphic has quit [Client Quit]
<aeth> elderK: CL is a safe language so it probably will try to find a reasonable initial-element (NIL or some numeric type's 0 or #\Nul) even if you don't provide one, although that's implementation specific
<jcowan> Yes, one of Scheme's notable features is relentless monomorphism.
<aeth> It might notice that you set every element right afterward and optimize that away, but I don't think even SBCL is that sophisticated
<aeth> jcowan: except for numbers
anamorphic has joined #lisp
<jcowan> yes
<jcowan> there is exact-inexact polymorphism, but that's all
anamorphic has quit [Client Quit]
<void_pointer> the make-array function has an :initial-element keyword to pass an initial element. It defaults to nil
anamorphic has joined #lisp
anamorphic has quit [Client Quit]
<jcowan> and there is universal polymorphism, like cons, and there is "universal polymorphism by cases", like write/display.
<aeth> void_pointer: But when it is nil that does not mean the initial element is nil, at least in SBCL. It will use the numeric type's 0 or the character #\Nul in SBCL e.g. (make-array 42 :element-type 'character)
<void_pointer> aeth: if it was that smart, it would take a lot less time to do the multiplciations. I am doing it several times in a row and it could just do it once and be done, but the time scales with the number of times it is done
anamorphic has joined #lisp
anamorphic has quit [Client Quit]
anamorphic has joined #lisp
<void_pointer> aeth: oh, that is convenient. I've always been scared to not give some :initial-element to avoid a crash
anamorphic has quit [Client Quit]
<jcowan> I have only ever seen trash in numeric arrays and only in some implementations; the rest are all about 0.
<void_pointer> aeth: which is funny given that it would just drop into the debugger if there was a problem rather than crash (I still think a lot like a Python programmer)
<jcowan> or 0.0 or 0.0+0.0i or whatever
<aeth> void_pointer: don't rely on that initial-element thing happening portably.
<aeth> jcowan: specifcially, the numeric type's 0 if numeric *or* #\Nul if character *or* NIL if generic
<jcowan> Makes sense, given a wide interpretation of 0 (see above)
<|3b|> accessing uninitialized array elements is undefined, so specify 0 if you want 0 :)
<aeth> |3b|: Or define this behavior explicitly in a macro even though every reasonable implementation already has it
<void_pointer> aeth: thanks for the tip
<jcowan> I just checked 3 Schemes for strings; 2 used #\space and one used \#nul
<aeth> jcowan: Schemes are more about scripting and interfacing with C
<no-defun-allowed> anyone familiar with cl-yacc?
<aeth> jcowan: CL likes to pretend that it's being used in LispMs
<jcowan> aeth: I don't think it's unreasonable to put trash in a numeric array
<jcowan> especially if it is large and initialization cost is noticeable
<aeth> (In case I was unclear, I was explaining why NUL might be undesirable but why CL doesn't care)
Oladon has joined #lisp
<|3b|> also, :initial-element doesn't default
<jcowan> R7RS allows #\nul to be forbidden in strings, but I don't know any implementation that actually does it. Some store a #\nul invisibly after the actual characters to prevent runaway behavior if you pass the string to C, but if there's a #\nul in it, C will of course act on that.
<void_pointer> if one is doing floats, nan is a common "null" that is used, in as much as there is only one nan (there are many many nan, most are signaling nans)
<jcowan> Exactly half to be precise
<aeth> void_pointer: Make sure to wrap your unsigned integer arithmetic in MOD with a power of 2 if you want C-style efficiency and wrapping semantics, at least if the compiler is smart enough.
<aeth> void_pointer: CL doesn't have a NaN. Well, officially it doesn't. Unofficially there's this whole mess: https://github.com/Shinmera/float-features/blob/master/float-features.lisp
asarch has quit [Quit: Leaving]
<jcowan> Come to think of it, a CL could exclude #\nul from the type base-char.
<aeth> I don't know why float-features isn't in QL yet. The alternatives to that library generally are a fast path for SBCL and a slow path for everyone else.
<void_pointer> aeth: just tried wrapping it in mod and it made it slower. Seems SBCL figured out the fast path on its own
<aeth> void_pointer: that is really strange
<aeth> void_pointer: for me this is better in SBCL than the non-mod version based on disassemble: (defun foo (x y) (declare ((unsigned-byte 32) x y)) (mod (* x y) (expt 2 32)))
<|3b|> jcowan: nothing says #\nul (if it exists) has to have the bit pattern 00000000 :p
<jcowan> Even EBCDIC doesn't go *that* far.
* |3b| usually prefers (ldb (byte 32 0) (...)) to MOD or LOGAND
<aeth> |3b|: They're the exact same in SBCL
<void_pointer> Got one thing switched up, I was doing (unsigned-byte 8) arithmetic, not (unsigned-byte 32)
<void_pointer> Image processing.
<void_pointer> (optimize (speed 3) (safety 0) (debug 0)))
<void_pointer> (declare (type (array (unsigned-byte 8) (800 600 3)) a b)
<void_pointer> (b (make-array '(800 600 3) :element-type '(unsigned-byte 8) :initial-element 0)))
<void_pointer> (let ((a (make-array '(800 600 3) :element-type '(unsigned-byte 8) :initial-element 0))
<void_pointer> (time (dotimes (j 100)
<void_pointer> (dotimes (i (array-total-size a))
<void_pointer> (declare (type (signed-byte 32) i))
<void_pointer> (setf (row-major-aref a i) (* (row-major-aref a i) (row-major-aref b i)))))))
LiamH has quit [Quit: Leaving.]
<|3b|> aeth: right, so i can pick whichever i like :)
<aeth> |3b|: I generally view it more in terms of mathematics than bits/bytes
<|3b|> void_pointer: specify array rank too if you know it
<aeth> The main difference would be if I was working with ub8 in certain things, I guess
<|3b|> though i guess might not matter with r-m-aref
<void_pointer> The type declaration does that in that it gives the exact dimensions
<jcowan> There is or was one Scheme that takes advantage of the permission to use random-looking (but consistent) integer codes for characters, just to screw you up if you assume it. This permission has been withdrawn in later standards. Now you have to use Unicode codepoints, although you can (theoretically) have characters with bucky bits set provided the codes exceed #x200000.
<|3b|> void_pointer: sorry, misread, hard to read code in irc
<sjl_> might declare them to be simple-array instead of just array
<sjl_> unsure if that'll actually do anything though
<|3b|> yeah, LDB,MOD,LOGAND to chop off extra bits should help there
<void_pointer> Takes 11.6 seconds in CCL and 2.3 seconds in SBCL so far
<void_pointer> Hmm, that might help
<|3b|> simple-array is also good
<no-defun-allowed> simple-array disallows things like displacement so it's faster
<|3b|> also
<void_pointer> ok, that did a lot. Now it takes 0.306 s on SBCL
<|3b|> also, declare I fixnum,
<void_pointer> yeah, can't believe I didn't catch that
<void_pointer> making i be a fixnum didn't change anything
<|3b|> it is more accurate type on 32 bit, and not wrong on 64 bit :p
<|3b|> (well, not wrong in the general case, you know exact size in that example)
<aeth> void_pointer: Technically speaking you don't need a type declaration if the type inference can infer it, like with the LET, unless you're doing something that uses CLtL2 (e.g. introspect-environment) to do fancy type-declaration-based macros (which cannot access the type inference).
<void_pointer> so now it is up to 470 M/s which is a lot better
<sjl_> (subtypep `(integer 0 ,array-total-size-limit) 'fixnum) ; => T on SBCL
<sjl_> so it probably inferred that on its own
<no-defun-allowed> 12fps with multithreading at 720p using that code to greenscreen
<aeth> void_pointer: If you're doing that at the top level of the REPL, you might get better numbers if you first define it as a function.
<no-defun-allowed> (declare (optimize (speed 3))) will find anything and everything to complain about
<aeth> void_pointer: If you define it as a function, of course, you'd need the type declarations
mejja has joined #lisp
pierpal has quit [Ping timeout: 252 seconds]
<aeth> void_pointer: (safety 0) is unnecessary unless you're bounds checking. Even if you are removing bounds checking, you should declare the (safety 0) at the most local place possible because you lose the useful static type checking in SBCL if you have (safety 0)
nirved has quit [Quit: Leaving]
<aeth> (You also lose the runtime type checking, but if you're working with specialized arrays and :type slots in structs, then that really doesn't matter at all. You won't really gain much with (safety 0) there. (safety 0) should only be used to remove bounds checks, and some people would even say that goes too far.)
<void_pointer> I avoid (safety 0) like the plague, but was just using it here to see what the max limits I could get out of it
<void_pointer> turning it to a function made it slightly faster (a couple percent) and didn't raise any of SBCL's optimization hints
<aeth> If you're doing (safety 0) you might not get all of the messages you could otherwise get
<sjl_> How to use (safety 0) properly: 1. Write with (safety 1) and benchmark. 2. Switch to (safety 0) and benchmark. 3. Compare benchmarks and say "huh, that's neat". 4. Change back to (safety 1) because you're a responsible human being.
<no-defun-allowed> ):
<aeth> sjl_: Right, the only use for (safety 0) is benchmarking.
<void_pointer> still didn't get any compiler messages, but (safety 1) decreased performance some
<aeth> void_pointer: disassemble and see if you're getting bounds checks
<Xach> elderK: you can create an array without specifying the initial element but the consequences of reading from it are undefined.
hhdave has quit [Quit: hhdave]
<aeth> void_pointer: If you're programming to remove bounds and type checks, (safety 0) normally won't buy you much
<Xach> elderK: some implementations use 0 as the initial element, some use nil, some use garbage
* Xach found that out The Hard Way
Bicyclidine is now known as Bike
<aeth> sjl_, void_pointer: The correct way to get (near) maximum performance in SBCL is to find a way to remove all bounds and type checks by providing enough information to the compiler in a way that SBCL likes it imo.
<jcowan> The trouble is that you don't know which declarations are optimizing and which are pessimizing a priori
<no-defun-allowed> 1. use (safety 0) cause you are bored 2. (defun f (x) (declare (optimize (safety 0) (speed 3)) (fixnum x)) (the fixnum (1+ x)))
<no-defun-allowed> 3. (sb-ext:gc :full t) 4. byebye!
<aeth> jcowan: What I like about SBCL is a combination of the optimization notes at (speed 3), the commented DISASSEMBLE that comments the parts you might want to optimize away, and the extensive benchmarking tools available.
* jcowan thinks type declarations should be explicitly marked "assertion" or "assumption"
<aeth> SBCL is the only implementation where I know what's going on
it3ration has quit [Ping timeout: 264 seconds]
<void_pointer> looked at the disassembly and it is not doing bounds checks. Only comparison is the end of loop condition
<aeth> jcowan: Type declarations are only an assumption in (safety 0) SBCL afaik.
* jcowan nods
xrash has joined #lisp
<jcowan> But I'd like local control rather than scoped control
<aeth> void_pointer: Strange that you have a noticable difference, then.
<void_pointer> however, the assembly code is quite ugly. I am not very familiar with amd64 assembly, just 16-bit x86 and it has been well over a decade
* jcowan decided when he saw the VAX assembler with its 256 opcodes that PDP-11 assembler was going to be the last one he ever learned
<jcowan> aeth: point
<void_pointer> One curious thing which may explain the performance issue. SBCL seems to be storing the (unsigned-byte 8) as two bytes each with one wasted byte based on the termination index
fikka has quit [Ping timeout: 272 seconds]
<void_pointer> (/ 2880000 3 800 600) gives 2
<jcowan> At one time the Chicken compiler would *always* inline any function declared "inline".
<jcowan> "But that might be what the user wanted?"
pierpal has joined #lisp
<jcowan> Me: "The user can't possibly want an infinite loop *in the compiler*."
<no-defun-allowed> what that does in the words of joe strummer, "gencgc copies garbage! ooh bub-bub-bye-bye!"
<no-defun-allowed> lol
<aeth> The only legitimate use of SBCL's (safety 0) imo is a locally to remove a bounds check that you know cannot be violated in a loop but that the compiler does not know. I'm not sure that that ever comes up.
<aeth> Unfortunately, even that's not ideal beacuse you can't just say remove-bounds-checks, you'd also remove other things you might want. So even when you have a legitimate case, just accept the slight performance hit
<jcowan> Well, sometimes you need code to run really reallly fast 90% of the time and crash the other 10%.
<jcowan> "If it doesn't have to be right, I can make it as fast as you want." Rejoinder: "<large program> has 1000 bugs. Which would you rather, that I removed all the bugs or made it run 1000 times as fast?"
<aeth> jcowan: In practice though you only gain something like 10%, not 1000x
<aeth> I don't really see the need to turn safety off in my game engine.
sjl_ has quit [Quit: WeeChat 2.3-dev]
<aeth> The only time you'd need it off is if you're doing something like calculating pi and you might save a few days/weeks
<jcowan> I think max optimization gets you a factor of 2, which however might be the difference between brakes that work and those that do not.
<void_pointer> 11 instructions before the multiply and 8 afterwards seems like a bit much
pierpal has quit [Ping timeout: 244 seconds]
<aeth> jcowan: Well, SBCL is roughly 3.5x slower than C in certain workloads, so maximum optimization and maximum unsafety would get a roughly 3.5x speed increase in certain cases assuming SBCL can be patched to do all the optimizations GCC/LLVM can do.
<aeth> (Also ignoring the differences SBCL inherently has by being GCed)
<jcowan> I mean "factor of 2" in general, not in any particular case
<jcowan> that's about what you can expect if you bum your code till it screams
<|3b|> aeth: only place i've seen it was in complicated loops over multiple arrays at once, where it could figure out some but not all
<|3b|> (seen local safety 0 arouns an aref help
<|3b|> but i think that code needed rewritten anyway :p
<void_pointer> goint up to (unsigned-byte 16) didn't change the termination condition while it reduced the instructions to 7 before the multiply and 6 afterwards
<|3b|> void_pointer: sure you aren't confused by lowtags?
<void_pointer> when you have a problem where it will take a week on a 4096 node cluster, factors of 2 mean a lot of time
<void_pointer> |3b|: are you referrring to the instruction count or the size of the array elements in bytes?
<|3b|> (bits of fixnums are shifted a bit (possibly 2) to include type info)
<|3b|> size of array
* |3b| is pretty sure sbcl stores unsigned-byte 8 packed, or i'd have had a lot more problems with textures in the past
<|3b|> and are you sure you shouldn't be using a GPU if it needs a week on a 4k cluster? :p
<jcowan> someone said that in SBCL array-total-size-limit is always a fixnum, but I think the spec requires that.
<|3b|> yeah, array indices (including row-major ones) are fixnums
<void_pointer> well, it does look like that is the case |3b| with the lowtags. Changing the size up to uint16, uint32, and uint64 didn't change the loop end condition
<|3b|> there is a bit of unclear things in the spec regarding largest allowed array size though
<jcowan> right, and a Good Thing Too.
<void_pointer> interestingly, the time the multiplications took reduced with each step up in size
<|3b|> fixnum array indices aren't a good thing when you want large bitvectors on 32bit clisp :(
slac-in-the-box has quit [Quit: leaving]
<void_pointer> with (unsigned-byte 64), it is 4 instructions before the multiply and 5 after
* |3b| wouldn't worry much about instruction counts
<|3b|> is this just abstract experimenting or do you have a specific task you want faster?
<void_pointer> |3b|: as for the GPU question, if the problem fits a GPU, then yes. the random example I was pulling out is one that has one part that is amenable to GPUs and another part that isn't. If both are done on the one cluster, it is over a week for one round. If the first part is done on a GPU cluster, we shave a few days and make less unhappy other users on the same cluster
pierpal has joined #lisp
<void_pointer> |3b|: I am trying to render something and there is one step in the pipeline that depending on what I have to work with to render, could have to be done in software. It is luckily a giant pointwise multiply
<void_pointer> hence the array dimensions (800 600 3)
<|3b|> multiply corresponding elements of 2 arrays is definitely GPU side, though if it is mixed in with other part i could see moving between clusters being way too much overhead :/
<void_pointer> the GPU part is a first step before some human intervention has to be done for a few hours or so before it can be ready for the second part
<void_pointer> the second part is the one that one might want to redo. First one once done, there is often little reason to redo
<void_pointer> but that is work stuff
<void_pointer> the optimizing problem I am doing here is hobby stuff
<|3b|> do you have any bounds on the values in the arrays?
<void_pointer> yes, 0-255
<|3b|> ok, so no :p
<void_pointer> or might go to floating point with a final conversion.
astalla has quit [Ping timeout: 252 seconds]
<|3b|> are you expecting the multiply to wrap often?
<void_pointer> I'm basically doing an axpy operation, but rather than being purely floating point (and then being able to use BLAS), it has integers. In principle, I could just convert the Fortran axpy function in refblas and wrap it
<void_pointer> hmm, you know, that question made me realize I am making a mistake in my code
<void_pointer> there is an extra step needed to prevent wrapping
<|3b|> axpy = scalar * vector then vector sum?
* |3b| thought you were doing hadamard product
<|3b|> also, just out of curiosity have you tried (map-into a #'* a b) rather than manual loop?
<void_pointer> |3b|: not yet
<void_pointer> axpy = scalar * vector + y
<void_pointer> but, in this case, scalar and y are arrays. I'm pretty sure there is a BLAS level 2 or 3 function for this but I don't remember its name
<void_pointer> you know, I think I am thinking myself in circles
<void_pointer> and forgetting major details due to being tired
* |3b| doesn't know blas, but a vector scalar sounds like an interesting thing to have :p
<void_pointer> here I am trying to do scalar * array1 * array2 + array3
<void_pointer> BLAS is a lot of fun, especially trying to write one's own and the struggles that go with getting it right
<|3b|> yeah, it's right on the edge of stuff i do, but i usually just write it myself on GPU for that sort of thing rather than trying to figure out CL<->fortran stuff
<no-defun-allowed> oclcl time?
pierpal has quit [Read error: Connection reset by peer]
* |3b| used my own opencl bindings last time i used opencl, but most of my hardware is NV and their opencl support isn't good enough for me to bother with anymore :(
<|3b|> (and i'm mostly doing graphics stuff so gl/vulkan compute shaders are more appropriate anyway)
<no-defun-allowed> ):
<aeth> I'm probably going to write my own BLAS at some point. Technically, you don't want one BLAS. That's not the point of BLAS.
<aeth> You'd want e.g. SBCL/x86-64, SBCL/x86, SBCL/arm64, etc., each one probably heavily using define-vop (or the equivalent if a different implementation)
<aeth> The common BLAS would just be the fallback
Kundry_Wag has joined #lisp
<|3b|> no-defun-allowed: yeah, pretty much :(
<no-defun-allowed> linux amd drivers aren't great either
<|3b|> right, which is a large part of the reason i ended up with mostly nv stuff
<|3b|> i dislike nv as a company, but they have nice hardware/drivers
<void_pointer> for what I am doing, gl is my eventual goal (it is graphics), but I can more easily reason with and debug array operations on the CPU or using simple 2D drawing commands (which use gl in the background). Also means I have a fallback.
<no-defun-allowed> i'll probably move to arch since the wiki and resources are less headache-inducing than ubuntu for the new stuff
<|3b|> (but wrong channel for that stuff)
<|3b|> void_pointer: well, combining 2 textures even with simple 2d stuff is pretty trivial in GL
<aeth> Porting the concept of BLAS to CL is a bit tricky because you have two representations for 2D stuff (i.e. matrices): 2D arrays and 1D arrays.
Kundry_Wag has quit [Ping timeout: 240 seconds]
<aeth> And you want both, e.g. if those matrices are going to be fed into OpenGL they have to be 1D
aleamb has joined #lisp
<void_pointer> |3b|: good to know. Part of it is that I don't know GL yet. Tried for a while and struggled. Decided I would come back to it once I had my rendering pipeline figured out and proofed in SDL or on arrays on the CPU
<void_pointer> aeth: yeah, it would be messy. Did it in Fortran a decade ago and was pretty easy, but that is no surprise because BLAS was designed around Fortran and Fortran was designed just for these sorts of things
<aeth> void_pointer: Fortunately we have a FORTRAN, too, and it's called SBCL ;-)
<aeth> void_pointer: Unfortunately, F2CL generates some pretty trash SBCL based on disassembling what it generates, so either you write your own translator or do it manually.
<void_pointer> aeth: and that is not even getting into some of the dark corners of Fortran I take it