<aw->
Hunar: hi, i'm not sure if you're familiar with PicoLisp debug features, but you might find it **very** useful when coding, to observe your code much better than using (print) everywhere. Just look up documentation for (trace) (debug) (!) (e) ...
<aw->
actually I think Mia wrote a blog post on that topic
seninha has quit [Remote host closed the connection]
genpaku has quit [Remote host closed the connection]
<Hunar>
Hello aw- :D I'm aware of the debugging tools but for lisps in general, I find scratching my head to be easier most of the times. so many things in lisp happen together, like trying to debug a mapcar
genpaku has joined #picolisp
<aw->
yeah...? that's exactly what picolisp step debugging is for
<aw->
you can manually step through each iteration if you want
<aw->
(mapcar '((X) (! + X 1)) (1 2 3))
<aw->
instead of
<aw->
(mapcar '((X) (prinl (+ X 1))) (1 2 3))
<Hunar>
You're right 🤔 what about something like (mapcar + L) I think in this case I can use trace on +
<aw->
yes you can do (trace '+) and then (mapcar + L)
<abu[m]>
In fact, there is a trick to put a break point into '+', via 'expr'
<abu[m]>
(expr '+) and then (debug '+)
<abu[m]>
You can the inspect the arguments with (rest)
<Hunar>
I didn't know that :D
<abu[m]>
It is not documented, and I think I never did that
<abu[m]>
In general, 'expr' (and thus also 'trace') on built-in functions is dangerous, because it should be used only on FEXPRs (i.e. not on FSUBRs)
<abu[m]>
(expr '+) is OK, but (expr 'setq) or (expr 'if) is not
<abu[m]>
Released a new PilBox with all recent PicoLisp changes
<beneroth>
yeah, cool :)
<abu[m]>
Seems it did not pass through PlayStore's validation yet. May take a few hours.
<Hunar>
Just finished the python glue thingy.. I can now call python functions from pil.
<Hunar>
I'm pretty sure there are many edge cases that I didn't account for, and I cant currently import libraries (future plan)
<Hunar>
And I did all the logic using terribly written python code :), it recieves everything from pil as is, evaluates it and converts the result into pil S-Expressions
<abu[m]>
👍
calle has joined #picolisp
seninha has joined #picolisp
<Hunar>
aaaaand just fund a bug in it :)
<beneroth>
awesome project :)
<Hunar>
Thanks :D
<beneroth>
one of the major benefits of python is its libraries (most in C/C++) so making them easily usable in pil can be useful for certain use cases :)
<beneroth>
you might want to look into the first form of pipe "(pipe exe) -> cnt" to keep a python process running in the background instead of restarting it for each call. of course, in some situation you would want to start python anew.
<beneroth>
the 'cnt returned (actually a 'fd) is just a number you can bind a symbol to and then use it as variable in (in) and (out)
<Hunar>
Thanks, actually abu pointed me to those methods afew days ago :) I plan to use it.
<Hunar>
But just found that I have much morr bugs than I thought
<beneroth>
sure thing, no hurry
<beneroth>
you also have to consider security. If python code or arguments handed to python are user input or network input, it could produce a potential security issue, where the pil code might be safe but maybe python could be made to execute something arbitrarily
<beneroth>
a kind of "python injection" then (similar to SQL injection common in mainstream webapps)
<beneroth>
bbl
<beneroth>
(ps. the way to mitigate that is never blacklists, as they are practically never complete, but explicit whitelists of allowed commands/values)
<Hunar>
Ah, that complicates things :| i'm not sure if I know python well enough to make it safe
<beneroth>
that's why you do a whitelist-approach, check the input for values/commands you are sure to be safe
<beneroth>
or hardcode what goes into python
<beneroth>
I don't think the security topic is for the FFI library to take care of, as it's highly application specific.
<abu[m]>
If the libs are mostly written in C/C++, is it not possible to call them directly from Pil?
seninha has quit [Ping timeout: 268 seconds]
<aw->
yeah i'm trying to figure out why Python is useful here
<aw->
skip the middleman and just FFI to the C libs that Python FFI's to
<abu[m]>
That would be cool. Makes a lot of things easier.
<aw->
hi abu[m] beneroth
<abu[m]>
right, hi aw- btw ☺
<beneroth>
hi aw- o/
<beneroth>
abu[m], aw- yeah of course if no python features are needed then use C/C++ libs directly, I agree
<beneroth>
there are also extensive libraries which are a mix of python and C libs
seninha has joined #picolisp
calle has quit [Ping timeout: 268 seconds]
chexum_ has joined #picolisp
chexum has quit [Ping timeout: 258 seconds]
seninha has quit [Ping timeout: 268 seconds]
chexum_ has quit [Remote host closed the connection]
chexum has joined #picolisp
<lagash>
abu[m]: an updated PilBox? I'm not sure if I want to go through all the pain of trying to get a half-decent workflow working again.. :(
<lagash>
I assume that the direct link https://software-lab.de/pilBox.apk is updated already? The Google Play link doesn't appear to have been updated just yet..
<lagash>
The changelog shows "Override onPermissionRequest() in WebChromeClient", wonder if that'll improve anything?
seninha has joined #picolisp
genpaku has quit [Read error: Connection reset by peer]
genpaku has joined #picolisp
<beneroth>
lagash, yeah Google Play takes its time
<beneroth>
lagash, whats the pain with the workflow? do you have to re-configure stuff after updating?