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
ygrek has joined #picolisp
beneroth_ has joined #picolisp
beneroth has quit [Read error: Connection reset by peer]
ygrek has quit [Remote host closed the connection]
tankf33der has joined #picolisp
corecheckno has quit [Read error: Connection reset by peer]
rob_w has joined #picolisp
rob_w has quit [Remote host closed the connection]
rob_w has joined #picolisp
rob_w has quit [Remote host closed the connection]
rob_w has joined #picolisp
rob_w has quit [Remote host closed the connection]
rob_w has joined #picolisp
rob_w has quit [Remote host closed the connection]
geri has joined #picolisp
<geri> hello
<geri> found out you can just do tail call elimination in forth by dropping latest address from return stack
<geri> which is very fun!
<abu[7]> Yeah, Forth is extremely flexible
<geri> yeah, although im yet to write anything useful in it personally
<geri> most i did is half of a lisp interpreter :D
<geri> speaking of lisp interpreters: https://github.com/jart/sectorlisp/blob/main/lisp.lisp
<geri> if you use picolisp's semantics of funtions being encoded in lists you can remove lambda keyword as well, making the impl even simpler
<abu[7]> ... Meeting
<geri> 頑張ってください
<bjorkintosh> geri: it's for a good reason. Forth is a typical turing tarpit. a lot is possible, but you have to choose the right implementation with the right combination of libs to be productive.
<bjorkintosh> otherwise you're writing everything from scratch.
<geri> well, also true, libs are not comparable to literally any of the more popular languages
<bjorkintosh> geri: because 1. a lot of Forth is used in embedded devices.
<bjorkintosh> 2. it suffers from lisp disease, where everyone who hears about it, thinks they too should in fact implement their own from scratch.
* bjorkintosh is only partially guilty.
<geri> we're all guilty..
<geri> reimplementing for fun is very fun at least
<bjorkintosh> of course.
rob_w has joined #picolisp
<tankf33der> hi all
<geri> hi
<tankf33der> why gforth? you can write forth on picolisp forth implementation.
<geri> prefer to start with "the original"
<tankf33der> FYI
<geri> although true, i can probably try rewriting some of my pil scripts in lifo
<bjorkintosh> there's a forth picolisp?
<geri> its a stack based language interpreter
<geri> abu[7]: where was it located exactly?
<bjorkintosh> what is a stack based language interpreter?
<geri> forth is also stack based
<geri> but its not really forth, its a "forth with lisp semantics"
<tankf33der> i meant forth implementation on picolisp:
<geri> abu wrote a new one recently i think
<geri> or maybe it was this one
<tankf33der> this one
<geri> that one used p to print instead of .
<geri> so maybe this one is even more recent? xd
<bjorkintosh> this book talks about forth and lisp: https://letoverlambda.com/
<geri> and common lisp macros :)
<bjorkintosh> ah good. you're familiar with it.
<geri> mhm
geri has quit [Ping timeout: 260 seconds]
geri has joined #picolisp
rob_w has quit [Remote host closed the connection]
beneroth_ has quit [Quit: Leaving]
beneroth has joined #picolisp
<beneroth> bjorkintosh, I would say the lisp curse is not primarily the susceptibility for NIH-syndrom ("not invented here", lets re-invent) but that libraries tend to be 80%-implementations at best, not aimed for universal use but just solving the problem at hand.
<bjorkintosh> beneroth: right. because they know the next person is just going to NIH their own solution :-D
<beneroth> probably/suspected because lisp makes creating libs quite easy (for experienced dev), whereas in other stacks libs are hard and tend to get polished into being universal 100%-solutions for the domain of the lib
<beneroth> bjorkintosh, partly, but that also forces the next person to make their own solution if they require something not covered in the existing 80%-libs
<bjorkintosh> right.
* beneroth squints at pil json libraries...
<beneroth> so the lisp curse is related to NIH but not the same thing
<beneroth> on the good side, I think picolisp with its built-in enforcing of "source-available" at least makes it more feasible to compare and re-use code from existing libraries, so maybe the lisp curse is a bit tampered in pil compared to other languages.
ygrek has joined #picolisp
<beneroth> hi ygrek
<abu[7]> Meeting over
<abu[7]> Nice discussion!
<bjorkintosh> abu[7]: a meeting on picolisp?
<abu[7]> Commercial project written in PicoLisp
<bjorkintosh> very nice.
<geri> beneroth: i was trying for a good json lib 😭
<geri> speaking of, abu[7] if i interned all the symbols while reading, wouldn't it be kinda bad cause of how many new symbols get interned?
<geri> probably in the same namespace where the lib gets called too
<abu[7]> Yes, depends on how many syms you have
<geri> beneroth: well, you never have problems getting open source code for a reference in any langauge
<geri> abu[7]: doesn't sound good...
<geri> so if you use the json reader with big-ish inputs it will just keep on filling your namespace's intern table and slowing everything down :(
<geri> thats kinda already happening with transient symbols too though
<geri> interns all strings, doesnt rely on == so can be used in a namespace
<geri> oh and works with (get), although a bit janky
<geri> cause arrays are 2 indexed instead of being 0 indexed
<geri> :D
<abu[7]> I think the interned symbols are no problem
<abu[7]> The tree search is fast
<abu[7]> and access is faster, because of '=='
<geri> well yeah, just gonna eat up a ton of memory
<geri> also if in same namespace going to be uncomfortable to tab complete
<abu[7]> Not much mem
<abu[7]> one and a half cell per sym
<geri> one call to swaymsg returns 1072 lines of words
<geri> well, i *hope* most api's are smart enough to allow for querying
<geri> limited querying
<geri> how do i put the lib in its own namespace now
<geri> (symbols (json-lib pico)) + somehow export the entry points
<abu[7]> (symbols 'myLib 'pico)
<abu[7]> see @lib/simul.l or @lib/svg.l
<abu[7]> and others
<geri> do you even need to use local and private in svg.l
<abu[7]> Yes
<geri> there is no mechanism for "exporting", right?
<abu[7]> 'export'
<geri> wait xd
<geri> amazing
<abu[7]> In fact I used 'export' very seldom
<abu[7]> but 'import' more frequently
<abu[7]> eg. in @src/lib/llvm.l
<geri> i hate how hard it is to make (private) (local) and (export) calls look good over many lines :(
<abu[7]> True
<geri> in vip youre just defining pico~vi and pico~v
<geri> hm
<abu[7]> That's also an "export" :)
<geri> cheating more like
<geri> :D
<abu[7]> yep :)
<geri> does (export) always export to pico though?
<abu[7]> no
<abu[7]> to the "second" namespace
<geri> so technically export is better...
<abu[7]> or explicitly given one
<geri> hm
<geri> why would you explicitly pass it a namespace though
<abu[7]> (export 'pico) xxx
<abu[7]> is as pico~xxx
<abu[7]> Thus 'export' is not really needed
<abu[7]> Just for completeness ...
<geri> okay ill do the hack then
<geri> actually its also ugly nevermind
<geri> :D
<abu[7]> Which hack?
<geri> (de pico~sym ...)
<abu[7]> ah, ok, good
<geri> so now you can use get, even though its not very intuitive
<geri> should be perfectly usable :)
<geri> honestly picolisp seems very close to original lisp in the fact its just cons cells and symbols
<geri> + numbers cause practicality
<geri> representing 10 as '(1 1 1 1 1 1 1 1 1 1) technically works and all but nobody got time for that :D
<abu[7]> Terribly easy to make a fork bomb in Pil!! Don't try this at home: (loop (fork)) ☺
<geri> :D
<bjorkintosh> abu[7]: shouldn't there be a 'if we see the fork bomb' return a 'oh no you don't!' switch in the interpreter? :-D
<geri> thats what compilers do
<abu[7]> Such a switch would be nice
<abu[7]> In fact I bricked my phone yesterday with a slightly more complicated version of the above
<geri> actually bricked or just made it die?
<abu[7]> It got hot for an hour until the batt drained
<abu[7]> I could boot then
<abu[7]> Pixel Fold has no hardware reset it seems :(
<geri> fun
<beneroth> bjorkintosh, one can use the `-reader macro for such metaprogramming. tricky and easy goes poof! but fun! e.g. (`(if *Dbg 'nil 'catch) '("") # only catch when we're not debugging ...)
<abu[7]> hmmm ;)
<bjorkintosh> <abu[7]> Such a switch would be nice
<abu[7]> or 'prog' instead of 'nil'
<bjorkintosh> some one should tell picolisp's creator that :-D
<beneroth> (this is for a server loop function. In nearly all cases, it's better and more in "pil-spirit" to quit with error. "crash hard and fast or not at all")
<beneroth> @geri, yeah I saw, and it's great you do that and publish it! I haven't yet get around to look deeper into your json lib, I also made one, but also didn't get around yet to publish it... I'm using/battle-testing it in a large new project soon, after that I think I will publish and compare it with the existing ones.
<beneroth> geri, but there are definitely languages where it's hard to find good open source examples. mostly it's then systems where the language itself and the whole stack around it is proprietary and only available with bigcorp enterprise licenses. but there are huge domains dominated by such systems (e.g. ERP, and especially PLM and CAD stuff)
<beneroth> in picolisp, when you have the program you always also have the source code.
<beneroth> in picolisp, the running program is just a slightly different representation of your exact source code.
<beneroth> I find this a very remarkable and useful feature
<abu[7]> off for a local meeting
<beneroth> abu[7], have fun (I hope)
<abu[7]> :)
<geri> beneroth: yeah my "battle testing" is why i just modified the schema xd
<geri> also gtg, laters
geri has quit [Quit: ERC 5.5.0.29.1 (IRC client for GNU Emacs 29.4)]
Iacob has quit [Remote host closed the connection]
Iacob has joined #picolisp
Iacob has quit [Client Quit]
Iacob has joined #picolisp
Iacob has quit [Client Quit]
Iacob has joined #picolisp
ygrek has quit [Remote host closed the connection]
ygrek has joined #picolisp
user3456 has quit [Remote host closed the connection]
ygrek has quit [Remote host closed the connection]
user3456 has joined #picolisp