gxt___ has quit [Write error: Connection reset by peer]
reb has quit [Ping timeout: 244 seconds]
gxt___ has joined #commonlisp
Demosthenex has quit [Ping timeout: 245 seconds]
Demosthenex has joined #commonlisp
<phantomics>
Checking in again with a question about the finer points of threading. In lparallel is there a fast way to get a count of the number of active workers in the kernel? I'm working on finding a way to divide large, unpredictable workloads without causing delays due to shortages of available threads
<hayley>
(lparallel.kernel:kernel-worker-count)
<hayley>
...eh, that's all workers, not just active.
<phantomics>
Yeah, that's the tricky part
<phantomics>
(lparallel:task-categories-running) will get the info, but running it millions of times will definitely cost
<hayley>
Though it'd be "intrusive" to your code, you could have your tasks atomically bump a counter?
<phantomics>
I've thought of keeping an integer count of active threads and incrementing/decrementing it when appropriate, but I'll have to handle many conditions
<phantomics>
Yes, that
<phantomics>
Intrusive isn't much of a problem, since I'm concentrating all parallelism in the system in a single function to focus on optimizing
gxt___ has quit [Ping timeout: 268 seconds]
gxt___ has joined #commonlisp
gxt___ has quit [Ping timeout: 268 seconds]
hineios4 has joined #commonlisp
hineios has quit [Ping timeout: 268 seconds]
hineios4 is now known as hineios
gxt___ has joined #commonlisp
Oladon has quit [Quit: Leaving.]
jmd_ has joined #commonlisp
jmdaemon has quit [Ping timeout: 240 seconds]
chip2n has joined #commonlisp
jealousmonk has quit [Read error: Connection reset by peer]
notzmv has joined #commonlisp
jmdaemon has joined #commonlisp
jmd_ has quit [Ping timeout: 268 seconds]
igemnace has joined #commonlisp
SR-71 has joined #commonlisp
mon_aaraj has quit [Ping timeout: 240 seconds]
mon_aaraj has joined #commonlisp
White_Flame has quit [Remote host closed the connection]
White_Flame has joined #commonlisp
<flip214>
phantomics: is that more a question of "how many cores did I get assigned on startup", or "how busy is my system right now"?
<flip214>
the latter will be unpredictable to some degree... the first question is "just" a syscall, but could vary too
jmd_ has joined #commonlisp
jmdaemon has quit [Ping timeout: 268 seconds]
mon_aaraj has quit [Ping timeout: 245 seconds]
mon_aaraj has joined #commonlisp
shka has joined #commonlisp
SR-71` has joined #commonlisp
SR-71` has quit [Remote host closed the connection]
SR-71 has quit [Ping timeout: 244 seconds]
Josh_2 has joined #commonlisp
karlosz has joined #commonlisp
<Josh_2>
Good morning :sunglasses:
<Josh_2>
I have a macro that is defining two conditions, the latter has the former as a superclass, but CL is complaining that the former is not yet defined
<Josh_2>
Idk how to fix
<flip214>
Josh_2: eval-when, I guess
<Josh_2>
Well I tried putting the entire form in an eval-when
<flip214>
no, you need the macro to expand to (PROG (EVAL-WHEN ...) (EVAL-WHEN ...))
<hayley>
Can we see the macro? I don't see why it should go wrong.
karlosz has quit [Quit: karlosz]
<flip214>
or it might be easier to just (EVAL ...) the superclass directly during macro runtime
<Josh_2>
flip214: okay will try that
<Josh_2>
oof sorry
<Josh_2>
turns out it was because I had a define-condition form somewhere it shouldn't have been
jeosol has quit [Quit: Client closed]
igemnace has quit [Remote host closed the connection]
igemnace has joined #commonlisp
igemnace has quit [Client Quit]
Josh_2 has quit [Ping timeout: 252 seconds]
Josh_2 has joined #commonlisp
<flip214>
Using SBCL 2.2.6+git something I observe that my code, when it dynamically creates a package, binds *PACKAGE* to it, and then (LOADs ...) some files into it (which use macros in other packages etc.),
<flip214>
gets the symbols LOOP-END-NIL, LOOP-STEP-NIL, and LOOP-TOP-NIL interned in that new package.
<flip214>
I'm fairly sure that my code doesn't do that; is that something that got fixed in SBCL lately?
pve has joined #commonlisp
<flip214>
Don't have a small reproducer yet, though.
_cymew_ has joined #commonlisp
MajorBiscuit has joined #commonlisp
mon_aaraj has quit [Ping timeout: 268 seconds]
mon_aaraj has joined #commonlisp
<aeth>
Josh_2: only certain things still count as toplevel, such as PROGN
<aeth>
so you have to be careful when doing defines in macros.
<aeth>
I'm guessing that's what the issue was?
admich has joined #commonlisp
miique has quit [Quit: You have been kicked for being idle]
Seok__ has quit [Quit: Leaving]
<flip214>
tracing SB-IMPL::ADD-SYMBOL doesn't give output... how are these symbols interned?
cosimone has quit [Read error: Connection reset by peer]
<_death>
are you using ITERATE?
<_death>
it generates such symbols via a function called symbol-append, which for some reason uses INTERN instead of MAKE-SYMBOL
azimut has joined #commonlisp
<flip214>
INTERN also falls back to SB-IMPL::ADD-SYMBOL
<beach>
flip214: If the function is inlined, you will not see anything when you trace it. I don't know that that's the case, but it could very well be that.
<flip214>
beach: well, swank's tracer shows that ADD-SYMBOL is being called ... but using SBCL's (TRACE :encapsulation nil :break sb-impl:add-symbol) [that should use a breakpoint] doesn't work
cosimone has joined #commonlisp
<flip214>
add-symbol is not marked for inlining
<flip214>
_death: hmmm, yeah, looks like might be the culprit
<beach>
flip214: If it is not declared notinline, it could be inlined. But I guess that's not the case.
<flip214>
_death: but ITERATE is used in functions that are "statically defined" and might only get called via macros... does iterate INTERN in the generated loop prolog or epilogue??
<flip214>
yeah, thanks... one macro calls an inlined function that uses ITERATE, I guess that's the point where it happens.
azimut has quit [Remote host closed the connection]
random-nick has joined #commonlisp
azimut has joined #commonlisp
<_death>
my guess is that make-symbol should be used instead, but I've not tried to assess the repercussions
<Josh_2>
aeth: Thanks for the info but no, the problem was I had a define-condition form with a superclass that was not yet defined somewhere it was not meant to be (duplicates)
<Josh_2>
as soon as I removed the duplicate my macro worked without any eval-whens :shrug:
<flip214>
yeah, perhaps that should be a GENSYM instead... reading the docs to find out what the iterate api is
<flip214>
as a workaround I now switch *PACKAGE* to CL-USER before compiling resp. macro expansion
<_death>
the block name comes from the user (or nil by default).. here we are talking about the symbols generated by iterate
<flip214>
yeah - but I argue when passing in a symbol the generated symbols should be in the same package, not in *package*.
<_death>
what are the premises of this argument
<flip214>
Of course, that wouldn't work for the default CL:NIL because of package locks
<flip214>
to avoid polluting other packages, that's a good argument IMO
<_death>
my suggestion is that these symbols should not belong to any package.. I could be wrong if there's some expectation of persistence beyond a macroexpansion, but a priori I consider it unlikely
<flip214>
well, yeah, these could be GENSYMs too. but then you'd need a MACROLET for RETURN-FROM to divert the user-defined symbol to the gensym.
<_death>
again, we are talking about *loop-top*/*loop-step*/*loop-end*, not *loop-name*
<flip214>
oh, you want _only_ these symbols moved, now I understand. Yeah, these might be simple gensyms, I guess.
MajorBiscuit has joined #commonlisp
shka has quit [Quit: Konversation terminated!]
mon_aaraj has quit [Read error: Connection reset by peer]
xaotuk has quit [Ping timeout: 240 seconds]
mon_aaraj has joined #commonlisp
mon_aaraj has quit [Ping timeout: 240 seconds]
morganw has joined #commonlisp
mon_aaraj has joined #commonlisp
mon_aaraj has quit [Ping timeout: 268 seconds]
mon_aaraj has joined #commonlisp
random-nick has quit [Ping timeout: 268 seconds]
sander has quit [Quit: So long! :)]
thuna` has joined #commonlisp
jeosol has joined #commonlisp
<jeosol>
good morning all!
mon_aaraj has quit [Ping timeout: 240 seconds]
mon_aaraj has joined #commonlisp
igemnace has joined #commonlisp
pmwals09 has joined #commonlisp
<shinohai[m]>
Buenos dias jeosol
pmwals09 has quit [Ping timeout: 268 seconds]
jmd_ has quit [Ping timeout: 244 seconds]
sander has joined #commonlisp
<jeosol>
thanks
azimut has quit [Remote host closed the connection]
gxt___ has quit [Write error: Connection reset by peer]
azimut has joined #commonlisp
gxt___ has joined #commonlisp
Lycurgus has joined #commonlisp
<Josh_2>
Mornin' jeosol
son0p has joined #commonlisp
<jeosol>
hi Josh_2, hope are well? How is SA?
<Josh_2>
Its alright :sunglasses:
<Josh_2>
How's your project coming along?
dBc has joined #commonlisp
Lycurgus has quit [Ping timeout: 240 seconds]
mon_aaraj has quit [Ping timeout: 245 seconds]
xaotuk has joined #commonlisp
Lycurgus has joined #commonlisp
fitzsim has joined #commonlisp
Lycurgus has quit [Quit: Exeunt juan@acm.org]
<jeosol>
Sorry, I was away.
<jeosol>
yeah, it's going well - it's partly self use but has a lot of utility for others, other researchers if i can deploy it efficiently and portably
knusbaum has joined #commonlisp
knusbaum has quit [Ping timeout: 252 seconds]
knusbaum has joined #commonlisp
[deleted] has quit [Ping timeout: 268 seconds]
cage has joined #commonlisp
morganw has quit [Remote host closed the connection]
jeosol43 has joined #commonlisp
jeosol43 has quit [Client Quit]
jeosol30 has joined #commonlisp
jeosol has quit [Ping timeout: 252 seconds]
livoreno has joined #commonlisp
xaotuk has quit [Ping timeout: 252 seconds]
azimut has quit [Ping timeout: 268 seconds]
azimut has joined #commonlisp
<phantomics>
flip214: I'm counting the number of cores that are currently busy, the number of cores present is simple to find
jeosol30 has quit [Quit: Client closed]
jeosol has joined #commonlisp
random-nick has joined #commonlisp
skeemer has joined #commonlisp
morganw has joined #commonlisp
karlosz has joined #commonlisp
rainthree has quit [Read error: Connection reset by peer]
rainthree3 has joined #commonlisp
NotThatRPG has joined #commonlisp
rainthree33 has joined #commonlisp
rainthree3 has quit [Ping timeout: 268 seconds]
waleee has joined #commonlisp
<beach>
Is SBCL still emitting style warnings for slots with the same SYMBOL-NAME but different SYMBOL-PACKAGE, or is it just that I haven't updated my SBCL for some time?
karlosz has quit [Ping timeout: 252 seconds]
orestarod has joined #commonlisp
<mfiano>
beach: In response to my issue, this was implemented in 2.1.9: "finalizing classes with slots with duplicate symbol-names will only emit a warning if either slot name is an exported symbol."
<beach>
I see. Thanks.
<beach>
Perhaps not good enough?
<mfiano>
Why would you ever export slot names?
<jackdaniel>
it may be a coincidence, i.e (foo :accessor foo)
karlosz has joined #commonlisp
<mfiano>
Yes, but beach and I explicitly annotate slot names to not coincide with exported symbols.
<beach>
Oh, slot names. Sorry.
<mfiano>
Or at least I did. I don't see returning to CL anytime soon.
<beach>
Yes, that would be good enough for me.
karlosz has quit [Ping timeout: 252 seconds]
livoreno has quit [Ping timeout: 268 seconds]
<flip214>
phantomics: cores busy _globally_, or with your CL image? Counting active _threads_ is easy... but _cores_ needs scheduler support, eg. reading /proc/self/sched or /proc/self/status every second and building differences
tibfulv has quit [Remote host closed the connection]
MajorBiscuit has quit [Ping timeout: 245 seconds]
<phantomics>
flip214: the goal is counting threads busy in the CL image. (lparallel:task-categories-running) returns this information but it builds a vector, and my goal would be to count active threads very often, anytime I might want to put a task in the lparallel channel, so I'd rather not use a method with that much overhead
tibfulv has joined #commonlisp
chip2n has quit [Ping timeout: 252 seconds]
dBc has quit [Quit: leaving]
azimut has quit [Remote host closed the connection]
azimut has joined #commonlisp
jealousmonk has joined #commonlisp
tyson2 has joined #commonlisp
tyson2 has quit [Remote host closed the connection]
<flip214>
phantomics: so, if you have 8 cores but 20 threads running, you'd want a value of 20?
<phantomics>
The issue is that I want to split complex tasks across threads but the efficiency of doing so depends on the available workers
<flip214>
phantomics: well, if you create your own kernel, you _know_ how many workers are available. Of course, the number of available _cores_ is a harder question....
<phantomics>
I mean the number of workers currently occupied, not the max available
<phantomics>
Basically, the issue is that I'm running tasks that can be divided into independent parts, thus can be multithreaded. However, some parts of a task may be more complicated than others, and an individual task may contain threadable parts
<phantomics>
So if one of the sub-tasks is threadable, I would want to subdivide it and then check whether there are idle workers
<phantomics>
If there are idle workers, they will get parts of the sub-task to do. If not, I will run the parts of the sub-task synchronously, -but- after each one completes, I will check again whether there are idle workers, and if so, I will start assigning them parts of the sub-task
igemnace has quit [Remote host closed the connection]
<phantomics>
A system like this should avoid many possible logjams
<phantomics>
Would the maybe-wake-a-worker function be usable to check whether a worker is idle?
<White_Flame>
you also need to average multiple samples of this. a single snapshot could happen to be running a bunch of 1 nanosecond jobs simultaneously
<phantomics>
The consequence of that would simply be that one task segment would get run synchronously, but when the subsequent segments are run the system would see idle workers and assign them the following segments
<rendar>
the lisp parser uses a stack right? e.g. (+ (+ 2 3) (+ 5 6)) it reads first +, and pushes that to a stack, it evals 2+3 and 5+6 and then eval the first + bringing those results from the stack, right?
molson has quit [Remote host closed the connection]
molson has joined #commonlisp
<jackdaniel>
the reader does not evaluate these things
<_death>
read and eval are separate.. an interpreter would first read the whole form, and then evaluate it
<_death>
(of course, they may call one another)
kaskal- has joined #commonlisp
<rendar>
yes, but my point is that it will eval first (+ 2 3) (+ 5 6) and then +
<rendar>
it can't evaluate first + without evaluating the other 2 ( ) ( )
kaskal has quit [Ping timeout: 245 seconds]
<_death>
it depends on the lisp dialect.. in Common Lisp the evaluation order is left to right, and the + is not evaluated at all
<rendar>
+ is not evaluated? how?
<Bike>
also, there's no stack involved.
<jackdaniel>
(+ (+ 2 3) (+ 5 6)) is equivalent to (funcall #'+ (funcall #'+ 2 3) (funcall #'+ 5 6)) ; so in some metasense it may be considered evaluated :)
<rendar>
if you have (a (b) (c)) you can't evaluate a before b or c..
<jackdaniel>
I think that you confuse evaluation and application
<rendar>
i mean, you must pass whatever (b) and (c) returns to a, and in doing that, you must get (b) and (c)
karlosz has joined #commonlisp
<jackdaniel>
evaluation - take a form and return a value
<rendar>
( ) this is called a form?
<Bike>
please read the clhs section death linked
<jackdaniel>
application - take a function and arguments and call the function with said arguments
<rendar>
ok
<Bike>
it explains the algorithm in pretty good detail
<Bike>
note that this is talking about the evaluator, not the parser or reader
<Bike>
which, as mentioned, do not do the bulk of evaluation
<rendar>
its very hard to read that website :(
<rendar>
it has the same format of a 1997 website
<jackdaniel>
well, that would be actually an argument that it is easier to read
<jackdaniel>
2022 websites are a pile of dynamically changed content with cookie popups, in other words - garbage
<jackdaniel>
(not all of course)
<rendar>
jackdaniel, at least, you don't have to do left and right with the head, like you're watching a tennis match
<jackdaniel>
meet the reader view, our lord and savior
<rendar>
well, can you advice me a book that covers such concepts, that goes in very detail?
<jackdaniel>
Lisp in Small Pieces is one
Dynom_ has joined #commonlisp
<_death>
yeah, that one contains >10 interpreters and compilers ;)
Dynom_ is now known as Guest688
<rendar>
wow great
<jackdaniel>
most notably it embraces techniques from both scheme and common lisp, so in some sense it is better than studying a single language
<rendar>
yes indeed
<rendar>
i'm writing a little lisp interpreter in python for learning purposes, and to compute (+ (+ 2 3) (+ 5 6)) i need a stack or something where to put the first + operator, computer 2+3 and 5+6 then compute the a+b with those results..
<_death>
often in toy lisps the stack is implicit (eval just recurses)
<rendar>
_death, indeed
<rendar>
but it seems i can't do a recursive eval here
<rendar>
let me explain:
<jackdaniel>
rendar: this is better suited for #lisp channel
<rendar>
ok
<jackdaniel>
thanks
<rendar>
np
<_death>
there's also structure and interpretation of computer programs (SICP).. there you can even see it in the logo (the mutual recursion of eval and apply)
<rendar>
yes as i said on #lisp, it seems i can't do that
frgo has joined #commonlisp
frgo has quit [Ping timeout: 240 seconds]
skeemer has quit [Remote host closed the connection]
skeemer has joined #commonlisp
Lord_of_Life_ has joined #commonlisp
Lord_of_Life has quit [Ping timeout: 245 seconds]
Lord_of_Life_ is now known as Lord_of_Life
skeemer has quit [Remote host closed the connection]
skeemer has joined #commonlisp
jeosol has quit [Quit: Client closed]
frodef has joined #commonlisp
rainthree33 has quit [Ping timeout: 245 seconds]
frodef has quit [Client Quit]
frodef has joined #commonlisp
lambdart has joined #commonlisp
Colere has quit [Ping timeout: 240 seconds]
Colere has joined #commonlisp
Colere has quit [Client Quit]
Colere has joined #commonlisp
MajorBiscuit has joined #commonlisp
Furor has joined #commonlisp
Colere has quit [Ping timeout: 245 seconds]
cage has quit [Quit: rcirc on GNU Emacs 27.1]
reb has joined #commonlisp
notzmv has quit [Ping timeout: 268 seconds]
smlck has quit [Ping timeout: 268 seconds]
livoreno has joined #commonlisp
morganw has quit [Remote host closed the connection]
livoreno has quit [Ping timeout: 268 seconds]
parjanya has quit [Ping timeout: 240 seconds]
mister_m has quit [Ping timeout: 252 seconds]
karlosz has quit [Ping timeout: 252 seconds]
jmdaemon has joined #commonlisp
Guest688 has quit [Quit: WeeChat 3.6]
reb has quit [Ping timeout: 244 seconds]
anticomputer has quit [Remote host closed the connection]
anticomputer has joined #commonlisp
pve has quit [Quit: leaving]
_cymew_ has quit [Ping timeout: 245 seconds]
notzmv has joined #commonlisp
parjanya has joined #commonlisp
azimut has quit [Ping timeout: 268 seconds]
reb has joined #commonlisp
<resttime>
In SBCL am I correct in thinking that the optimize speed safety etc. are things that create a 'cost' score used to prioritise a VOP (depending on VOP cost) during compile time?
<resttime>
Wondering here also that when defining a vop with DEFINE-VOP, the generator is supplied a number as a cost too and I dunno how this is calculated since the docstring says that it's estimated
torbo has joined #commonlisp
<resttime>
(Question here being how does one estimate this number)
Guest3 has joined #commonlisp
<kakuhen>
I think the scale is ill-defined. Usually when defining your own VOPs you will set the cost to something like number of assembly instructions you're running, then refine it later if needed
<Shinmera>
Number of cycles spent as overhead, if you can. But iirc it's just sorta guessed.
<Kingsy>
any doom emacs users in here?
<kakuhen>
e.g. a VOP that does nothing but a shl or xor will probably be cost 1
NotThatRPG has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
aartaka has quit [Ping timeout: 245 seconds]
Kongotania has joined #commonlisp
Guest3 has quit [Quit: Client closed]
Kongotania has quit [Remote host closed the connection]
<Bike>
i don't think the optimize qualities affect the cost? they just change what transformations are run. that was my impression, anyway, i'm not that deep into sbcl
<White_Flame>
resttime: many of the decisions are relative to each other like (if (> speed size) ...)
<White_Flame>
to determine which codegen strategy to use
<White_Flame>
as well as absolute comparisons
<Bike>
i thought the vop costs were just numbers associated with them, which are used by the generator to determine what to do, but that's after any of the optimize qualities stuff happens
<White_Flame>
and I just mean comparing the speed/size declarations to each other, the vop costs aren't used in that determination
<resttime>
Ahhh, so first it's the policies and then generator costs, from the docstring they seem to be :POLICY {:SMALL | :SMALL-SAFE | :FAST | :SAFE | :FAST-SAFE}
Kongotania has joined #commonlisp
MajorBiscuit has quit [Ping timeout: 244 seconds]
Kongotania has quit [Remote host closed the connection]
<resttime>
Guess I wonder where those decisions are happening, it's a blackbox to me how the optimize decisions translate to the policy
<kakuhen>
well, (declare (optimize speed)) will probably use the vop with a :fast-safe policy, if available
<resttime>
Yeah it actually is exactly that, found the function node-ltn-policy in sbcl/src/compiler/ltn.lisp
aartaka has joined #commonlisp
jeosol has joined #commonlisp
anticomputer has quit [Quit: quit]
anticomputer has joined #commonlisp
splatt990 has joined #commonlisp
anticomputer has quit [Remote host closed the connection]
anticomputer has joined #commonlisp
MajorBiscuit has joined #commonlisp
karlosz has joined #commonlisp
orestarod has quit [Ping timeout: 268 seconds]
aartaka has quit [Ping timeout: 240 seconds]
NotThatRPG has joined #commonlisp
MajorBiscuit has quit [Ping timeout: 268 seconds]
NotThatRPG has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]