<geri>
also forth's creator said he doesnt want forth standartized because it kills innovation, so creating your own forth for your use case is the expected thing to do :D
<abu[7]>
I completely agree with that
<geri>
i like standards, but i see why he thinks that
<geri>
re-learning every tool all the time is tedious
<geri>
and re-writing software that could just work if there were standards
<geri>
(but in reality wont "just work" because of some small implementation details that weren't properly documented in the spec)
<abu[7]>
Forth so easy to roll your own
<geri>
lisp interpreters too imo
<geri>
just slightly different levels
<abu[7]>
Forth is a lot easier
<abu[7]>
No data types and no garbage collection
<geri>
i guess
<geri>
but still infinitely easier than your own C or whatnot
<abu[7]>
right
<geri>
is gc hard to write?
<geri>
thats like one part i hadnt gone through yet
<abu[7]>
The gc in pil is simple, as there is only a single size (a cell)
<abu[7]>
Pil gc got complicated because of features like database and coroutines
<abu[7]>
For a purer version, look into src/gc.l of miniPicoLisp
<geri>
one day ill get why database is built into the language instead of being some kind of library
<geri>
xd
<geri>
yeah i was thinking that pil gc would be faster and simpler cause everything is a cell
<abu[7]>
DB objects must be a first class data type
<geri>
minipico's gc file only 169 lines, cool
<abu[7]>
T, and gc itself is only 100
<geri>
not like i understand it though XD
<geri>
brb, gotta walk
<geri>
(for like 40 minutes...)
<abu[7]>
Have fun!
<abu[7]>
Here it is raining, will go later
abu[7] has left #picolisp [#picolisp]
abu[7] has joined #picolisp
<geri>
rain feels nice to listen to at least
<abu[7]>
true :)
<geri>
but yeah, i wrote a super basic and super bad stack machine and now working on compiling stuff to it
<geri>
at least -*+/ work
<geri>
im really happy about my music client too)
<abu[7]>
Perfect :)
<aw->
abu[7]: RISC-V ASM ;)
<abu[7]>
Oh, cool!
<abu[7]>
Seems my Arm ASM knowledge is rusty
<beneroth>
aw-, really cool :D
<tankf33der>
forth machine on picolisp is already implemented if you need it
<tankf33der>
geri: ^^^
<beneroth>
hey tankf33der :)
<geri>
tankf33der: i know about lifo, im trying to write a compiler for fun
user47 has joined #picolisp
<user47>
hi
<abu[7]>
Hi user47
<user47>
I am toying around with namespaces right now and i am not quite sure i understand them completly. I found the "symbolsnamespace" wiki entry but there are still a few questions i have, for example: i what way are namespaces nested?
<abu[7]>
A namespace is a collection of symbols to be searched by the reader. As it is also just a symbol, in may be contained in another namespace
<abu[7]>
s/in may/it may
<user47>
when i use the "namespaces" function i see all the namespaces, is a nested namespace searched before or after the ones that are on the same level?
<abu[7]>
The namespace search order is a simple list, searched sequentially
<abu[7]>
(symbols)
geri has quit [Ping timeout: 252 seconds]
<user47>
ah, that makes sense
<user47>
i have noticed some behaviour that puzzles me. if i start pil and enter e.g. "vip~winsize" everthing works as expected, but if i enter "vip~pico~vip~winsize", it puts me in the "vip" namespace and no symbol seems to be bound to anything; is that expected?
<abu[7]>
I would say yes, 'vip~pico' does not exist, so a new symbol 'pico' is created in 'vip'. Not sure atm about the exact consequences after that ;)
<abu[7]>
In any case, that new symbol 'pico' is not a namespace, thus we get "Bad symbol namespace"
<user47>
so in vip there is no way of getting to the real 'pico' namespace, because there is no nested 'pico' namespace symbol that holds what it normaly holds; is that approximately correct?
<abu[7]>
Yes. But you can create it
<abu[7]>
(setq vip~pico pico)
<abu[7]>
Then vip~pico~vip~winsize gives 8
<abu[7]>
Do you think such a use case exists?
<user47>
as far as i understand, its a different think if i switch to a namespace with 'symbols' e.g. (symbols 'vip 'pico) and try to access something in 'pico' or if i access something using '~', because in the first case there is a set search order, while in the second its only symbols in the namespace itself and i nested namespaces (using '~') that can be accessed, a far i understand; but to answer your question, it can be
<user47>
doubted, but i like to understand the intricasies of PicoLisp ;)
<abu[7]>
It is different insofar as 'symbols' sets a new search order. The reader always starts there
<abu[7]>
a~b~c needs 'a' to be somewhere in the current search order
<abu[7]>
b and c are then directly accessed
<user47>
that makes totally sense, also if i do e.g. 'vip~de' it finds nothing, because in this case it only searches in 'vip' and doesnt go out of the with '~' specified namespace
<abu[7]>
Right
<abu[7]>
My example above (setq vip~pico pico) is perhaps not good, it creates a copy of 'pico'.
<abu[7]>
Better is (intern 'pico 'vip)
<user47>
Then its two references to the same symbol, right?
<abu[7]>
Yes
<user47>
I noticed, if i do (setq vip~pico pico) and the do (namespaces T), it shows 'vip' nested under 'pico' (as expected) and '"pico"' nested under 'vip'; why is the '"pico"' under 'vip' a transient symbol?
<abu[7]>
This is because this symbol is "shadowed" by the 'pico' found earlier in the search order
<abu[7]>
If you do (symbols '(vip pico)) it is no longer transient
<user47>
Is that just a way of indicating that a symbol is shadowed or is it also an actual transient symbol (if that makes any difference; i am not sure) ;)
<abu[7]>
Basically there is no difference. A transient symbol means just that it is a symbol which is nowhere interned in the current search order
<abu[7]>
(including not interned anywhere)
<abu[7]>
The new pico symbol is interned in vip, but vip is not searched in the above case
<abu[7]>
If we do (symbols 'pico 'vip), it will also no longer be transient
<user47>
I see, now '"pico"' turns into 'vip~pico' to differentiate it from the normal 'pico', correct?
<abu[7]>
T
<user47>
If i do (setq vip~pico pico) then (symbols 'vip 'pico) and (namespaces T), there is a namespace named '@@'; where does it come from?
<abu[7]>
I think this is a relict from the REPL mechanism of keeping the last 3 results in @, @@ and @@@. When you did (setq vip~pico pico), it returned a very long list (a tree)
<abu[7]>
This is the value of 'pico'
<abu[7]>
So technically '@@' indeed became a namespace for a short time
<user47>
Interesting, that explains why its gone after a second '(namespaces T)'
<abu[7]>
Yep
<abu[7]>
I did (setq vip~pico pico) (symbols 'vip 'pico)
<abu[7]>
to avoid the long output
<abu[7]>
and thus never had @@ as a namespace :)
<user47>
Oh, i never thought about entering two LISP expressions at once on the RELP, but obviously there is no reason why that shouldnt work, very nice
<abu[7]>
I often simply do (longResult) T
<user47>
Huh, i sometimes do (t (longResult)), but your way is more convenient
<abu[7]>
a little less to type :)
<abu[7]>
brb
abu[7] has left #picolisp [#picolisp]
abu[7] has joined #picolisp
<abu[7]>
I stop for today o/
<user47>
Well i think ive learned a lot, atm i have no further questions, so thanks for the help :)