phoe changed the topic of #commonlisp to: Common Lisp, the #1=(programmable . #1#) programming language | Wiki: <https://www.cliki.net> | IRC Logs: <https://irclog.tymoon.eu/libera/%23commonlisp> | Cookbook: <https://lispcookbook.github.io/cl-cookbook> | Pastebin: <https://plaster.tymoon.eu/>
eddof13 has joined #commonlisp
mgl has quit [Ping timeout: 256 seconds]
zacque has joined #commonlisp
morganw has quit [Remote host closed the connection]
<mfiano> I just use iedit because I was bitten by the project-wide replace when I wasn't paying enough attention with Lisps many namespaces and all.
<Guest74> _death: thanks, that looks promising. At least it has multiple file search.  and it's built for emacs.  I'd probably write my own editor first.
<Guest74> Catie: mfiano: thanks, i should probably check out iedit incase I run into stuff.
<mfiano> Specifically, I use evil-multiedit, which uses iedit under the hood, but I doubt many people use evil-mode here.
<drbluefall> chuckles in Doom
lisp123 has joined #commonlisp
<Catie> I've only recently discovered iedit and I'm thoroughly in love
<Guest74> what's evil mode? I'm an emacs noob
<mfiano> Makes Emacs more like vim, with modal keybindings and vim-style text objects/motions/etc
karlosz has joined #commonlisp
<Guest74> ah, I can barely hold what little I know of emacs.  too much junk already in my brain.
<drbluefall> I'd personally suggest waiting until you have a solid grasp of Emacs until you try venturing out to `evil-mode`
lisp123 has quit [Ping timeout: 256 seconds]
Oladon has joined #commonlisp
<Guest74> that doesn't seem to make sense considering it makes emacs unlike emacs.
epolanski has quit [Quit: Connection closed for inactivity]
<drbluefall> And that's the catch
<drbluefall> You're basically turning Emacs into an entirely new editor
<mfiano> It does make sense when you realize how much elisp configuration is necessary when you add large highly configurable packages that affect the state of Emacs as a whole.
eddof13 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<mfiano> THat's where Doom Emacs comes in, which I used for a few years, but I prefer my own configuration over some of its opinionated things.
karlosz has quit [Ping timeout: 240 seconds]
<mfiano> (or Spacemacs for the brave adventurous souls out there)
<drbluefall> Spacemacs... oh man, Spacemacs.
<drbluefall> Just... not a fan of that.
<Guest74> yeah I can't stand using others configs.  I tend not to use anything unless I understand it.
akoana has joined #commonlisp
<drbluefall> I understand the appeal of handrolling a config from scratch, but Doom has basically been good enough for as long as I can remember, and where it hasn't been has usually been fixable via a little elisp-fu in my config.el.
bhyde[m] has quit [Ping timeout: 240 seconds]
<Guest74> I find it introduces more complexity.  Instead of just changing something that doesn't work for you, you have to figure out whether it's the default and how to change that or if it's something introduced by the config and have to change that.
<Guest74> Then again, i've never tried doom.  I just remember a horrible experience with portacle.
<drbluefall> For me, it serves as an abstraction.
<drbluefall> It's the same reason I use a framework like actix-web, or libraries like serde or blake3.
<drbluefall> I may not fully understand how they work, but they do the thing that I need them to do, and allow me to skip ahead to the thing I actually want to be making.
<drbluefall> Whether that be a login system or a decent editor config.
<drbluefall> Admittedly I've never tried Portacle.
<Guest74> I understand that's how most people work. I can't.  I'm a read the source not the manual kind of guy.
karlosz has joined #commonlisp
random-nick has quit [Ping timeout: 252 seconds]
<mfiano> I am with you there. The only thing worse than no documentation or comments is inconsistent documentation or comments.
bhyde[m] has joined #commonlisp
karlosz has quit [Ping timeout: 256 seconds]
Everything has joined #commonlisp
kevingal has quit [Remote host closed the connection]
lisper29 has quit [Quit: Leaving]
azimut_ has joined #commonlisp
igemnace has quit [Remote host closed the connection]
azimut has quit [Ping timeout: 240 seconds]
igemnace has joined #commonlisp
VincentVega has quit [Ping timeout: 240 seconds]
igemnace has quit [Remote host closed the connection]
igemnace has joined #commonlisp
Oladon has quit [Quit: Leaving.]
thegreatcatadore has joined #commonlisp
igemnace has quit [Remote host closed the connection]
sukaeto has quit [Ping timeout: 250 seconds]
<Guest74> after using both i kinda wish there was something that mixed iedit and deadgrep.  Though i do see how iedit could easily go wrong.
sukaeto has joined #commonlisp
ssafar has quit [Ping timeout: 252 seconds]
ssafar has joined #commonlisp
igemnace has joined #commonlisp
thegreatcatadore has quit [Quit: thegreatcatadore]
thegreatcatadore has joined #commonlisp
lisp123 has joined #commonlisp
lisp123 has quit [Ping timeout: 252 seconds]
akoana has quit [Quit: leaving]
NotThatRPG has quit [Ping timeout: 240 seconds]
NotThatRPG has joined #commonlisp
<_death> I don't know iedit, but I use multiple-cursors.. if you want to do it more carefully you can query-replace
<Guest74> does the multiple-cursors work in the deadgrep buffer?  I just noticed they had an option to directly edit in it.
NotThatRPG has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<_death> in the deadgrep buffer, you can M-x deadgrep-edit-mode, do your changes in that buffer, then M-x deadgrep-mode to switch back.. it sure could use some improvements though
<_death> anyway, this is offtopic, and I should go to sleep ;)
Inline__ has joined #commonlisp
NotThatRPG has joined #commonlisp
Inline has quit [Ping timeout: 250 seconds]
igemnace has quit [Remote host closed the connection]
igemnace has joined #commonlisp
NotThatRPG has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<Guest74> yes, I mentioned the option to edit in the buffer. Get some sleep :)
<Guest74> and thanks for bringing up the tool.
igemnace has quit [Remote host closed the connection]
NotThatRPG has joined #commonlisp
igemnace has joined #commonlisp
NotThatRPG has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
NotThatRPG has joined #commonlisp
zacque has quit [Quit: Goodbye :D]
hashfunc569 has joined #commonlisp
<hashfunc569> i'm not quite sure what's wrong with this type specifier ... (my-var nil :type (list (cons symbol package)) :read-only t)
<Bike> list is not a type specifier
<hashfunc569> ah ok, so it should be two conses?
<hashfunc569> i'll give it a try
<hashfunc569> ok this works ... (my-var nil :type (cons (cons symbol package)) :read-only t)
Bike has quit [Quit: Connection closed]
terrorjack has quit [Quit: The Lounge - https://thelounge.chat]
terrorjack has joined #commonlisp
mon_aaraj has quit [Ping timeout: 240 seconds]
mon_aaraj has joined #commonlisp
vats has quit [Ping timeout: 256 seconds]
mzan has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
thegreatcatadore has quit [Quit: thegreatcatadore]
mzan has joined #commonlisp
<beach> Good morning everyone!
lisp123 has joined #commonlisp
lisp123 has quit [Ping timeout: 252 seconds]
semz_ has joined #commonlisp
semz has quit [Ping timeout: 256 seconds]
s-liao has joined #commonlisp
tyson2 has quit [Remote host closed the connection]
semz_ is now known as semz
euandreh has quit [Ping timeout: 250 seconds]
s-liao has quit [Ping timeout: 256 seconds]
s-liao has joined #commonlisp
euandreh has joined #commonlisp
waleee has quit [Ping timeout: 250 seconds]
notzmv has quit [Ping timeout: 252 seconds]
Giovanni has quit [Remote host closed the connection]
s-liao has quit [Quit: Client closed]
Oladon has joined #commonlisp
hashfunc569 has quit [Ping timeout: 240 seconds]
karlosz has joined #commonlisp
lisp123 has joined #commonlisp
shka has joined #commonlisp
lisp123 has quit [Ping timeout: 240 seconds]
vats has joined #commonlisp
Oladon has quit [Quit: Leaving.]
pillton has joined #commonlisp
aartaka has joined #commonlisp
notzmv has joined #commonlisp
lisp123 has joined #commonlisp
nature has joined #commonlisp
lisp123 has quit [Ping timeout: 256 seconds]
Andrew has left #commonlisp [WeeChat 3.4]
Devon has quit [Ping timeout: 252 seconds]
shka has quit [Ping timeout: 252 seconds]
MajorBiscuit has joined #commonlisp
s-liao has joined #commonlisp
amb007 has quit [Ping timeout: 250 seconds]
amb007 has joined #commonlisp
mgl has joined #commonlisp
s-liao has quit [Quit: Client closed]
s-liao has joined #commonlisp
perrierjouet has quit [Quit: WeeChat 3.4]
Dynom has joined #commonlisp
attila_lendvai has joined #commonlisp
sander has quit [Ping timeout: 240 seconds]
perrierjouet has joined #commonlisp
s-liao has quit [Quit: Client closed]
vats has quit [Ping timeout: 252 seconds]
s-liao has joined #commonlisp
katco has quit [Quit: You have been kicked for being idle]
russe`` has joined #commonlisp
russe` has quit [Remote host closed the connection]
lisp123 has joined #commonlisp
Major_Biscuit has joined #commonlisp
MajorBiscuit has quit [Ping timeout: 240 seconds]
lisp123 has quit [Ping timeout: 252 seconds]
szkl has quit [Quit: Connection closed for inactivity]
s-liao has quit [Ping timeout: 256 seconds]
s-liao has joined #commonlisp
rain3 has joined #commonlisp
cosimone has joined #commonlisp
Cymew has joined #commonlisp
lisp123 has joined #commonlisp
taiju-sub has joined #commonlisp
<jackdaniel> svg backend for mcclim is coming along - here a png image used as the ink for a rectangle and a circle: http://turtleware.eu/static/paste/25c45b52-foo.svg
<lisp123> jackdaniel: wooo! great stuff
<lisp123> Once that's done, Lisp will take over the world!
<jackdaniel> I have my doubts, but I'm sure that I'll be proud of myself
<jackdaniel> I've already finished the first and the second 90% of the tutorial, what is left is the last 90%
s-liao has quit [Quit: Client closed]
<lisp123> Is this the backend tutorial?
<jackdaniel> yes and no - this tutorial focuses on "output-only" backends with recording and stuff
s-liao has joined #commonlisp
<lisp123> Understood
<jackdaniel> the second tutorial will be about adding input handling for an interactive backend
<lisp123> Its a tricky one because one kinda needs to re-implement the command loop
<lisp123> Since most current GUI backends are based on callbacks
<lisp123> So need to add that overlay
<jackdaniel> no, it is enough to implement input handling - McCLIM implements the command loop based on that
<lisp123> I see
<jackdaniel> it is similar with drawing backends - it is enough to implement drawing operations (and transformations), recording is implemented by higher abstractions
<lisp123> I see. So the amount of operations to implement in a backend isn't too big?
<jackdaniel> yes, if you want to do a poor job (i.e without handling non-uniform inks and line styles) then a drawing backend is around 150 loc
<lisp123> Oooh nice.
<jackdaniel> as of the input - probably comparable.
<jackdaniel> but if you want to polish it then the amount of code grows
<jackdaniel> either way that's why I'm writing it in a form of a tutorial, to give an understanding of how things work out together
<jackdaniel> (and what is needed)
<beach> jackdaniel: Looks great! Congratulations!
<jackdaniel> thanks, but this is still not finished. as I've said I'm working on the third 90% of the tutorial :)
s-liao has quit [Quit: Client closed]
<beach> Sure. Still, progress is good.
<lisp123> Waiting eagerly for the tutorial :)
<jackdaniel> if you want I may exploit you to proof read it before I publish it
<lisp123> Sure thing
<jackdaniel> OK, I'll contact you when I have finished the initial draft
<jackdaniel> thanks
<lisp123> Great! Thanks
igemnace has quit [Quit: WeeChat 3.4]
aartaka has quit [Ping timeout: 256 seconds]
lisp123 has quit [Remote host closed the connection]
kevingal has joined #commonlisp
tyson2 has joined #commonlisp
kevingal has quit [Ping timeout: 250 seconds]
kevingal has joined #commonlisp
mfiano has quit [Quit: WeeChat 3.4]
vats has joined #commonlisp
mfiano has joined #commonlisp
yewscion has joined #commonlisp
mfiano has quit [Client Quit]
mfiano has joined #commonlisp
thegreatcatadore has joined #commonlisp
amb007 has quit [Ping timeout: 256 seconds]
thegreatcatadore has quit [Client Quit]
amb007 has joined #commonlisp
livoreno has quit [Ping timeout: 252 seconds]
thegreatcatadore has joined #commonlisp
rotateq has joined #commonlisp
X-Scale` has joined #commonlisp
X-Scale has quit [Ping timeout: 256 seconds]
X-Scale` is now known as X-Scale
frgo has quit [Ping timeout: 272 seconds]
vats has quit [Ping timeout: 252 seconds]
aartaka has joined #commonlisp
random-nick has joined #commonlisp
lisp123 has joined #commonlisp
lisp123 has quit [Ping timeout: 252 seconds]
razetime has joined #commonlisp
v88m has joined #commonlisp
v88m has quit [Ping timeout: 252 seconds]
pillton has quit [Quit: ERC (IRC client for Emacs 27.2)]
amb007 has quit [Ping timeout: 240 seconds]
amb007 has joined #commonlisp
aartaka has quit [Ping timeout: 240 seconds]
aartaka has joined #commonlisp
aartaka has quit [Read error: Connection reset by peer]
aartaka has joined #commonlisp
wacki has joined #commonlisp
<Guest74> is there a better/nicer way to do this unsigned to signed conversion? https://pastebin.com/KLbrzAeN
<Guest74> besides replacing the expt with a case
<beach> Add or subtract (ash 1 (1- size)) or something like that.
<beach> plus or minus 1. I didn't do the detailed calculation.
<beach> Maybe (ash 1 size).
<Guest74> to replace the expt part?  but that gives me all 0s after the leading 1.
<Guest74> oh, i see ash then minus 1?
<beach> Not to replace the expt. For the entire calculation.
<Guest74> then I don't see how that works.
<beach> So if size is (say) 4 and you have 1000 (which is -8 or 8 then you can add or subtract 16 which is (ash 1 4).
Bike has joined #commonlisp
<kakuhen> why not something like (logior integer (- (mask-field (byte 1 (1- size)) integer)))
<Guest74> oh, because lisp.  I wonder if the compiler is smart about that.
<beach> kakuhen: Because that is more complicated than what I suggest?
<splittist> Or, even worse https://plaster.tymoon.eu/view/2986
<kakuhen> beach: if it wasnt clear, i was responding to his original question, not your suggestion
<beach> kakuhen: It was clear. But why make it so complicated?
<Guest74> that's way more expensive than what i wrote!
<Xach> Guest74: I usually use (dpb int (byte size 0) -1)
<Xach> I find it easier to read - I don't know how the compiler treats it.
<Guest74> that makes sense
s-liao has joined #commonlisp
igemnace has joined #commonlisp
Algernon69 has joined #commonlisp
<Guest74> it certainly get's the smallest assembly on sbcl.
<Guest74> Was wondering about this after reading the paper posted the other day about optimizations in sbcl.
<Xach> I think Xof showed me that formulation 15-ish years ago
<Guest74> and i think he wrote the paper? anyways, thanks for passing on the knowledge.
Everything has quit [Quit: leaving]
<Guest74> it seems so obvious now.
<splittist> Looks like one instruction on the CADR (putting big-ints to one side...)
<splittist> (Or something)
<Guest74> though the logbitp part still seems unnecessarily expensive.
VincentVega has joined #commonlisp
thegreatcatadore has quit [Quit: thegreatcatadore]
<beach> So nobody likes my solution. Oh well.
<Guest74> I don't recall anybody saying that.
<beach> Since two's complement is just a wraparound, the most natural thing to do is to subtract 2^size which is (ash 1 size)
<Guest74> I'm not sure compilers go by what is natural.
<Guest74> I can't wrap my head around the disassemblies of ash and dpb, so I guess I'll have to test.
<beach> Oh, you want performance? What can be cheaper than a shift and a subtract?
<Guest74> I guess we will find out.  I they put more effort into the log fns and dpb and less into making ash smart.
<Guest74> s/i they/i think they/
lisp123 has joined #commonlisp
<edgar-rft> Guest74: As far as I know in Lisp "signed" and "unsigned" are just integer ranges. If you have a fixed bit-width it might an option to store the (expt 2 (1- size)) offset in some variable and then just add and subtract the offset with the respective values.
<Guest74> Yes, that's what I meant by replacing it with a case.
lisp123 has quit [Ping timeout: 250 seconds]
<Guest74> which might end up being the fastest, but ugliest if combined with beach's
<edgar-rft> fast low-level code usually *is* ugly as hell :-)
<Guest74> I was hoping for something pretty the compiler knew what to do with.
<Guest74> as is, the one from xof takes about 2/3 the processing.
aartaka has quit [Read error: Connection reset by peer]
aartaka has joined #commonlisp
aartaka has quit [Read error: Connection reset by peer]
aartaka has joined #commonlisp
v88m has joined #commonlisp
rain3 has quit [Quit: Leaving]
tyson2 has quit [Remote host closed the connection]
rgherdt__ has joined #commonlisp
rgherdt_ has quit [Ping timeout: 240 seconds]
<Guest74> well, I don't know how I was testing, but beach: had the fastest even without optimizations, adding a case made it maybe 5% faster. And surprisingly mine was faster than the dpb.  So maybe there needs to be some declarations in there.  However all the declarations I could think of made little to no difference.
<Guest74> and the logbitp part still takes the most amount of time.
triffid has quit [Remote host closed the connection]
<Guest74> in fact, almost all the time.  So need a better way to test if it's negative.
triffid has joined #commonlisp
vats has joined #commonlisp
<beach> Guest74: check whether it is greater than or equal to (ash 1 (1- size))
<Guest74> that makes sense
Algernon69 has quit [Read error: No route to host]
<beach> Whew!
<Guest74> nah, makes it slower than logbitp
Algernon69 has joined #commonlisp
patrice has joined #commonlisp
waleee has joined #commonlisp
tyson2 has joined #commonlisp
v88m has quit [Ping timeout: 240 seconds]
v88m has joined #commonlisp
shka has joined #commonlisp
yewscion has quit [Ping timeout: 256 seconds]
mon_aaraj has quit [Ping timeout: 256 seconds]
s-liao has quit [Quit: Client closed]
v88m has quit [Ping timeout: 256 seconds]
v88m has joined #commonlisp
<Xach> Guest74: you will get very different code with constants instead of a variable size
patrice has quit [Quit: Leaving]
mon_aaraj has joined #commonlisp
hashfunc569 has joined #commonlisp
<Guest74> yeah, I've been thinking about that if I wanted less generic functions. just like in assembling int8s into large sizes.  rather keep it small and generic for now.
rgherdt_ has joined #commonlisp
lisp123 has joined #commonlisp
rgherdt__ has quit [Ping timeout: 252 seconds]
rotateq has quit [Remote host closed the connection]
lisp123 has quit [Ping timeout: 268 seconds]
mon_aaraj has quit [Ping timeout: 250 seconds]
mon_aaraj has joined #commonlisp
Algernon91 has joined #commonlisp
Algernon69 has quit [Read error: Connection reset by peer]
Giovanni has joined #commonlisp
<Guest74> The dpb does become the fastest with constants and mine seems to get slower.  Also seems weird that mine get's faster the more it's run, till it's not much different than beach's, but the other don't really change besides normal variance with benchmarking, no matter the benchmark.  Which I guess at this point means it doesn't matter for the
<Guest74> generic case.
cosimone has quit [Read error: Connection reset by peer]
cosimone has joined #commonlisp
Algernon91 has quit [Read error: Connection reset by peer]
Oladon has joined #commonlisp
Algernon69 has joined #commonlisp
<Guest74> welp, now I have nothing to distract me from trying to figure out which unfinished library to work on.
yewscion has joined #commonlisp
attila_lendvai has quit [Ping timeout: 252 seconds]
eddof13 has joined #commonlisp
hashfunc569 has quit [Ping timeout: 260 seconds]
tyson2 has quit [Remote host closed the connection]
aeth has quit [Ping timeout: 250 seconds]
aeth has joined #commonlisp
jack_rabbit has quit [Quit: ZNC 1.8.2 - https://znc.in]
Giovanni has quit [Read error: Connection reset by peer]
Giovanni has joined #commonlisp
Giovanni has quit [Read error: Connection reset by peer]
Giovanni has joined #commonlisp
waleee has quit [Ping timeout: 260 seconds]
Algernon69 has quit [Read error: Connection reset by peer]
Algernon91 has joined #commonlisp
livoreno has joined #commonlisp
v88m has quit [Ping timeout: 252 seconds]
Algernon69 has joined #commonlisp
v88m has joined #commonlisp
yewscion has quit [Quit: Connection closed]
Algernon91 has quit [Read error: Connection reset by peer]
v88m has quit [Ping timeout: 256 seconds]
v88m has joined #commonlisp
lisp123 has joined #commonlisp
aartaka has quit [Read error: Connection reset by peer]
aartaka has joined #commonlisp
v88m has quit [Ping timeout: 245 seconds]
lisp123 has quit [Ping timeout: 252 seconds]
v88m has joined #commonlisp
Oladon has quit [Quit: Leaving.]
mon_aaraj has quit [Ping timeout: 240 seconds]
szkl has joined #commonlisp
yewscion has joined #commonlisp
razetime has quit [Ping timeout: 250 seconds]
mon_aaraj has joined #commonlisp
Cymew has quit [Ping timeout: 250 seconds]
wacki has quit [Quit: Leaving.]
Algernon69 has quit [Read error: Connection reset by peer]
Algernon69 has joined #commonlisp
NotThatRPG has quit [Quit: Textual IRC Client: www.textualapp.com]
Algernon69 has quit [Ping timeout: 252 seconds]
Giovanni has quit [Remote host closed the connection]
Giovanni has joined #commonlisp
Major_Biscuit has quit [Quit: WeeChat 3.4]
Giovanni has quit [Ping timeout: 250 seconds]
Giovanni has joined #commonlisp
tane has joined #commonlisp
tane has joined #commonlisp
tane has quit [Changing host]
eddof13 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
frgo has joined #commonlisp
rogersm has joined #commonlisp
cosimone has quit [Read error: Connection reset by peer]
ec has joined #commonlisp
Oladon has joined #commonlisp
v88m has quit [Ping timeout: 252 seconds]
aeth has quit [Ping timeout: 250 seconds]
morganw has joined #commonlisp
aeth has joined #commonlisp
<Oladon> Wharrgarbl.
Algernon69 has joined #commonlisp
<jasom> Guest74: which conversion are you trying to do?
kevingal has quit [Remote host closed the connection]
<jasom> I think (dpb int (byte size 0) -1) only works if int is known to be negative?
lisp123 has joined #commonlisp
Algernon69 has quit [Ping timeout: 268 seconds]
<Guest74> jasom: all the ones discussed only work if it's negative. Do you know of a way that doesn't?
<jasom> kakuhen's works for all values
<jasom> (logior integer (- (mask-field (byte 1 (1- size)) integer)))
lisp123 has quit [Ping timeout: 250 seconds]
ec has quit [Quit: ec]
<Guest74> i've only been testing random negative numbers. I'm sure that would slow stuff down a bit if there was a lot of positives.
<jasom> Guest74: I suspect it's faster because of the lack of branching
<Guest74> I'm rewriting to test with positives.
<jasom> if "size" is a constant and byte is small enough, it works out to two instructions
<Guest74> if lisp compilers are aware of how to transform it.
<jasom> er 3 instructions rather
<jasom> SBCL does zero smart transforms and it's 3 instructions; RAX <- #x10000000; NEG RAX; OR RDx, RAX
<jasom> that was for 32-bit on a 64-bit machine; I suspect 64-bits would be smarter
<Guest74> if you specify the size before hand.
<jasom> If you don't specify the size before hand then you're going to get really slow code in general; it will need to handle bignums properly
<jasom> so in that case, checking the sign-bit will win just because the vast amount of extra work you are doing by not knowing if you need a bignum or not
<Guest74> so i didn't bother changing the data and just checked with negatives and it comes out the slowest.
<jasom> and for that case, it might be good to have a fixnum version and a non-fixnum version, as the fixnum version should be pretty fast and not need the bit check
<jasom> which can be done with a compiler macro
vats has quit [Ping timeout: 252 seconds]
<Guest74> That is fast with negatives when you know the size, biggest jump in performance when knowing the size.
<jasom> I'm not sure why it thinks it needs to check for overflow in that version; will be the biggest performance hit there probably (though when inlined will go away since it still fits in a machien word)
pranavats has left #commonlisp [Error from remote client]
<Guest74> that's very nice.  inlined it's almost twice as fast as beach's.
Algernon69 has joined #commonlisp
<Guest74> though I don't have declarations in the others.
<jasom> Hopefully you atleast have an optimize declaration?
amb007 has quit [Ping timeout: 256 seconds]
<jasom> That makes a *huge* difference on numeric code in SBCL
amb007 has joined #commonlisp
pranavats has joined #commonlisp
<Guest74> not even.  my dumb way to maybe see how other implementations might do.
<Guest74> I should probably boot one up sometime
cosimone has joined #commonlisp
wacki has joined #commonlisp
v88m has joined #commonlisp
<jasom> The naive way of doing it if you know it's negative is just to reverse the twos-complement definition (- (1+ (ash 1 size)) (lognot int))
<jasom> which I think is what beach suggested, with an off-by-one
<Guest74>  (- int (ash 1 size))
<jasom> right, I guess mine reduces to that
Algernon69 has quit [Ping timeout: 252 seconds]
<Guest74> though what you wrote doesn't compute properly.
kevingal has joined #commonlisp
<jasom> (- 0 (1+ (ash 1 size)) (lognot int))
<jasom> was missing a negation
ec has joined #commonlisp
<jasom> so (- (1+ (ash 1 size)) (lognot int))
<jasom> so (- (+ (1+ (ash 1 size)) (lognot int))_
<Guest74> you sure this time :)
* jasom can't type today
waleee has joined #commonlisp
<jasom> the last one was right after chainging _ to )
<Guest74> but it's not very pretty and only handles negatives.
ec has quit [Client Quit]
<Guest74> the kakuhen with declarations is nice. I might have to read up on that.
v88m has quit [Remote host closed the connection]
<Guest74> jasom: is kakuhen the right name/spelling?  I can't find anything
<jasom> │05:32:05 kakuhen | why not something like (logior integer (- (mask-field (byte 1 (1- size)) integer))) │ Brucio-61
<jasom> oops, over-selected but that's pasted right from my irc buffer
<Guest74> oh, it's an irc nick! and I had already tested it! without the declarations it's the slowest.
amb007 has quit [Ping timeout: 252 seconds]
amb007 has joined #commonlisp
<jasom> when you are benchmarking numeric code without declarations, you are basically testing how many function calls are made
<jasom> because fixnum operations are many times faster than the function call overhead
tyson2 has joined #commonlisp
Guest74 has quit [Quit: Ping timeout (120 seconds)]
Guest74 has joined #commonlisp
szkl has quit [Quit: Connection closed for inactivity]
Oladon has quit [Quit: Leaving.]
amb007 has quit [Read error: Connection reset by peer]
Guest74 has quit [Client Quit]
amb007 has joined #commonlisp
igemnace has quit [Ping timeout: 260 seconds]
Lord_of_Life has quit [Ping timeout: 245 seconds]
Lord_of_Life has joined #commonlisp
igemnace has joined #commonlisp
lisp123 has joined #commonlisp
lisp123 has quit [Ping timeout: 240 seconds]
cosimone has quit [Read error: Connection reset by peer]
ec has joined #commonlisp
yewscion has quit [Ping timeout: 252 seconds]
King_julian has joined #commonlisp
azimut_ has quit [Ping timeout: 240 seconds]
lisp123 has joined #commonlisp
Oladon has joined #commonlisp
lisp123 has quit [Ping timeout: 240 seconds]
Everything has joined #commonlisp
Giovanni has quit [Ping timeout: 250 seconds]
Giovanni has joined #commonlisp
aartaka has quit [Ping timeout: 240 seconds]
szkl has joined #commonlisp
cosimone has joined #commonlisp
aartaka has joined #commonlisp
Inline__ is now known as Inline
Dynom has quit [Quit: WeeChat 3.4]
wyrd has quit [Ping timeout: 240 seconds]
wyrd has joined #commonlisp
wacki has quit [Quit: Leaving.]
nature has quit [Ping timeout: 240 seconds]
tane has quit [Quit: Leaving]
shka has quit [Ping timeout: 256 seconds]
mgl has quit [Quit: Client closed]
Algernon69 has joined #commonlisp
Oladon has quit [Quit: Leaving.]
King_julian has quit [Ping timeout: 240 seconds]
Everything has quit [Quit: leaving]
Oladon has joined #commonlisp
Algernon69 has quit [Quit: Leaving]
orestarod has joined #commonlisp
morganw has quit [Remote host closed the connection]
ec has quit [Ping timeout: 240 seconds]
lisp123 has joined #commonlisp
lisp123 has quit [Ping timeout: 256 seconds]
beach` has joined #commonlisp
beach has quit [Ping timeout: 250 seconds]
igemnace has quit [Remote host closed the connection]
taiju-sub has quit [Ping timeout: 240 seconds]