tibfulv has quit [Read error: Connection reset by peer]
tibfulv has joined #commonlisp
chsasank has quit [Ping timeout: 246 seconds]
chsasank has joined #commonlisp
dnhester` has joined #commonlisp
chsasank9 has quit [Ping timeout: 246 seconds]
gorignak has joined #commonlisp
tibfulv has quit [Remote host closed the connection]
dnhester` has quit [Ping timeout: 260 seconds]
tibfulv has joined #commonlisp
<chsasank>
aeth, Mondenkind: thanks for the links. I have decided to directly emit the x86 and use a simple runtime for now.\
<chsasank>
primarily because I was not happy with LLVM's IR and other alternatives don't support SIMD
Lord_of_Life has quit [Ping timeout: 256 seconds]
Lord_of_Life has joined #commonlisp
agrosant has quit [Ping timeout: 264 seconds]
<chsasank>
once I have a good experience with codegen I'll probably design my own IR/VM
dnhester` has joined #commonlisp
<aeth>
personally, for me, after making my brain hurt trying to remove the global state (well, it's not really global, it's just dynamic scoping) that I had to do to get it to work in the first place (and various possible simplifications to remove some global state break on various edge cases) I've decided to go (at least) two pass and try ANF
<aeth>
chsasank: if you want a SIMD backend, you can try targeting SB-SIMD with your language when #+(and sbcl x86-64)
<chsasank>
hey wait, you can do inline asm in sbcl?!
<aeth>
yes
dnhester` has quit [Ping timeout: 260 seconds]
<aeth>
but sb-simd is far more concise and offers the possibility of other implementations copying the API
<chsasank>
I wish there are benchmarks vs c :(
<Mondenkind>
you will get: bad scheduling; bad regalloc; no use of memory operands; many missing instructions
<Mondenkind>
how much those matter depends on application
<aeth>
you'll still need a scalar version because (1) SIMD isn't available to every target CPU and (2) is currently only on SBCL as SB-SIMD afaik and (3) is sometimes slower than the scalar version when it's short
<aeth>
e.g. my example is probably not enough to win vs a naive vec4+ called on two vec4s represented as (simple-array single-float (4))... especially if you want to convert back and forth
<ixelp>
Closing the Performance Gap Between Lisp and C
<chsasank>
I am going in all assembly, so portability is not that much of a concern rn 😅
mulk has quit [Ping timeout: 272 seconds]
<chsasank>
for me it's to prove that automatic search of optimizations in FL can give good perf
<chsasank>
sb-simd is rougly 80% of C
<aeth>
Mondenkind: yes, and? It's not like it's much of a moving target as progress in general slows. 2013's AVX-512 was first in hardware in 2016, but only one (iirc) gen of Intel consumer CPUs supports it and they rolled back support so they could do p+e cores. While AMD just added support in the most recent (2022) Zen.
mulk has joined #commonlisp
<aeth>
so the biggest thing missing from SB-SIMD is, afaik, no avx-512 and that's also still missing from most x86-64 you can expect user users to have
<aeth>
in the '00s it probably would have been impossible to keep up with advances in C compilers and in CPUs
<Mondenkind>
i'm not talking about avx512. last time i tried to use it it was missing stuff i needed (in avx2 at least, don't remember mighta been sse4.2) so i gave up
<chsasank>
but his criticism on scheduling and register allocation
lucasta has quit [Remote host closed the connection]
<chsasank>
is orthogoal to avx 512
<aeth>
Mondenkind: missing stuff that will eventually, slowly, be added
<aeth>
chsasank: optimization is even less of a big deal? it happens eventually
<aeth>
by the time you actually build on it, it may be much better, which is the advantage of not doing your own inline asm
<aeth>
the only issue is if it's so bad it's no improvement over not using it
<chsasank>
just as a design/educational exercise doing code gen is a good idea for me :)
<chsasank>
runtime might suck but that's alright
<aeth>
the only thing that seems a bit odd/bad about sb-simd as a SIMD target (as far as API design itself goes) is that it's n-ary like regular Common Lisp arithmetic, but by the time you'd actually target it, you're almost certainly down to binary
<aeth>
but there also doesn't seem to be much of a reason to write it directly
dnhester` has joined #commonlisp
<chsasank>
aeth: I am planning to do my own optimization :)
<chsasank>
a bit ambitious true, let me get burnt :)
<aeth>
Personally, I just want the same thing (* it's floats so you won't get the exact same answers) to run on the CPU and GPU... If the CPU stuff can just compile down to CL (with perhaps some optional implementation-specific backends like SB-SIMD) that's fine for me.
NicknameJohn has joined #commonlisp
<chsasank>
actually. I am open to opencl on cpu
<chsasank>
I wonder how good spir-v is on cpu
dnhester` has quit [Ping timeout: 272 seconds]
<aeth>
it probably seems little to no real world use so instead of debugging your own code, you'd be debugging someone's massive C++ code
<chsasank>
aeth: it's just a wrapper over all different compute drivers
<aeth>
one problem with the LLVM in general is that they're from the C++ world so compilation speed has absolutely no priority
<aeth>
to a C++ programmer, if you double compilation speed to make something 10% faster, you win
<aeth>
this would be very annoying to use at a REPL
chsasank8 has joined #commonlisp
<bike>
yeah, it's really friggin slow.
<aeth>
and then you'd have to FFI instead of calling it like a CL function so the size of the code before the DSL makes performance sense is larger...
<bike>
has been a major thorn in clasp's side
<aeth>
(unless you use clasp)
chsasank has quit [Ping timeout: 246 seconds]
<bike>
i'm not sure what you mean by that last bit
chsasank8 is now known as chsasank
<aeth>
I'd assume that using the LLVM wouldn't have as much overhead from Clasp
igemnace has joined #commonlisp
<bike>
there's still overhead from wrapping LLVM objects into lisp objects and such. but i think llvm is slow enough that the overhead is basically irrelevant.
green_ has quit [Ping timeout: 240 seconds]
waleee has quit [Ping timeout: 264 seconds]
tyson2 has quit [Remote host closed the connection]
bjorkintosh has quit [Ping timeout: 264 seconds]
bjorkintosh has joined #commonlisp
tisanae has quit [Remote host closed the connection]
kurfen has joined #commonlisp
tisanae has joined #commonlisp
nerap has joined #commonlisp
kamafam has joined #commonlisp
agrosant has quit [Ping timeout: 264 seconds]
agrosant has joined #commonlisp
Pixel_Outlaw has joined #commonlisp
agrosant has quit [Ping timeout: 264 seconds]
pfdietz has quit [Ping timeout: 250 seconds]
NicknameJohn has quit [Ping timeout: 264 seconds]
justache is now known as justache_Test
justache_Test is now known as justache
dnhester` has joined #commonlisp
dnhester` has quit [Ping timeout: 252 seconds]
istewart has quit [Quit: Konversation terminated!]
chsasank0 has joined #commonlisp
chsasank has quit [Ping timeout: 240 seconds]
chsasank0 is now known as chsasank
tisanae has quit [Remote host closed the connection]
NicknameJohn has joined #commonlisp
ymir has quit [Ping timeout: 268 seconds]
Pixel_Outlaw has quit [Quit: Leaving]
nerap` has joined #commonlisp
ronald has quit [Read error: Connection reset by peer]
<paulapatience>
skin: bareword-start is missing '*'
azimut has quit [Ping timeout: 260 seconds]
dnhester` has joined #commonlisp
random-nick has joined #commonlisp
random-nick has quit [Ping timeout: 256 seconds]
dcb has quit [Quit: Connection closed for inactivity]
danza has joined #commonlisp
<paulapatience>
skin: unescaped and backtick-unescaped are presumably missing %x7F from their exclusions
jladd has quit [Ping timeout: 264 seconds]
jladd has joined #commonlisp
danza has quit [Ping timeout: 264 seconds]
mulk has quit [Ping timeout: 264 seconds]
mulk has joined #commonlisp
ebrasca has joined #commonlisp
akoana has quit [Ping timeout: 268 seconds]
danse-nr3 has joined #commonlisp
danse-nr3 has quit [Remote host closed the connection]
danse-nr3 has joined #commonlisp
danse-nr3 has quit [Remote host closed the connection]
danse-nr3 has joined #commonlisp
agrosant has joined #commonlisp
rainthree has joined #commonlisp
chomwitt has joined #commonlisp
danse-nr3 has quit [Ping timeout: 255 seconds]
<paulapatience>
skin: Why does / need to be escapable in strings and quoted symbols?
yitzi has joined #commonlisp
agrosant has quit [Ping timeout: 264 seconds]
<paulapatience>
skin: Also, there's no way to insert Unicode codepoints of more than 16 bits with \u
<paulapatience>
Probably \u{} would be better
dcb has joined #commonlisp
<paulapatience>
skin: line-content should probably also forbid DEL.
danse-nr3 has joined #commonlisp
<paulapatience>
And should prose-lines allow escapes? Currently they are forbidden.
<adlai>
chsasank: please be wary of using inline assemblers provided by lisp compilers ... I got excited about this while learning lisp and rapidly reached problems where my code was creating undetectable corruption because it was breaking GC invariants.
<chsasank>
I'm gonna just emit gas syntax assembly
<ixelp>
Scheme Compiler in Incremental Steps: Compiling Integers - Sasank's Blog
<adlai>
I'm not discouraging you from studying the tool and using it; simply, realise that once you emit any machine code, you must be smarter than your entire compiler.
<adlai>
... or at least, aim to be :)
<chsasank>
I read the article and felt it required me to learn new API :P
<chsasank>
I already have some scaffolding I can use
<chsasank>
actually I am stumped on how to pass around data for my array based functional language
<chsasank>
I emitted common lisp code before and it was straight forward there because lists are basic there. Not so in assembly.
<adlai>
good metaphor; think of this as removing locks from all construction sites. do you want to be responsible for someone else's child walking off a scaffolding outside the windows of the fifth floor? keep writing inline assembly without studying the invariants of ~all~ code produced by your compiler.
<chsasank>
For now I am experimenting by manually writing C code for some of the expressions
agrosant has joined #commonlisp
<adlai>
if you want a crazy idea for dynamic data in arrays: rather than geeking out on CDR-coding, use diagonals.
<chsasank>
I didn't that
<adlai>
they will bloat your allocation, although allow flexibility for optimizing towards vectors.
<chsasank>
can you share some references?
<adlai>
nope
<adlai>
this is a conversation, not a correspondence.
<chsasank>
I am not sure I get what you mean
<adlai>
ok
<chsasank>
haha, am a noob. so trying to read something instead of bothering you with questions :)
<chsasank>
what is diagonals?
<chsasank>
how does it help me with optimization?
traidare has quit [Ping timeout: 252 seconds]
attila_lendvai has joined #commonlisp
* adlai
spoke a reference to unpublished work; keep building your project, you have actual code rather than only dreams.
green_ has joined #commonlisp
mariari has quit [Quit: WeeChat 4.2.1]
<chsasank>
adlai: now you need to tell me how that works 😛
mariari has joined #commonlisp
<chsasank>
I am kinda lost because I need to have lists but they should really be vectors for max efficiency
<beach>
That would depend on what you want to do with them.
<beach>
Like if you want to add an element to the front, then a vector is no good.
<chsasank>
mostly it's map reduce operations
<chsasank>
also some distribute operations
<chsasank>
basically it's sort of like numpy
<paulapatience>
skin: Ok, I have an initial parser that is working. Some minor things left, like forbidding control characters in comments, etc.
<ixelp>
Scheme Compiler in Incremental Steps: Heap Allocation - Sasank's Blog
pfdietz has joined #commonlisp
agrosant has quit [Ping timeout: 264 seconds]
tyson2 has joined #commonlisp
<chsasank>
ah if I don't have to store sizes at runtime and everything is known at compile time, it becomes much easier!
<beach>
No dynamic allocation? How do you deal with map/reduce then?
<beach>
Actually, never mind. It doesn't matter.
igemnace has joined #commonlisp
<chsasank>
I can infer sizes statically (I think)
agrosant has joined #commonlisp
<beach>
I said "never mind", because we are drifting off topic here it seems.
pillton has quit [Remote host closed the connection]
agrosant has quit [Ping timeout: 264 seconds]
traidare has joined #commonlisp
agrosant has joined #commonlisp
msavoritias has joined #commonlisp
tok has joined #commonlisp
azimut has joined #commonlisp
attila_lendvai has quit [Ping timeout: 260 seconds]
a51 has joined #commonlisp
<pve>
Hi! If I change the initform of a class allocated slot and re-define the class with C-c C-c, should the slot take on the new value? I was half-expecting it to do so, but at least SBCL doesn't do that. Only if I remove the slot completely, and then add it with the new initform does it work.
<pve>
The hyperspec says "The :initform form for a shared slot may be used when defining or re-defining the class". Am I misunderstanding this?
chomwitt has quit [Ping timeout: 260 seconds]
green_ has quit [Ping timeout: 260 seconds]
<yitzi>
Just to clarify, you expect the class allocated slot value to change when you redefine the class?
<pve>
yitzi: well I expected it initially, now I'm less sure
<yitzi>
I'm not even sure how it could do that. It would have to know what the initform evaluated to when the class was initially allocated. Initforms are side-effect free anyways.
<yitzi>
In other words, it would have to keep track of each slot and where its value initally came from.
<yitzi>
s/side-effect/not side-effect/
dcb has quit [Quit: Connection closed for inactivity]
<pranavats>
pve: from CLTL2: "The value of a slot that is specified as shared both in the old class and in the new class is *retained*. ... Slots that were local in the old class and that are shared in the new class are initialized. Newly added shared slots are initialized."
<skin>
yes, things like %7F and other control characters
<skin>
forward slash needs escaped to maintain json compatibility
<skin>
16bit \u is a known issue and also is for json compatibility
alcor has quit [Ping timeout: 240 seconds]
<skin>
but you can still represent all of unicode using conjugate pairs
<skin>
prose lines were intended as something that didn't need escapes so that a developer could copy and paste something into a file and then prefix the lines without
<skin>
worrying about what was in the lines
<skin>
something that the user could not do if escapes were honored, so no escapes, that was on purpose
<skin>
Probably should stop spamming this channel, since we're in different timezones :) email me? me@djha.skin
green_ has joined #commonlisp
awlygj has joined #commonlisp
green_ has quit [Remote host closed the connection]
green_ has joined #commonlisp
danse-nr3 has joined #commonlisp
green_ has quit [Ping timeout: 264 seconds]
alcor has joined #commonlisp
agrosant has quit [Ping timeout: 264 seconds]
<pve>
pranavats: thanks, it's clear now
zaymington has quit [Ping timeout: 260 seconds]
notzmv has quit [Ping timeout: 256 seconds]
<pranavats>
pve: Thanks for asking. It clarified things for me as well.
varjag has quit [Quit: ERC (IRC client for Emacs 27.1)]
tok has quit [Remote host closed the connection]
AndreiDuma has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
pfdietz has quit [Quit: Client closed]
pfdietz has joined #commonlisp
occ has quit [Ping timeout: 264 seconds]
chomwitt has joined #commonlisp
chomwitt has quit [Ping timeout: 255 seconds]
occ has joined #commonlisp
tyson2 has quit [Read error: Connection reset by peer]
danse-nr3 has quit [Remote host closed the connection]
danse-nr3 has joined #commonlisp
gxt_ has quit [Ping timeout: 260 seconds]
gxt_ has joined #commonlisp
domovod has joined #commonlisp
NicknameJohn has quit [Remote host closed the connection]
<ixelp>
CLHS: Standard Generic Function SHARED-INITIALIZE
<beach>
Bubblegumdrop: Specbot is mainly useful if you want to show someone else some part of the standard. If everyone used it to look up their own stuff, this channel would be very noisy.
zxcvz has quit [Quit: zxcvz]
<beach>
Bubblegumdrop: And you can do /msg specbot clhs ... if you want.
<Bubblegumdrop>
Oh, sorry. Somebody asked about :initform and I have used these three to CHANGE-CLASS and REINITIALIZE-INSTANCE for slot values
agrosant has joined #commonlisp
traidare has quit [Ping timeout: 272 seconds]
<Bubblegumdrop>
Art of MOP book also covers this
bendersteed has quit [Quit: bendersteed]
<beach>
The question was specifically about slots with allocation :CLASS.
danse-nr3 has quit [Ping timeout: 260 seconds]
traidare has joined #commonlisp
Posterdati has quit [Ping timeout: 260 seconds]
zxcvz has joined #commonlisp
dino_tutter has quit [Ping timeout: 246 seconds]
Posterdati has joined #commonlisp
occ has quit [Ping timeout: 260 seconds]
hirez has quit [Read error: Connection reset by peer]
hirez has joined #commonlisp
occ has joined #commonlisp
AndreiDuma has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
AndreiDuma has joined #commonlisp
zetef has quit [Remote host closed the connection]
chomwitt has joined #commonlisp
vats has joined #commonlisp
tisanae has joined #commonlisp
tisanae has quit [Remote host closed the connection]
nerap has joined #commonlisp
wacki has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
wacki has joined #commonlisp
traidare has quit [Quit: WeeChat 4.2.1]
traidare has joined #commonlisp
vats has quit [Remote host closed the connection]
Josh_2 has joined #commonlisp
<Josh_2>
Hi hi
Bubblegumdrop_ has joined #commonlisp
Bubblegumdrop has quit [Ping timeout: 260 seconds]
iisi has quit [Ping timeout: 246 seconds]
iisi has joined #commonlisp
<Josh_2>
Solved my own problem before I even asked the question :sunglasses:
waleee has joined #commonlisp
pfdietz has quit [Quit: Client closed]
igemnace has quit [Read error: Connection reset by peer]
pfdietz has joined #commonlisp
varjag has joined #commonlisp
mgl has quit [Ping timeout: 268 seconds]
attila_lendvai has joined #commonlisp
mi6x3m has joined #commonlisp
<mi6x3m>
friends is it possible to use a variable as a separator in a "~{~a~^ ~}" format specifier
<mi6x3m>
i.e. "~{~a~^<custom var>~}" list separator
<Josh_2>
You can call functions in format
<Josh_2>
so probably
nerap has quit [Ping timeout: 268 seconds]
<Josh_2>
You can call your function and have it return the value of your variable
alcor has quit [Remote host closed the connection]
<mi6x3m>
Josh_2, but how would it apply the semantics of "print unless it's the last element"
<mi6x3m>
that ~^ has
<Josh_2>
idk, did you try it?
<mi6x3m>
yeah doesn't work
pfdietz has quit [Quit: Client closed]
<Josh_2>
:'(
b3lm0nt has quit [Quit: WeeChat 3.8]
alcor has joined #commonlisp
ldb has joined #commonlisp
<mi6x3m>
Josh_2, I think it should be possible though
<mi6x3m>
I found some info online
<Josh_2>
Lemme know if you get it :sunglasses:
<Josh_2>
Can't say I've ever used ~^ for anything other than space or ,
<mi6x3m>
Josh_2, it worked :)
<mi6x3m>
thanks
mi6x3m has quit [Remote host closed the connection]
msavoritias has quit [Remote host closed the connection]
alcor has quit [Remote host closed the connection]
<yitzi>
mi6x3m: I am sure there are many ways to do that. If you want to do as Josh_2 suggests then your do could flet with formatter