<tankf33der>
check out opaque pointers chapter in the begginning.
<abu[m]>
OK, will check thoroughly later
<beneroth>
uh oh
rob_w has quit [Remote host closed the connection]
abu[m] has quit [Ping timeout: 246 seconds]
Thorsten[m] has quit [Ping timeout: 252 seconds]
Hunar has quit [Ping timeout: 260 seconds]
abu[m] has joined #picolisp
<abu[m]>
tankf33der: Very good link!
<abu[m]>
However I still don't understand what this means for the future
Hunar has joined #picolisp
<abu[m]>
Will I need to abandon typed pointers in the LLVM-IR too?
<abu[m]>
The docs seem to talk only about the tools generating LLVM
<abu[m]>
all that C++ stuff which I don't use
<abu[m]>
In some ways, my code *does* depend on pointer types. It is a huge task to change all that
Thorsten[m] has joined #picolisp
seninha has quit [Quit: Leaving]
seninha has joined #picolisp
<tankf33der>
This is just good overview article what was done in 2022. I am using nightly llvm builds to catch problems faster.
<abu[m]>
very good
<abu[m]>
I keep an eye on this opaque issue anyway. If all goes wrong, I'll need to rewrite large parts of @src/lib/llvm.l to use opaque pointers also internally
<beneroth>
so there is still a way to do pointer typing in LLVM? I understood it roughly as they want to get rid of it entirely?
<beneroth>
which would mean.. back to lower level asm for pil or wtf?
<abu[m]>
That's what I meant about the future. At the moment typed pointers in LLVM-IR work fine
<abu[m]>
Not back to asm
<abu[m]>
but rewrite @src/lib/llvm.l to generate different, typeless, code
<abu[m]>
In fact I would prefer it that way. If I'd start from scratch I would use untyped pointers
<beneroth>
by encoding the type tag in an extra cell instead of the picolisp pointers themselves? or would it be no difference on the picolisp vm, just the llvm code?
<abu[m]>
as we had in ASM
<abu[m]>
Nono, this has nothing to do with the Pil data structures
<beneroth>
ok, too deep for me. need to study this properly eventually...
<abu[m]>
In C: char *p
<abu[m]>
this is a typed pointer
<abu[m]>
x = *p
<abu[m]>
gives a char
<beneroth>
yeah instead of void *p;
<abu[m]>
Typeless meanj you have a pointer void *p
<abu[m]>
and do x = *(char*)p
<beneroth>
and I believe this works in C also with tag bits in the pointer itself, same as in pil, no?
<abu[m]>
same result
<beneroth>
yes. but for pil you need to store the type (num/sym/lst) somewhere, no?
<abu[m]>
no, it is a static issue only at compile time
<beneroth>
ah okay
<beneroth>
then I misunderstood
<beneroth>
thanks for explaining! appreciated
<abu[m]>
The resulting binary is 100% identical
<abu[m]>
☺
<beneroth>
I see
<beneroth>
then why did you ever use typing in llvm in the first place? what advantage for compiling pil? kinda as additional assert safety or?
<abu[m]>
Initially only typed pointers existed in LLVM
<abu[m]>
like in C
<beneroth>
aaah
<beneroth>
makes sense
<beneroth>
I see
<abu[m]>
Only in newer C's you can say void *p
<beneroth>
yeah I guess that's why the C syntax for function pointers is from a lower level daemon abyss dimension
<abu[m]>
Hu? ;)
<abu[m]>
You read to many fantasy/SF stuff? ;)
<beneroth>
hahaha, maybe
<beneroth>
int (*functionPtr)(int,int);
<abu[m]>
Yeah, such nightmares
<beneroth>
brackets and stars.
<abu[m]>
yep, so the types propagate through everything
<beneroth>
picolisp is stronger static typed than C
<abu[m]>
yes, because of the tags in the data
<beneroth>
yes
<beneroth>
also runtime checks haha :D
<abu[m]>
T
<abu[m]>
Writing something like PicoLisp in C is easier with untyped pointers. If you look at the old pil32 C sources you see that it type-casts like mad (or Java in Ersatz) to get around those type-limitations
<abu[m]>
ASM in pil64 has no types at all, and thus no casting
<abu[m]>
The type of the accessed data is determined in the instruction opcode and not by a pointer type
<abu[m]>
And now they move into that direction by LLVM too, basically a good thing
<abu[m]>
Just a little too late! 😈
<abu[m]>
So I hope *very* much that typed pointers on the LLVM-IR level will always stay supported
<abu[m]>
Otherwise @src/lib/llvm.l needs to be rewritten, and also large parts of the Pil source files src/*.l
<abu[m]>
Imagine that C abandons pointer types! All C code must be rewritten to cast the void* pointers to the proper type in each access
seninha has quit [Remote host closed the connection]
seninha has joined #picolisp
seninha has quit [Remote host closed the connection]
alexshendi has joined #picolisp
alexshe6 has joined #picolisp
alexshendi has quit [Read error: Connection reset by peer]
theruran has quit [Quit: Connection closed for inactivity]
alexshe6 has quit [Quit: -a- IRC for Android 2.1.60]