beneroth changed the topic of #picolisp to: PicoLisp language | The scalpel of software development | Channel Log: https://libera.irclog.whitequark.org/picolisp | Check www.picolisp.com for more information
theruran has joined #picolisp
theruran has quit [Quit: Connection closed for inactivity]
msavoritias has joined #picolisp
bjorkintosh has joined #picolisp
bjorkintosh has joined #picolisp
msavoritias has quit [Ping timeout: 255 seconds]
geri has joined #picolisp
<geri> hey, could you remind me what you were saying about picolisp executing stuff directly?
<geri> is val(x) that? like the function reference is stored in the symbol or something
<geri> s/function/value/
<abu[7]> Hmm, wasn't it about interpreting the cellstructures?
<geri> i dont remember :D
<abu[7]> Traversing the lists
<abu[7]> The interpreter jumps from built-in to buiut-in
<geri> like not having to have special wrappers for lambdas?
<abu[7]> The lambda is kind of implied
<geri> well yeah, i meant that like in cl lambda + map is slower than a single loop macro
<geri> (sometimes not much slower)
<abu[7]> In pil too there is a function call overhead
<geri> what was that about jumping between built-ins then?
<abu[7]> map calls a fun eac
<abu[7]> h time
<abu[7]> Well, it is how the interpreter works
<abu[7]> The program is a graph of linked cells
<geri> you mean like how functions are either straight up C/ASM/... calls or "lambdas" that call those?
<geri> that it's a graph of linked cells i can guess from the name :D
<abu[7]> Right, and the "lambda"s boil down to primitives on the bottom
<geri> yeah
<geri> i just recently understood that you can call functions via a pointer in C
<geri> xd
<abu[7]> T
<geri> C has first class functions everybody :)
<abu[7]> The interpreter is in the inline 'eval' mostly all of the time
<abu[7]> : (vi 'llvm~eval)
<geri> i had to clone original repo because i couldnt find definition of evList via vi
<abu[7]> Shift-K did not work?
<geri> didn't know about it
<geri> xd
<abu[7]> Or ^] as in vim
<geri> no C-o or C-i, rip
<abu[7]> C-i it TAB ;)
<geri> yeah
<geri> in vim its go to previous/next place where i was
<abu[7]> It is '' in vip or vim
<abu[7]> ^O opens a new termux session here
<abu[7]> Must run, back in in 20 mins
<geri> how does variable lookup work?
<geri> i dont really understand pilsrc all that well haha
<geri> (vi 'llvm~val) probably
<abu[7]> Exactly. There is no lookup, it compiles to a single pointer dereference (*p in C)
<geri> so symbols point directly to their values?
<abu[7]> Yes, see @doc/structures
<abu[7]> The CDR of a symbol cell is the VAL
<geri> maybe a silly question - if value of a symbol is stored in its cell's cdr, why doesn't (cdr 'somesymbol) work?
<geri> s/work/return anything other than NIL/
<abu[7]> This would access a random location in heap and is therefore checked and disallowed
<geri> okay..
<geri> where can i check how dynamic scoping is implemented?
<abu[7]> 'use' or 'let'
<geri> (i love that let uses let for it's definition)
<abu[7]> Or (vi 'llvm~evExpr)
<abu[7]> Hehe, yes
<abu[7]> as 'if' uscs 'if'
<geri> amazing :D
<abu[7]> In evExpr it is e.g. (loop (set $Bind (setq P (push # [val sym LINK]
<abu[7]> Binding of angs
<geri> my brain processor is overheating sec
<geri> :D
<abu[7]> Oh ☺
<geri> in first let, what happens when P is getting set with let?
<geri> wait, maybe $At is a global like bind
<abu[7]> It is '@'
<geri> yeah xd
<geri> just found it
<abu[7]> 'P' points into the stack
<abu[7]> So the first let is the case (let Sym Val ...
<abu[7]> In @doc/structures it is below "Bind frame:"
<geri> so LINK points to all children bindings?
<geri> or the opposite way :D
<geri> i feel like i need to study way more cs than i know for this stuff haha
<abu[7]> Not children but the previous frame
<abu[7]> A linked list of frames on the stack
<geri> oh btw
<geri> i found out this is possible and it feels insane
<geri> (de hello (name) (prinl (pack "Hello, " (or name "world") "!")))
<geri> (let "Hello, " "Goodbye, " (hello))
<geri> :D
<abu[7]> T
<geri> anyways, thanks for teaching me some, but i need moar research
<geri> and to sleep as well
<geri> enjoy the evening
<abu[7]> ☺/
geri has quit [Quit: ERC 5.5.0.29.1 (IRC client for GNU Emacs 29.3)]
theruran has joined #picolisp