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
<aw-> indeed good community here. I'm also glad it's not on shitty Discord.
wineroots has joined #picolisp
v88m has quit [Ping timeout: 250 seconds]
v88m has joined #picolisp
rob_w has joined #picolisp
rowanthorpe has joined #picolisp
rowanthorpe1 has joined #picolisp
rowanthorpe has quit [Ping timeout: 240 seconds]
<razzy> I do not like Discord. Have Discord console client?
mtsd has joined #picolisp
razzy has quit [Ping timeout: 250 seconds]
rowanthorpe1 has quit [Remote host closed the connection]
razzy has joined #picolisp
rowanthorpe has joined #picolisp
razzy has quit [Ping timeout: 248 seconds]
razzy has joined #picolisp
razzy has quit [Ping timeout: 248 seconds]
razzy has joined #picolisp
razzy has quit [Ping timeout: 240 seconds]
razzy has joined #picolisp
razzy has quit [Ping timeout: 248 seconds]
razzy has joined #picolisp
razzy has quit [Ping timeout: 248 seconds]
v88m has quit [Remote host closed the connection]
razzy has joined #picolisp
razzy has quit [Ping timeout: 250 seconds]
razzy has joined #picolisp
<wineroots> Use a discord to matrix bridge and use a console matrix client. Or similarly look for an xmpp option razzy
razzy has quit [Ping timeout: 250 seconds]
razzy has joined #picolisp
razzy has quit [Ping timeout: 240 seconds]
razzy has joined #picolisp
rob_w has quit [Quit: Leaving]
rowanthorpe has quit [Quit: rowanthorpe]
razzy has quit [Ping timeout: 248 seconds]
razzy has joined #picolisp
mtsd has quit [Quit: Leaving]
razzy has quit [Ping timeout: 240 seconds]
razzy has joined #picolisp
razzy has quit [Ping timeout: 248 seconds]
razzy has joined #picolisp
hunar has joined #picolisp
razzy has quit [Ping timeout: 250 seconds]
razzy has joined #picolisp
<razzy> hmm, weird. program works. than randomly either cycles without output or segmentation faults.
<razzy> Regenaxer: when i arrange plenty memory (gc 100) it works fine.
<razzy> program create lots of garbage
<Regenaxer> Looks like a gc problem. Perhaps you found a bug in pil21?
<Regenaxer> Can you show the minimal setup which reproduces it?
<razzy> Regenaxer: could be lots of work.
<razzy> will do.
<Regenaxer> ok, then 'trace' all functions
<razzy> trace should help.
<Regenaxer> yes, first the Lisp level functions, and if you know which one then trace the built-in functions
<razzy> Regenaxer: trace does not work as I expect. Can i (trace 'myFun)
<Regenaxer> Yes, but only EXPRs can be traced, not FEXPRs
<Regenaxer> Well, FEXPRs work too, but are not fully traced
<Regenaxer> So no reason to worry
<Regenaxer> Easiest is (traceAll) for a first search
<razzy> hmm,.. trace has problems
<razzy> is there debug all?
<Regenaxer> Makes not really sense
<Regenaxer> Why does trace not work?
<razzy> i do not know. it breaks.
<Regenaxer> Can't be ;)
<razzy> traceAll works. also
<Regenaxer> What kind of "break"?
<razzy> no ins no outs cycle at 100% cpu
<Regenaxer> So trace did not break
<razzy> (trace 'until) breaks program
<Regenaxer> Your program is in an infinite loop
<Regenaxer> No, 'until' can't be traced
<Regenaxer> EXPRs and FEXPRs
<Regenaxer> or SUBRs
<Regenaxer> but not FSUBRs
<Regenaxer> 'until' does not evaluate the arguments in a way that can be traced
<Regenaxer> I said *first* trace all relevant Lisp-level functions
<razzy> traceAll works. it segments faults in much later cycle. I suspect that gc has more time.
<Regenaxer> myFoo etc
<Regenaxer> ok
<Regenaxer> so *where* does it crash*
<Regenaxer> ?
<Regenaxer> That's why we trace it
<Regenaxer> a fun is entered but never left
<razzy> i will try several runs to have consistent results
<Regenaxer> So you see in the trace history exactly *where* it crashed
<hunar> Hi everyone :D I wrote down some general questions that i want to ask
<Regenaxer> Hi hunar! Great, please ask :)
<hunar> Why doesn't the creator of this language have a Wikipedia page :/ I wanted to know his age, i didn't even know if he was alive.. Does he have a bio page somewhere?
<Regenaxer> Haha, well I think that's me
<Regenaxer> I'm 67 now
<hunar> Oooo :X sorry, i had a feeling but didn't realize it :X
<Regenaxer> Sorry, no direct page about me
<Regenaxer> We are such a small community that I have to pepulate it ;)
<Regenaxer> *pop...
<hunar> I'm very happy that i'm talking to the creator :D
<Regenaxer> No big thing
<hunar> I hope you reach 100+ years :D
<Regenaxer> Pil is very simple
<Regenaxer> OK, thanks!!!
<Regenaxer> I would say I'm the "discoverer", not "creator"
<Regenaxer> Most concepts in Pil existed somewhere
<hunar> No problem :D, next question, what editors do Pil users use? I like using vim but emacs was the only feature rich editor for CL .. I want from my editors (syntax highlighting + autocompletion + info about the functions that i'm trying to use)
<Regenaxer> I personally am a VI fan, never used emacs, but some people here do
<Regenaxer> Built-in into Pil is "Vip", a vim subset written in Pil
<Regenaxer> It does syntax highlighting only for comments and strings though
<hunar> Is it possible to get the argument list along with a docstring with Vip or VI
<Regenaxer> If the function is in memory, just (pp 'foo)
<Regenaxer> The arg list is (car foo)
<Regenaxer> You can do : (vi 'foo)
<Regenaxer> or : (doc 'foo)
<Regenaxer> (doc) only for built-in funs of course
<Regenaxer> But (vi 'foo) works for any function
<Regenaxer> You know you need to start it with "+"?
<Regenaxer> $ ./pil +
<hunar> I have a problem now :/
<Regenaxer> Not installed yet? ;)
<hunar> when i use pil its ok, but when i use pil + the closing parenthesis freezes the terminal
<Regenaxer> strange
razzy has quit [Ping timeout: 250 seconds]
<Regenaxer> The parens are handled by readline()
<Regenaxer> Is it pil21?
<hunar> I tried with another virtualbox linux today and it didn't have this problem, it must be my system only
<Regenaxer> I remember this issue in old pils
<Regenaxer> there the paren handling was handled by pil itself
<hunar> I'll reinstall readline and come back
<Regenaxer> and a (wait 200) or so is called when jumqing to parens
<hunar> Yes exactly, I get that too
<Regenaxer> It boiled down to some system call not working
<Regenaxer> Old pils called select(2)
<Regenaxer> pil21 calls poll(2) but that's not the preblem
<hunar> Oh, i'm using Archlinux and it says the AUR version (that i'm using) is outdated, i'll have to recompile
<hunar> Version 18.9.5
<Regenaxer> I see, Arch should be fine
<Regenaxer> I strongly recommend to use pil21
<Regenaxer> then see INSTALL
<Regenaxer> $ sudo apt install make clang llvm libreadline-dev libffi-dev libssl-dev pkg-config
<Regenaxer> ...
<Regenaxer> well, no 'apt' in Arch, but you know
<hunar> Thanks :D I did go over the compilation procedure for windows, it should be similar :D
<Regenaxer> oh, right! You told so :)
<Regenaxer> What is AUR btw?
<hunar> It's this website https://aur.archlinux.org/ that archlinux uses to install packages that aren't in the official repositories, it is a PKGBUILD file that contains all the dependencies and build/install procedures that even non archlinux users can use as a guide, we just type (makepkg -si) and it download/compile/get dependencies/install it
<Regenaxer> I see
<Regenaxer> Yeah, outdated
<Regenaxer> Direct fetch of the TGZ is best
<hunar> Yeah
<hunar> Install complete, i tried (vi 'car) i saw the implementation but i hoped to get a small informative docstring :D, no worries i think i will just alt+tab to a browser during development
<Regenaxer> Cool
<Regenaxer> Does (doc 'car) work?
<Regenaxer> It defaults to w3m browser
<hunar> Ooo that is much better
<hunar> It opened firefox for me
<Regenaxer> yes, according to $BROWSER then
<hunar> yeah :D, next question, i think the answer is yes but does Pil have live editing without re-run thingy? i don't know what it was called, basically if i run a server would further changes in the Pil sources affect the server without stopping&running it again?
<Regenaxer> yes, also with 'vi'
<Regenaxer> You either pass a list of symbols
<Regenaxer> : (vi '(myFoo myBar))
<Regenaxer> or use the shortcut
<Regenaxer> : (v myFoo myBar)
<Regenaxer> This basically pretty-prints the data to a temp-file
<Regenaxer> value plus properties
<Regenaxer> In a typical pil web app most sources are loaded on the fly anyway
<Regenaxer> So you can edit the sources and then just click the browser reload button
<hunar> I think i need to get into more of the tutorial to fully understand the procedure :) I'll comeback and read this again
<Regenaxer> good :)
<hunar> another question :D, does Pil have tail call optimization? the thing that doesn't let some recursive functions to use all the memory
<Regenaxer> No, no tail call optim
<Regenaxer> Not really feasible in an interpreter
<Regenaxer> You must use loops instead
<hunar> Did you run into those issues in your programming years with Pil?
<Regenaxer> the memory problems?
<hunar> I personally never used such recursion
<Regenaxer> ah
<Regenaxer> yes, I never needed
<Regenaxer> I feel that loops is the right thing for looping ;)
<Regenaxer> Recursion is needed for tree traversals etc
<Regenaxer> and those things are not tail-recursive
<Regenaxer> (or only partial)
<hunar> I agree :D
<hunar> One question left :D can the android app PilBox access the phone sensors?
<Regenaxer> Yes
<Regenaxer> there are some demos
<hunar> Amazing!
<Regenaxer> eg "steps"
<Regenaxer> or "battery"
<hunar> I found it :D https://picolisp.com/wiki/?PilBox thanks, i didn't encounter it before
<Regenaxer> (the battery worked on my old Nexus 9, but for unknown reasons not on this OnePlus 6T)
<Regenaxer> Ok
<Regenaxer> There is a more up to date README at https://www.software-lab.de/PilBox/README
<Regenaxer> Lists the example apps
<hunar> Thanks :D
<Regenaxer> You know that you just type "steps" in the settings and press "Download"?
<Regenaxer> Then you can click on the list and directly view the source
<hunar> I didn't :| let me try it
<hunar> Battery doesn't work for me either, Nokia 6
<Regenaxer> Shows empty screen?
<hunar> yes
<Regenaxer> Don't know what happenend
<Regenaxer> Perhaps my fault
<Regenaxer> did not check under pil21 yet
<Regenaxer> Will do during the next days
<hunar> There is also picolisp in termux not sure how useful it is
<Regenaxer> I use it as my main env, but the Termux version is also old
<hunar> Can I edit code and run in PilBox itself?
<Regenaxer> So I use a pil21 inst
<Regenaxer> Yes, you can either edit in the repl (tedious) or connect a terminal and use vip
<hunar> How to connect the terminal
<Regenaxer> In the repl window in PilBox enter a file name and press edit
razzy has joined #picolisp
<Regenaxer> The terminal usage is new
<Regenaxer> I showed it last PilCon
<Regenaxer> not documented yet
<Regenaxer> You can connect either from Termux or a PC in the same LAN
<Regenaxer> But: it needs a common secret
<Regenaxer> What is better, Termux or PC?
<hunar> In PilBox when I enter the filename and press edit, i can write stuff but when i press done, it all dissapears
<Regenaxer> (needs a pil21 in both cases)
<Regenaxer> yes, but the changes are written
<Regenaxer> just edit the file again
<Regenaxer> or do
<hunar> I like termux, except i'm muuch faster at typing with 10 fingers on pc
<Regenaxer> ! cat file
<Regenaxer> ok
<Regenaxer> So put a random string into a file ~/.pty
<Regenaxer> on your pc
<Regenaxer> then in repl do the same
<Regenaxer> PilBow looks for a file ~/.pty on startup
<Regenaxer> then it opens a socket on port 8082
<hunar> wait :/ i got lost.. (put random string in ~/.pty on pc) (then in repl do same, i didn't understand this one
<Regenaxer> you edit a file ".pty" in the repl
<Regenaxer> and paste the same secret string
<hunar> in PilBox
<Regenaxer> yes
<Regenaxer> you can also do
<Regenaxer> !echo "xxxxx" >.pty
<Regenaxer> in the repl prompt
<Regenaxer> '!' shell call
<hunar> Done
<Regenaxer> ok
<Regenaxer> I have .pty in termux
<Regenaxer> then I can call
<Regenaxer> $ pil21/bin/pty
<Regenaxer> this is a script which does a kind of telnet
<Regenaxer> it also sends the secret
<Regenaxer> But: First restart PilBox
<Regenaxer> i.e. swipe it off one time
<Regenaxer> To connect from PC, do
<Regenaxer> $ ./pil pil21/bin/pty 192.168....
<Regenaxer> ie you must find the IP address of the phone
<Regenaxer> $ ip addr
<Regenaxer> in Termux for example
<hunar> I don't have pty in /bin .. i think i didn't install the rolling version
<Regenaxer> yes, it is very new
<hunar> I'll get it and come back :D
<Regenaxer> good
<hunar> Ok, it says android:
<Regenaxer> Perfect! :)
<Regenaxer> It is the namespace android
<Regenaxer> You can now : (vi 'car)
<razzy> Regenaxer: i have inspect program variables. i will send conclusion tomorow
<razzy> *i have to
<hunar> It is veeery laggy :(
<Regenaxer> No hurry razzy
<Regenaxer> hunar, really?
<Regenaxer> Here it feels smooth
<hunar> It got better now :D
<Regenaxer> the bin/pty is not very efficient
<hunar> I think app battery optimization on android is messing with it
<Regenaxer> it does char by char
<Regenaxer> oh
<Regenaxer> I see
<hunar> I'll disable it
<Regenaxer> yes, faulty somewhere
<Regenaxer> Does the step counter work?
<Regenaxer> It also uses serverSentEvent but works fine here
<hunar> I shake my phone, nothing happens, a few seconds later the number increased
<Regenaxer> on my phone it seems to wait 10 steps
<Regenaxer> then jumps by 10
<Regenaxer> Depends on the phone hardware
<hunar> Wait, It works perfectly now :/
<Regenaxer> If you switch the app, then (vi 'work) always edits the currently active one
<Regenaxer> i.e. depending on namespace
<hunar> And the battery one made the screen red, does it change the background? I'm on 17% charge
<Regenaxer> The background is constant
<Regenaxer> simple CSST
<Regenaxer> CSS
<hunar> ok so the battery still not working
<Regenaxer> yes, same here
<hunar> one more thing, when i'm connected with my pc, what file is being edited?
<Regenaxer> Something works:
<Regenaxer> android: *BatteryManager
<Regenaxer> -> {H@@@1216631101}
<Regenaxer> Try (show *BatteryManager)
<Regenaxer> It edits the file on PilBox
<Regenaxer> bin/pty is just a terminal
<Regenaxer> And (show *BatteryManager) shows the real thing
<Regenaxer> The object in the Java runtime
<hunar> So whatever i type on my pc directly takes effect on PilBox or i have to run it there
<hunar> android: (show *BatteryManager)
<hunar> -> NIL
<hunar> NIL NIL
<Regenaxer> Battery must be active
<Regenaxer> the app
<hunar> android: (show *BatteryManager)
<hunar> {H@@@1133444647} ({H@@@1154765747} . "android.os.BatteryManager")
<hunar> ACTION_CHARGING "android.os.action.CHARGING"
<hunar> ACTION_DISCHARGING "android.os.action.DISCHARGING"
<hunar> BATTERY_HEALTH_COLD 7
<hunar> BATTERY_HEALTH_DEAD 4
<hunar> BATTERY_HEALTH_GOOD 2
<hunar> BATTERY_HEALTH_OVERHEAT 3
<hunar> BATTERY_HEALTH_OVER_VOLTAGE 5
<hunar> BATTERY_HEALTH_UNKNOWN 1
<hunar> BATTERY_HEALTH_UNSPECIFIED_FAILURE 6
<hunar> BATTERY_PLUGGED_AC 1
<hunar> BATTERY_PLUGGED_USB 2
<hunar> BATTERY_PLUGGED_WIRELESS 4
<hunar> BATTERY_PROPERTY_CAPACITY 4
<Regenaxer> hehe, yes :)
<hunar> BATTERY_PROPERTY_CHARGE_COUNTER 1
<hunar> BATTERY_PROPERTY_CURRENT_AVERAGE 3
<hunar> BATTERY_PROPERTY_CURRENT_NOW 2
<hunar> BATTERY_PROPERTY_ENERGY_COUNTER 5
<hunar> BATTERY_PROPERTY_STATUS 6
<hunar> BATTERY_STATUS_CHARGING 2
<hunar> BATTERY_STATUS_DISCHARGING 3
<hunar> BATTERY_STATUS_FULL 5
<hunar> BATTERY_STATUS_NOT_CHARGING 4
<hunar> BATTERY_STATUS_UNKNOWN 1
<hunar> EXTRA_BATTERY_LOW "battery_low"
<hunar> EXTRA_CHARGE_COUNTER "charge_counter"
<hunar> EXTRA_CURRENT "current"
<hunar> EXTRA_EVENTS "android.os.extra.EVENTS"
<hunar> EXTRA_EVENT_TIMESTAMP "android.os.extra.EVENT_TIMESTAMP"
<hunar> EXTRA_HEALTH "health"
<hunar> EXTRA_ICON_SMALL "icon-small"
<hunar> EXTRA_INVALID_CHARGER "invalid_charger"
<hunar> EXTRA_LEVEL "level"
<hunar> EXTRA_MAX_CHARGING_CURRENT "max_charging_current"
<hunar> EXTRA_MAX_CHARGING_VOLTAGE "max_charging_voltage"
<hunar> EXTRA_PLUGGED "plugged"
<hunar> EXTRA_PRESENT "present"
<hunar> EXTRA_SCALE "scale"
<hunar> EXTRA_STATUS "status"
<hunar> EXTRA_TECHNOLOGY "technology"
<hunar> EXTRA_TEMPERATURE "temperature"
<hunar> EXTRA_VOLTAGE "voltage"
<hunar> EXTRA_WIRELESS_CHARGER_DISABLE "wireless_cahrger_disable"
<hunar> -> {H@@@1133444647}
<hunar> oh that was too many lines :(
<Regenaxer> :)
<hunar> :D
<Regenaxer> Similar output here
<Regenaxer> So the sensor interface works
<hunar> Great :D
<hunar> When the screen turns off it becomes laggy again
<Regenaxer> not sure
<Regenaxer> Android is a mess. Too many things running all the time asynchronously
<Regenaxer> (vi 'work) shows the battery gui
<Regenaxer> The <h2> appears
<Regenaxer> but (serverSentEvent "bat" '*BatSse) does not
razzy_ has joined #picolisp
v88m has joined #picolisp
<hunar> Sorry i still didn't get the file editing process.. i'm connected on my pc, how can i make a script and save it, and how to run it on PilBox
<Regenaxer> (vi "script.l") ?
<hunar> After that I type script.l in PilBox repl and Eval?
razzy has quit [Ping timeout: 240 seconds]
<Regenaxer> You can (load "script.l")
<Regenaxer> You cannot run an executable in Android any more
<hunar> I think :wq isn't implemented in Vip
<Regenaxer> like (call "chmod" "+x" "script") and then run it
<Regenaxer> right
<Regenaxer> only :x or :q
<Regenaxer> :x saves only if modified
<Regenaxer> and :q quits without asking ;)
<hunar> So the syntax is different from vi
<Regenaxer> a litle
<Regenaxer> a subset
<Regenaxer> :w works too
<hunar> I was doing :q!
<Regenaxer> ah, ! is not recognized :)
<Regenaxer> I usually do :x
<hunar> I think yours is better, less symbols is less confusing
<Regenaxer> to be sure it is not written if not modified
<Regenaxer> ok, thanks!
<hunar> :)
<Regenaxer> I wrote vip exactly according to my .vimrc
<Regenaxer> s/exactly/mostly
<hunar> So if i run my scripts and it contained gui stuff, it will appear on PilBox? or i have to do extra stuff
<Regenaxer> So splitting is qs (in addition to ^Ws)
<Regenaxer> To make a PilBox app, do
<Regenaxer> (call "mkdir" "myApp"
<Regenaxer> oops
<Regenaxer> you create a dir, with a file "App.l" in it
<Regenaxer> easiest if you install hello
<hunar> I don't use too many vim functionality so i guess i'll be re-learning at most 10 commands :D
<Regenaxer> then look at (vi "hello/App.l")
<Regenaxer> ok :)
<hunar> I'll take a look at hello :D that should clear things up
<Regenaxer> yes
<Regenaxer> it is the absolute minimum
<Regenaxer> The first item should be a string
<Regenaxer> it gives the button on the start page
<Regenaxer> And then (menu ... HTML ...)
<Regenaxer> You could modify hello/App.l
<Regenaxer> Another very simple example is "crash"
<hunar> Thanks :D i'll try
<hunar> I tried listing the files with (!ls) what should i write instead
<Regenaxer> :ls
<Regenaxer> you can resize the command window (as opposed to vim)
<Regenaxer> with "+" and "-" you can resize
<hunar> I tried :ls and (:ls) in both PilBox and PC, it didn't work :/
<Regenaxer> also if you make the command win bigger?
<Regenaxer> Minus key in the above window?
<Regenaxer> Oh!
<Regenaxer> Just found a bug in pil21!!!!
<Regenaxer> in the crash App
<Regenaxer> it does not crash :)
<Regenaxer> It uses (/ 1 0)
<Regenaxer> but no error in pil21 :(
<hunar> Right :| in an online picolisp interpreter it says :
<hunar> !? (/ 1 0)
<hunar> but here it's 0
<hunar> Div/0
<Regenaxer> yeah
<Regenaxer> stupid
<Regenaxer> It is wrong all the time since pil21
<Regenaxer> (? (== N ZERO) N)
<Regenaxer> (when (== N ZERO)
<Regenaxer> (divErr Exe) )
<Regenaxer> The first line is superfluous
<Regenaxer> So divErr is never reached
<Regenaxer> I will fix
<hunar> Before you go :) I still cant get :ls to work, it says Undefined
<hunar> :echo works but :ls doesn't
<Regenaxer> The rule in the vip command window is:
<Regenaxer> - A colon and a command *without* space is an editor command
<Regenaxer> - a colon and a space followed by an expression is Lisp
<Regenaxer> So
<Regenaxer> :ls
<Regenaxer> is a listing, but
<Regenaxer> : ls
<Regenaxer> evaluates the symbol 'ls'
<Regenaxer> You can do
<Regenaxer> : (* 3 4)
<Regenaxer> -> 12
<hunar> Now !ls works in PilBox terminal but not on pc
<Regenaxer> Strange!
<Regenaxer> What might be different?
<hunar> I don't know, an app restart didn't sole it either
<hunar> solve*
<Regenaxer> hmm
<Regenaxer> OK, fixed the div/0 issue
<hunar> :)
<Regenaxer> Released it to the rolling release
<Regenaxer> Never noticed :)
<Regenaxer> No divisions by zero usually
<Regenaxer> I think I stop for today
<Regenaxer> tired
<hunar> I just tried one thing, edited the hello/App.l example and added a unicode word, it wasn't displaed in the output
<Regenaxer> In the <h2> line?
<hunar> No, Hello World! سڵاو
<Regenaxer> it is a cache issue
<Regenaxer> you can clear the browser cache
<Regenaxer> in REPL
<Regenaxer> No
<Regenaxer> not necessary
<Regenaxer> Here it changes immediately
<hunar> I'll leave you for now :D thanks for answering all those questions :) take your rest :D
<Regenaxer> No problem! I think just edit works. I'm sure you find :)
<Regenaxer> So good night to everybody!! :)
<hunar> Good night Regenaxer :D
hunar has quit [Quit: Leaving]
razzy has joined #picolisp
razzy_ has quit [Ping timeout: 240 seconds]
oldf8l has joined #picolisp
stultulo has quit [Ping timeout: 240 seconds]
NobleNibble has joined #picolisp
oldf8l has quit [Ping timeout: 248 seconds]