<geo80>
morning everyone! I was just reading the logs to get sync..
<geo80>
morning Regenaxer!
<geo80>
I saw the link from the log about word count using CL, cool! what's more interesting is the CL:TIME function
<geo80>
it shows some nice details that I was actually looking for when developing pilMCU. questions is, do we have such function for picolisp?
<geo80>
I used (bench) but what i want is the processor cycles, which is the number i want to compare between FPGA and processors
<geo80>
if my fpga can execute lesser processor cycles than Intel, then would be awesome!
<geo80>
about picolisp in wsl, yes it works fine so far on my end
<geo80>
I have WSL with ubuntu 18something, then installed pil64
<geo80>
and this i got
<geo80>
$ pil +
<geo80>
: (bench (do 1000 (gc)))
<geo80>
0.509 sec
<geo80>
-> NIL
<geo80>
:
orivej has quit [Ping timeout: 252 seconds]
<geo80>
about mainstream languages, maybe these too: ruby, golang, rust, swift, kotlin, lua, scala, Haskell?
<geo80>
Hi @sar
<geo80>
hi sarna, you can try WSL at work and install pil64 ;)
<geo80>
but hmm Regenaxer, any chance if picolisp would not depend on POSIX? maybe pil21 at least?
<geo80>
also you mentioned pil21 will be slow at the moment, any chance it will surpass pil64? if not, is it due to the llvm?
freemint has quit [Remote host closed the connection]
freemint has joined #picolisp
<geo80>
sarna about your question "like I have a function foo and I want to get (de foo ...)", i think you can try (pp 'foo)
<geo80>
: (de foo (x y) (+ x y))
<geo80>
-> foo
<geo80>
: (foo 1 2)
<geo80>
-> 3
<geo80>
: (val 'foo)
<geo80>
-> ((x y) (+ x y))
<geo80>
: (pp 'foo)
<geo80>
(de foo (x y)
<geo80>
(+ x y) )
<geo80>
-> foo
<geo80>
:
<geo80>
hi aw- looks like rock64 is slow for a ARM64 quadcore?
<geo80>
its beaten by Regenaxer mobile phone :)
freemint has quit [Ping timeout: 245 seconds]
andyjpb has quit [Ping timeout: 240 seconds]
orivej has joined #picolisp
<aw->
geo80: i wouldn't say slow, but it's definitely not as fast as my x86-64 computer
<geo80>
aw- i see, yeah that's expected, but what's the CPU spec of rock64 again?
<geo80>
how's down there? here its sunny but the wind is cold
<aw->
not sure, i think it's a A53 quad core ~1.8GHz or something
<aw->
1.4GHz
<geo80>
i see, not so bad... cool!
<aw->
it also has a 500MHz GPU but I don't know how to use it so whatever
<aw->
weather: raining all day today and yesterday, still warm ~23deg
<geo80>
hahaha great! maybe some image processing or try tensorflow? not sure..
<aw->
there's a typhoon coming
<aw->
started near the Philippines
<geo80>
ah i see.. great! oh! typhoon number? ah maybe that's the reason for this Mondays rain.. did i mention we will attend the papal mass here in Tokyo dome this Monday :)
<geo80>
stay safe there
<aw->
typhoon #27
<geo80>
ah ok noted
<aw->
yes papal mass, great
<geo80>
they always name it in number here hehe unlike in Philippines we have names
<geo80>
thanks! we are blessed to win the ticket for three :) getting excited for Monday...
<aw->
yes Hagibis
<aw->
velocity, right?
<aw->
that was the last big one
<geo80>
name yes, meaning almost. its a deep old filipino name which means strong speed
<geo80>
and yes indeed
<geo80>
the wind shakes our building PLUS there was an earthquake as well
<geo80>
Chiba was hit very bad but thanks God our side are fine
<geo80>
it was suppose to be same as Yolanda? but good thing it slowed down a little
<aw->
yeah it seems crazy
<Regenaxer>
Good morning geo80, aw-!
<Regenaxer>
We have 'tick', but that's not CPU cycles
<Regenaxer>
And yes, you *can* do PicoLisp without POSIX, see miniPicoLisp, ErsatzLisp, PilMCU, PilOS
<Regenaxer>
but that's just the language
<Regenaxer>
the powerful, interesting things need POSIX
<Regenaxer>
Database locking, process families, asynchronoul I/O
<Regenaxer>
fork(), pipe(), fcntl(), and many more
<Regenaxer>
So why does everybody think LLVM helps on Windows? It is just a replacement for the *lowest* level which is in other cases C, Java, PilAsm
<geo80>
Morning Regenaxer! noted about 'tick' thanks! i think i did implement and use that as well in PilMCU? but can you please refresh me, is tick the number of how many pilASM instructions are executed?
<geo80>
noted about the essential of POSIX
<Regenaxer>
No, tick is the system TICK in POSIX. the processs time slice usually
<geo80>
oh! i see, ok then its not so useful for comparing then...
<geo80>
hmm is there a way to get the processor cycle in PicoLisp level or PilASM level?
<Regenaxer>
Some assembly or C library perhaps
<geo80>
one quick question too, does other languages have those interesting things mentioned above too correct?
<geo80>
ah i see, ok got it
<Regenaxer>
Which interesting things do you mean?
<geo80>
Database locking, process families, asynchronoul I/O
<Regenaxer>
As I said, this is not an issue of Language but of OS. Pil32 in C also depends on POSIX
<Regenaxer>
If you want PicoLisp without POSIX, you can use mini, Ersatz (or PilMCU or PilOS if they were ready)
<geo80>
ok got it
<geo80>
but hmm maybe let me rephrase my question. what does picolisp have that hinders it to be like python and ruby in terms of independent to the OS?
<Regenaxer>
It does not hinder. As I just said
<Regenaxer>
The language
<Regenaxer>
But the application framework needs it
<Regenaxer>
either WebApps or PilBox on Android
<Regenaxer>
You have no built-in database in Python or Ruby, right?
<Regenaxer>
No process families operating on them?
<Regenaxer>
I'm always surprised why I have to explain these basic things over and over again :(
<geo80>
ok2 sorry for asking
<Regenaxer>
It is not just you
<geo80>
again sorry.. but thank you for explaining again
<Regenaxer>
:)
<geo80>
as i mentioned, i want to share and promote picolisp to others, and these others are mostly windows users and showing-off their python/ruby/js stuff
<geo80>
but no worries, i believe i still can find way how to introduce them to picolisp ;)
<geo80>
what i noticed is most of them are scared or lazy to install WSL
<Regenaxer>
You could write a Windows version then perhaps?
<Regenaxer>
Find other ways for the database
<Regenaxer>
Or omit it? But then pil is pretty crippled
<Regenaxer>
all DB/GUI integration is lost
<geo80>
that would be cool!! actually i did think about that but im not sure which approach is the best
<geo80>
first plan was to implement it using C#?
<Regenaxer>
The language does not matter
<Regenaxer>
You can use Java (start with Ersatz)
<Regenaxer>
PilAsm is also good, ie pil64
<geo80>
ah yeah pil64 was indeed the best i think
<Regenaxer>
it just depends whether it needs PIC on Windows, which is currently not supported by pilAsm for x84
<geo80>
i already prepared the assembler from windows but i think someone here also attempted?
<Regenaxer>
Right, it needs just a new src64/arch/ file
<geo80>
ah i see
<geo80>
ah ok2 let me revisit that approach then
<geo80>
btw about PIC, do you mean pilASM needs PIC or not?
<Regenaxer>
src64/arch/x86-64.l is for GNU assembler and has no PIC
<Regenaxer>
only x86
<Regenaxer>
ppc64 and arm64 are supported with PIC
<Regenaxer>
I was too lazy to implement it for x84
<Regenaxer>
it *is* in x86 too, but only for shared libs
<Regenaxer>
x86 is a mess
<Regenaxer>
PIC is an afterthought for Intel
<Regenaxer>
8080, 8086 and i386 did not support it in hardware
<Regenaxer>
x86-64 is better, but still a kludge
<Regenaxer>
So LLVM will take care of all these things
<geo80>
ah i see, ok all noted
<geo80>
so does it mean for windows, we need a x86-64.l for Windows Assembler with no PIC?
<Regenaxer>
I don't know anything about Windows
<Regenaxer>
There are many assemblers
<Regenaxer>
Perhaps even GNU asm?
<Regenaxer>
But no idea whether Windows needs PIC
<geo80>
ok let google these then
<Regenaxer>
*if* there is gas, and *if* it needs NO PIC, you can directly use the existing src64/arch/x86-64.l
<Regenaxer>
src64/arch/x86-64.l generates code for gas, and without PIC, it does not care about OS or POSIX
<Regenaxer>
Because *in* Cygwin PicoLisp runs already
<Regenaxer>
with restrictions
<Regenaxer>
eg. Cygwin did not completely implement some POSIX features
<Regenaxer>
(at least until a few years ago)
<geo80>
yeah that's the reason why i plan to use MASM
<geo80>
now i remember
<geo80>
i was preparing MASM
<geo80>
and i got this useful info
<geo80>
MASM uses the Intel syntax for its instructions, which stands in stark contrast to the AT&T syntax used by the GAS assembler. Most notably, MASM instructions take their operands in reverse order from GAS. This one fact is perhaps the biggest stumbling block for people trying to transition between the two assemblers.
<Regenaxer>
ok, I see
<geo80>
hmm maybe a translator from GAS to MASM would be a nice picolisp side project?
<geo80>
but ok let me check about PIC first
<geo80>
brb
<Regenaxer>
geo80, but keep in mind that porting pil this way won't give you much more than what ErsatzLisp already supports today
<Regenaxer>
So just run Ersatz on Windows :)
freemint has joined #picolisp
<geo80>
oh! ersatz is running on jvm correct?
<geo80>
and if i remember correctly, ersatz is but slow compared to pil64?
<geo80>
if pil64 is made with MASM, should it be better?
<Regenaxer>
yes, Ersatz is about 6 times slower I think
<Regenaxer>
Rewriting pil64 is a *huge* task
<Regenaxer>
i.e. remove all POSIX dependencies. Try it!
<geo80>
ah
<sarna>
geo80: rust and haskell aren't that mainstream
<sarna>
geo80: and yeah, I use linux at work, but other machines are windows
<sarna>
thanks for the pp tip!
<Regenaxer>
Hi sarna o/
<sarna>
hello Regenaxer o/
<geo80>
Hi sarna! ah i see, cool! no problem
<sarna>
most people don't have WSL2 yet, because IT locked the updates
<geo80>
btw, about pil64 on windows, there must be alternative functions that can be used as replacements under windows libraries?
<Regenaxer>
right
<geo80>
Regenaxer cool! is that the one you showed me? nice app indeed!!
<Regenaxer>
yes, one of them
<Regenaxer>
The real interesting stuff today is mobile
<Regenaxer>
Desktop PCs are decreasing in importance
<Regenaxer>
And I prefer to write apps for desktop as WebApps
<Regenaxer>
so they run on any system
<Regenaxer>
Thats why I don't waste my time for Windows
<Regenaxer>
All my apps now are server based, with mobiles distributing DBs
<Regenaxer>
You can't do that on Windows PCs
<Regenaxer>
But as I said, start with Ersatz
<Regenaxer>
see if it is really too slow
<Regenaxer>
The problems are in other places, i.e.what kind of applications to write, how to make the GUI etc
<Regenaxer>
All world goes to cloud services, why waste time with isolated Windows applications?
<sarna>
true, native windows apps aren't that hot these days
<geo80>
hmm i see.. sounds like google chrome... cloud based OS and apps?
<Regenaxer>
No, simple browser
<Regenaxer>
it is the most portable GUI
<geo80>
ah ok2
<Regenaxer>
Even PilBox uses it ;)
<Regenaxer>
And for simple scripts in Windows Ersatz (or miniPicoLisp) are sufficient
<Regenaxer>
miniPicoLisp builds on Windows I think
<Regenaxer>
MingW or so, forgot the name
<geo80>
Cygwin?
<Regenaxer>
Yes
<Regenaxer>
Cygwin is almost full POSIX
<Regenaxer>
but has its problems afaik
<geo80>
yeah
<geo80>
and only pil32 works
<Regenaxer>
Why that?
<geo80>
based on my attempts
<Regenaxer>
ok
<Regenaxer>
PIC?
<geo80>
ah not sure but i just used the default makefile
<geo80>
or wait, i might be wrong.. coz i was trying both Cygwin32bit and Cygwin64bit
mtsd has joined #picolisp
freemint has joined #picolisp
<Regenaxer>
ok, and probablt pil64/Makefile was never extended for Cygwin
<mtsd>
Good mornin'
<Regenaxer>
Good morning mtsd!
<mtsd>
Hi Regenaxer
<mtsd>
I seem to remember that it was possible to download the source of the picolisp wiki somwhere?
<mtsd>
7fach.de/wiki.tgz, or somehting similiar?
<Regenaxer>
yes, software-lab.de/wiki.tgz iirc
<mtsd>
Thanks!
<Regenaxer>
there is also a link somewhere in picolisp.com
<tankf33der>
MihailP@pc-307353 MINGW64 ~/picoLisp
<tankf33der>
: (version)
<tankf33der>
: *OS
<tankf33der>
$ ./pil +
<tankf33der>
-> (18 10 16)
<tankf33der>
18.10.16
<tankf33der>
-> "Windows_NT"
<tankf33der>
: (== 1 1)
<tankf33der>
-> T
<tankf33der>
:
<tankf33der>
in general works.
<Regenaxer>
Hi tankf33der!
<tankf33der>
mingw64
<mtsd>
I am about to look into creating a static site generator, using Pil (of course. What else ;))
<Regenaxer>
mtsd, cool!
<mtsd>
I have been thinking about it for some time.
<geo80>
hi mtsd and tankf33der! cool!
<mtsd>
Hi geo80!
freemint has quit [Ping timeout: 276 seconds]
<geo80>
mtsd nice idea!
<mtsd>
I think it is a perfect fit. Content stored in a Pil database, then generate html files from that. We have an xhtml library already.
<mtsd>
Should be possible to send the resulting markup into files inseatd of to a browser, I think
<Regenaxer>
Mansur Mamkin and Vidyuth Kini also cloned he wiki
<mtsd>
I wish to look at the source anyway, for ideas. Always inspiring to read your code, Regenaxer :)
<Regenaxer>
thx ;)
<mtsd>
And with Pil, we can really go to the source, when studying Pil source code. I mean, you are here every day :)
<geo80>
mtsd if you need a hand, i like to join so I can also learn from actual work :)
<mtsd>
Sure geo80! Always good to discuss ideas and work together
<geo80>
mtsd thanks!
<mtsd>
It is a very early stage, but I want to get going. Some people at work asked for a solution where they could put documentation and various info.
<Regenaxer>
perfect I think
<mtsd>
When such requests come to me, the result is inevitably Pil applications
<Regenaxer>
The wiki has markup, version control, document upload
<mtsd>
Yes, it is all there
<Regenaxer>
users and permissions too
<mtsd>
I had a look at the code before, but it is a long time ago now
<Regenaxer>
the above wiki.tgz is always up to date, the version running on picolisp.com
<mtsd>
I might very well end up using the wiki as-is, just changing the css. I think all the necessary functionality is in place
<geo80>
cool!
<mtsd>
But, I will go ahead with the static site generator anyway. I have some other, future, plans for that project
<mtsd>
geo80, since you come from the embedded world, I might start asking you questions about low-level stuff some day
freemint has joined #picolisp
<mtsd>
Just out of interest. I am completely incompetent when it comes to that :)
<geo80>
mtsd great! and sure! anytime! no problem :)
<Regenaxer>
I will focus on pil21 for the near future - let's see how it works out
<geo80>
Regenaxer thanks in advance!
<Regenaxer>
Nothing to thank ;) I do it for fun
<geo80>
hahaha still you deserve to be thanked ;)
<Regenaxer>
Nono, I'm glad if people have fun too
<geo80>
yup! i always have fun reading your code helping others and learn something cool about PicoLisp every time someone asks
<geo80>
and whats more fun is to see how short PicoLisp codes are compared to other lisp dialects or even to other languages?
<Regenaxer>
true
<mtsd>
Yes, I second that
<mtsd>
The compactness, both of code and the database, is astonishing
<mtsd>
When not doing Pil, I get dragged into working on a large code base with Python, Django and Angular.
<mtsd>
I tend to produce more bad language than code and functionality there....
<geo80>
yeah that's true too..
<geo80>
btw Regenaxer, I just remember, PilMCU and PilOS are based on pil64 and both have built-in db without POSIX, what is the difference of implementation for the db side?
<Regenaxer>
They are single-user
<geo80>
ah i see ok
<Regenaxer>
No multi-process, no locking, no pipes for sync
<geo80>
ok got it thanks
<Regenaxer>
And no asynchronous I/O (tasks). You remember we did that ourselves in PilMCU
<Regenaxer>
iirc some "wait" instruction
<Regenaxer>
Normal Pil kses select() system call
<Regenaxer>
or poll() in pil21
<Regenaxer>
(Linux uses poll() internally for select())
<Regenaxer>
s/kses/uses
<Regenaxer>
Whe whole Pil runtime enginen centeres around that select()
<Regenaxer>
event handling
<geo80>
ah yeah! i remember that! that was actually nice
<geo80>
we utilized reg A and did some masking?
<Regenaxer>
yeah, though I don't remember well
<geo80>
no problem hehe
freemint has quit [Ping timeout: 240 seconds]
beneroth has joined #picolisp
freemint has joined #picolisp
freemint has quit [Ping timeout: 265 seconds]
freemint has joined #picolisp
<geo80>
will go home now, till tomorrow!
<Regenaxer>
see you geo80!
<geo80>
Regenaxer see you!
geo80 has left #picolisp [#picolisp]
orivej has quit [Ping timeout: 240 seconds]
orivej has joined #picolisp
mtsd has quit [Ping timeout: 265 seconds]
freemint has quit [Ping timeout: 250 seconds]
mtsd has joined #picolisp
freemint has joined #picolisp
mtsd has quit [Remote host closed the connection]
mtsd has joined #picolisp
freemint has quit [Ping timeout: 245 seconds]
freemint has joined #picolisp
xkapastel has joined #picolisp
freemint has quit [Ping timeout: 245 seconds]
freemint has joined #picolisp
freemint has quit [Quit: Leaving]
freemint has joined #picolisp
andyjpb has joined #picolisp
freemint has quit [Ping timeout: 250 seconds]
freemint has joined #picolisp
mtsd has quit [Quit: Leaving]
freemint has quit [Remote host closed the connection]
freemint has joined #picolisp
libertas has quit [Ping timeout: 265 seconds]
orivej has quit [Ping timeout: 245 seconds]
beneroth has quit [Quit: Leaving]
andyjpb has quit [Ping timeout: 276 seconds]
libertas has joined #picolisp
<sarna>
hi, how can I get the exit code of a shell command I call in pil?
<Regenaxer>
'call' returns a boolean for success
<Regenaxer>
you find the exit code in '@@', but it is not really useful
libertas has quit [Client Quit]
<sarna>
so if exit code is 128, @@ is gonna be 128?
<Regenaxer>
No, it is more complicated
<Regenaxer>
it is 2 bytes
<Regenaxer>
I think the upqer one has 7 if the exit code was 7
<sarna>
heck
<Regenaxer>
Check the Unix docs (eg. Richard Stevens)
<sarna>
does the thing in @@ have some technical name? like, “something object”?
<Regenaxer>
'@@' is just a convention for a second return value in some functions
<Regenaxer>
it is a global
<Regenaxer>
In this case the "thing" is a number
<Regenaxer>
of two bytes
<Regenaxer>
Try (>> 8 @@)
<sarna>
oh I see, thanks!
<Regenaxer>
or (& (>> 8 @@) 255)
<Regenaxer>
I'm not sure atm
<Regenaxer>
In general the exit code in Unix is not useful
<Regenaxer>
only 8 bit signed
<Regenaxer>
Better return something in stdout
<Regenaxer>
(in '("mycommand" "arg" 123) (line T) ..
<Regenaxer>
or (in ... (read))
<sarna>
yeah :) I’m asking because one of our tools at works kinda depends on error codes returned by other programs
<sarna>
so I was curious
<sarna>
s/works/work
<Regenaxer>
I see, ok, makes sense
<Regenaxer>
Look at if first perhaps with (hex @@)
<Regenaxer>
to see the bytes
xkapastel has quit [Quit: Connection closed for inactivity]
<Regenaxer>
i.e. (call "script" "arg") (hex @@)
<Regenaxer>
both on the same line
<Regenaxer>
because otherwise the REPL overwrites @@
<Regenaxer>
the repl uses @, @@ and @@@
<Regenaxer>
Oops, I have a tel conference. bbl
freemint has quit [Ping timeout: 245 seconds]
<sarna>
guns save that, thank you
<Regenaxer>
ok, done already
<tankf33der>
if i have old android phone, what can i do with picolisp on it?
<tankf33der>
absolutely nothing known to me.
<Regenaxer>
Can you install Termux?
<Regenaxer>
Needs Android 5 or 6 iirc
<Regenaxer>
And PilBox
<Regenaxer>
PilBox needs Android 5.0
<Regenaxer>
if possible arm64, but arm32 works too with a plugin (emu)
<Regenaxer>
Termux and "apt install picolisp" is the easiest, but needs 64-bit CPU
<tankf33der>
so i need power plug first
<tankf33der>
lets see
<tankf33der>
i should get root first, right?
<Regenaxer>
No, root is not needed
<Regenaxer>
I think 32 bit Termux does not support pil any more (not sure atm)