ChanServ changed the topic of #picolisp to: PicoLisp language | Channel Log: https://irclog.whitequark.org/picolisp/ | Check also http://www.picolisp.com for more information
f8l has quit [Ping timeout: 268 seconds]
f8l has joined #picolisp
ubLIX has joined #picolisp
orivej has joined #picolisp
ubLIX has quit [Quit: ubLIX]
xkapastel has quit [Quit: Connection closed for inactivity]
alexshendi has quit [Read error: Connection reset by peer]
<viaken> Regenaxer: What sort of black magic are you using here? I just benchmarked nginx serving static sites against picolisp generating them with xhtml.l and pil came out ahead.
<viaken> I suppose there's no real trips to disk with pil, though. I wonder if adding something in the db would change it.
<tankf33der> viaken: merge sort
<viaken> Can someone point me to the rhyme/reason behind the lambda-binding environment offsets chosen in xhtml.l? I'm needing to use (tag) some and need to understand how it's chosen.
<tankf33der> not me, all this unknown to me
<tankf33der> most active ppl in EU time here if you
<tankf33der> not feet try mailling list
<tankf33der> or wait several hours :)
<Regenaxer> Hi viaken! I think there is no black magic. Just a minimal server
<Regenaxer> and yes, lots of stuff may be cached in memory
<Regenaxer> The offets in the tag function are there to run the prog bodies in the env of the caller
<Regenaxer> I would recommend to simply pick an example and modify it
freemint has joined #picolisp
freemint2 has quit [Ping timeout: 245 seconds]
orivej has quit [Ping timeout: 272 seconds]
freemint2 has joined #picolisp
freemint has quit [Ping timeout: 246 seconds]
_whitelogger has joined #picolisp
rob_w has joined #picolisp
xkapastel has joined #picolisp
freemint2 has quit [Ping timeout: 252 seconds]
freemint has joined #picolisp
mtsd has joined #picolisp
<mtsd> Good morning!
<Regenaxer> Good morning mtsd!
<Regenaxer> How is life? :)
<mtsd> Oh, busy!! :)
<Regenaxer> With son?
<mtsd> Yes, with all three of them
<Regenaxer> Good :)
<mtsd> Taking the two oldest to school and pre-school in the mornings, and picking them up in the afternoon
<mtsd> Youngest one is asleep now, so I took the opportunity to visit my favourite programmers :)
<Regenaxer> :)
<mtsd> I hope I can get started a bit on documenting http.l etc, has taken a bit more time than I would have liked
<Regenaxer> cool! No hurry!
<mtsd> Sorry about that, I really am
<mtsd> How is life for you, these days? All well, I hope?
<Regenaxer> Yes, also busy :)
<mtsd> Yes, I check the changelog regularly. There is always new, great stuff, there
<Regenaxer> Thanks
<Regenaxer> Most goes into PilBox related stuff
<mtsd> By the way, do you have any pointers on how to get started with Pil assembler? How to start looking into the really low-level stuff?
<mtsd> i.e. trying to understand how things are really working? ;)
<Regenaxer> Hmm, not so much. The main "doc" is doc64/asm
<Regenaxer> that's the one I use too to look up things
<mtsd> I thought so. Just a matter of studying that and then come up with questions, I suppose?
<Regenaxer> yes, that's best
<mtsd> My idea is that I would like to move towards being a programmer, for real. Not just a "library user". If you follow what I mean?
<Regenaxer> The asm basically manipulates the registers shown in doc64/asm, operating on the data in doc64/structures
<Regenaxer> yes, though there is no clear separation
<Regenaxer> especially not in pil
<mtsd> True, good point
<mtsd> I have gotten to the point where I can write applications, at least.
<mtsd> It is probably a matter of spending the time required to really study things, for me
<Regenaxer> indeed
<mtsd> No shortcuts ;)
<mtsd> But that is what I like. If you spend the time and effort required, you can really understand it all, from top to bottom.
<Regenaxer> And later save lots of time and nerves
<mtsd> Spend time and effort early, to save more time and effort later
<Regenaxer> T
<beneroth> Good morning mtsd !
<beneroth> Hi Regenaxer :)
<beneroth> very true and wise, what you say :)
<mtsd> Hi beneroth!
<mtsd> How are things?
<Regenaxer> Hi beneroth!
<beneroth> good. also busy, mainly with writing bills, paper work, and multiple programming projects in parallel - some of them delayed by third parties (annoying). I'm healthy and in good mood :-)
<mtsd> Good to hear!
<Nistur> mornin'
<Regenaxer> Hi Nistur
<Nistur> hello :)
<mtsd> Hello Nistur
<beneroth> Ahoy Nistur ! :D
<Nistur> hello hello hello :)
<Nistur> My second Atari STE arrived, which means my development plan can go into action :P
<beneroth> yay awesome!
ubLIX has joined #picolisp
<Regenaxer> Perfect! :)
ubLIX has quit [Quit: ubLIX]
freemint2 has joined #picolisp
freemint has quit [Ping timeout: 268 seconds]
mtsd has quit [Ping timeout: 240 seconds]
<razzy> well, i played with chess for several days. i found bugs i introduced. and it plays decent chess. i have trouble defeating it at depth4 without knowing its cost function.
<Regenaxer> Thanks! You are the first one I know who tested it :)
<razzy> i am not surprised
<Regenaxer> :)
<Nistur> I am good at failing at chess. A 2 year old moving the pieces randomly would beat me.
<razzy> i am using picochess to play changed chess with roomate
<tankf33der> razzy: try lichess
<tankf33der> :)
<tankf33der> lichess.org
<razzy> lichess is awesome, but i do not know how to change rules
<razzy> maybe download and rewrite javascript?
<razzy> i changed rules precisely so it is not easy to use public engines
<razzy> only think i need from computer is to workout step by step 2-6lvl deep tactical exchanges. if computer gives me 5 good moves i can choose very very strong move
orivej has joined #picolisp
razzy has quit [Ping timeout: 268 seconds]
razzy has joined #picolisp
<razzy> when reading NIL value at symbol, anybody have problem deciding if it is FALSE or nothing?
<beneroth> NIL and FALSE is considered to be the same thing in picolisp
<razzy> i know, anybody think it is confusing? any thinkaround?
<beneroth> I don't think it is confusing, and from experience I can say that the picolisp way seems to be the more natural one in nearly all situations. in most cases, you're only interested if there is a value or not, and if there is one you further process it.
<beneroth> so you can always use a specific value to mean false in your application, so that you can differentiate between "false" and "has no value", if you need that. in my experience, you don't need this in the general cases, only specific ones, so the default assumption of picolisp makes sense
<beneroth> e.g. in pilDB there exists no NULL, no three-value-logic. if you wan't to differentiate between "unknown" and "empty value", you need to store a certain empty value
<beneroth> you can always use 'false or 'empty or thelike as a value for that, just pick something which is clearly not in the range of possible legitimate values for that variable
<razzy> i agree. but i have little problem understanding foreign code. when i ask picolisp about some symbol, i do not know if it is undefined or false.
<Regenaxer> "Undefined" exists only for functions in PicoLisp
<Regenaxer> Symbols *always* have a value, which may be NIL initially
<razzy> but i guess it is not picolisp problem, but problem from somebody who written the app. thx for clarification
<razzy> Regenaxer: why have different values for symbols and variables?
<razzy> i mean, internaly they are same
<Regenaxer> internally we have only symbols. A symbol may be *used* as a variable
<razzy> sorry, why have different values for functions and variables?
<Regenaxer> What different values do you mean?
<razzy> undefined?
<Regenaxer> The same values
<razzy> but i think undefined is just another name for NIL
<Regenaxer> But some value may not be a function
<razzy> hm
<Regenaxer> Not only NIL
<Regenaxer> anything which is not a function
<Regenaxer> see the ref
<Regenaxer> a function is either a number or a (lambda)list
<Regenaxer> See doc/ref.html#ev
<razzy> i think distiction between function, symbol, variable should be stored in properties and be the same othervise.
<razzy> i will look for it
<Regenaxer> I recommend that you read the whole section "Programming Environment" thorougly
<Regenaxer> and try to understand it, as it is a bit terse ;)
<Regenaxer> But at least the chapter "Evaluation"
<razzy> thx, i will read up and no longer bother you :]
<Regenaxer> no problem!
<razzy> i have another small issue. i thinked that function take symbols as arguments.
<razzy> but function game in simul.l takes "strings" which confuses me. https://ptpb.pw/qqwP
<Regenaxer> You mean "parameters" right? They take any argument
<Regenaxer> ah
<Regenaxer> There are no strings in pil. They are transient symbols
<Regenaxer> See the reference above
<razzy> good question? bad question? i meant transient symbols
<Regenaxer> right, so they are symbols
<Regenaxer> transient symbols are used often for a local scope
<razzy> aaarg, mindblown
<razzy> hmm,.. how can i look inside transient symbol value?
<Regenaxer> You can access it with 'loc'
<beneroth> if a transient symbol has no value, it evaluates (gives back) its name
<beneroth> this differs from normal symbol.
<razzy> why there is this behaviour?pls
<beneroth> has the nice feat that you can do translation by giving "strings" a value (the translated string)
<beneroth> and without value it behaves kinda like a string in other languages
<Regenaxer> beneroth, not completely right
<razzy> some convoluted magic :]
<Regenaxer> A transient symbol also gives back its value as other symbols too
<Regenaxer> It is just *initialized* to itself
<Regenaxer> For example NIL and T are also this way
<beneroth> it's not initialized, as it doesn't have a value by default
<beneroth> well
<Regenaxer> It always has a value
<beneroth> hm. in behaviour you are right
<beneroth> ok
<Regenaxer> physically
<beneroth> ok you are right
<beneroth> so.. two pointers to the name then?
<Regenaxer> Then you can do (setq "A" 1)
<Regenaxer> not the name
<Regenaxer> the symbol
<Regenaxer> the value *is* the symbol again
<Regenaxer> like T
<Regenaxer> (val (val (val T))) -> T
<Regenaxer> or NIL
<Regenaxer> (val (val (val "a")))
<beneroth> yes, when you set a value. I mean for when you didn't set a value. is the value-pointer pointing to the same as the name-pointer does (in the cell structure) ? or is the value pointing to NIL ?
<Regenaxer> (== "a" (val "a"))
<Regenaxer> The name is not visible on the Lisp level
<Regenaxer> always only the symbol
<Regenaxer> The name is a list of numbers internaley
<beneroth> I'm fully aware that transient symbol can hold another symbol/number/list (function definition) as a value.
<Regenaxer> yes, any symbol
<Regenaxer> can
<Regenaxer> (setq a 'a)
<Regenaxer> this is the same
rob_w has quit [Quit: Leaving]
<Regenaxer> Only that transients are automatically initialized this way
<razzy> hmm, i am little lost
<Regenaxer> For localization this value is set to the translation later
<beneroth> : (setq "a" NIL)
<beneroth> -> NIL
<beneroth> : "a"
<beneroth> -> NIL
<beneroth> I see. you are right, "initialized" is the correct term, I was wrong.
<beneroth> so "transient symbols are on default initialized with their name as their value" would be correct, Regenaxer ?
<Regenaxer> not the name, but the symbol itself
<beneroth> ok
<Regenaxer> the value *points* to the symbol
<beneroth> yes I see
<razzy> those complex behaviour seems little uncalled for
<beneroth> you will see its usefulness later on. for now just accept it ;-)
<Regenaxer> yeah
<beneroth> if you find a even simpler solution giving all the (not yet obvious to you) benefits, I'm sure Regenaxer would probably adapt it. But its quite doubtful that such a better solution exist.
<razzy> very reasuring ;]
<razzy> Regenaxer: does using transient symbols have some benefits? (asking for game function)
<Regenaxer> yes, when you want to make sure to have them file-local
<Regenaxer> And then this auto-evaluating feature, so you don't need to quote hem
<Regenaxer> (prinl "hello") versus (prinl 'hello)
<Regenaxer> same output, but the internal symbol must be quoted
<razzy> hmm, i like to write all (quote hello) when learning languge
<razzy> makes one deep engrave language to its brain
<Regenaxer> ok, that's fine
<Regenaxer> indeed more obvious
<razzy> i think all languages should have some basic, expanded verbose mode :]
<Regenaxer> you can (and should) always be verbose by priting lots of comments
<Regenaxer> (I'm bad at that however)
<razzy> :D i was going to point it out
<beneroth> problem is most people are happy settled after finding just 1 (often bad) way to do things. hence PHP. so maybe enforcing a good way (open for debate ofc) might be an overall better, even when it makes people a bit uncomfortable initially.
<Regenaxer> bbl
<razzy> bbl
alexshendi has joined #picolisp
ubLIX has joined #picolisp
razzy has quit [Ping timeout: 268 seconds]
alexshendi has quit [Ping timeout: 268 seconds]
ubLIX has quit [Quit: ubLIX]
razzy has joined #picolisp
razzy has quit [Remote host closed the connection]
razzy has joined #picolisp
alexshendi has joined #picolisp
razzy has quit [Ping timeout: 268 seconds]
razzy has joined #picolisp
alexshendi has quit [Read error: Connection reset by peer]
razzy has quit [Ping timeout: 252 seconds]
alexshendi has joined #picolisp
freemint has joined #picolisp
freemint2 has quit [Ping timeout: 276 seconds]
freemint has quit [Ping timeout: 252 seconds]
razzy has joined #picolisp
<razzy> hmm, i have behaviour i do not understand. i cannot access values of transient symbols after debugging https://paste.pound-python.org/show/NSWaIgINdkUKMckCITdV/
<razzy> any ideas?
<Regenaxer> It has not really to do with debugging. In general they are found by the *reader* only as long as you are in the same scope
<Regenaxer> And same scope is one 'load'
<Regenaxer> eg. inside a single source
<Regenaxer> in the REPL only until you enter an empty line, which sends EOF to 'load'
<razzy> why
<razzy> err sry
<Regenaxer> So the rule is: They are found by the reader as long as in the same repl
<Regenaxer> Example:
<Regenaxer> : (zero "a")
<Regenaxer> : "a"
<Regenaxer> -> 0
<Regenaxer> -> 0
<Regenaxer> :
<Regenaxer> : "a"
<Regenaxer> -> "a"
<Regenaxer> I hit ENTER in the line with only a :
<Regenaxer> this closed the repl and started a new
<Regenaxer> You use this feature in a debug break
<Regenaxer> the '!' prompt
<Regenaxer> here you have a local repl
<razzy> how can i make repl load variables?
<Regenaxer> ENTER leaves this repl and continued execution
<razzy> so i can inspect them?
<Regenaxer> Better don't use transients then
<Regenaxer> I recommend namespaces
<Regenaxer> As long as in the namespace, the symbols are *internal* and not *transient*
<Regenaxer> From another namespace they are transient then
<Regenaxer> hmm
<Regenaxer> you use pil32?
<Regenaxer> no namespaces then
<razzy> i use multiple pils
<razzy> namespace is (let ?)
<Regenaxer> no, namespace is (symbols 'foo 'bar 'pico)
<Regenaxer> 'let' binds local variables
<razzy> i will rewrite your code tham
<Regenaxer> So in your case, I would not worry now
<razzy> than
<Regenaxer> just use normal internal symbols
<Regenaxer> There are only certain cases where you need them
<Regenaxer> Explained in the faq
<razzy> internal? or transient :
<Regenaxer> ie. if you call a passed in function, or if you modify the value of a passed in symbol
<Regenaxer> transients
<Regenaxer> like 'game' does
<Regenaxer> It gets functions passed in
<Regenaxer> Three functions "Moves" "Move" and "Cost"
<razzy> i will rewrite game function because i cannot inspect transient symbols properly
<Regenaxer> yes
<razzy> is it my best option?
<Regenaxer> I would (trace 'game) first
<razzy> hm thx
<Regenaxer> Transients are indeed tricky to debug
<Regenaxer> I use (loc "Moves" game) and so
<razzy> i had problems using loc.
<razzy> never knew how to use
<Regenaxer> It is tedious to type so much stuff
<Regenaxer> eg (val (loc "MyVar" myFun))
<razzy> btw, why have different namespaces for symbols in picolisp? dont we have (let) for precisely that reason?
<Regenaxer> or (show (loc "MyVar" myFun))
<Regenaxer> no, 'let' binds local variables
<Regenaxer> *binds*
<razzy> local variables are symbols
<Regenaxer> the symbols are the same
<Regenaxer> yes
<Regenaxer> With namespaces you have different *symbols* with the same name
<razzy> yes, why not make localy binded symbols?
<Regenaxer> Functions, classes, global constants etc
<Regenaxer> Nothing to do with values
<razzy> these are just symbols
<Regenaxer> T
<Regenaxer> You have a function 'foo' in one namespace
<Regenaxer> and 'foo' in another
<Regenaxer> different behavior
<Regenaxer> Both functions exist and may run at the same time
<Regenaxer> namespace is only about the reader
<Regenaxer> just like transients
<Regenaxer> transients are in a kind of private namespace
<razzy> i think i understand behaviour. i feel that (let) should be up to the job
<Regenaxer> Sorry, not at all
<Regenaxer> namespaces are for a whole library
<Regenaxer> look at @lib/gis.l, @lib/android.l or @lib/vip.l
<Regenaxer> It PilBox you have many apps run in the same process
<Regenaxer> So namespaces are needed to separate them
<Regenaxer> Some of them even have a DB
<Regenaxer> With different E/R classes of the same name
<razzy> like local namespaces. i like the idea of namespaces. i feel local namespaces should be created by some function similiar to (let)
<razzy> i even think (let) could create local namespace :]
<Regenaxer> You don't understand at all. I give up
<razzy> and you would need some global def function
<razzy> maybe
<razzy> Regenaxer: thank you for your time:]. your explanation of my problem was on spot.
<Regenaxer> Good :)
<razzy> btw, somthing like untraceAll?
<Regenaxer> Unfortunately not, you need to restart
<razzy> good enough
lodsw has quit [Ping timeout: 252 seconds]
<razzy> only chumps use traceAll
<razzy> :
<razzy> :]
<Regenaxer> What is a chump? ;)
lodsw has joined #picolisp
<razzy> i have seen it in movie. https://www.merriam-webster.com/dictionary/chump easily tricked person who use trace all for amusement
<Regenaxer> Found it in Wiktionary, yeah
<Regenaxer> I use traceAll whenever I have no more idea where to look for a bug
libertas has quit [Remote host closed the connection]
libertas has joined #picolisp
ubLIX has joined #picolisp
freemint has joined #picolisp
* freemint is /me