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
freemint has quit [Remote host closed the connection]
freemint has joined #picolisp
freemint has quit [Remote host closed the connection]
freemint has joined #picolisp
xkapastel has joined #picolisp
freemint has quit [Remote host closed the connection]
freemint has joined #picolisp
andyjpb has quit [Ping timeout: 245 seconds]
theruran has joined #picolisp
xkapastel has quit [Quit: Connection closed for inactivity]
freemint has quit [Ping timeout: 250 seconds]
yunfan has quit [Quit: WeeChat 1.9.1]
yunfan has joined #picolisp
yunfan has quit [Client Quit]
yunfan has joined #picolisp
yunfan has quit [Client Quit]
yunfan has joined #picolisp
yunfan has quit [Quit: WeeChat 2.3]
yunfan has joined #picolisp
sarna has joined #picolisp
sarna has left #picolisp [#picolisp]
yunfan has quit [Quit: WeeChat 2.3]
alexshendi has quit [Remote host closed the connection]
mtsd has joined #picolisp
mtsd has quit [Remote host closed the connection]
mtsd has joined #picolisp
mtsd has quit [Client Quit]
mtsd has joined #picolisp
mtsd has quit [Remote host closed the connection]
mtsd has joined #picolisp
yunfan has joined #picolisp
maxxcan has joined #picolisp
orivej has quit [Ping timeout: 265 seconds]
sarna has joined #picolisp
freemint has joined #picolisp
andyjpb has joined #picolisp
maxxcan has quit [Quit: maxxcan]
freemint has quit [Ping timeout: 250 seconds]
freemint has joined #picolisp
freeemint has joined #picolisp
freemint has quit [Read error: Connection reset by peer]
freeemint has quit [Read error: Connection reset by peer]
freemint has joined #picolisp
freemint has quit [Remote host closed the connection]
freemint has joined #picolisp
freemint has quit [Remote host closed the connection]
freemint has joined #picolisp
freemint has quit [Remote host closed the connection]
freemint has joined #picolisp
freemint has quit [Read error: Connection reset by peer]
freeemint has joined #picolisp
freeemint has quit [Remote host closed the connection]
freemint has joined #picolisp
freeemint has joined #picolisp
freeemint has quit [Client Quit]
freeemint has joined #picolisp
freeemint has quit [Remote host closed the connection]
freemint has quit [Ping timeout: 252 seconds]
beneroth has joined #picolisp
freemint has joined #picolisp
<sarna> hi, what are the typical GC pause times for picolisp? can I measure them somehow myself?
<sarna> I tried searching in the docs but couldn’t really find anything useful
<Regenaxer> Yes, call (bench (do 1000 (gc)))
<Regenaxer> I think it is about 1 msec per megabyte
<Regenaxer> or below for fast machines
<Regenaxer> Here on my phone
<Regenaxer> : (bench (do 1000 (gc)))
<Regenaxer> 1.906 sec
<Regenaxer> : (heap)
<Regenaxer> -> 3
<aw-> wow
<aw-> : (bench (do 1000 (gc)))
<aw-> 5.462 sec
<aw-> : (heap)
<aw-> -> NIL
<aw-> -> 2
<aw-> on my rock64
<Regenaxer> ok :)
<aw-> slow
<Regenaxer> No problem I presume
<aw-> not that i notice
<aw-> haha, exactly
<Regenaxer> Most people worry a lot about gc time, and try to avoid consing. Not helpful I believe
<Regenaxer> (well, perhaps not most. But I did initially, 30 years ago ;)
<mtsd> Time brings wisdom :)
<mtsd> The way people often worry about runtime speed of various languages
<Regenaxer> Sometimes :)
<Regenaxer> yes, exactly
<mtsd> In practice, it often means the program faster gets to the point where it waits for some other resource
<Regenaxer> right
freemint has quit [Ping timeout: 245 seconds]
mtsd has quit [Quit: Leaving]
freemint has joined #picolisp
<sarna> thanks for explaining :)
<Regenaxer> :)
<beneroth> hi sarna
<beneroth> hi Regenaxer :)
<Regenaxer> Hi beneroth!
<sarna> hello
<beneroth> I've heard (no firsthand knowledge) GC pauses are a regular bottleneck problem in Java and .NET etc. It certainly was in the earlier Java versions 15 years ago, a sudden big memory allocation (e.g. pictures / 3D stuff in a game) could slow it extremely, and even crash. Java supposedly got much better.
<sarna> oh and by the way, how do you debug segfaults? with gdb?
<beneroth> finding the function call you did by accident :D
<sarna> beneroth: the default java GC kinda sucks, it’s very configurable though
<Regenaxer> yeah, gdb is hard though
<beneroth> segfaults are a picolisp beginner issue, usually caused by having (A) in the code and A being no function
<Regenaxer> First try is (traceAll)
<Regenaxer> beneroth, right
<beneroth> once picolisp naming conventions are a habit, segfaults happen kinda never
<Regenaxer> yeah
<beneroth> picolisp has a bunch of debugging functionality. if they don't help anymore, then I find strace very helpful
<sarna> I really hope it’s not like ”you won’t get any memory errors in C when you’re careful” :D
<Regenaxer> And as testing is interactive, you usually know immediately
<sarna> I see, nice
<beneroth> T (= true/agree/right)
<beneroth> Welcome here, sarna :)
<Regenaxer> So if there is no idea where in the program it happens, do (traceAll) before a run
<Regenaxer> If it is in a system call, 'strace' helps too
<beneroth> (and run by starting pil with an + at the end... pil <file> +
<beneroth> )
<Regenaxer> right, that's important
<beneroth> or pil + -> (load "file")
<Regenaxer> both for bench and trace
<sarna> beneroth: thanks, I’ve been here before! I went off to explore other lisps (and kinda ocaml but it was a short phase)
<beneroth> sarna, you can put ! at the beginning of an expression, e.g. (prinl "hello") -> (! prinl "hello") <- that is a breakpoint, repl will fall into debug mode when you reach it (and pil was started in debug mode = with + at end)
<Regenaxer> I think the only two common reasons for segfaults are "calling" a number (function pointer) and stack overflows
<beneroth> sarna, I was think.. then welcome back ;-)
<beneroth> Regenaxer, T
<sarna> nice! that’s super helpful, gonna save it Regenaxer
<Regenaxer> :)
<sarna> oh another question - can I get the code for a function somehow?
<beneroth> and stack overflows is usually endless recursion or such (as always)
<sarna> like I have a function foo and I want to get (de foo ...)
<beneroth> sarna, (val 'func)
<beneroth> if it is not a builting
<Regenaxer> sarna, try : (vi 'car)
<beneroth> T, much better :D
<Regenaxer> or (em 'fun) for emacs
<beneroth> important: names are not part of picolisp functions. picolisp functions are just lists with a certain structure. function names are just a kind of variables with the value being the function body
<beneroth> so the same function can have multiple names, or none at all, e.g. '(() (prinl "anonymous function"))
<sarna> Regenaxer: I’d like to access the code in the program though, not for debugging purposes only
<beneroth> you can use (show 'car) to display all properties and the value of the symbol 'car'.
<sarna> nice!
<beneroth> in debug mode, car has a property *Dbg pointing to where (file, line) the symbol was defined
<beneroth> that info is used by (vi) and similar functions
<sarna> does debug mode slow the program significantly? seems like it’s doing a lot
<beneroth> functions are just symbols having the function implementation as list in the symbols value, or when it is a built-in function, having a number (pointer to the function in the picolisp VM)
<beneroth> not slowing much, just adding and keeping some more metadata around
<sarna> cool
<Regenaxer> I think it does not slow down at all in debug mode
<Regenaxer> it just loads more stuff
<beneroth> lisp is already a fully "reflection"-able language (that is the power of lisp), so not much extra data to shuffle around when debugging, not comparable to compiled languages
<Regenaxer> so starup is a little slower
<sarna> beneroth: depends on a lisp, I’d say :)
<beneroth> well, they vary on the "fully" part of that statement, agreed :)
<beneroth> but basically.. its the list core concept: code is data which can be viewed and edited.
<sarna> scheme implementations typically aren’t as interactive as common lisp impls
<beneroth> if that is possible, then its not a lisp
<beneroth> *not
<sarna> yeah, just a language with s-expression syntax
<beneroth> T
* beneroth doesn't know much about scheme and other lisps.
<beneroth> we have some schemers here in the community. mostly chicken schemers afaik.
<sarna> yeah, chicken is the most popular I think
<sarna> along with racket
<Regenaxer> yeah
<sarna> but a lot of people use racket for university n stuff
* beneroth beneroth wanted to get into lisp, was immediately turned of by common lisps platform-dependency-issues (C++ style), looked in a few lisps a bit but settled then with picolisp. happy ever since.
<beneroth> ah racket is a scheme dialect? I did know about racket, but not where it belongs into the family tree. :D
<sarna> ocaml turned me off when I found out windows support is nonexistent :) I don’t use windows, but if I wanted to ship a program on windows, I wouldn’t be able to
<sarna> well it used to be called PLT scheme but they changed the name
<Regenaxer> oh, in pil too it is non-existent :)
<sarna> oof, really? :(
<Regenaxer> yes, it needs POSIX
<Regenaxer> well, you can use Ersatz or Mini
<Regenaxer> but they are limited
<Regenaxer> Pil runs in WSL I think
<sarna> shoot
<sarna> the majority of people at work use windows, means I wouldn’t be able to use it there at all
<Regenaxer> My customers all use windows too
<Regenaxer> Pil applications are server based, so no problem
<Regenaxer> the clients are browsers on anything
<sarna> true, you can do it this way
<beneroth> pil21 brings hope for windows support, right Regenaxer ?
<Regenaxer> It is better anyway, you won't put databsases on unsafe clients
<Regenaxer> No
<sarna> :D
<beneroth> the whole POSIX fork/fctl etc. issues ?
<Regenaxer> it needs POSIX
<Regenaxer> yes
<beneroth> well.. windows will soon support it :P
<Regenaxer> Windows is too limited
<Regenaxer> ok, yes, WSL
<Regenaxer> No problem I think
<beneroth> T, afaik
<beneroth> even more so, as the newer WSL is a full ubuntu, not linux kernel emulation (like Wine, just other direction)
<beneroth> but I haven't tried
<beneroth> Regenaxer, but pil21 will fly on MacOS, probably, right?
<Regenaxer> yes, and iOS I hope
<sarna> what’s pil21? can’t find it anywhere
<beneroth> it's not in the news, just here in IRC discussed a few times
<beneroth> new edition of picolisp
<beneroth> implementation of the VM on LLVM
<sarna> better, faster, stronger?
<beneroth> still in the works
<Regenaxer> sarna, pil21 is not even announced yet
<beneroth> could still be canceled :D
<Regenaxer> Slower probably
<Regenaxer> but more portable
<Regenaxer> (between Unixes)
<sarna> I see
<Regenaxer> My main platform is and will be Android
<Regenaxer> iOS needs llvm
<Regenaxer> Then Pil will run on every platform
<sarna> I got plisp working without any issues on termux
<Regenaxer> (except windows)
<Regenaxer> yes, but for applications you should try PilBox
<beneroth> termux for development, PilBox for application
<Regenaxer> right
<sarna> I don’t have an android phone anymore, sadly
<beneroth> what do you have instead?
<sarna> ~~a blackberry~~
<sarna> an iphone
<Regenaxer> So in pil21 will work perhaps :)
<Regenaxer> if someone ports PilBox to iOS
<sarna> hope so :)
<beneroth> and Apple allows it...
<Regenaxer> T
<Regenaxer> Sorry, interrupt, away a while
<sarna> SIGINT
<beneroth> :)
<beneroth> what do you want to programm, sarna ?
<sarna> beneroth: for work I currently write ops scripts, outside of work I’m entertaining the idea of making a roguelike
<beneroth> ah, I think now I remember your earlier visits here :)
<sarna> I kinda want to write some code generators, because stuff at work is really mundane sometimes
freemint has quit [Quit: Leaving]
<sarna> idk yet if a templating engine would be enough or not
<beneroth> I feel you
<beneroth> code generation with pil works beautifully
<sarna> I imagine pil generating pil is amazing, can I generate JS though? :)
<sarna> some simple transformations, no magic
<beneroth> I usually have a database entity, a database record having the parameters, and the generated code being stored in a +Blob (file in database), so when the generated code is called, the bloab is simply (load)ed.. or freshly created. "cache invalidation" is just setting the +Blob property to NIL. the generated code can easily be inspected for debugging.
<beneroth> sure
freemint has joined #picolisp
<beneroth> js is basically just strings
<beneroth> same as html :)
<sarna> super cool!
<Regenaxer> ret
<sarna> haha, yeah, everything is just strings
<beneroth> have a look at lib/xhtml.l in your picolisp directory
<beneroth> it is basically definition of the F-EXPR 'tag which then is used to implement the element-specific functions
<beneroth> results in a pretty simple, easy to write and read DSL
<beneroth> easy to customize too
* beneroth curses about C# MVC
<beneroth> welcome back Regenaxer :)
<sarna> will do, thanks again :)
<Regenaxer> :)
<sarna> I was supposed to write C# at my job, glad I managed to escape to the operations branch
<sarna> I can write in anything, it just has to work :)
<Regenaxer> Good strategy :)
<beneroth> C# itself.. is okay. it's a mess of multiple languages, because after the initial design they add new stuff (e.g. lisp-imitating lambda implementation), but it's like another language dialect. and the ugly thing is, it's all context dependent, sometimes run-time context dependent. not elegant at all.
<beneroth> the webframework MVC is just horrible, full of flaws.
<sarna> I think C# is pretty good as far as mainstream languages go, the ecosystem is terrible though
<sarna> libraries, apis, everything
<beneroth> well hat are mainstream languages.. Java, C#, PHP... Python and C/C++ (if C/C++ still count).. ?
<beneroth> s/hat/what
<beneroth> Perl is dying afaik
<beneroth> ah yes
<beneroth> VBA
<beneroth> don't forget XD
<sarna> JS, don’t forget JS
<beneroth> ah right
<sarna> TS is even worse because it gives you false sense of security
<beneroth> well static typing is not improving security. it allows people who should not program to have some executable output at all.
<beneroth> in C# I spend more time with the type system than with actual implementation of business logic (switch on typeof is even not possible.. planned for next version of C#...)
<beneroth> question is, if JS can be called a single language, or if it better should be looked at as a family of languages, with all the dialect and fashion-driven frameworks
<sarna> TS is gradually typed, you can cast from any type to some other type and the type system won’t do anything to help you :D
<sarna> even with the strictest warnings
<beneroth> yeah
<beneroth> so not reliable
<beneroth> only with disciplined programmers, and then you don't need those systems
<sarna> well nobody really writes in pure JS anymore, that’s true
<sarna> it’s either TS or some Babel-language or CoffeeScript or ClojureScript or whatever
<sarna> tests > types, that has been proven many times
<beneroth> do you work with NPM ?
<beneroth> T
<sarna> you can run static analysis on dynamically typed programs too, and fuzz them
<beneroth> T
<sarna> for a bit, then switched to yarn
<sarna> not much different though
<sarna> why?
<beneroth> I don't want any NPM-sourced stuff on my servers and software, just for the fact that NPM repo is inherently untrustable.
<beneroth> I guess that is better with Yarn (conceptually) ?
<sarna> oh, yeah I read about the problems some time ago
<sarna> iirc you don’t have to have the same code in the package as on git
<sarna> because minification and whatnot
<beneroth> well I got aware of the potential problems before the first happened. worst thing is, they claimed to fix it, and then it repeated twice in similiar fashion since the first incident.
<sarna> well npm is the name of their package repository (I think?) and yarn downloads packages from there as well :/
<sarna> yeah it’s terrible
<beneroth> ok
<sarna> I hope wasm will kick JS’s ass
<sarna> and we’ll all just compile all our languages to wasm instead of using JS
<beneroth> well first incident was a guy who the company behind NPM pissed off (forced him to give his package name to another dev/company for no reason, and no compensation), so the guy removed all his packages from NPM, and some of the were basic string functions (leftpad ..) used everywhere, so everything didn't build anymore. most people were unable to replace the URL in their dependency files with git (the guy has his stuff on git too, so easy fix) or
<beneroth> implement those basic functions themselves (4 lines of easy code, come-on...)
<sarna> yeah I remember this one
<sarna> it’s madness
<beneroth> and it turned out, it was possible to upload a new package with same name as the removed ones, as a complete different dev, and it would be pulled from the dependency manages :)
<sarna> I have a small react app at work, I ran tokei on node_modules
<beneroth> what is tokei?
<sarna> 1500 000 lines of code..
<sarna> like wc -l on steroids
<beneroth> could probably be less
<beneroth> lol
<beneroth> those issues are conceptual, not only bad operations
<sarna> a pretty sweet program
<sarna> written in rust, so you can just fetch a binary
<sarna> fast as hell too
<sarna> yeah the entire JS ecosystem is poop
<sarna> anything too popular will diverge towards being poop eventually
<beneroth> not bad
<beneroth> thanks for the hint, bookmarking
<sarna> :) my pleasure
<beneroth> TCP didn't, except that it was never planned for the current scale and now it can't get updated without harming the current infrastructure (so it is not done)
<beneroth> all good systems are designed by just a few people. often just 1-2.
<sarna> yeah, small teams for the win
<beneroth> design by committee is just waiting until politics drives the design instead of merit.
<beneroth> it is a miracle how well it works for C++, I think
<sarna> C++ works well? first time I hear about this :D
<beneroth> relatively :)
<sarna> well yeah
<beneroth> its mostly well backward-compatible (not like.. python 2 -> 3)
<sarna> don’t even get me started on this
<beneroth> it is just a too broad language. nobody programs in C++, every team picks a subset
<beneroth> haha :D
<sarna> our scripts run on servers we don’t own
<sarna> so a good chunk of it is python2
<beneroth> hey python is the new java.. and much more elegant than java, so it's probably an improvement, I guess :)
<sarna> we’re gonna poop ourselves so bad in 2020
<beneroth> aha?
<beneroth> haha
<sarna> true, @ everybody programming in a subset of C++
<beneroth> another reason I base my stuff on pil. it is simple enough and MIT licensed, so in worst case me/my company should be able to keep it rolling
<beneroth> or so I hope
<sarna> yeah, it’s best to depend on simple systems you can understand and maintain yourself
<sarna> or your team/company can
<beneroth> exactly this
<beneroth> every dependency is technical debt
<sarna> relying on big tech is risky
<beneroth> yeah
<beneroth> though relying on good programmers is also risky
<beneroth> and not an option for many companies
<beneroth> so sticking with the mainstream can be a very reasonable choice
<sarna> yeah, that’s unfortunate
<beneroth> haha
<beneroth> thanks for this link, didn't know this site, beautiful xD
<sarna> :^) iirc they killed ~160 projects already
<sarna> muh reliable
<beneroth> oh I'm still pissed for their killing of the XAMPP bridge they originally had. classic EEE strategy applied.
<beneroth> I never used much from them beside the search engine.
<sarna> yeah, now I’m worried about “microsoft <3s open source” :/
<beneroth> they're the microsoft from the 90s
<sarna> ddg for life
<beneroth> well microsoft has not so much power anymore, they crave for developers, their old community is retired by now.
<sarna> yeah but they own github now
<beneroth> so they have to play nice. and they mostly do.
<beneroth> yeah
<beneroth> picolisp used google code years ago.
<sarna> and two most popular (I think?) editors - VS and VSCode
<sarna> sourcehut.org is really nice
<sarna> and started to gain some traction
<beneroth> when google killed google code, Regenaxer just stopped using such stuff and is self-hosting. good enough.
<sarna> nice :D
<beneroth> regularly people come here asking why we're not on github :P
<Regenaxer> T
<beneroth> "but this is github, this will never happen" - sold to MS.. - "oh lets quickly migrate to gitlab" (well, gitlab was hosted on azure back then)
<beneroth> (and gitlab proved they don't know how to backup)
<beneroth> it's always the same
<sarna> gitlab added a clause to their ToS saying they can serve to unethical customers, lol
<beneroth> but hyped guys don't want to listen to cranks like us :()
<sarna> but removed it after community backlash
<beneroth> yeah, SJW much
<beneroth> reminds of the epic JSON license :)
<beneroth> it's basically MIT but with added "do not use for evil".. IBM lawyers actually got an exemption "do not use for evil - except IBM and its customers and minions might use it for evil"
<beneroth> :D
<beneroth> (lawyers don't like evil because it is an undefined symbol)
orivej has joined #picolisp
<sarna> well, the community was furious about gitlab because they put the clause there right after people found out about github’s contract with ICE
<sarna> really bad move, PR-wise
<sarna> beneroth: yeah lol, Good and Evil Capitalized.. will prevent the Evil usage for sure
<beneroth> well I would like to have a way to forbid surveillance actors to use FOSS stuff
<beneroth> but the point is... there is no workaround. state under the rule of law, democracy, check and balances, independent justice system... is the only way to fix it.
<sarna> LGPL maybe? they’d have to open source their code at least
<sarna> yeah, more effective than putting “don’t use it for Evil” in a license
<beneroth> lynch mob justice is a regression, not progression
<beneroth> well, I tend to the folks who find it funny :)
<beneroth> the JSON thing
<sarna> the funniest thing is that people are mad about github and yet still use it for everything..
<beneroth> I'm deeply troubled about the whole SJW cultures... there is some merit, but most of it is trying fighting fire with fire.. or fascism with worse fascism...
<beneroth> hehe
<beneroth> well
<beneroth> it works
<beneroth> meritocracy is a thing, even when people like to deny it :)
<beneroth> only results matter
xkapastel has joined #picolisp
orivej has quit [Ping timeout: 265 seconds]
freemint has quit [Quit: Leaving]
orivej has joined #picolisp
orivej has quit [Ping timeout: 240 seconds]
orivej has joined #picolisp
freemint has joined #picolisp
freemint has quit [Ping timeout: 250 seconds]
freemint has joined #picolisp
xkapastel has quit [Quit: Connection closed for inactivity]
beneroth has quit [Quit: Leaving]