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
geri has joined #picolisp
<geri> hey-hey
<geri> i just found something silly out
<geri> ((list (list 'a 'b) '(+ a b)) 1 2)
<geri> this is actually very much legal
<geri> gonna go rewrite half of my code not to use explicit evals :D
<geri> or not, i guess it only works with lambdas and for builtins you need to use eval anyway
<geri> oh nevermind, pico eval actually allows ((list '+ 1 2)) as well
<geri> that is so cool
<abu[7]> お早うgeri!
<geri> :DD
<geri> was it actually using the kanji for "fast"?
<abu[7]> yes
<abu[7]> hayai
<geri> today ive learned
<geri> okay so i made (...) mean eval if the lambda is not valid
<geri> its funny but so hard to debug that id rather not
<geri> let eval be eval and () be a function call
<geri> does evaluating function call build a new list before passing it to the body or do it in-place?
<abu[7]> No, it does no consing by itself
<geri> huh
<geri> what does it do then?
<geri> i mean if '((Name) (print "Hello, " Name))
<abu[7]> This is a legal function
<abu[7]> Why should it cons?
<geri> im thinking :D
<geri> i guess it just sees Name, takes first argument, evals and binds
<geri> then does the same thing with other stuff
<abu[7]> right
<abu[7]> so only stack operations
<abu[7]> llvm~evList
<geri> all the param destructuring is in evExpr?
<abu[7]> Yes, and the same in evMethod
<geri> i was probably consing to pass it to destructuring bind prettily
<geri> to not have to do it all in 3 places
<geri> maybe if i add a "eval" flag to the bind itll be better
<geri> although the function does so much now its kinda confusing :D
<geri> also i just realized i can kinda emulate forth's hyperstatic environments with private namespace :D
<geri> : start ." original" ; ok
<geri> : entry start ; ok
<geri> : start ." new" ; ok
<geri> entry original ok
<geri> entry original ok
m_mans has joined #picolisp
Guest87 has joined #picolisp
Guest87 has quit [Client Quit]
Serj-Aleks has joined #picolisp
<Serj-Aleks> Первый раз использую IRC канал, даже не знал, что это ... и пока не понимаю, как пользоваться ... Присоединился, потому что недавно узнал о проекте PicoLisp и приняд для себя решение в него погрузиться.
<abu[7]> Serj-Aleks, no problem! There is always a first time. Welcome here! ☺
<tankf33der> Serj-Aleks: ку
<Serj-Aleks> Спасибо всем, кто откликнулся. Попробую выйти и зайти снова. Программа говорит, что мои настройки в сети будут запомнены на моем компьютере. Надо проверить. Я сначала заходил с телефона как
<Serj-Aleks> гость, но потом решил с компьютера с ником.
<tankf33der> ok
Serj-Aleks has quit [Quit: Client closed]
<bjorkintosh> what was all that?
<tankf33der> new russian speaker
<abu[7]> He is new to IRC
Serj-Aleks has joined #picolisp
<abu[7]> Maybe tankf33der, m_mans on geri can herp
<tankf33der> is geri knows russian ?
<abu[7]> Serj-Aleks, which password do you mean?
<tankf33der> he left but will return
<abu[7]> geri seems here though (?)
<tankf33der> geri: wake up
<m_mans> Hi all! Yeah, I proposed him to ask in russian Telegram chat
<abu[7]> Is there a pil telegram channel?
<m_mans> Very small one, no activity there
<tankf33der> :)
<abu[7]> Cool anyway :)
<abu[7]> So Serj-Aleks does not know English?
<m_mans> mostly for us, who does not speak English fluently )
<abu[7]> Bad English is also OK
<m_mans> abu[7]: I know nothing about him yet
ygrek has joined #picolisp
Serj-Aleks has quit [Quit: Client closed]
m_mans has quit [Ping timeout: 244 seconds]
<geri> tankf33der: im very slow damn
<geri> yeah he just said that he wants to get deeper into picolisp and that he experienced some technical issues with his computer/irc
<geri> probably irc client, it wasn't exactly clear honestly
<geri> like 80% it was about irc
<geri> "First time using an IRC channel, didn't even know what it was... and still don't understand how to use it... Joined because learned about the PicoLisp project recently and decided to dive deeper into it"
<geri> "Thank you to everyone who responded. I'll try to leave and join again. The program says my settings will be synced with my computer. Need to check. First time I joined off of my phone as a guest, but later decided to join from a phone with a nick"
<geri> abu[7]: im also confused what passwords you meant :D
<abu[7]> I had his texts translated by AI
<geri> my ai is a little better B)
<abu[7]> but answered to him in English. Not sure if he understood ...
<abu[7]> :)
<geri> he kinda never reacted to actual words so im not sure
<geri> but the thank you implies that probably yes
<abu[7]> right
<geri> tankf33der: what's ку
<tankf33der> I thought you understand russian. Sorry.
<geri> i understand russian, not internet slang
<geri> apparently a short greeting
<tankf33der> Ok
<geri> abu[7]: what do you like about dynamic binding
<abu[7]> Simple and fast
<geri> can already say that probably symbols being "real" and relative simplicty
<geri> also shadowing stuff can be nice, like (let *Some-Global Some-value body)
<abu[7]> T
<abu[7]> You can do even in C
bjorkintosh has quit [Quit: "Every day, computers are making people easier to use." David Temkin]
<geri> shadowing globals?
<abu[7]> int f () int i = GlobalI; ...; GlobalI = i; ...
<abu[7]> int f () {int i = GlobalI; ...; GlobalI = i; ...
bjorkintosh has joined #picolisp
bjorkintosh has joined #picolisp
<geri> yeah fair
<geri> any other upsides come to mind?
<abu[7]> for example?
<geri> to dynamic binding
<abu[7]> Like you said, shadowing
<abu[7]> globals or other free vars
<abu[7]> or functions especially
<abu[7]> (let car foo (bar))
<geri> yeah
<geri> thats why emacs also uses dynamic binding
<geri> although it has got lexical since forever as well
<geri> for downsides i guess less efficient to compile and shadowing can be nasty sometimes
<abu[7]> both true
<abu[7]> But lexical binding has the same problems in other situations like macros
<geri> like need for gensyms in common lisp?
<abu[7]> T
<geri> that's honestly more of a problem with list-based macro system instead of the complex langauge scheme uses for hygiene
<geri> but it also gives you power, just like shadowing in dynamic binding
<geri> like, you can make a macro take and return arbitrary forms
<geri> scheme's are a little more limited, by design though
<abu[7]> I see
ello has quit [Quit: ZNC 1.9.1 - https://znc.in]
<geri> have you looked into cps at some point?
<abu[7]> cps?
<geri> continuation passing style
<abu[7]> nope
<abu[7]> Is it analog to passing a coroutine around?
<geri> well, its a bit more general
<geri> you can implement try/except and coroutines, etc. with it easily
ello has joined #picolisp
<geri> gives you explicit return stack basically in any language
<geri> i wanna experiment with it some time later, apparently could make stuff simpler
<geri> also cps gives you tail recursion for free
<geri> though honestly i dont know enough about it yet xd
<abu[7]> sounds expensive
<geri> you can use stacks instead of procedure calls
<abu[7]> hmm
<abu[7]> For me a coroutine is a stack
<geri> and throw/catch?
<abu[7]> simlar, but not necessaraly related to stack segments
<abu[7]> you can throw inside the current co, but also into another
<geri> well, its supposed to be some sort of generalization for a lot of control flow stuff
<abu[7]> I doubt you can get tail recursion for free
<abu[7]> only in trivial cases
<geri> in scheme continuations are first class, just a function that takes one argument
<abu[7]> In Pil co's are also first class
<geri> you can then just do (while Exp (setq Exp (Exp)))
<geri> apparently its called trampolining
<abu[7]> T
<geri> interesting stuff
<geri> honestly picolisp functions arent just first class
<geri> they're like luxury class, cause you can just edit them with no problem
<abu[7]> So 0th class? ;)
<geri> :D
<geri> more of my silly little code
<geri> also made private namespace get saved/restored upon reading a file, so let0 wont be interned anywhere upon finishing the read
<abu[7]> ok
<geri> its very fun!
<abu[7]> :)
<geri> oh also i remembered
<geri> remember you dont like colors in your text editor cause its inaccurate and "car" could be a vehicle and not a builtin?
<geri> but unless youre using namespaces/shadow it, "car" is always pointing to a builtin :D
<geri> and even if you use namespaces, car is still gonna be there in pico
<geri> without which you cannot do anything
<abu[7]> Coloring is static, but symbols are dynamic
<abu[7]> or meaning in general
<geri> time to write something a la colorforth? :D
<geri> obviously joking, idk what it would even mean
<abu[7]> hmm, I don't like too many colors in code
<geri> you only got lists symbols and numbers anyway
<geri> i agree
<geri> too many bad, but all white is bad too
<geri> comments + transients is a good middle ground imo
<abu[7]> yeah
<geri> i would maybe give builtins a different shade so you don't shadow them on accident
<geri> but probably not even worth the effort
<abu[7]> I think so ;)
<geri> do you also have this thing where you can "declare" a symbol in a particular namespace using namespace~symbol? :D
<abu[7]> right
<geri> wait, priv is a namespace right
<abu[7]> yes
<geri> so instead of (private) Symbol, can't you do priv~Symbol?
<abu[7]> T
<abu[7]> Vip does that
<geri> looks way better imo
<geri> nice
<abu[7]> (intern "X" 'priv)
<abu[7]> special case
<geri> actually, does (private) force re-interning or or priv is just marked somehow as "i cannot hold data for long"?
<abu[7]> It has an a bit special behavior, as described in the ref
<abu[7]> always searched first, but never gets new symbols automatically interned
<abu[7]> That's the key points!
<abu[7]> Besides to re-privitze if a symbol appears again
<abu[7]> *re-privatize
<geri> fun!
<geri> where's search order stored?
<abu[7]> (vi 'llvm~$Intern)
<abu[7]> It is a list of symbols
<geri> so it's not user-accesible?
<geri> like pico
<abu[7]> as shown by (symbols)
<abu[7]> not explicitly
<abu[7]> set and returned by the 'symbols' function
<abu[7]> (if (atom X) (val $Intern) ...
<geri> so its not attached to a particular namespace?
<abu[7]> which one? 'priv'?
<geri> each
<geri> namespace pico has no search order required, but if i wanna use (symbols 'test 'pico)
<geri> do i need to do exact same symbols call each time?
<abu[7]> Depends
<geri> instead of just (symbols 'test) and it knows that pico is also to be used
<abu[7]> but 'pico' is a normal namespace
<abu[7]> and 'priv' too
<abu[7]> With (symbols 'test) pico is not searched
<geri> in fact, i dont think you even can do anything from there
<abu[7]> 'local' does that
<abu[7]> a single ns
<geri> hm
<abu[7]> (symbols (list (car (symbols))) (read))
<abu[7]> Just 1 ns :)
<abu[7]> the first one
<geri> i meant like if you "defined" a namespace, you probably dont wanna have to redeclare symbols it uses every time you gotta hop back in
<abu[7]> ns has nothing to do with declarations
<abu[7]> only scope
<abu[7]> I think I don't understand
<abu[7]> "hop back in"
<abu[7]> A namespace is just a tree of symbols
<abu[7]> 2 trees to be exact
<geri> if i have a namespace "core", it gets defined elsewhere but need to go in and add something else
<geri> id have to put the exact same call to symbols to do that
<geri> probably not a big problem though
<abu[7]> T
<abu[7]> just do (symbols '(core foo bar pico))
<geri> i store namespace info in a symbol "meta", with search order and namespace name
<abu[7]> or (symbols '(core foo bar pico) (readSomething))
<geri> maybe overkill
<geri> oh thats nice
<abu[7]> Pil ns uses '~' as a special marker, so a kind of meta symbol
<abu[7]> not absolutely needed
<geri> i though thats a reader marker
<abu[7]> but useful for checks
<abu[7]> yes, when reading
<abu[7]> but in the CAR of a ns it does not conflict
<geri> why is \~ and nil interned in new namespace when doing (symbols 'test 'pico)
<geri> capital nil
<abu[7]> : (car pico)
<abu[7]> -> \~
<geri> its a marker that variable is a namespace?
<abu[7]> NIL is not interned
<abu[7]> it is the tree
<abu[7]> idx
<geri> oh
<geri> just empty
<geri> xd
<abu[7]> Try (all 'ns)
<abu[7]> yes
<abu[7]> empty node links
<abu[7]> : (symbols 'foo 'pico)
<abu[7]> -> (pico)
<abu[7]> foo: (local) (bar blub)
<abu[7]> foo: (all 'foo)
<abu[7]> -> (bar blub) # foo~bar
<abu[7]> foo: foo
<abu[7]> -> (\~ (bar NIL blub))
<abu[7]> That's the idx trees
<geri> makes sense
<geri> so what's \~ for again?
<geri> its a marker "this is a namespace"?
<abu[7]> Exactly
<abu[7]> Some functions check it
<abu[7]> (inline needNsp (Exe X)
<geri> aha
<geri> makes sense
<abu[7]> The reader, and 'symbolt' iirc
<geri> symbolt?
<abu[7]> foo~bar needs 'foo'
<geri> yeah
<abu[7]> symbols
<abu[7]> Easy to err, eg. in foo~bar~blub~sym
<geri> pico~pico~pico~pico is the best
<abu[7]> :)
<geri> gotta sleep
<geri> have fun
<abu[7]> OK, cu! ♥
<geri> wow, a heart!
<geri> thanks, laters
<abu[7]> ☺
geri has quit [Quit: ERC 5.5.0.29.1 (IRC client for GNU Emacs 29.4)]
ygrek has quit [Remote host closed the connection]