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/>
waleee has quit [Ping timeout: 272 seconds]
waleee has joined #commonlisp
Inline has joined #commonlisp
perrierjouet has joined #commonlisp
lagash has quit [Ping timeout: 250 seconds]
karlosz has quit [Quit: karlosz]
lisp123 has joined #commonlisp
ec has quit [Quit: ec]
lisp123 has quit [Ping timeout: 252 seconds]
lagash has joined #commonlisp
random-nick has quit [Ping timeout: 272 seconds]
cjb has joined #commonlisp
morganw has quit [Remote host closed the connection]
eugercek has quit [Remote host closed the connection]
<qhong> Is there a way to develop distributed program using the usual image/repl-centric style?
<qhong> I know there's cl-mpi, but it sounds like one have to compile static binary and run with mpiexec -- basically like developing C
wmblathe_ is now known as wmblathers
<pillton> qhong: I don't think so. Your question is related to how do you serialize a closure?
<qhong> pillton: yes, I see. I know that some work exists on serializable closures, but they don't seem to intersect with any projects on distributed computing, so guess we're out of luck.
<White_Flame> obviously, pointers/references don't work over the network
<White_Flame> but when you're doing pure functional work, that actually doesn't matter and you can send everything without bothering referring to stuff on a particular machien
<pillton> qhong: I saw yesterday that Christian Queinnec looked at it. https://christian.queinnec.org/WWW/Distribution.html
<White_Flame> also, SLIME/SWANK is already a distributed model, and you could repl through any node you want
drakonis has quit [Quit: WeeChat 3.1]
<White_Flame> I've done a lot of heterogeneous distributed programming in lisp, and haven't found any lisp-specific barriers
<White_Flame> but distributed programming in general is much more difficult
<White_Flame> (in the "multithreading programming is hard!" sense)
<White_Flame> there's certain discipline & architectural design required to eliminate the problems. trying to treat it like a single-address space machine isn't usually the best facade to build
<pillton> White_Flame: I think "a great many" people would love to be able to do (slurm:start-batch (lambda () (format t "hello array job ~A.~%" slurm:*array-job*)) :array 1000).
<White_Flame> sure, and that literal form is easily done ;)
<White_Flame> since it doesn't close over anything
<qhong> White_Flame: Yes I can see swank could work. One will need to write some administrative program on top of it to make it work more pleasantly (e.g. slurm:start-batch), but I guess this is true for anything that can send stuff over the network
<qhong> And if given I have to invent some wheel, I'd prefer MPI because of performance benefit
<White_Flame> there's tons of styles of distributed programming. there's no silver bullet solution fo everyone
<White_Flame> so you'd have to describe what sort of stuff you're doing in order to get anything more specific
<pillton> White_Flame: Sure. I should have thought of a better example. Hopefully you get my point.
<qhong> I need to run the same loop on multiple processors, and each processors communicate via asynchronous message passing
<White_Flame> what does the loop need to reference?
<qhong> Only local data
<White_Flame> the loop body, specifically
<White_Flame> well then that's easy
<White_Flame> send a string with the lambda form to each node, read/compile it, and invoke it per parameter received over the wire
<White_Flame> or for some numeric range
<White_Flame> (as long as the parameters are simple, too)
<qhong> Yes I agree in principle it is easy, and can be written without much hassle using sockets. Socket is quite slow however comparing to "dedicated" HPC stuff
<White_Flame> if you can send the already-READ lambda s-expression across your networking, that'd be even more straightforward
<White_Flame> of course
<White_Flame> distributed computing only makes sense if the latency of issuing work is less than the computational time of the units of work
<White_Flame> (in whatever aggregate)
<qhong> Oh now I see, I can probably do this for MPI too. So the important idea is to broadcast S-expressions from the local REPL
<qhong> Then interactive development can somewhat work
<White_Flame> sure, you interact with the job dispatcher, and it deals with sending out messages to the compute farm slave boxes
Guest74 has joined #commonlisp
<White_Flame> and then there's a lot of load balancing, push vs pull, etc decisions there as well
<qhong> I'm less worried about the "in production" optimizations, I know they can be done. I just want to improve development experience, because the documented way of using cl-mpi is too inconvinient.
lottaquestions has joined #commonlisp
<Guest74> Sometimes I write stuff the way I want to, with the semantics I want, and then connect that to the underlying systems after.
<hashfunc1aa5> how do you abort something in the slime repl? when I C-c C-C (`slime-interrupt`) it interrupts the process, but a new empty prompt isn't given
<Guest74> that should pop up an sldb window.
attila_lendvai has quit [Ping timeout: 252 seconds]
<hashfunc1aa5> Guest74: C-c C-c does pop-up and sldb window. what i'm looking for is a way to start a new clean line in the repl
<hashfunc1aa5> like the behavior that C-c has in a terminal
<Guest74> Then you should read what's in the window.  Abort is an option.
<hashfunc1aa5> Guest74: thanks
<hashfunc1aa5> i didn't think it would be that simple
xsperry has quit [Remote host closed the connection]
<Guest74> np, i don't think I read anything in that window for a while either!
<Guest74> you can just press a and it will choose the closest abort, or something like that.
<hashfunc1aa5> one last slime question for the day: is there a way in slime to quickly navigate past commands? like something akin to C-r in a terminal?
<Guest74> M-p
<Guest74> meta is most likely bound to alt if you didn't change it.
<White_Flame> I always use q to dismiss sldb windows, whatever command that is
<hashfunc1aa5> M-p and M-n do cycle between the previous and next in the history. what i'm looking for is a way to 'search' the previous commands.
<hashfunc1aa5> like the behavior that C-r has in a terminal
<Guest74> ah, sorry.  I misread that.  didn't know terminals work like that.
<White_Flame> you can type a prefix and hit M-p, but you can also C-r in the repl to text seach, and hit enter on a previous command to bring it current
<etimmons> It's been a while since I used slime, but I think you're looking for M-r
<Guest74> that gives me a wrong type argument.
<hashfunc1aa5> Guest74: White_Flame: etimmons: thanks
<hashfunc1aa5> typing the prefix and issuing M-p is the best, i think
<White_Flame> and you can M-p/M-n through the prefix-matching history, too
<hashfunc1aa5> White_Flame: yeah, that's the feature i was looking for
<White_Flame> I would be surprised if there is a full non-prefix searcher as well somewhere, though
<White_Flame> *wouldn't
<Guest74> The only thing I'd add to my repl is the ability to save/pin something in the history.  Though with emacs there's probably already something like that.
occ has joined #commonlisp
<hashfunc1aa5> Guest74: actually... i'm still at a loss for aborting the current line
<Guest74> do you mean just clearing it?
<Guest74> like c-k?
<Guest74> c-a c-k i mean.
<Guest74> I'm not a big emacs user btw.
<hashfunc1aa5> what i'm looking for isn't to clear it, but to just start a new prompt
<Guest74> sorry, I don't understand.
<White_Flame> yeah, I know what you mean. You typed stuff you don't want to execute. But just go to the home and C-k it away
<White_Flame> (especially with paredit)
<hashfunc1aa5> White_Flame: i typed stuff that i don't want to execute, but i don't want to clear it either.
s-liao has joined #commonlisp
<hashfunc1aa5> maybe i'm not making any sense?
<Guest74> sometimes I want to keep some incomplete thing and I just press enter and abort whatever error pops up.  I'm not a sophisticated emacs user though.
<hashfunc1aa5> in a terminal i do this all the time:
<hashfunc1aa5> user@host:~$ asdf^C
<hashfunc1aa5> user@host:~$
<hashfunc1aa5> Guest74: that would work, but in the case where i want to avoid side-effects (be evaluating) and still keep what i typed that approach wouldn't work for me
<hashfunc1aa5> i could just make an emacs function for this. but i'd be surprised if slime didn't have something like this already built-in
karlosz has joined #commonlisp
<hashfunc1aa5> i found it
<hashfunc1aa5> give a prefix argument before you press RET
Bike has quit [Quit: Lost terminal]
<hashfunc1aa5> but that still doesn't eliminate the case where i want to avoid side-effects...
<White_Flame> another dumb hack would be to quote your form before pressing return :-P
<hashfunc1aa5> White_Flame: that right there is a good idea
<White_Flame> clutters up the output, though, by repeating it back to you
lisp123 has joined #commonlisp
<hashfunc1aa5> issuing a C-c C-o could hack that output away
<Guest74> so a repl should have a stash command.
Bike has joined #commonlisp
<hashfunc1aa5> i'm probably just trying to over-optimize my workflow
<hashfunc1aa5> i'll just leave it be. we figured it out enough
lisp123 has quit [Ping timeout: 272 seconds]
pranavats has left #commonlisp [Disconnected: Replaced by new connection]
pranavats has joined #commonlisp
specbot has quit [Remote host closed the connection]
minion has quit [Remote host closed the connection]
minion has joined #commonlisp
specbot has joined #commonlisp
karlosz has quit [Quit: karlosz]
ammer has joined #commonlisp
s-liao has quit [Quit: Client closed]
s-liao has joined #commonlisp
Bike has quit [Quit: Connection closed]
waleee has quit [Ping timeout: 240 seconds]
occ has quit [Ping timeout: 252 seconds]
<beach> Good morning everyone!
s-liao has quit [Quit: Client closed]
azimut has quit [Remote host closed the connection]
azimut has joined #commonlisp
pingpongball has joined #commonlisp
pingpongball has quit [Quit: Client closed]
cjb has quit [Quit: rcirc on GNU Emacs 29.0.50]
lisp123 has joined #commonlisp
s-liao has joined #commonlisp
alvaro121_ has joined #commonlisp
alvaro121 has quit [Ping timeout: 256 seconds]
semz_ has joined #commonlisp
semz has quit [Ping timeout: 250 seconds]
lisp123 has quit [Remote host closed the connection]
tyson2 has quit [Remote host closed the connection]
lisp123 has joined #commonlisp
lagash has quit [Ping timeout: 252 seconds]
lagash has joined #commonlisp
lisp123 has quit [Ping timeout: 272 seconds]
aartaka has joined #commonlisp
wyrd has quit [Remote host closed the connection]
wyrd has joined #commonlisp
semz_ is now known as semz
occ has joined #commonlisp
Inline has quit [Remote host closed the connection]
Inline has joined #commonlisp
occ has quit [Ping timeout: 252 seconds]
jealousmonk has quit [Quit: ERC 5.4.1 (IRC client for GNU Emacs 27.1)]
occ has joined #commonlisp
rotateq has quit [Ping timeout: 250 seconds]
aartaka has quit [Ping timeout: 252 seconds]
aartaka has joined #commonlisp
shka has joined #commonlisp
frgo has quit [Ping timeout: 252 seconds]
SR-71 has joined #commonlisp
hashfunc1aa5 has quit [Ping timeout: 240 seconds]
occ has quit [Ping timeout: 240 seconds]
sloanr has joined #commonlisp
occ has joined #commonlisp
karlosz has joined #commonlisp
aartaka has quit [Ping timeout: 252 seconds]
aartaka has joined #commonlisp
sloanr has quit [Ping timeout: 272 seconds]
occ has quit [Ping timeout: 272 seconds]
taiju` has joined #commonlisp
occ has joined #commonlisp
Cymew has joined #commonlisp
s-liao has quit [Quit: Client closed]
lisp123 has joined #commonlisp
lisp123 has quit [Ping timeout: 240 seconds]
ASau has quit [Remote host closed the connection]
Algernon69 has joined #commonlisp
taiju` has quit [Ping timeout: 240 seconds]
wacki has joined #commonlisp
parjanya has quit [Ping timeout: 252 seconds]
rogersm has quit [Ping timeout: 272 seconds]
karlosz has quit [Quit: karlosz]
pingpongball has joined #commonlisp
pingpongball has quit [Client Quit]
blacked has joined #commonlisp
MajorBiscuit has joined #commonlisp
blacked is now known as pingpongball
rotateq has joined #commonlisp
aartaka has quit [Ping timeout: 240 seconds]
aartaka has joined #commonlisp
occ has quit [Ping timeout: 240 seconds]
yagamisa1o is now known as newblue
pingpongball has quit [Quit: Client closed]
occ has joined #commonlisp
occ has quit [Ping timeout: 240 seconds]
perrierjouet has quit [Quit: WeeChat 3.4]
ammer has quit [Quit: WeeChat 2.8]
amb007 has quit [Ping timeout: 272 seconds]
amb007 has joined #commonlisp
rogersm has joined #commonlisp
occ has joined #commonlisp
newblue has quit [Changing host]
newblue has joined #commonlisp
perrierjouet has joined #commonlisp
aeth has quit [Ping timeout: 240 seconds]
aeth has joined #commonlisp
lisp123 has joined #commonlisp
<phoe> morning
<beach> Hello phoe.
<phoe> hey hi
amb007 has quit [Ping timeout: 272 seconds]
amb007 has joined #commonlisp
m5zs7k has quit [Read error: Connection reset by peer]
m5zs7k_ has joined #commonlisp
Dynom has joined #commonlisp
occ has quit [Ping timeout: 252 seconds]
MajorBiscuit has quit [Ping timeout: 252 seconds]
MajorBiscuit has joined #commonlisp
m5zs7k_ is now known as m5zs7k
lisp123 has quit [Remote host closed the connection]
pve has joined #commonlisp
frgo has joined #commonlisp
lisp123 has joined #commonlisp
scymtym has quit [Remote host closed the connection]
scymtym has joined #commonlisp
lisp123 has quit [Ping timeout: 240 seconds]
eugercek has joined #commonlisp
scymtym has quit [Ping timeout: 272 seconds]
parjanya has joined #commonlisp
cosimone has joined #commonlisp
scymtym has joined #commonlisp
notzmv has quit [Ping timeout: 240 seconds]
<SR-71> So, what are you guys working on?
* jackdaniel at the moment works on the motivation to do something productive :)
<SR-71> Why not start a project for fun.
<SR-71> You always learn something new.
<jackdaniel> you should see my local-projects directory
<moon-child> you should see mine
<moon-child> :)
<SR-71> I wish I orginized my local projects
<SR-71> They are everywhere
<mfiano> SR-71: There is #clprojects where a few of us talk about what we are working on.
<SR-71> That's cool
occ has joined #commonlisp
hobo_ has joined #commonlisp
<SR-71> While I was reading source of dogecoin, I had this idea.
hobo has quit [Ping timeout: 240 seconds]
<SR-71> Why not implement a coin in Lisp, just for fun
occ has quit [Client Quit]
<jackdaniel> (defun produce-coin (electricity) (values :pollution :fake-gold)) ;)
<SR-71> That would be a blast
<SR-71> At least I would have a reason to implement my own P2P network.
<moon-child> SR-71: because cryptocurrencies tend to have detrimental effects on society, including extreme electricty use, vector for fascism, etc.
<moon-child> this includes those which were made 'just for fun', such as dogecoin
<moon-child> which, fwiw, has been disavowed by its creator for those exact reasons
pillton has quit [Quit: ERC (IRC client for Emacs 27.2)]
<jackdaniel> I've at least put a common lisp code to mask the political statement - some effort please
<SR-71> moon-child: Not to mention laundering and theft.
<SR-71> I was looking for a reason to implement my own P2P server and client... any reason.
<moon-child> it's hardly p2p if there is a server and separately a client :)
<jackdaniel> implement a torrent server, it will be useful for sharing data
<moon-child> anyway make an irc server
<SR-71> But, but there are already many.
<moon-child> I guarantee you there are more cryptocurrencies than irc servers
<moon-child> and none of the latter are in lisp
<SR-71> Oh really
<SR-71> That would be intresting
<moon-child> *is
<SR-71> An irc server in lisp, i wonder what would we call it?
<jackdaniel> ircl
<SR-71> ParenChat..
<SR-71> Or maybe something recursive
<SR-71> Like they did for Gnu and Linux
<edgar-rft> probably INTERNET-RELAY-CHAT-SERVER :-)
<SR-71> Yeah
<SR-71> That sounds appropriate.
<SR-71> But there should be some lispiness
<SR-71> like, maybe *INTERNET-RELAY-CHAT-SERVER*
<edgar-rft> that wold be more the name of a special variable
<SR-71> Yeah, that would look ugly
<SR-71> why not cl-irc
<SR-71> Wait
<SR-71> That's more like a channel name
<rotateq> there is a system named cl-irc
<SR-71> It's a IRC client liabrary
<SR-71> *an
attila_lendvai has joined #commonlisp
random-nick has joined #commonlisp
mepy has quit [Ping timeout: 272 seconds]
lisp123 has joined #commonlisp
lisp123 has quit [Ping timeout: 252 seconds]
patrice has joined #commonlisp
cosimone has quit [Ping timeout: 252 seconds]
cosimone has joined #commonlisp
blacked has joined #commonlisp
mon_aaraj has quit [Ping timeout: 252 seconds]
mon_aaraj has joined #commonlisp
tyson2 has joined #commonlisp
<Shinmera> I'm working on a 3d animation library this week, so I can hopefully finally import rigged models and fun stuff like that.
<Shinmera> or, maybe not library, but just a part of Trial.
s-liao has joined #commonlisp
<mfiano> Yeah, I think such a system would be too coupled to many other facets of an engine to be in any generally useful library form.
<mfiano> Maybe it could be done with a lot of thought, but I don't think that is what you want to be spending your time on when you have a game to make :)
<Shinmera> I'm on holidays
<Shinmera> but I probably won't bother, not because it's a hard challenge, but because I estimate even if I did do it people wouldn't actually use it.
Brucio-61 has joined #commonlisp
* mfiano spent a good few months designing an animation system that didn't even try to be generally useful.
<mfiano> Shinmera: I liked my "action list"-based animation system the best out of the few I tried. Have you looked into it before?
<Shinmera> yeah
<mfiano> Good, it just required a doubly-linked list and some creativity, instead of a full state machine with bugs galore.
clos-encounters has quit [Remote host closed the connection]
<Shinmera> to be clear I'm not talking about a system to handle transitions between animations or queueing and all that (yet). I'm talking about the low level stuff of getting a rigged model to work.
<mfiano> Ah fair enough. Luckily glTF handles most of that
<Shinmera> it "handles" storage
<Shinmera> which is the small part.
<mfiano> I see what you mean. Especially if you are integrating it with your physics subsystem.
<Shinmera> Wish I had one of those
s-liao has quit [Ping timeout: 256 seconds]
notzmv has joined #commonlisp
s-liao has joined #commonlisp
blacked is now known as pingpongball
MajorBiscuit has quit [Ping timeout: 252 seconds]
MajorBiscuit has joined #commonlisp
patrice has quit [Quit: Leaving]
s-liao has quit [Quit: Ping timeout (120 seconds)]
yewscion has joined #commonlisp
s-liao has joined #commonlisp
s-liao has quit [Client Quit]
s-liao has joined #commonlisp
s-liao has quit [Client Quit]
pingpongball has quit [Quit: Client closed]
lisp123 has joined #commonlisp
lisp123 has quit [Client Quit]
random-nick has quit [Ping timeout: 252 seconds]
patrice has joined #commonlisp
hobo_ is now known as hobo
<mfiano> If I set :adjustable t :fill-pointer t, is it mandated that implementations must set the fill pointer to the length of the array?
<phoe> clhs make-array
<phoe> "If fill-pointer is t, the length of the vector is used to initialize the fill pointer."
<phoe> seems that it is required, yes
Brucio-61 has quit [Ping timeout: 252 seconds]
<mfiano> Thank you
MajorBiscuit has quit [Ping timeout: 240 seconds]
random-nick has joined #commonlisp
MajorBiscuit has joined #commonlisp
aartaka has quit [Ping timeout: 252 seconds]
mepy has joined #commonlisp
treflip has joined #commonlisp
pjb has joined #commonlisp
rotateq has quit [Remote host closed the connection]
aartaka has joined #commonlisp
scymtym has quit [Ping timeout: 250 seconds]
mon_aaraj has quit [Ping timeout: 240 seconds]
attila_lendvai has quit [Ping timeout: 250 seconds]
mon_aaraj has joined #commonlisp
yewscion has quit [Ping timeout: 272 seconds]
Bike has joined #commonlisp
igemnace has quit [Quit: WeeChat 3.4]
tyson2 has quit [Ping timeout: 256 seconds]
tyson2 has joined #commonlisp
tyson2 has quit [Remote host closed the connection]
<dieggsy> I have an implementation/performance question: https://paste.dieggsy.com/2022-02-15T10:23:41 the first of these is *HEAPS* faster in allegro CL for a fairly expensive key-fn, even though they produce the same result. is allegro's implementation of remove-duplicates inefficient somehow, or am i missing a way in which these aren't equivalent
scymtym has joined #commonlisp
kevingal has joined #commonlisp
<phoe> dieggsy: could you post some benchmarks as well?
<Guest74> they aren't equivalent in that one is working on a list where the function has already been applied.
<Bike> let's see, it could optimize :key #'car, it could be inlining key-fn
<Bike> i recently found out allegro has this feature that might help https://franz.com/support/documentation/10.0/doc/compiling.htm#decl-help-1
<Bike> this being faster surprises me, though. i'd like to know how that is done
<dieggsy> Guest74: right, i suppose i meant equivalent from a functional standpoint as in is fast-filter guaranteed to produce the same results as slow-filter
<Bike> oh, or i guess it could just be remove-duplicates calling the key O(n2) times, if that's allowed
<Bike> yeah, that could be it.
<phoe> dieggsy: just a random question - you did COMPILE both functions, right?
<phoe> asking because Allegro also has an interpreter, it seems
Oladon has joined #commonlisp
<dieggsy> phoe: I ran sly-compile-defun on both
<Bike> yeah i just tried on sbcl, and for remove-duplicates on a nine-element list, the key is called forty times
<Bike> something similar could be happening on allegro
<dieggsy> phoe: here's a benchmark - real results but the calls were replaced with my example names https://paste.dieggsy.com/2022-02-15T10:35:40
<Bike> you could check on allegro with something like (let ((count 0)) (remove-duplicates whatever :key (lambda (x) (incf count) x)) count)
<Guest74> that's too bad. I kinda like key
<Bike> i suppose the consideration is that usually, the key is something cheap like car, and to avoid calling the key too many times you kind of need to cons up some kind of intermediate structure
<dieggsy> Bike: cool idea
<Bike> and doing so is more expensive than repeatedly calling the key, for a cheap key
<Guest74> makes note to always use cheap keys.
Guest74 has quit [Quit: Connection closed]
<dieggsy> Bike: yeah, called 123630 times on a 896-element list lol
<Bike> i mean, look at what you're doing here - to avoid calling the key so many times, you cons up, what, three times the input list?
<Bike> three more times, i mean
<Bike> unless the key is pretty expensive, that's not going to be worthwhile
<Bike> (in this case it obviously is worthwhile)
<dieggsy> Oh, I see
<dieggsy> so this is a memory/speed tradeoff?
<phoe> yes
<phoe> or rather, more like memory/time tradeoff
<dieggsy> right
<phoe> because "speed" is relative
<dieggsy> absolutely
<Bike> pretty much. remove-duplicates without consing means comparing every element against every other element, for O(n2) comparisons. if you cons up a cache or other structure you can reduce that, but then you're consing
<phoe> for an expensive key function, you'll want to pre-cons the result list to avoid quadratic explosion in terms of calling the key function
Guest74 has joined #commonlisp
jealousmonk has joined #commonlisp
<Bike> that said, i'm a little surprised allegro doesn't go to some other strategy
<Bike> oh but i guess with a key it's hard to do that maybe
<Bike> hrm
<dieggsy> yeah, the real issue here is why my key is so darn expensive lmao
<Bike> sbcl uses a hash table on long lists, but only with no key and a test that's a hash table test
<phoe> what is your key?
<dieggsy> phoe: it's bad, it does a (potentially very large) list lookup . i think we should probably implement that as a hash table in the first place but that's. maybe a bit out of my control ATM. .... maybe not. separate ticket in any case lol
mon_aaraj has quit [Ping timeout: 240 seconds]
<phoe> oof
mon_aaraj has joined #commonlisp
<dieggsy> phoe: ha, nevermind, it's 100% my fault that it's a list lookup in the first place in this case (what idiot implemented this as a list? - oh)
alvaro121_ has quit [Ping timeout: 252 seconds]
alvaro121 has joined #commonlisp
tyson2 has joined #commonlisp
hhdave has quit [Ping timeout: 272 seconds]
hhdave has joined #commonlisp
Cymew has quit [Ping timeout: 272 seconds]
megeve has quit [Ping timeout: 240 seconds]
megeve has joined #commonlisp
patrice has quit [Quit: Leaving]
karlosz has joined #commonlisp
attila_lendvai has joined #commonlisp
rotateq has joined #commonlisp
Algernon69 has quit [Read error: Connection reset by peer]
Algernon91 has joined #commonlisp
karlosz has quit [Ping timeout: 252 seconds]
Guest74 has quit [Quit: Connection closed]
Algernon91 has quit [Ping timeout: 252 seconds]
silasfox has joined #commonlisp
SR-71 has quit [Remote host closed the connection]
serbest has joined #commonlisp
eugercek has quit [Ping timeout: 252 seconds]
Algernon91 has joined #commonlisp
cage has joined #commonlisp
Oladon has quit [Quit: Leaving.]
Algernon666 has joined #commonlisp
Algernon91 has quit [Ping timeout: 252 seconds]
MajorBiscuit has quit [Quit: WeeChat 3.4]
alvaro121_ has joined #commonlisp
Oladon has joined #commonlisp
alvaro121 has quit [Ping timeout: 272 seconds]
alvaro121 has joined #commonlisp
alvaro121_ has quit [Ping timeout: 252 seconds]
Catie has quit [Remote host closed the connection]
cosimone has quit [Remote host closed the connection]
cosimone has joined #commonlisp
<ecraven> does anyone here know of any sort of study or comparison of what "big enough" is for fixnum size? is there an actual difference in practical applications between 50 bit fixnums and 62 bit fixnums, for example?
VincentVega has joined #commonlisp
amb007 has quit [Ping timeout: 272 seconds]
amb007 has joined #commonlisp
serbest has quit [Quit: Konversation terminated!]
mzan has quit [Quit: No Ping reply in 180 seconds.]
mzan has joined #commonlisp
alvaro121_ has joined #commonlisp
alvaro121 has quit [Ping timeout: 240 seconds]
<dieggsy> ecraven: i wouldn't have an answer anyway, but i don't understand the question
<dieggsy> big enough for what
lisp123 has joined #commonlisp
treflip has quit [Quit: good night]
<ecraven> if I ran a few "typical" programs (yes, it's own problem) with 52 bit fixnums and then again with 62 bit fixnums, would there be a noticable difference?
<ecraven> do programs actually *use* integers of the larger size?
<jackdaniel> say that you simulate a population growth (let's assume that the planet is a tad bigger)
<jackdaniel> then you pretty quickly hit the limit of the fixnum (if your simulation assumes an exponential growth)
<jackdaniel> then you simulate n planets and then wars between these demi-aliens
<ecraven> yea, but will that not hit bignums anyway?
<jackdaniel> or, to scale it down, you may simulate some kind of molecule interactions, also quite a big numbers
<jackdaniel> let's say that number of rabbits doubles each year
<jackdaniel> how many rabits will you have after 1 century?
<jackdaniel> (expt 2 100)
<jackdaniel> (fixnump *) ; -> NIL
<jackdaniel> dieggsy question was on point - that /depends on the application/
<jackdaniel> you can't represent ipv6 in a fixnum
ldb has joined #commonlisp
<Bike> also, it's probably not application dependent in a way that makes averaging over applications reasonable.
<Bike> like maybe it matters a lot for one kind of program but not for another kind
<ecraven> yea, the question probably makes no sense... so you either get immediate doubles (which is nice), or immediate larger fixnums (which is nice), but never both ;) [unless you have a good unboxing compiler] ;)
Algernon666 has quit [Read error: Network is unreachable]
<jackdaniel> right, if you count records in a database then a fixnum is plenty
<jackdaniel> 62bit*
<jackdaniel> it is hard to make a double immediate
waleee has joined #commonlisp
<ecraven> with nan-boxing?
<ecraven> wouldn't it be immediate by default?
<jackdaniel> double-float has 64bit, single-float has 32bit
<Bike> you'd still need a tag to differentiate doubles from pointers
<jackdaniel> an immediate object requires a few bits shaved to annotate a type
<ldb> common lisp "by default" uses single-float
<jackdaniel> that's why fixnum usually is 61 or 62 bits
<jackdaniel> (and not 64)
<ecraven> jackdaniel: nan-boxing puts all non-double values into the NaN space (which gives you at most 51 bits, I think)
<ecraven> but you have immediate doubles, as a trade-off ;)
<jackdaniel> I see, I'll read about this -thanks
<phoe> so that's 51 bits for both tag and address
<Bike> even pointers, huh. well i guess you don't usually use the whole address space.
<phoe> also your pointers can be always aligned, that saves a few bits
<ecraven> phoe: that depends.. you have 52 bits (you lose 11 for the exponent and one for quiet/signaling). so you take 1 bit to signify fixnums.. then you have 50 bits left for pointers (which is enough, given virtual memory has 48 bits at most for now) and characters and everything else
<jackdaniel> phoe: what do you mean?
<ecraven> as far as I understand, on arm and x86_64 only 48 bits of virtual memory are only ever used (though there are 56 bit extensions, but nobody uses them so far, I think?)
<phoe> jackdaniel: if your objects must be aligned to 8 bytes in RAM, then the three lower bits of your pointer must be always 0 - unless I misunderstand something, which is possible
<phoe> I rarely go this low-level
<phoe> you can use these always-zero bits for tags or something
<jackdaniel> phoe: yes, that's what makes immediate types possible - but they are aligned without doing anything
<jackdaniel> last few bits are simply zeroed
<Bike> i think all phoe meant was that if you want to stuff your pointer into 51 bits, you at least don't need to store the last few bits, so it's only 61 bits into 51
<phoe> if all pointers are is represented like #b...000, then you can shift it right by three and not lose information
<jackdaniel> ah, but why would you stuff a pointer into a pointer? that would be actually explicitly indirect
<phoe> so what Bike said
<jackdaniel> i.e there is no need to make a pointer an immediate type because the pointer itself (when you have it) is by definition immediate
<attila_lendvai> Xach, is there something that is holding back the cffi version in ql? it's almost 3 years old (unless i'm misreading something).
<attila_lendvai> well, something must be off. i see cffi_0.24.1 on guicklisp.org
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
pranavats has left #commonlisp [Error from remote client]
* jackdaniel also sees 0.24.1 in his (recently updated) dists
tyson2 has quit [Remote host closed the connection]
Catie has joined #commonlisp
azimut has quit [Remote host closed the connection]
<attila_lendvai> FTR, i needed an even newer patch than that, and thus my local checkout was shadowing ql, which then didn't fetch anything recent
azimut has joined #commonlisp
pranavats has joined #commonlisp
ec has joined #commonlisp
mon_aaraj has quit [Ping timeout: 240 seconds]
akoana has joined #commonlisp
mon_aaraj has joined #commonlisp
lisp123 has quit [Remote host closed the connection]
ldb has quit [Ping timeout: 272 seconds]
ldb has joined #commonlisp
Algernon666 has joined #commonlisp
<jcowan> Bike: You don't, actually; you put the pointers in the range of signaling NaNs.
<Bike> don't what
<jcowan> Need a tag to discriminate pointers from double floats.
<Bike> oh. yeah i figured that out a few lines past that
<jcowan> woops, sorry
<Bike> i'm slow sometimes
<jcowan> However, it makes sense for pointer-heavy languages to rotate the results so that the pointers have all high bits 0. YOu need to unrotate for floats, but that is cheap. (In double-heavy languages like JS, you don't have that problem.)
Algernon666 has quit [Ping timeout: 252 seconds]
Lord_of_Life_ has joined #commonlisp
Lord_of_Life has quit [Ping timeout: 252 seconds]
Lord_of_Life_ is now known as Lord_of_Life
iamFIREcracker has joined #commonlisp
iamFIREc1 has quit [Ping timeout: 252 seconds]
ldb has quit [Quit: ERC (IRC client for Emacs 27.2)]
tyson2 has joined #commonlisp
kevingal_ has joined #commonlisp
ahlk has joined #commonlisp
waleee has quit [Ping timeout: 256 seconds]
specbot has quit [Remote host closed the connection]
minion has quit [Read error: Connection reset by peer]
minion has joined #commonlisp
specbot has joined #commonlisp
cosimone has quit [Remote host closed the connection]
cosimone has joined #commonlisp
<Xach> attila_lendvai: i use (ql:where-is-system "cffi") to discover such issues sometimes
* attila_lendvai makes notes
<Xach> it will show local-projects, or (even scarier) /usr/share/common-lisp-controller/..., or the quicklisp dist paths
<ecraven> jcowan: so are lisps pointer-heavy or double-heavy? or should fixnums be favoured over either :-/
<attila_lendvai> uhh, clc?! that monster is still around, terrorizing lispers? :)
<Xach> a nightmare from the past
waleee has joined #commonlisp
morganw has joined #commonlisp
Oladon has quit [Quit: Leaving.]
cage has quit [Quit: rcirc on GNU Emacs 27.1]
<jcowan> Pointer-heavy, I would say: we are constantly dereferencing boxes of various sizes. As for fixnums, they can be included in the pointer range by using the bottom 3 bits as a tag. The same for characters and NIL.
<jcowan> So pretty much all the atomic primitive types (except other float sizes if you have them) can be represented unboxed.
aartaka has quit [Ping timeout: 272 seconds]
<ecraven> that'd make fixnums even smaller though :-/
<ecraven> but maybe 47 bit fixnums are enough, and there isn't much difference between 47 and 51 anyway
<White_Flame> sbcl uses 63-bit fixnums. all other tags have the lowest bit set, and then use additional low bits
<White_Flame> as far as numbers/counts go, yeah the range is generally going to be fine about 32 bits. But then you get things like bitmasks, IDs, etc that want an even 64 bits easily
<White_Flame> s/about/above/
<jcowan> The trick there is to do what Chicken Scheme does and optimize short bignums, since almost all bignums represent 64-bit values from the FFI.
Oladon has joined #commonlisp
masinter has quit [Quit: ~ Trillian - www.trillian.im ~]
Volt has joined #commonlisp
dmgk has left #commonlisp [#commonlisp]
kevingal has quit [Remote host closed the connection]
Volt is now known as Volt_
cosimone has quit [Remote host closed the connection]
cosimone has joined #commonlisp
<ecraven> jcowan: how are they optimised?
<_death> maybe it places them in a particular address range, so that it doesn't have to tag them
kevingal_ has quit [Remote host closed the connection]
<_death> I mean, there's still a pointer needed.. but no header
wacki has quit [Quit: Leaving.]
Dynom has quit [Quit: WeeChat 3.4]
eugercek has joined #commonlisp
<jcowan> Something like that. I don't know the details. They live in a special space that is not processed by the normal GC, I know that much.
<jcowan> (whereas the pointer object is in normal space)
eugercek has quit [Read error: Connection reset by peer]
eugercek has joined #commonlisp
<ecraven> jcowan: what's the advantage of putting fixnums into the pointer space? you still need to check the high bits on whether it is a double, and then the low bits for what is is exactly? is that better than using multiple different high-bit tags?
<ecraven> maybe it is, you need to check, but not mask away / unbox...
<_death> there's a series of posts about numeric tower in chicken https://www.more-magic.net/posts/numeric-tower-part-5.html
<_death> I've only skimmed it
<jcowan> Well, you have two spaces in a 64-bit address you can use for tags, so taking advantage of both makes sense to me. It's a little irritating that fixnump is "high tag is 0, lowest bit in 1" which can't be done in a single mask instruction (I think; my knowledge of assembly-language programming stopped with the PDP-11).
dec0d3r has joined #commonlisp
<jcowan> It is also apparently true that Solaris can allocate regions in the top half of memory to the user (as opposed to the kernel) which makes things more complicated. Fortunately, Solaris is not a dominant platform.
<ecraven> hm.. actually, you need to shift by the tag, so that isn't any easier than just masking away the high tag bits
<ecraven> but then,, masking the high bits is (from my limited understanding of the instruction set) more costly (in instruction size at least) than rotating
Algernon666 has joined #commonlisp
attila_lendvai has quit [Ping timeout: 252 seconds]
aeth has quit [Ping timeout: 240 seconds]
shka has quit [Ping timeout: 240 seconds]
aeth has joined #commonlisp
aeth has quit [Ping timeout: 272 seconds]
<ecraven> White_Flame: on unboxing a fixnum, is sign extension done by just setting the highest bit to the second-highest?
aeth has joined #commonlisp
<White_Flame> the top 63 bits are used for the number, and the low bit is 0
<White_Flame> so addition/subtraction/signedness is transparnt
<ecraven> ah, nice
<White_Flame> for non-fixnums, the low bit is 1, and then more low bits are used for the type tag
<ecraven> so each pointer access needs to clear the tag in the low bits before accessing memory?
<ecraven> or do you use indexed memory accesses for that?
<White_Flame> sbcl uses indexed memory. so given a cons cell, whose type tag is probably #b111, you get [rdx-7] for the car, and [rdx+1] for the cdr
cosimone has quit [Quit: Sorry, I need to scratch my left butt cheek.]
<ecraven> very nice, thanks!
<White_Flame> I don't think it's variable-length type tag generally, just 2 different types of tags, showing that you don't need a fixed number for all types
<ecraven> White_Flame: is there documentation on which tags sbcl uses? which source file might I look at?
<White_Flame> I mostly looked at the disassembly, but there are some internals .txt files somewhere which are likely out of date but do introduce the concepts
ec has quit [Quit: ec]
Algernon666 has quit [Quit: Leaving]
triffid has joined #commonlisp
orestarod has joined #commonlisp
<ecraven> hm.. nice, one bit also makes adjusting after multiplication/division simple enough
rotateq has quit [Quit: ERC (IRC client for Emacs 27.2)]
azimut_ has joined #commonlisp
azimut has quit [Ping timeout: 240 seconds]
<moon-child> adjust before, otherwise you lose information
<moon-child> but yes
<ecraven> yea, not in my case, I have free bits up high ;)
<alanz> I am trying to call REMOVE-IF-NOT using a lambda stored in the CDR of a dotted pair. But it needs a function designator for the predicate. How can I do it?
<phoe> lambda stored in the CDR of a dotted pair? what do you mean
Bike has quit [Quit: Lost terminal]
<moon-child> (remove-if-not (cdr pair) seq)?
mepy has quit [Quit: Leaving]
<alanz> moon-child, that is what I would expect to work, but it complains that it expecting a symbol or function
<phoe> alanz: well, what do you feed it then
orestarod has quit [Quit: Leaving]
<phoe> (let ((pair (cons 42 #'oddp))) (remove-if-not (cdr pair) '(1 2 3 4 5))) or something should work
<phoe> (cons 42 #'oddp) evaluates to a dotted pair
Bike has joined #commonlisp
<alanz> phoe, hmm, that works. I was doing (let ((pair '(42 . #'oddp))) (remove-if-not (cdr pair) '(1 2 3 4 5)))
<alanz> which does not. Thanks.
dec0d3r has quit [*.net *.split]
Lord_of_Life has quit [*.net *.split]
megeve has quit [*.net *.split]
semz has quit [*.net *.split]
stylewarning has quit [*.net *.split]
szkl has quit [*.net *.split]
mixfix41 has quit [*.net *.split]
hefner has quit [*.net *.split]
loke has quit [*.net *.split]
zagura has quit [*.net *.split]
Kabriel has quit [*.net *.split]
rdrg109 has quit [*.net *.split]
<moon-child> #'oddp reads the same as (function oddp)
<moon-child> which is not a function designator
<moon-child> but evaluates to one
orestarod has joined #commonlisp
<moon-child> you could also do `(42 . ,#'oddp)
<moon-child> or just '(42 . oddp), as a symbol is a function designator
<alanz> The problem seems to be using '(42 . #'oddp) vs (cons 43 #'oddp)
<alanz> 42
<White_Flame> '(42 . (FUNCTION ODDP))
<White_Flame> which is '(42 FUNCTION ODDP)
<alanz> I am happy with the cons form, tbh.
semz has joined #commonlisp
dec0d3r has joined #commonlisp
Lord_of_Life has joined #commonlisp
megeve has joined #commonlisp
stylewarning has joined #commonlisp
szkl has joined #commonlisp
mixfix41 has joined #commonlisp
hefner has joined #commonlisp
rdrg109 has joined #commonlisp
loke has joined #commonlisp
Kabriel has joined #commonlisp
zagura has joined #commonlisp
mixfix41 has quit [Max SendQ exceeded]
rdrg109 has quit [Max SendQ exceeded]
rdrg109 has joined #commonlisp
<White_Flame> do you understand the issue, though?
<White_Flame> same is if you tried '(42 . (+ 1 2)) and expected (42 . 3) instead of (42 + 1 2)
<alanz> White_Flame, now I do.
<alanz> thanks
morganw has quit [Remote host closed the connection]
szkl has quit [Ping timeout: 250 seconds]
szkl has joined #commonlisp
<phoe> I got bitten by #'FOO not being #<FUNCTION FOO> a couple of times
<phoe> the issue was always in context of quoted data though
<alanz> This is my first time, at least now I know what to look for.
<alanz> This reminds me of getting used to inscrutable haskell compiler errors
<White_Flame> and even quote itself is captured as (QUOTE FOO) unintentionally in some quoted scenarios
<White_Flame> instead of just FOO
<phoe> and both of them is a feature
<phoe> s/is a feature/are features/
Alfr has quit [Remote host closed the connection]
<phoe> especially in case of `',x
<phoe> although I am yet to see `#',x in practice :D
Alfr has joined #commonlisp
<moon-child> my...
<moon-child> (note: it is an annoyance that certain reader macros do _not_ expand to lists. E.G. you cannot say `#c(1 ,(+ 2 2))
<moon-child> )
<White_Flame> or `10,(code-char 49)05 for the integer 10105
tyson2 has quit [Remote host closed the connection]
mon_aaraj has quit [Ping timeout: 252 seconds]
mon_aaraj has joined #commonlisp
<moon-child> listen, you
<White_Flame> :)
<White_Flame> but that is an interesting thing, to programmatically inject evaluated CL chars into the READ input stream
<moon-child> #.(read-from-string (format ...))
<White_Flame> that's a separate token
<moon-child> sure, yes
<moon-child> you'd have to build all the tokens in your format
<moon-child> couldn't insert a ")" or w/e
<White_Flame> I mean, 10#.(read-from-string ...)05
<moon-child> but, meh, do you want c macros? And: you already have reader macros
<White_Flame> right
<White_Flame> I have no use for such a thing but it is the endpoint of meta-reading I think
<moon-child> meh
<moon-child> I would rather get rid of the reader entirely
<moon-child> structural editing, baby
<White_Flame> hard agree
<White_Flame> other than that, I do have my own reader based on strings and not just chars
<moon-child> what do you mean by that?
<White_Flame> eg "<<" can be breaking punctuation so 1<<2>>3 is 5 tokens
<White_Flame> break up the input string by whitespace, punctuation, and tokens, instead of a character-based regex lexer
<moon-child> I see
<White_Flame> for most programming languages it makes the lexing/parsing child's play
igemnace has joined #commonlisp