<Seteeri>
Hello! Does anyone ever use the picolisp channel on reddit? So far there have been no posts, however, the first PilCon proposal would make a nice first post.
<anddam>
I somehow liked it very much, not sure I understand why I read it though
<Regenaxer>
The docs are all a bit terse
<anddam>
eh
<anddam>
from what I understand picolisp offers a simple environment, with few datatype, unicode aware, a "built-in ORM" and the basic libraries for common needs. Also it's interpreted and you can check errors at runtime
<Regenaxer>
thats all correct, yes
<anddam>
not sure the last two things are related, I gather the "source code is the executing code" is more general of lisp
<Regenaxer>
right, but most Lisps are compiled and then the equivalence to the source is gone
<Regenaxer>
Pil also kind of compiles, but not to machine code
<Regenaxer>
it builds pointer structures, as described in the above ref
orivej has quit [Ping timeout: 240 seconds]
<anddam>
pointer structures as in the single data cell?
<anddam>
is actually 2 cells, with the first cell CDR pointing to the address of the second one
<anddam>
is that right?
<anddam>
due to that + symbol in the CDR
<Regenaxer>
yes, NIL occupies 2 cells
<Regenaxer>
hmm
<Regenaxer>
the + is a mistype I think
<Regenaxer>
no meaning here
<anddam>
oh
<anddam>
that is not what I expected
<Regenaxer>
:)
<Regenaxer>
I never noticed
<Regenaxer>
Fixed it
<anddam>
or broke it, from my PoV
<Regenaxer>
You think the + has meaning?
<anddam>
my idea was that the symbol started with one cell, then the CDR could link to another and in that case in the ascii art there's a + where the link crosses the cell border, in the NIL symbol case I thought the second cell was adjacent out of convenience
<anddam>
but that's because I assumed a symbol (of which NIL is a special case) started with one cell
<Regenaxer>
The arrow from the top is the important point
<Regenaxer>
it points between car and cdr, thus it is a symbol
<anddam>
I'm possibly overthinking a minor detail since I don't know almost anything else about the language
<Regenaxer>
no problem
<anddam>
actually what spun my interest this turn was the PicoLisp Works link on reddit
<anddam>
I think I'll go with a practical approach for once
<Regenaxer>
OK
<Regenaxer>
NIL itself is the first cell only
<Regenaxer>
it is a symbol, bocause the pointer is offset by 8 bytes
<Regenaxer>
The second cell is padding
<anddam>
so it "points to the CDR"
<Regenaxer>
with two NILs in turn
<anddam>
because the cell is 16bytes
<Regenaxer>
right
<anddam>
I liked that low-level trick with the offsets
<anddam>
btw b(0) is gc
<Regenaxer>
NIL points to itself with its value
<Regenaxer>
b(0) ?
<anddam>
LSB
<anddam>
rightmost bit
<Regenaxer>
exactly
<anddam>
ok, so there are 8 possible values for types
<anddam>
numbers has 4
<anddam>
I haven't cleared lists yet, but with 4 type of symbols I was foreseeing a problem there
<Regenaxer>
well, testing for combinations of bits is exzensive
<Regenaxer>
so the basic types have 1 bit each
<Regenaxer>
short, big, sym
<Regenaxer>
none is cell
<anddam>
and cell is list as well, right?
<Regenaxer>
The most central doc is doc64/structures
<Regenaxer>
yes
<anddam>
makes sense, I said 4 since numbers (bigint and shortint) have sign as well
<Regenaxer>
yeah
<anddam>
I figure I'd like to understand how to implement something I need with picolisp, to have an actual use case
<Regenaxer>
So bit 3 (and 8) is not uniqu
<anddam>
what about bit 8?
<Regenaxer>
if you test just with 8, it might be a sym or a negative number
<Regenaxer>
so it depends on context
<Regenaxer>
usuall number is tested for first
<Regenaxer>
& 6
<anddam>
oh you are talking values there, not bit position
<anddam>
8 as in 1000
<Regenaxer>
yes, bit 3
<anddam>
I understand
<Regenaxer>
Perhaps PilBox? Not easy for beginners, but the best to build something useful
<Regenaxer>
You can make an Android app with 3 lines :)
<Regenaxer>
"Hello World"
<Regenaxer>
(menu "Hello World!"
<Regenaxer>
(<h1> "center fh" "Hello World!") )
<anddam>
yea, but I figure anything other than the label would be a PITA, at least at first
<Regenaxer>
yep
<Regenaxer>
Perhaps look around at rosettacode for ideas?
<anddam>
I noticed that is linked a lot from the docs