* |3b|
points at something definitive rather than relying on my brain which will get confused by reasonable seeming options :)
<|3b|>
ouch, mostly definitive :/ (has it as :init-form in the description of the argument to :initform)
<|3b|>
:initform with no - is the correct one
<skidd0>
oh that is odd
<skidd0>
now my method works
<skidd0>
thank you, Petit_Dejeuner, Ober, and |3b| (and specbot)
troydm has quit [Ping timeout: 252 seconds]
skidd0 has quit [Quit: WeeChat 2.2]
troydm has joined #lisp
joast has quit [Remote host closed the connection]
robotoad has quit [Quit: robotoad]
DGASAU has quit [Read error: Connection reset by peer]
joast has joined #lisp
DGASAU has joined #lisp
shifty has joined #lisp
fiddlerwoaroof has quit [Read error: Connection reset by peer]
fiddlerwoaroof has joined #lisp
rocx has joined #lisp
chipolux has quit [Quit: chipolux]
Roy_Fokker has quit [Read error: Connection reset by peer]
<rocx>
stupid question: is there a better way to make `random' actually be random across executions besides constantly making a new random-state as an argument for random?
marusich has joined #lisp
chipolux has joined #lisp
patche has joined #lisp
patche has quit [Client Quit]
DecimPrime has joined #lisp
<Bike>
seeding it each time won't make it any more "actually random" really
<Bike>
there's only so much entropy
<rocx>
so it basically works best on a persistent program rather than a compiled program to get consistently random number?
robotoad has joined #lisp
<Bike>
what behavior do you actually want
<Bike>
usually a pseudorandom sequence is fine
<rocx>
say, when running the program, first thing it does is generate some string (in a hypothetical and structured way). it needs to be random every time the program is run.
<Bike>
just seed it once at startup then
<Bike>
assuming you mean it should be distinct between runs
<rocx>
yes. as in (setf *random-state* (make-random-state t)) ?
<Bike>
yeah should be fine
<rocx>
hm. odd. swore i did that and it didn't work as intended.
moei has quit [Quit: Leaving...]
jkordani has quit [Read error: Connection reset by peer]
dddddd has quit [Remote host closed the connection]
pierpal has quit [Read error: Connection reset by peer]
anewuser has quit [Ping timeout: 268 seconds]
skeuomorf has joined #lisp
jackdaniel has quit [Ping timeout: 252 seconds]
dented42 has joined #lisp
r1b has quit [Ping timeout: 245 seconds]
adlai has quit [Ping timeout: 272 seconds]
adlai has joined #lisp
pierpal has joined #lisp
Copenhagen_Bram has quit [Read error: Connection reset by peer]
Copenhagen_Bram has joined #lisp
nowhere_man has quit [Ping timeout: 252 seconds]
<beach>
Good morning everyone!
<no-defun-allowed>
Morning beach
jackdaniel has joined #lisp
nowhere_man has joined #lisp
Copenhagen_Bram has quit [Read error: Connection reset by peer]
moei has joined #lisp
steiner has joined #lisp
Copenhagen_Bram has joined #lisp
Bike has quit [Quit: Lost terminal]
vlatkoB has joined #lisp
orivej has quit [Ping timeout: 245 seconds]
<LdBeth>
Midnight
shifty has quit [Ping timeout: 252 seconds]
shrdlu68 has joined #lisp
shifty has joined #lisp
_whitelogger has joined #lisp
myrmidon has joined #lisp
pierpal has quit [Read error: Connection reset by peer]
<no-defun-allowed>
hi shrdlu68
<shrdlu68>
no-defun-allowed: Hello
<shrdlu68>
Is there a way to tell my implementation (sbcl, in this case), to do (* x y) like MUL x y? x and y being, say 64-bit values.
<no-defun-allowed>
pop a (declare (fixnum x y)) in your function and it should get closer
<no-defun-allowed>
basically if you have some kind of body with lexical binds you can tell CL systems that they are some type and that they should optimize for it
myrmidon has quit [Ping timeout: 252 seconds]
myrmidon has joined #lisp
<shrdlu68>
My goal is to get a 64-bit value by multiplying two 64-bit numbers, just as one would in C. I'm not sure type declaration will help.
<no-defun-allowed>
oh good point
<no-defun-allowed>
as well, (declare (optimize (safety 0))) tends to stop overflow checking
<no-defun-allowed>
i wouldn't expect it to be portable for obvious reasons
pierpal has joined #lisp
pierpal has quit [Read error: Connection reset by peer]
pierpal has joined #lisp
<aeth>
shrdlu68: 64-bit values work as long as they're not boxed
<aeth>
shrdlu68: they're not boxed as long as they don't leave the function
<aeth>
shrdlu68: ways you can do that are (1) inline function, (2) use a macro, (3) mutate a specialized array (i.e. :element-type) or a struct with a slot with a :type, (4) coerce it into a value that's not boxed (e.g. coercing a double-float to a single-float as the return value)
<aeth>
otherwise, you get generic arithmetic functions that will box
zxcvz has joined #lisp
<aeth>
note that #3 is the most implementation specific and #1 might not always work if the compiler isn't very smart.
pierpal has quit [Read error: Connection reset by peer]
<aeth>
shrdlu68: as for wrapping around, in SBCL, you can do that with mod
<aeth>
shrdlu68: e.g. (defun foo (a) (declare ((simple-array (unsigned-byte 64) (1)) a)) (setf (aref a 0) (mod (* (aref a 0) 42) (expt 2 64))) a)
kajo has quit [Quit: From my rotting body, flowers shall grow and I am in them and that is eternity. -- E. M.]
pierpal has joined #lisp
<aeth>
(For something that trivial you'd probably want to go with an inline function, though. The inline function itself will have the unoptimized disassembly, but the caller function will be optimized.)
pierpal has quit [Read error: Connection reset by peer]
scymtym has joined #lisp
pierpal has joined #lisp
angavrilov has joined #lisp
pierpal has quit [Read error: Connection reset by peer]
shka_ has joined #lisp
ravndal has quit [Quit: WeeChat 2.2]
pierpal has joined #lisp
ravndal has joined #lisp
razzy has joined #lisp
shka_ has quit [Remote host closed the connection]
<aeth>
The second version will allocate the final result as a bignum, but inlining can remove the allocation depending on the details of the calling function
<aeth>
s/will allocate/might allocate/
<shrdlu68>
But you end up doing both mod and multiplication.
<aeth>
I don't see a DIV in the disassembly
<aeth>
I also don't see the LEA followed by an AND that mod by a power of 2 (optimized specially) normally gives
froggey has quit [Ping timeout: 240 seconds]
<aeth>
It's more than that, though. Doing the multiplication on an ub64 and then the mod would make it a bignum and then do the generic mod on the bignum. It would be very noticable.
pierpal has quit [Read error: Connection reset by peer]
froggey has joined #lisp
sauvin_ has joined #lisp
pierpal has joined #lisp
ggole has joined #lisp
<aeth>
hmm... actually, modifying it to get variations that aren't optimized produces weird results
Sauvin has quit [Ping timeout: 260 seconds]
siraben has joined #lisp
johnjay has quit [Ping timeout: 256 seconds]
pierpal has quit [Read error: Connection reset by peer]
makomo has joined #lisp
shrdlu68 has left #lisp ["brb"]
doubledup has quit [Quit: Leaving]
doubledup has joined #lisp
trittweiler has joined #lisp
doubledup has quit [Quit: Leaving]
doubledup has joined #lisp
shifty has joined #lisp
robotoad has quit [Quit: robotoad]
pierpal has joined #lisp
dented42 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dented42 has joined #lisp
doubledup has quit [Quit: Leaving]
dented42 has quit [Ping timeout: 244 seconds]
doubledup has joined #lisp
graphene has quit [Remote host closed the connection]
graphene has joined #lisp
micro has quit [Remote host closed the connection]
random-nick has joined #lisp
makomo has quit [Ping timeout: 244 seconds]
shrdlu68 has joined #lisp
dented42 has joined #lisp
makomo has joined #lisp
sauvin_ is now known as Sauvin
shka_ has quit [Ping timeout: 252 seconds]
shka_ has joined #lisp
beach has quit [Ping timeout: 252 seconds]
beach has joined #lisp
varjag has joined #lisp
anewuser has joined #lisp
orivej has joined #lisp
dented42 has quit [Ping timeout: 272 seconds]
krkini has quit [Quit: No Ping reply in 180 seconds.]
kini has joined #lisp
SenasOzys has joined #lisp
dddddd has joined #lisp
kini has quit [Client Quit]
kini has joined #lisp
dented42 has joined #lisp
scymtym has quit [Ping timeout: 245 seconds]
Lycurgus has joined #lisp
Josh_2 has joined #lisp
vlatkoB_ has joined #lisp
vlatkoB has quit [Ping timeout: 252 seconds]
graphene has quit [Remote host closed the connection]
graphene has joined #lisp
<no-defun-allowed>
Woohoo, I think it's burnout time.
Bike has joined #lisp
kajo has joined #lisp
<beach>
no-defun-allowed: Are you working too hard?
<shrdlu68>
What does (space 3) really do? Is it "don't sacrifice speed for space"?
<shrdlu68>
I mean (space 0)
<shka_>
shrdlu68: not much :-)
<shka_>
in sbcl, it makes function more likely to be inlined
<shka_>
other then that, i don't know
<Bike>
it means "space [usage] is extremely important". implementations can decide what that means variously
<phoe>
space 0 means "don't care for space in the slightest"
<phoe>
space 3 means "the resulting code is meant to be as small as possible"
<Bike>
space means "both code size and run-time space" according to the standard
<Bike>
i mean
<Bike>
they're 'all kinda vague
<phoe>
in particular (optimize (speed 3) (space 0) (debug 0) (safety 0) (compilation-speed 0)) means "sacrifice everything for speed"
<phoe>
that's the setting everyone is the most interested in for some weird reason
<shka_>
*weird reason* :P
<shrdlu68>
(compilation-speed)? Why would that produce faster code?
<Bike>
compilation-speed 0 is telling the compiler to take its time
<Bike>
so it can maybe do more optimizations
<shrdlu68>
Oh.
<shrdlu68>
What's the default?
<Bike>
implementation-defind, i think
froggey has quit [Ping timeout: 252 seconds]
scymtym has joined #lisp
froggey has joined #lisp
skeuomorf has quit [Ping timeout: 252 seconds]
cydork has quit [Quit: WeeChat 2.2]
mkolenda has quit [Remote host closed the connection]
mkolenda has joined #lisp
<phoe>
compilation-speed 0 is SBCL, compilation-speed 3 is CCL
<phoe>
/s
warweasle has joined #lisp
<shka_>
sbcl compilation-speed is acceptable
<phoe>
I know, I'm just being silly
<Shinmera>
And it's improved a lot recently thanks to Stas
<phoe>
Yep - especially regarding Ironclad that was famous for taking way too long to compile
<phoe>
There were fixes both in Ironclad and in SBCL to improve that situation, and the SBCL fixes actually helped all of SBCL compilation speeds
<scymtym>
yeah, we heavily optimized the register allocator more or less specifically for ironclad. dougk, stas and myself worked on it
<beach>
What is special about Ironclad?
<Bike>
huge functions that do a lot of arithmetic
<scymtym>
it uses macros to generate large functions
<beach>
I see.
<Bike>
it's pretty slow to compile even in general
<scymtym>
and i suspect large chunks of straight-line code and thus large basic blocks or something like that in addition to just large in general
<russellw>
a function can return two values using VALUES. but is it considered okay to return two values on one path and one value on another? Or is it required or recommended that if a function ever returns two values, it should always do so?
<Bike>
i find it confusing, but it's allowed
<Bike>
i usually just manually write out the implied NILs
<shka_>
russellw: returning fixed number of values is a better idea
SenasOzys has quit [Read error: Connection reset by peer]
<Bike>
might also be easier to optimize if the number of values is fixed.
SaganMan has quit [Quit: WeeChat 1.6]
<russellw>
so not required, but recommended? olay, thanks!
jsjolen has joined #lisp
dented42 has quit [Ping timeout: 252 seconds]
Essadon has joined #lisp
jsjolen has quit [Remote host closed the connection]
jsjolen has joined #lisp
hellosaw has joined #lisp
jsjolen has quit [Remote host closed the connection]
jsjolen has joined #lisp
Lycurgus has quit [Quit: Exeunt]
shrdlu68 has quit [Quit: WeeChat 2.0.1]
kajo has quit [Quit: From my rotting body, flowers shall grow and I am in them and that is eternity. -- E. M.]
<jsjolen>
I'm debugging some code running in SBCL. At some point there's a type mismatch from a DECLARE, does anyone know if it's possible to receive more info about what DECLARE it's from (like what variable it pertains to)?
angavrilov has quit [Remote host closed the connection]
<Bike>
what message are you getting?
<jsjolen>
The value 3 is not of type (SIMPLE-ARRAY (UNSIGNED-BYTE 8) (*))
<jsjolen>
And the call-stack doesn't reveal a lot (a single call to a fast-method)
<Bike>
you can get more info by throwing a (declare (optimize debug)) in there somwhere. if you paste what you're seeing i might be able to untangle it, too
<jsjolen>
I did do a SB-EXT:restrict-compiler-policy before doing an ASDF:compile-system (and I'm fairly certain that the system does not do that itself)
<jsjolen>
Alright, I manually commented out all of the declares, now I get that it's a call to LENGTH at least.
<jsjolen>
Aha, I got it.
<beach>
I just love those error messages. They are so ... unhelpful.
dented42 has joined #lisp
<_death>
(defun helpfulify (error-message) (string-append error-message "; and by the way, your shoe laces are untied."))
<jsjolen>
_death: Jokes on you, I'm wearing sandals with socks
flazh has quit [Ping timeout: 268 seconds]
<_death>
but that means your shoe's laces are likely untied indeed
<Shinmera>
beach: What would be more helpful to say about a type mismatch?
<jsjolen>
Only if you use classic logic
<_death>
jsjolen: well, aside from vacuous truth.. it may be that it's the shoe not worn ;)
steiner has quit [Remote host closed the connection]
<jsjolen>
_death: Good point
Roy_Fokker has joined #lisp
flazh has joined #lisp
<jsjolen>
There are 2 CL implementations of HMMs on Github. One is large, well-featured and fast but I can't get it to work and the other one doesn't implement learning. I might give up on making the first one work and write my own, but that'd just be: https://xkcd.com/927/
<Josh_2>
jsjolen: nah that would just be the lisp way, apparently we like to reinvent the wheel *hmm*
<Shinmera>
My wheel's better than yours
<shka_>
Shinmera: actually your wheels are pretty good
<Shinmera>
Thanks
<shka_>
;-)
<Shinmera>
Working on lockless wheels recently
<Shinmera>
so, new wheels on quicklisp soon
<jsjolen>
Josh_2: Yeah, only issue is that implementing the algorithms is really boring haha. Hey, I've got them in Java, maybe I should just use ABCL? inb4 now I've got 2 problems
<shka_>
you made something like trivial-atomics recently?
<Shinmera>
No
<Shinmera>
Not gonna try either, all I need is CAS on svref and slot accessors.
<shka_>
ok
igemnace has joined #lisp
_whitelogger has joined #lisp
dented42 has quit [Ping timeout: 245 seconds]
flazh has quit [Read error: Connection reset by peer]
flazh has joined #lisp
<beach>
Shinmera: The argument <name> was supposed to contain a <type> but it contains a <type> instead.
emma_ has joined #lisp
<hellosaw>
hi, do any of you know how to connect to multiple mysql databases using mito?
slyrus2 has joined #lisp
dented42 has joined #lisp
elderK has quit [Quit: Connection closed for inactivity]
<|3b|>
always nice when text looks better than the lines :)
<jackdaniel>
haha
<jackdaniel>
yeah
Iolo has left #lisp ["Konversation terminated!"]
ggole has quit [Quit: ggole]
knicklux has quit [Remote host closed the connection]
r1b has joined #lisp
bendersteed has quit [Quit: bye]
zxcvz has quit [Quit: Leaving]
vlatkoB_ has quit [Remote host closed the connection]
megeve has left #lisp [#lisp]
vlatkoB has joined #lisp
anewuser has quit [Quit: anewuser]
dented42 has quit [Ping timeout: 252 seconds]
kajo has joined #lisp
serichsen has joined #lisp
<serichsen>
good evening
doubledup has joined #lisp
buffergn0me has quit [Remote host closed the connection]
thinkpad has quit [Ping timeout: 268 seconds]
thinkpad has joined #lisp
vlatkoB has quit [Remote host closed the connection]
buffergn0me has joined #lisp
<phoe>
heyy
robotoad has quit [Quit: robotoad]
robotoad has joined #lisp
<shka_>
what's going on?
bacterio has quit [Quit: bacterio]
jcowan has joined #lisp
<jcowan>
It seems that value the expression (eql #c(2.0 1.0) #c(2.0 1)) is implementation-dependent. Is this the result of bugs or an allowed divergence?
<Bike>
"Two complex numbers are considered to be eql if their real parts are eql and their imaginary parts are eql"
Lycurgus has joined #lisp
<Bike>
so i think no?
<|3b|>
what does (type-of #c(2.0 1)) say?
<jcowan>
The CLHS (under EQL) says: "[EQL returns true] If x and y are both numbers of the same type and the same value."
<jcowan>
And the definition of #c says that it does floating-point contagion.
<|3b|>
spec also says that r and i parts are either both real or both rational
<jcowan>
Bike's sentence comes from CLtLv2 6.3, so presumably is overridden by the ANS.
<|3b|>
so if there is an implementation extension for float+rational, they aren't EQL. if there isn't, they should both be float/float and probably same type so eql
<jcowan>
|3b|: yes, not supporting +inf, -inf, nan, and -0.0 is stupid nowadays
serichsen has quit [Ping timeout: 252 seconds]
<jcowan>
So clisp is out of spec here
<jcowan>
(because #C(2.0 1) and #c(2.0 1.0) are not eql)
<Bike>
are you running with clisp's ansi conformance flag?
<jcowan>
no
<Bike>
cos i just remembered it totally has such a thing
<trittweiler>
So this isn't about EQL at all but about #c and COMPLEX. I.e. an example where the definition of EQL kicks in would be: (eql (complex 1 0.5f0) (complex 1 0.5d0)) must be NIL
<jcowan>
But the -ansi flag doesn't help, eql still returns NIL
<trittweiler>
assuming single-float and double-float are distinct types. Can't remember if that's mandated by the standard
<jcowan>
No, it isn't.
<jcowan>
Only pairwise consistency is mandated
<Bike>
what if you mess with custom:*floating-point-contagion-ansi*
<jcowan>
Didn't know about that one
<Bike>
and floating-point-rational-contagion-ansi because so many flags
<jcowan>
the custom: flag doesn't change it either
themsay 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.]
<jcowan>
in short, Lispworks has 19-bit shorts but is otherwise normal, and clisp has 17-bit shorts and arbitrary precision longs.
r1b has quit [Quit: r1b]
<trittweiler>
That document doesn't seem to mention the assumed architecture (x86-64), perhaps that would be a useful addendum?
<fe[nl]ix>
trittweiler: IEEE floats should behave the same across architectures
<trittweiler>
Might also want to include a note about Emacs lisp which is quite a popular Lisp. That doesn't have a concept of different floats to begin with so it's sort of out of place but may still be worth a note given its pop
dented42 has joined #lisp
<jcowan>
trittweiler: Good idea
smaster has quit [Ping timeout: 252 seconds]
orivej has quit [Quit: orivej]
<|3b|>
fe[nl]ix: immediate short floats might depend on pointer size though
jcowan has quit [Quit: This computer has gone to sleep]
orivej has joined #lisp
<aeth>
you could try typep
<aeth>
(for clisp)
shka_ has quit [Ping timeout: 252 seconds]
<aeth>
(typep (complex 1f0 1f0) '(complex single-float)) => T
<aeth>
Shinmera: Good library. I might need to use it.
warweasle_afk has quit [Quit: rcirc on GNU Emacs 24.4.1]
angavrilov has quit [Remote host closed the connection]
knicklux has quit [Ping timeout: 246 seconds]
skeuomorf has joined #lisp
<Petit_Dejeuner>
Is there an equivalent to *nix access(2) in Common Lisp? I couldn't find anything in UIOP or the file I/O chapter in PCL. Is there some third party library I should be using?
Josh_2 has quit [Read error: Connection reset by peer]
dented42 has quit [Ping timeout: 264 seconds]
<Petit_Dejeuner>
I guess I'll try Osicat for now.
kajo has quit [Quit: From my rotting body, flowers shall grow and I am in them and that is eternity. -- E. M.]
marusich has quit [Ping timeout: 240 seconds]
kajo has joined #lisp
kajo has quit [Client Quit]
<LdBeth>
it about file permission
<fe[nl]ix>
Petit_Dejeuner: don't use it
<Petit_Dejeuner>
fe[nl]ix: Anything better?
<fe[nl]ix>
attempt to do whatever you're planning to do with the file and handle the errors
knicklux has joined #lisp
<Petit_Dejeuner>
...yeah, you're right.
<Petit_Dejeuner>
Thanks.
* Petit_Dejeuner
deletes 20 loc and a dependency
zxcvz has joined #lisp
robotoad has quit [Max SendQ exceeded]
robotoad has joined #lisp
groovy2shoes has quit [Read error: Connection reset by peer]
Elon_Satoshi has joined #lisp
emaczen has quit [Ping timeout: 260 seconds]
Copenhagen_Bram has quit [Ping timeout: 260 seconds]
<nyingen_>
I have a situation where a lib I installed via quicklisp is not working and needs to be patched. I can see where QL installed it
<on_ion>
~/quicklisp/ ?
<nyingen_>
If I modify that code, how do I make sure the lisp system compiles and uses that new version
<|3b|>
just loading it again probably will do that
<Bike>
quicklisp won't download a system again unless it's updated.
<nyingen_>
To be clear, my project depends on library A which depends on library B, and B is the one that needs the patch
<|3b|>
right, ASDF handles loading for QL, and recompiles when files are modified
<nyingen_>
ok
<nyingen_>
so (ql:quickload "library-a") would do it?
<|3b|>
probably better to put a temporary copy in ~/quicklisp/local-projects/ and modify that though
<|3b|>
right, or load your project if it has proper dependencies
dented42 has quit [Ping timeout: 246 seconds]
<nyingen_>
right, I didn't use quickproject this time because I thought it would be a small one-off
<nyingen_>
So to put the local copy in ~/quicklisp/local-projects, I just use 'cp' as normal? Or do I need to tell QL to do it somehow?
<nyingen_>
I know almost nothing about QL so feel free to point me to the relevant docs if these are simple questions :)
<|3b|>
cp or a git checkout or whatever (in case it is fixed already upstream)
<nyingen_>
ah, I should check that
<nyingen_>
QL doesn't pull from git, it has its own repo, right?
<nyingen_>
and once I have it in local-projects/ do I need to do something special to make QL use that one?
<|3b|>
right, it gets current code (for some project-dependent definition of current) every month, and that's what you get all month
Pixel_Outlaw has joined #lisp
<|3b|>
possibly (ql:register-local-projects) after making the copy if it doesn't see it immediately, but ql loads things from local-projects before the things it downloads
<|3b|>
'current' might mean 'git head', or 'release tarball', or specific branch from git or whatever
<nyingen_>
I see
<nyingen_>
The lib I need to patch hasn't been updated in some years by the looks of it
<|3b|>
what lib?
<on_ion>
|3b|: that is what i do, but a symbolic link in ~/ql/l-p
<nyingen_>
|3b|: this would be 'chillax', a lib for communicating with CouchDB
<|3b|>
ah
<|3b|>
author of that stopped using CL i think :(
<nyingen_>
Ah that's too bad
<on_ion>
no one stays in the temple forever =)
<on_ion>
except those whom teach others
<on_ion>
The Way
<nyingen_>
|3b|: well thanks for the tips. I'll give this a whirl later, and if it all works out I guess I'll fork the chillax lib since it sounds like it's probably unmaintained
<nyingen_>
in case anyone else is interested in it. it's a simple lib but I like the API
warweasle has joined #lisp
Josh_2 has quit [Quit: ERC (IRC client for Emacs 26.1)]