ChanServ changed the topic of #picolisp to: PicoLisp language | Channel Log: https://irclog.whitequark.org/picolisp/ | Picolisp latest found at http://www.software-lab.de/down.html | check also http://www.picolisp.com for more information
orivej has quit [Ping timeout: 256 seconds]
orivej has joined #picolisp
orivej has quit [Ping timeout: 240 seconds]
tankf33der has quit [Read error: Connection reset by peer]
michelp has quit [Ping timeout: 255 seconds]
tankf33der has joined #picolisp
michelp has joined #picolisp
yunfan is now known as bruceutvt
bruceutvt is now known as OrginCode
bene|off is now known as beneroth
<beneroth> Hi all
<Regenaxer> Hi beneroth
<beneroth> Guten Morgen Regenaxer :)
<Regenaxer> :)
alexshendi has quit [Remote host closed the connection]
alexshendi has joined #picolisp
<tankf33der> morning
<Regenaxer> Hi tankf33der
OrginCode is now known as yinFling
<beneroth> hi tankf33der
rob_w has joined #picolisp
<cess11_> Good morning.
<Regenaxer> Hi cess11_
freeemint_ has joined #picolisp
<freeemint_> Good morning
<Regenaxer> Hi Freeemint_
freeemint_ has quit [Client Quit]
freeemint_ has joined #picolisp
<freeemint_> Good morning
yinFling is now known as yunfan
<Regenaxer> Hi freeemint_ (again ;)
<freeemint_> (Android browsers are weird)
<freeemint_> is there a difference between bind and let (which is not syntax)
<freeemint_> ?
<Regenaxer> The internal mechanisms are the same
<Regenaxer> Also the same as 'use' + 'setq', or as function parameter bindings
<beneroth> the (let) in pil64 supports a second mode with destructuring bind
<Regenaxer> or 'for'
<Regenaxer> beneroth, right, though the internals are the same here too
<Regenaxer> (saving and restoring values I mean)
<beneroth> aye
<freeemint_> So it os only syntax
<Regenaxer> yes
<freeemint_> What is your opinion on keyword arguements?
<beneroth> ?
<Regenaxer> freeemint_, you mean interpreting the arguments?
<Regenaxer> There was a rosetta task. I don't find them convenient
<beneroth> like named parameters?
<freeemint_> beneroth: yes
<Regenaxer> It is an interpretation of the arguments, which happens in similar ways often with fexprs
<Regenaxer> (foo 'var1 123 'var2 "def")
<Regenaxer> kind of ugly
<Regenaxer> freeemint_, that's why you asked about 'bind'?
<beneroth> ah. well I thought sometimes this would be useful if there are many optional parameters
<freeemint_> i do find it kinda annoying when i have to look up the order parameters in lets say 'html or some header function
<Regenaxer> yes, but tedious
<beneroth> but then splitting the stuff up into multiple functions would probably be nicer
<Regenaxer> because the function has to build all the defaults
<Regenaxer> yeah
<Regenaxer> or pass an assoc list
<Regenaxer> or objects
<Regenaxer> anything
<beneroth> aye
<freeemint_> Well an IDE could make keyword arguements almost fun
<freeemint_> I asked about bind because i browsed the ref
<Regenaxer> Theoretically yes, but for practical applications I find it inconvenient
<Regenaxer> ok
<Regenaxer> See rosetta task "Named parameters"
<Regenaxer> it has 2 solutions
<Regenaxer> Passing symbol-value pairs
<Regenaxer> (bind (rest) # Bind symbols in CARs to values in CDRs
<Regenaxer> (de foo @
<Regenaxer> (println 'Bar 'is Bar)
<Regenaxer> (println 'Mumble 'is Mumble) ) )
<Regenaxer> (foo '(Bar . 123) '(Mumble . "def"))
<Regenaxer>
<Regenaxer> Passing a name list followed by values
<Regenaxer> (bind (next) # Save all symbols in first argument
<Regenaxer> (de foo @
<Regenaxer> (mapc set (arg) (rest)) # then bind them to remaining arguments
<Regenaxer> (println 'Bar 'is Bar)
<Regenaxer> (println 'Mumble 'is Mumble) ) )
<Regenaxer> (foo '(Bar Mumble) 123 "def")
<Regenaxer>
<Regenaxer> Another would be (foo 'Bar 123 'Mumble "def")
<Regenaxer> Left as an exercise to freeemint_ ;)
<Regenaxer> I would normally prefer a long argument list with NILs
<Regenaxer> Easier to handle and a lot faster
<Regenaxer> The nice thing is that pil binds missing args to NIL
<Regenaxer> optional args
<freeemint_> I see
<Regenaxer> So I always put such args in the end
<beneroth> > The nice thing is that pil binds missing args to NIL - yep, very nice and useful
<freeemint_> So you just do not prefer them
<beneroth> I can see their value in a function with many optional parameters. happened to me sometimes, when I added additional attributes/features to initially simple functions.
<beneroth> reading the code later you have to lookup what the parameter means again (all the NIL ones)
<beneroth> but then one should probably re-work the function and split it up to make it simpler again :)
<Regenaxer> Exactly!
<freeemint_> beneroth reworking not always make sense ... but ok
<beneroth> freeemint_, the biggest problem is letting software grow without periodic reworking. because the stuff evolves and grows, and after some time the initial design/intent is far away from the current usage. then the design should be reworked. else you end up with "technical debt", which is likely the biggest IT problem in businesses.
<beneroth> or you forbid all new features after initial release and only do security/bug fixes. but that's usually neither practical nor meaningful.
<beneroth> I regularly work on ~30 year old software in businesses. full of stuff which is not needed any more and has largely no function now, just making even little changes extremely complicated and time consuming
<beneroth> Managers usually don't like to invest the money/time to fix this properly. but then only grows worse over time. only cure is to do some reworking from time to time, when the reworking is still more easy to do.
<beneroth> but as it is still easy, the reworking gets usually delayed until its not easy anymore ;)
<freeemint_> Thanks for the insight
<beneroth> your welcome :)
freeemint_ has quit [Ping timeout: 260 seconds]
<tankf33der> Regenaxer: here ?
<Regenaxer> Hai
<tankf33der> pseudo like c code
<tankf33der> look at ouput
<tankf33der> my pil code also prints 2 0 and 16777343
<tankf33der> question:
<tankf33der> how get address in addr: addr = &(ipv4->sin_addr);
<tankf33der> to pass it to inet_ntop
<tankf33der> ?
<tankf33der> inet_ntop(p->ai_family, addr, ipstr, sizeof ipstr);
<Regenaxer> it is just a difference of pointers, right?
<Regenaxer> Subtract the offset in struct
<Regenaxer> sin_addr offset
<tankf33der> aaaa
<Regenaxer> Looks in C much more complicated than it is physically
aw- has joined #picolisp
<tankf33der> inet_ntop(p->ai_family, addr, ipstr, sizeof ipstr);
<tankf33der> (native "@" "inet_ntop" NIL 2 Addr '(Str (16 . S)) 16)
<tankf33der> is it ok?
<tankf33der> :/
<Regenaxer> a single string pointer?
<Regenaxer> (Str (8 . S))
<Regenaxer> ah
<Regenaxer> a buffer, not a pointer
<tankf33der> yeap
<Regenaxer> yes, good I think
<tankf33der> it close.
<tankf33der> so close
<tankf33der> '(Str (16 . S)) crashes
<tankf33der> maximum 16 bytes for ipv4, 46 maximum for ipv6
<Regenaxer> hmm, can you try (Str (16 S)) ?
<Regenaxer> I forgot about the string syntax
<tankf33der> no reference :)
<tankf33der> crash.
<Regenaxer> hmm
<aw-> i think it's 15 bytes for IPv4 and 45 bytes for IPv6
<tankf33der> ./netinet/in.h:#define INET6_ADDRSTRLEN 46
<Regenaxer> S is for string pointers
<aw-> weird
<Regenaxer> the length does not matter
<Regenaxer> it runs till nullbyte
<tankf33der> String arguments can be specified as symbols. native allocates memory for each string (with strdup(3)), passes the pointer to the C function, and releases the memory (with free(3)) when done.
<Regenaxer> Not sure now, how about (Str (16 (S))) ?
<Regenaxer> No, this is about *arguments*
<Regenaxer> parsing structure elements is something different
<aw-> oh right.. 45 chars + null
<Regenaxer> Hmm, I would have expected that Str (16 . S)) is correct :(
<tankf33der> '(Str (1 . C))
<tankf33der> return "1"
<tankf33der> :)
<aw-> what is ipstr argument?
<Regenaxer> yes, and your case (49 50 55 46 48 46 48 46 49 0 is correct
<tankf33der> something around S then
<Regenaxer> Hmm, (Str (16 . S)) expects a string *pointer*, not a char buffer
<tankf33der> in c
<tankf33der> char ipstr[INET6_ADDRSTRLEN];
<aw-> tankf33der: thanks
<Regenaxer> But it must work
<Regenaxer> I have an example where it works, however it is a structure *returned*, not passed as an arg
<Regenaxer> Should be the same internally
<Regenaxer> ah, no
<Regenaxer> I'm wrong
<Regenaxer> No, if it is a buffer, you must handle the chars
<aw-> '(Str (C . 16)) ?
<Regenaxer> No
<Regenaxer> yes :)
<Regenaxer> (Str (16 C . 16))
<Regenaxer> so
<Regenaxer> buffer size 16
<tankf33der> works!
<Regenaxer> How?
<tankf33der> (native "@" "inet_ntop" NIL 2 Addr '(Str (16 C . 16)) 16)
<tankf33der> ("1" "2" "7" "." "0" "." "0" "." "1")
<Regenaxer> ah, ok
<Regenaxer> good
<tankf33der> perfect.
<Regenaxer> Yeah, 'S' is a pointer, not a buffer
<aw-> yes
<aw-> tankf33der: what do you have set for Addr ?
<aw-> sorry I just jumped in, missed a bit ;)
<tankf33der> aw-: current code:
<aw-> awesome
<Regenaxer> aw-, you could check the log, we had a long discussion yesterday
<aw-> oh i see
<tankf33der> my goal write recvfrom on natives.
<tankf33der> sendto is (udp) function already.
<tankf33der> so i need this on picolisp:
<tankf33der> yeap.
alexshendi has quit [Read error: Connection reset by peer]
<aw-> oh yeah, hi all
<aw-> actually i'm disconnecting now ;) done for the day. Good night
aw- has quit [Quit: Leaving.]
freemint has joined #picolisp
<Regenaxer> freemint, you are young. Don't you want to build something for Google's Summer of Code?
<Regenaxer> PicoLisp = Open Source
<freemint> I am not sure what but ... hey .. maybe
<Regenaxer> I also have no idea atm
<Regenaxer> Anybody here?
<freemint> I've seen that you did something related to google code in the past ...
<Regenaxer> It would be a task for the whole community here perhaps
<Regenaxer> It was not me, but Thorsten who initiated it
<Regenaxer> Was rejected however
<freemint> If you tell me a little more about the procedures ... why doing it under the "Google's Summer of Code" label ...
<Regenaxer> I have to read about the matter again
<Regenaxer> conditions
<Regenaxer> Problem is time perhaps, I'm rather busy this year :(
<freemint> What was the motivation back then?
shpx has joined #picolisp
<Regenaxer> Interesting, and last not least some money
<Regenaxer> Thorsten wanted to do his OrgMode project in pil
<freemint> Regenaxer, Did you make Picolisp an organization this year?
<Regenaxer> no, how? ;)
<freemint> well travel back in time ...
<freemint> you can only handout "Google's Summer of Code"-ships if you are an organization that is registered for this year
<freemint> well ... we get them next year
<Regenaxer> ok, too much trouble
<freemint> ... nah i think it is worth it ... if only for the attention you get by being on the projects list
<beneroth> hm. actually I'm not so sure if googles attention for the language would be good in the long term. Google applies EEE in a similar way than Microsoft in the 90s, look at Android, Chat (XMPP bridge killed), and their influence strategy in web standards
<beneroth> though freemint is right :)
<Regenaxer> T
<Regenaxer> I also distrust Gurgel
rob_w has quit [Quit: Leaving]
<shpx> Google will not extend, embrace or extinguish Picolisp.
<Regenaxer> yes, that's sure
<beneroth> T, I think mainly because 1) unlikely interest for that 2) pil is so small (and useful without much extension).
<beneroth> tough EEE can applied to picolisp based products I think
orivej has joined #picolisp
<tankf33der> done
<tankf33der> what a day!
<tankf33der> centos7, archlinux works.
<Regenaxer> Congratulations!!
<beneroth> wohoooo
<beneroth> great
* beneroth would like to use this code
<freemint> beneroth, you make the there is one "Big G"-Fallacy. There is no "Google" and there is not one "goverment". Inside any big thing there are parts with opposing interests
<freemint> example NSA tries to break Tor and the Navy finances it.
<beneroth> I know, I'm consciousness of this. But this doesn't refute my point, I would think.
<beneroth> in the end some few people make decisions and the other have to accept it, if they like it or not. or leave.
<beneroth> multiple interests in a container only means that there is a room for good too (for whoever defines what good is), and surely Google did and does a lot good.
shpx has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<beneroth> doesn't make the bad stuff less bad somehow. I also have the (apparently rather exotic) viewpoint that also bad deeds don't minimize good deeds by the same org or even by the same person.
<freemint> Regenaxer, do you know that Picolisp is used for "Biogasanalagensteuerung"
<beneroth> what?
<Regenaxer> yes, you asked yesterday
<freemint> ahh
<Regenaxer> Hagl Motorsteuerung
<Regenaxer> Robert
<freemint> Yeah
<beneroth> ah
<beneroth> the thing were you guys wondered how freemint learnt this
<freemint> Do you know them?
<freemint> shodan.io
<beneroth> ah lulz
<Regenaxer> I worked for Mibtec
<beneroth> yeah you find some of my servers there too
<beneroth> you got an account, freemint ?
<Regenaxer> via rob_w
<freemint> (search engine for ports and apls running there)
<freemint> i got a free one.
<freemint> I tested all apps which were in the first 20 (accessable with free account) for not using allowed
<freemint> they all did
<Regenaxer> the 'allow' mechanism?
<Regenaxer> sent a test probe?
<freemint> yes: !prin?3
<freemint> should work?
<Regenaxer> println?
<Regenaxer> or 'msg'
<freemint> host/!prin?3
<Regenaxer> yes
<freemint> if allowed is not used i get back 404
<freemint> *is used
<Regenaxer> T
<Regenaxer> 'msg' is nonsense, it prints to stderr
<freemint> Regenaxer, If you were aware of a vulnerable picolisp application what would you do?
<Regenaxer> Contact the admin if possible
<beneroth> if that fails, send (call 'kill -9 (or *PPid *Pid), that gets admin attention probably xD
<beneroth> well such a vulnerable server should be completely re-installed...
<freemint> beneroth, are you sure that you are maybe not sued as hacker?
<Regenaxer> kill -9 might destroy something
<beneroth> hm, T. laws.
<Regenaxer> better echo to the log with 'msg'
<freemint> of value ...
<Regenaxer> (hoping there is a log)
<beneroth> (hoping someone cares to read it)
<Regenaxer> yeah
<beneroth> well, arguably I would expect better from a fellow software surgeon ;)
<beneroth> Regenaxer, its heavily snowing at my place
<Regenaxer> oh
<Regenaxer> Will come here too then
<Regenaxer> We just had sunshine, but now cloudy
<freemint> beneroth, where is your place?
<Regenaxer> I must go for a walk then
<Regenaxer> better now
<Regenaxer> bbl, afp :)
<beneroth> have a nice walk
<beneroth> @#picolisp: sorry for making Regenaxer taking a leave, haha xD
<freemint> it is fine ...
<beneroth> freemint, Winterthur. Town near Zurich.
<freemint> ah ...
<freemint> why would Regenaxer Winter is comming to him too?
<freemint> the alps are in between
<beneroth> nah, the Alps are south of me, mostly
<beneroth> dunno how much our weather correlates, it did some in the past, not always
<beneroth> its like 5 hours by train from my place to his
<beneroth> he might be able to explain it to us, as a trained meteorologist ;)
<freemint> he is a ....?
<beneroth> the science of weather forecasting. heavily computer based.
akkad has left #picolisp ["ERC (IRC client for Emacs 25.3.1)"]
<freemint> I know what it mean but i was not aware that he is one
<freemint> *numeric computation
<beneroth> thats how he got into computers, afaik
<beneroth> working on big machines - no languages - so he invented picolisp (and precursors)
<beneroth> but yeah, he worked mainly as programmer afaik
<beneroth> Regenaxer, correct me when you're back
<beneroth> Regenaxer, we should write your biography
<freemint> Picolisp came from HPC?
<freemint> beneroth, picolisp is as far away from high performance computing as it could be today ...
<beneroth> why?
<beneroth> nobody is using it for that at the moment, afaik. but in principle - why not?
<beneroth> python is used in HPC
<freemint> it takes no advantage of any kind of hardware acceleration for calculation. It has no datastructures which are appropiate for it (Python has).
<freemint> It has no compliation support (Python has)
<freemint> It is mainly for Symbolic computing, with a "weird" number type, no type system allwing for inference ...
<beneroth> python mainly uses libraries for this (written in asm or compiled from C/C++). there is no reason for not doing the same with picolisp.
<freemint> if that is your point than any point is as close to HPC as python
<freemint> bash? you could write a library ...
<freemint> ruby?
<freemint> erlanf?
<freemint> the point is that it *is* as far away as it could be
<freemint> It does not even share data structres or number formats with languages that are ment for HPC ... that means you can not even expect the algorithms to have the same Big O()
<freemint> (and yes i would like to see a Torch, Theano, NumPy binding or something)
<beneroth> SQL is further (but also turing complete) :P
<beneroth> anything not running on linux is further away :P
<freemint> wrong,
<freemint> IBM FORTRAN does not run on Linux
<freemint> beneroth, yeah SQL is farther
<freemint> you are right
<beneroth> FORTRAN generally runs on Linux afaik. I don't know about a IBM variant.
<Regenaxer> ret
<Regenaxer> Good walk :)
<Regenaxer> and no snow yet
<beneroth> :)
<beneroth> is it likely that my weather moves to you?
<beneroth> still heavily snowing and foggy here
<Regenaxer> We had a strong eastern current these days, but if it turns now ...
<beneroth> I'm just a bit south of the Rhine (south west of the Bodensee)
<Regenaxer> Normally I get your weather
<Regenaxer> yes
<beneroth> I guess when the wind is right... nothing in the way to block much, afaik
<Regenaxer> I don't know todays situation
<Regenaxer> yep
<Regenaxer> Off for shower ;)
<beneroth> happy showering
<cess11_> tankf33der: Awesome, good work.
<cess11_> All "HPC" relies on specialised machine code. For being interpreted picolisp performs insanely well and it is fairly easy to adapt it to C-libs.
<cess11_> I think there's a woman on the mailing list using pil for scientific calculation and programming, forgot her name.
<cess11_> FORTRAN:s are usually specialised and commercial, though there's gfortran for Linux systems. It is mainly for historical and commercial reasons FORTRAN and COBOL are still the languages of some very wealthy sectors, not efficiency.
<cess11_> Like Alphabet/Google (golang) and Facebook (React) it is convenient that they are esoteric and need somewhat specialised coders, this makes them vulnerable and cheaper in the long run compared to competing with all other IT using companies for the coding workers.
<cess11_> The JVM is very efficient, it could easily replace COBOL in these domains, but e.g. the financial sector has even stopped trying to replace the batch based processes due to it realising it would somewhat diminish its power.
<cess11_> This is also why they choose python, it is ad hoc, two incompatible languages and plain sucks except in hack-and-forget home projects.
<beneroth> thanks for the explaining
<beneroth> well I thought the main reason for the increase in python usage is that its (still increasingly afaik) used to teach programming, no?
<cess11_> One needs to learn all sorts of messed up perl-like idiosyncrasies to even get close to fluent, really irritating.
<beneroth> oh its perl-influenced? didn't know. sounds fun xD
<cess11_> Yeah, but that is due to industry demand I believe.
<cess11_> Also because it is convenient for lib-glueing in a scientific context.
<beneroth> I thought the schools switched before industry, but could be
<beneroth> aye
<beneroth> lib-glueing is a good feature, arguably
<cess11_> Yeah, but at a high cost if one also decides to go python for other uses.
<cess11_> Writing good, maintainable code in python is really, really hard. One needs to do it kind of non-idiomatically and chatty, and whitespace is syntax.
<beneroth> ok, interesting.
<beneroth> need to go, cya later. bbl.
<cess11_> So it is hard to output programmatically, besides the obvious, metaprogramming looks like a wreck with whistles.
<cess11_> See you.
<Regenaxer> See you beneroth
<Regenaxer> Sorry, was busy
<cess11_> I hope to spend some time with Chuck Moore's chip later this year, I think that is a good direction for both software and hardware.
<Regenaxer> Forth chip?
<cess11_> Yes, 144 little forth machines on a chip with channels between neighbours.
<Regenaxer> cool
<Regenaxer> 32-bit CPUs?
<cess11_> 500 euros or so IIRC, not really expensive.
<Regenaxer> T
<Regenaxer> and each with its own RAM?
<Regenaxer> Hmm, I don't find any hard data
<cess11_> There maybe, not sure.
<cess11_> I think they might be 16bit and have a small RAM.
<Regenaxer> I want to know the word size, RAM per machine, ROM etc
<Regenaxer> Is the ROM the same for all?
<Regenaxer> Such things are important, not all that bla ;)
<cess11_> 18bit words.
<Regenaxer> ah
<Regenaxer> interesting
<cess11_> 64 word RAM and ROM respectively per machine.
<Regenaxer> ok
<Regenaxer> 64k
<cess11_> Data stack is 8 words.
<Regenaxer> So each can run different things
<cess11_> Yes, and an adaptation of ColorForth is typically used for programming.
<cess11_> Small but flexible.
<Regenaxer> yeah
<cess11_> And cheap energy costs, these can probably run on small solar panels and still do interesting things.
<yumaikas> Dang, only 64 word ROM and RAM? How much of forth is already on the chip?
<Regenaxer> A Forth runs well in 2 k
<yumaikas> Right, but 64 words != 2k.
<Regenaxer> I understood 64 k words
<yumaikas> Ah
<yumaikas> That makes more sense
<Regenaxer> The stack may well be 8 words, is ok if not recursive
<cess11_> SELF CONTAINED MEMORY AND STACKS: Each F18A contains 128 words of memory
<cess11_> (up to 512 instructions) plus 20 words of stacks and registers; no memory bottlenecks.
<cess11_> 18-bit registers are S and T, the top two elements of the data stack; R, the top element
<cess11_> of the return stack; and A, a read/write register. Address register B has 9 bits, and the
<cess11_> program counter P has 10.
<Regenaxer> uh, ok
<cess11_> 2x64 18bit words.
<Regenaxer> hmm, thats really tight ;)
<yumaikas> ^ And this is coming from the Author of Picolisp
<Regenaxer> yeah
<cess11_> 2x64 18bit words, quite constrained but not impossible.
<yumaikas> how much ROM did the Atari 2600 have?
<Regenaxer> My very first (self-built) computer had 254 8bit words
<cess11_> 4k ROM on the 2600, originally.
<cess11_> 128 bytes RAM.
<yumaikas> So someone made TIS-100 IRL
<cess11_> Basically, yes.
<cess11_> Colour is syntax in his weird forth system, seems both scary and clever: https://forth.hcc.nl/html/arrayForth_Cursus_v2.1NL/arrayForth_Cursus_v2.1EN.html
<freemint> cess11_, Regenaxer i followed Green Array for some tim but it seemed really dead
<beneroth> back
alexshendi_ has joined #picolisp
<freemint> welcome back beneroth
<beneroth> ty freemint
shpx has joined #picolisp
freemint has quit [Ping timeout: 265 seconds]