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
alexshendi has joined #picolisp
alexshendi has quit [Ping timeout: 256 seconds]
shpx has joined #picolisp
shpx has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
shpx has joined #picolisp
tankf33der has joined #picolisp
orivej has quit [Ping timeout: 264 seconds]
shpx has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
orivej has joined #picolisp
shpx has joined #picolisp
tankf33der has quit [Quit: Connection closed for inactivity]
tankf33der has joined #picolisp
rob_w has joined #picolisp
yunfan has joined #picolisp
yunfan has quit [Quit: already be with hell]
yunfan has joined #picolisp
<yunfan> hi i am a little confused about the data type implement details while reading the tutorial
<Regenaxer> Hi yunfan
<yunfan> when it said Number were implment on cells, i could understand that short number's details
<yunfan> it looks like it use the least 4 bits for indication, while the left 60bits to store values
<yunfan> but for big number, that figure and words made me confused
<Regenaxer> Only in pil32 all numbers use cells
<Regenaxer> pil64 has short numbers too, which are encoded directly
<Regenaxer> So you are concerned about pil64?
<yunfan> maybe, i just watch the page
mtsd has joined #picolisp
<yunfan> at the chapers about Number
<Regenaxer> ok
<Regenaxer> So short numbers are ...xxxS010
<Regenaxer> and bignums have a pointer ...xxxS100
<Regenaxer> The critical flag is bit 1
<Regenaxer> S is the sign in both
<yunfan> but it said in bignums, they hold 64 bits values
<Regenaxer> yes, in the CAR parts of the cell
<yunfan> if so, it must not exist in the same machine word of xxxs100
<Regenaxer> no, it uses the full 64 bits for data
<Regenaxer> only the pointer to the whole bignum needs flag bits
<yunfan> so only the first cell has that 4 bits for type hinting?
<Regenaxer> no, only the *pointer* to the first cell
<Regenaxer> a number is either a short num, or a pointer to a bignum
<yunfan> i got it
<yunfan> btw, do you have any recommendation for using picolisp devloping http api services? i dont need rendering html
<Regenaxer> What kind of api services do you mean?
<yunfan> like some ordinarly services
<yunfan> its just a http interface with uri, and messaging using json(or maybe messagepack?)
<Regenaxer> Calling other processes?
<yunfan> i guess redis/sql/other kv database accessing would be need
<Regenaxer> A server dispatching requests? Should be no problem
<yunfan> not only dispatching, but also handling some real jobs
<Regenaxer> Sure, no problem I think
<yunfan> for eg, if i made an authorization service for my small sites
<yunfan> then which libraries will you recommend?
<Regenaxer> Just @lib/http.l should do
<Regenaxer> I do such things dispatching to pil servers
<Regenaxer> You could reply with non-HTML
<yunfan> Regenaxer: what about the performance?
<Regenaxer> There is also @lib/xmlrpc.l
<yunfan> oh, i hate xml
<Regenaxer> hehe, me too. But sometimes needed
<yunfan> well my site, my decision :D
<Regenaxer> Performance is probably not the bottleneck
<Regenaxer> yeah
<yunfan> and were there any existing libraries for accesing redis?
<yunfan> and other mainstream nosql database
<yunfan> i want to build a hub like service
<Regenaxer> I don't know any. What is needed for redis?
<yunfan> which would highly rely on nosqll database
<yunfan> Regenaxer: caching
<Regenaxer> I would set up a pil DB of course
<Regenaxer> and import stuff into that
<yunfan> i dont think that would be as fast as redis
<Regenaxer> How do you know?
<tankf33der> :)
<Regenaxer> I have no idea
<Regenaxer> Just try :)
<yunfan> from a decade experiences of being backend developer
<Regenaxer> Hi tankf33der
<tankf33der> hi all
<yunfan> but i am open to other choice if they could beaten redis
<Regenaxer> At least a pil DB also runs in memory
<Regenaxer> just the persistence is in files
<Regenaxer> So it depends a lot how you model your data
<yunfan> i hightly rely on redis's sorted set data type
<yunfan> also hash and set is very useful to me
<Regenaxer> I never looked at Redis
<Regenaxer> never needed
<yunfan> maybe, but i think if pil db really beat redis, people wont ignore it. especially those user who has hundrend of servers runs redis
<yunfan> but again, i am open to that choice, might take a chance to try it
<Regenaxer> "limitation of data sets that can't be larger than memory"
<Regenaxer> No problem in pil :)
<yunfan> btw, can we compile all our pl code into a static executable ?
<Regenaxer> Though it gets slower then of course
<yunfan> just like golang does
<Regenaxer> No
<Regenaxer> By principle no compiler for code
<yunfan> how about code packing tech like java's jar ?
<Regenaxer> yes, for example PilBox does this
<Regenaxer> zips and tgzs
<yunfan> ok
<Regenaxer> I mean the fact that PilBox is an APK
<Regenaxer> But inside it, the Lisp sources are plain text
<Regenaxer> Some people used pil inside docker
<Regenaxer> but I have not tried
<yunfan> well, that's not what i mean
<yunfan> as you knew, jar could be execute by java command directly
<Regenaxer> T
<yunfan> that's why i ask whether it could be compiled into a static executable before
<yunfan> a single file solution seems fit my taste
<Regenaxer> Kind of unpacking and running at the same time
<Regenaxer> Could be done, but I never did
<Regenaxer> (except in PilBox)
<yunfan> i am always want the forth guys could built a android forth that can generate apk itself
<yunfan> so could pilbox do that that?
<Regenaxer> It does not generate itself. This is done by the Android SDK
<Regenaxer> The apps *inside* pilbox are
<Regenaxer> They are just plain ZIPs, expanded at runtime
<Regenaxer> Once you installed PilBox, you just pass it a ZIP
<Regenaxer> The ZIP can be built trivially using the zip utility
<yunfan> ok
<yunfan> and about the bignums, still has a question
<Regenaxer> ok
<yunfan> what's the detail of the bignum itself?
<yunfan> i knew it has a xxxxs100 in its CAR?
<Regenaxer> no, it has xxxxxx in the CAR
<Regenaxer> the number is not two-complement
<Regenaxer> it is an unsigned bit string
<Regenaxer> and the S bit for the sign in the pointer
<Regenaxer> The CDR is a pointer again, to the higher words of the number
<Regenaxer> That pointer always has ...xxx0100
<yunfan> so the CDR point to the real store, while CAR hold's the type hinting?
<Regenaxer> no, the CAR has 64 bits of the number
<yunfan> here's the question, is that x usally all 0?
<Regenaxer> no, the 'x's in the diagram can be 1 or 0
<Regenaxer> only where there is '0' it is definitely so
<yunfan> but if so, it could only store 60bits in the first cell?
<Regenaxer> no, it stores 64 bits in *each* cell
<Regenaxer> *short* numbers have 60 bits plus sign
<yunfan> i knew that, but you said the bignum just point to those cells
<Regenaxer> yep
<yunfan> i mean the bignum itself need to have a cell too, isnt that?
<Regenaxer> The bignum *is* the pointer
<Regenaxer> Just as a list or a symbol too
<Regenaxer> A symbol is a pointer pointing to a cell with value and tail
<yunfan> yes, but the tutorial said every data based on cells
<Regenaxer> yep
<yunfan> and cell were made of 2 machine words?
<Regenaxer> right
<yunfan> in 64 bit machine, isnt that a cell were 128 bits width?
<Regenaxer> But what the Lisp interpreter handles are just pointers
<yunfan> also in 64 bit machine, a pointer only use 64 bit
<Regenaxer> exactly
<Regenaxer> (setq A 7)
<yunfan> since everything you use in picolisp were based on cell, so pointer use cell too?
<Regenaxer> here the *pointer* to 7 is moved into the value cell where 'A' points to
<yunfan> then if a pointer use only 64bits , what will it use for the rest 64 bits in a single cell?
<Regenaxer> The lowest 4 bits in the pointer are tag bits
<Regenaxer> In total the pointer points to a cell, possibly with an offset
<Regenaxer> You see the offset in the diagrams in 'doc64/structures"
<Regenaxer> V
<Regenaxer> |
<Regenaxer> +-----+--+--+
<Regenaxer> +-----+-----+
<Regenaxer> See? The V points to the *middle* of the next cell
<Regenaxer> it has an offset of 4
<Regenaxer> 0100
<Regenaxer> very simple
<Regenaxer> The tag bits don't need to be masked off
<yunfan> no, i mean in the top cell, what was hold in the left 64 bits
<Regenaxer> All cells in a bignum are analog, the first cell is not special
<Regenaxer> only the pointer to the first cell is
<Regenaxer> ie the "bignum" for the interpreter
<yunfan> the pointer to the first cell is what i disccusing
<Regenaxer> ok
<yunfan> i want to know its detail in bits
<Regenaxer> So it is ...xxxS100
<Regenaxer> more cannot be said
<Regenaxer> all 'x' are pointer data
<yunfan> but that pointer also hold in a cell too, isnt it?
<Regenaxer> no
<yunfan> not?
<Regenaxer> it *points* to a cell
<Regenaxer> as you said, a cell is 128 bits
<yunfan> yes
<Regenaxer> a pointer is 64 bits
<Regenaxer> The pointer is stored somewhere
<yunfan> so it just use a machine word, dont belong to any cell?
<Regenaxer> in a value of a symbol, or the CAR of a list
<Regenaxer> yes
<Regenaxer> The pointer may be in a CPU register, or on the stack, or in a global
<Regenaxer> it always points ito a heap of cells
<yunfan> oh, i got it. it were in a cell too, its just store that pointer's value in a CDR parts like any other data types
<Regenaxer> s/ito/into
<Regenaxer> right
<yunfan> some other data type might contain it as its value
<Regenaxer> yep
<yunfan> its simple and elegant
<Regenaxer> McCarthy's idea :)
<Regenaxer> the essence of Lisp so to say
<yunfan> but i am worried about performance bottleneck like hashtable collision attack
<yunfan> basiclly you were manipulating a giant linked list, isnt it
<Regenaxer> "attack" in the sense of security?
<Regenaxer> yes, or many lists
<yunfan> nope, just worrint about performance
<Regenaxer> There is some overhead of course
<Regenaxer> following pointers
<Regenaxer> It has a worse cache efficiency than linear code
<yunfan> yes, especially those pointers were not in one cache bank line
<Regenaxer> But the advantage is faster memory management
<yunfan> it will jump here and there, with cache missed
<Regenaxer> No fragmentation
<Regenaxer> right
<yunfan> but i noticed that picolisp could invoke native code, right
<Regenaxer> No fragmentation because all heap elements are of same size
<Regenaxer> yes
<Regenaxer> C libs
<yunfan> guess i could use some c code when i need really optimizing
<Regenaxer> T
<yunfan> what about the inverse forward?
<yunfan> could a c program invoke picolisp?
<Regenaxer> Yes, there is a lisp() function
<yunfan> how's the overhead? is it bigger that lua?
<Regenaxer> You can define 24 callbacks iirc
<Regenaxer> No idea about lua
<Regenaxer> There is some overhead, as the function is looked up
<Regenaxer> and the conversion of arguments
<yunfan> ok, will try
orivej has quit [Ping timeout: 256 seconds]
<beneroth> yunfan, pil DB will be good enough for your use case, certainly. maybe you are quicker developing with redis, but you need to implement a conversion-layer to picolisp (no redis bindings for picolisp yet afaik) or maybe go via redis CLI or whatever. your interface will probably degrade performance (even then it probably doesn't matter in practice). Also, with pil DB you have a powerful OOP/graph DB natively integrated into picolisp (no ORM, application & DB
<beneroth> layer is the same!), making programming likely much easier than to convert to another datastore
<beneroth> the community here would surely appreciate if you made redis bindings... but I doubt it would be much of benefit beside having some more compatibility to plugin into existing environments
<yunfan> beneroth: what about grid support?
<yunfan> beneroth: pil db isnt independ service , right?
<beneroth> what do you mean by that? grid as in cluster of servers?
<beneroth> no it isn't. but you could build an independent pilDB service with it, naturally.
<yunfan> beneroth: yes, i mean clusters, when you said a independent service, then it cames lots of problems
<yunfan> like how them communicate each other, how we do request balancing, how to redistribute data over the cluster
<beneroth> are you sure you need a cluster for your use case?
<yunfan> i need to plan for future, i knew pildb might be much powerful than redis, that's why i am worried
<beneroth> master slave replication (for fallback or additional reading-instances) is pretty simple to set up. other mechanics are more involved to set up, but you can control everything.
<yunfan> i am worried i used many of its uniq features and when i need to migrate to cluster, i will met lots of problem that i need fix myself
<beneroth> don't worry about using the most powerful DB (it depends heavily on your use case). and in most cases, so much power is not needed :)
<yunfan> after all , i just want to build my single site. right
<beneroth> well, why do you like do you picolisp for it in the first place? :)
<yunfan> beneroth: because its lisp, which is elegant i like(not like forth), and it was first a small site as i think
<yunfan> beneroth: i'd read the book hackers and painters, i was very admire of their abilities to modified code during meeting :D
<beneroth> yeah I read that one too :)
<yunfan> to do that, i'd already done install termux and picolisp on my cellphone
<beneroth> there is a paul graham advice fitting to your use case: do things that don't scale
<yunfan> and i bought a convenient keyboard
<yunfan> what i need is the coding :D
<yunfan> beneroth: i dont believe his advice, because i used to do like that, and learnt a lot
<beneroth> don't do premature optimization by planning for big cluster growth. if you really need it, you will most probably have the money and resources to adapt your current setup.
<beneroth> ok
<beneroth> I strongly believe into KISS and YAGNI. and picolisp is heavily based on that, too
<yunfan> beneroth: many people follow that advice because when the service grows up, they could hire many other ones, and make that headache problem as others
<beneroth> don't build things you don't need NOW. optimize for the current, practical use case, leave away as much as possible, then you have a small amount of code to adapt when changes are coming. also smaller attack surface, less probability for bugs.
<yunfan> but i decide to maintain that myself
<beneroth> well most of the few people using picolisp are maintaining themselves :)
<yunfan> beneroth: i used to choose clojure, but it changed so fast, books just got expired in just one year
<beneroth> Regenaxer, the picolisp author, is in the business of ERP applications for more than 30 years, using exclusively picolisp and pilDB, and he made a good living of it :)
<yunfan> also that datomic service were expensive to user like me
<beneroth> yeah, thats a big disadvantage with the new, fashionable stuff
<beneroth> picolisp is old, not changing much anymore. the parts are stable and tested in real world.
<beneroth> how was datomic expensive to user like yoU?
<yunfan> beneroth: this is the differences between you guys and me, i start my backend developing life from serving millions of users. i used to worried about performance first :[
<beneroth> I looked at the datomic architecture. it could be implemented for pilDB I think. but so far nobody had a need for it :)
<yunfan> beneroth: i am a chinese :D chinese dollar could change lesser USD :D
<beneroth> good point. we're usually in the hundreds of concurrent users, or less.
<beneroth> ah. I see :)
<beneroth> I'm Swiss
<yunfan> beneroth: yes, in your case, a single QPS is not a problem you need to worried about
<Regenaxer> What is a QPS?
<yunfan> but for me, if the QPS below 1k, i will be crazy
<yunfan> query per second
<Regenaxer> ah, thx
<beneroth> well pilDB fights this by reducing the need for queries, kinda. by having smarter queries.
<yunfan> beneroth: i think it looks like the popular tech in frontend , which is called graphql
<beneroth> the question is: what is your goal: is your goal to build a highly scaling authentication service? or is it your goal to build one with picolisp?
<yunfan> beneroth: my goal is to build a website which i had been thinking for a decade. and i could saw its potention to became a big service
<beneroth> hm..basically in picolisp the philosophy is to not separate frontend and backend. it's pretty weird and different from a mainstream point of view, but it makes a lot sense.
<yunfan> so that's why i choose to split it into many services
<beneroth> can't you scale by sharding (setting up more identical instances) ?
<yunfan> also since its a single man's job, i think i need to develop it quickly, and modify it quickly
<beneroth> that would be a point for picolisp
<yunfan> so i was inspired by hackers and paitners the book
<yunfan> i used to use clojure, as i said.
<yunfan> but finally i found picolisp were much more suit
<Regenaxer> Also, in term of speed Clojure and Pil don't differ much
<yunfan> the clojure community claim that you dont need to be familliar with java, but actually we i really developing a sample service, i found that i really need to be familliar with java circle
<yunfan> like maven
<yunfan> and others
<beneroth> yeah, so we figured too
<beneroth> (we're always interested in experience people had with other lisps)
<yunfan> Regenaxer: for that i dont worry, since you could be invoke by c :D
<Regenaxer> sure :)
<yunfan> beneroth: also i am a big fans of forth, except everyone has its own forth, so i decide not to waste my time learning someone's word dcitionary
<Regenaxer> I like Forth too
<yunfan> maybe someday i will re-implmeent redis using forth
<Regenaxer> A Forth in Pil btw: https://software-lab.de/forth.l
<yunfan> ha
<Regenaxer> (just a start)
<beneroth> my background is enterprise (and smaller) databases, ERPs, business apps. I have my own company and attempt to build a platform (based on picolisp) to easily build web applications. not intended for scaling to thousands of concurrent users, as my main target is for now business applications. I want flexibility. I looked at a number of tech stacks and finally ended here :)
<beneroth> if you can scale by sharding, I see no problem with being based on picolisp
<yunfan> flexibility is always a demand i think, especially for you guys in developed coutries
<yunfan> because time is money :D
<beneroth> if you need to scale the whole thing as a monolith, it becomes much harder. then maybe better build upon existing software targeted at that special use case, and use picolisp maybe on top of it to glue it together or so.
<yunfan> beneroth: of course, that's why i choose micro-service arch
<yunfan> i used to build monolith backend , and got lots of pain
<yunfan> now i'd learnt
<beneroth> if you are not satisfied by current other solutions for big scale (either because of requirements or just personal interest), and you want to build your own system (large task), than picolisp might be the right choice as it allows fast development
<Regenaxer> and fine tuning
<beneroth> well, take care not to fall into the other extreme :) the optimal solutions is usually not at either end of the (gauss?) curve
<beneroth> T
<yunfan> currently i am quit satisfied by picolisp except its lack of compiling feature, but that's not a key point
<Regenaxer> T
<beneroth> picolisp is about programming being in control and having transparent insight and access to the inner workings. allows much more fine tuning then usual stacks. but might require a bit more work where other stacks have ready-to-use solutions. though you could also just wrap them :)
<yunfan> btw, can picolisp run in mcus?
<beneroth> yes, some
<beneroth> there is pilMCU
<beneroth> well it's in the work
<beneroth> nowhere finished yet :)
<yunfan> http://picolisp.com/wiki/?pilMCUhttp://picolisp.com/wiki/?pilMCU
<yunfan> this looks not like a MCU version
<yunfan> i am intersting of could it run on esp8266
<yunfan> or esp32
<Regenaxer> miniPicoLisp would run on it
<beneroth> there was also this project: https://en.wikibooks.org/wiki/Mizar32
<yunfan> interesting, like micropython :D
<beneroth> as you are in China, you might be able to meet up with Georg Orais (China is small country, I know)
<yunfan> are you joking?
<beneroth> :D
<Regenaxer> No, Geo is in Japan now :)
<yunfan> but i do knew some western guys live in china who were a big fans of forth
<beneroth> it's difficult to meet picolispers in flesh xD
<yunfan> i dont care people's choice of language
<beneroth> well it's not so hard to find fans. question is, what fits you and your use case(s)
<yunfan> compared to programming language, i would be excited to meet up with people interesting of indoor farming :D
<yunfan> yes, that's another hobyist of me
<yunfan> i even rented 3 green house here at shanghai
<beneroth> I programming picolisp over 4 years now, and found the productivity gains are real for me
<beneroth> cool :)
<yunfan> beneroth: then what you use of those saved time ?
<beneroth> working more, instead of doing something else, haha
<yunfan> aha
<yunfan> i guess i would be excited if i went to netherland
<beneroth> I also work with more mainstream stacks in parallel (for clients), so I believe I can compare a bit
<yunfan> they have a food valey
<yunfan> me too, i use python for my daily work
<yunfan> but the python community dislike lispy code while i use it all the time
<beneroth> python appears to be kinda of a foreign relative to lisp with a bad relationship between them, hehe
<yunfan> beneroth: well, in python we have list comprehension, which i use it all the day
<yunfan> and that code looks like very familliar with lisp
<yunfan> except not that powerful(i got that impression after learned clojure)
<beneroth> there is this famous talk where Peter Norvig (one of the leading AI experts, long-term common lisp proponent) switched to python "its like lisp but more readable/better fitting for education for students". and McCarthy (inventor of Lisp) was in the hall and asked "does python have equivalence of code and data?" and Norvig "No, it hasn't John". then silence :D
<beneroth> but yeah, in the end only results matter.
<beneroth> debating and thinking of nice theories and models doesn't change anything, the stuff must be implemented to have an effect.
<yunfan> beneroth: its simple, mccarthy were math master who could easily be convenient with lisp code, while our industry cant find lots of such people
<beneroth> T this is a big point
<yunfan> just like forth's inventor chunk moore, who claim OS is the biggest fraug
<yunfan> well his point is very reasonable except the rest of us cant not be smarty like him
<yunfan> and we still need the help of OS, thus we need to be put up with OS's side effects
<beneroth> I argue that the advantage of Java/C# etc. is not its power, but its limits on power, limiting the failures a bad programmer can do and so making even bad programmers minimally productive. harms better programmers a lot. big companies can this way have many programmers work on the same stuff, and more easily exchange them.
<yunfan> anyway, i am going home, see you tomorrow
<beneroth> see you tomorrow
<beneroth> :)
<beneroth> will try to tell you then that your assumption, that we can't be all clever, might be wrong :)
<Regenaxer> see you yunfan!
<beneroth> some brain capacity is required, sure, but most of a 10X (or 100X) programmer is just strong discipline and good habits, I believe
orivej has joined #picolisp
<Regenaxer> I think it is a matter of being interested of what one is doing
<Regenaxer> and as a result actually think about one is doing
<beneroth> so true
<beneroth> and then focusing on the parts that make a difference vs. the parts which gives one merely a good feeling :)
<Regenaxer> T
libertas has joined #picolisp
libertas has quit [Client Quit]
shpx has quit [Quit: Textual IRC Client: www.textualapp.com]
libertas has joined #picolisp
sriram has joined #picolisp
<sriram> Hi....In lib/pdfPage.l : (dm grp> (Lst) (list (mapcar list Lst)) )
<sriram> here grp> seems like a "static" method i.e does not impact the class variables at all
<Regenaxer> Hi sriram!
<sriram> Hi Regenaxer...good afternoon...!
<Regenaxer> :)
<sriram> (not afternoon? I get confused with time diff :) )
<Regenaxer> Well, a "static" method does not exist in pil
<Regenaxer> A static method is nothing than a normal function, right?
<sriram> ah ...i was just saying the equivalent of a c++ "static" method
<Regenaxer> in the sense of hidden?
<sriram> but what i meant was that it has nothing to do with the class and so might as well be a de rather than a dm>
<Regenaxer> I meant in the sense of Java
<sriram> yes only in the sense of hidden then
<Regenaxer> if in the sense of 'de', then like static in Java :)
<sriram> so grp> is encapsulated in the scope of PdfPage...and has no other benefit
<sriram> since it does not use any class variables
<Regenaxer> I think it has
<sriram> it is called as follows : (let Grp (grp> This (: lst))
<Regenaxer> It can be overwritten in other projects
<Regenaxer> I think I did sos
<Regenaxer> so
<sriram> was wondering why grp> is not defined as (dm grp> () (list (mapcar list (: lst))) )
<sriram> then it would make sense to be a dm
<sriram> and it would be called as (let Grp (grp> This)
<sriram> i think there must be some flaw in my reasoning :) but not sure what
<Regenaxer> I think it is needed as it is
<Regenaxer> In the menu program I override it
<sriram> oh i see
<sriram> perhaps grp> is a base class method that always takes an Lst
<Regenaxer> and it may well get a modified list, not just (: lst)
<sriram> ok I think I follow
<Regenaxer> yeah
<sriram> ok...yes...similar to html>, cannot change signature
<Regenaxer> yes, a kind of hook or callback method
<sriram> do you find it helpful to have some kind of naming scheme so that "standard" base class methods like upd>, html> can be distinguished (while reading code)
<sriram> from the methods specific to the current class?
<sriram> (just was wondering...I dont use any such in c++)
<sriram> perhaps it is not useful to have such a scheme
<Regenaxer> yes, might be useful, though I don't know where the border is
<sriram> i was thinking class specific methods one way, and overridden methods another way
<sriram> and perhaps a third for "abstract" methods that must be overridden
<Regenaxer> hmm, but any method is meant to be overwritable
<sriram> e.g drawCanvas
<Regenaxer> drawCanvas is a function
<Regenaxer> a place holder
<Regenaxer> aka "deferred" in the Forth sense
<sriram> yes, similar to "abstract" definition...it has a pre-defined signature expected
<Regenaxer> T
<sriram> perhaps interface is a better word
<sriram> rather than abstract
<sriram> so similarly i think there are some Entity methods like upd>, chk>
<sriram> that have an expected "signature"
<Regenaxer> The "signature" (in the C sense) is usually constant in pil
<Regenaxer> Like grp> (Lst)
<beneroth> no overloading into multiple functions/methods. though "overloading" is kinda possible when implemented in the one function
<Regenaxer> Though anything can be changed on the fly
<Regenaxer> yes
<Regenaxer> no dispatch on the arguments and their types
<Regenaxer> These must be checked at runtime
<beneroth> which I find actually good. this way, all is at one place, not spread over multiple files (as it is likely in C/C++)
<Regenaxer> and dispatched in the method itself
<sriram> yes...but in any case, this was only for my own understanding..so that when i read a class definition (in pil) i could tell
<beneroth> yeah every object has its own virtual table, kinda :D
<sriram> which methods *must* be overridden by me
<Regenaxer> correct
<Regenaxer> *must* be overridden should actually be in a comment ;)
<beneroth> sriram, it's not so clearly defined/separated in picolisp (vs. other languages), because actually all methods in picolisp are overwriteable and virtual. including the methods on the class (which is just another object in picolisp)
<Regenaxer> I think there is no formal way
<Regenaxer> T
<beneroth> important is too (pass) the arguments to the super method in case you don't want completely overshadow it. e.g. with the T message on +Entity classes.
<beneroth> (the "constructor" / initializing method. called by (request) and (new) etc... )
<sriram> lib/http.l calls the html> method.. I only knew about it since I saw dm html> in pdfPage, seems like it is an expected
<Regenaxer> it is also called in @lib/form.l btw
<sriram> method of an Entity. but +Entity does not have a html> method defined (as far as I could see)
<beneroth> it's nice to implement default values that way. e.g. (class +Foo +Entity) (rel aa (+Number)) (dm T @ (put> This 'aa 5) (pass super), when just calling (new T '(+Foo)), the new object will have 5 in 'aa property. when called (new T '(+Foo) 'aa 10), the property will firs set to 5, but then method T of +Entity class gets called (because of the (pass super)) and receive the arguments (aa 10) and set the property accordingly
<Regenaxer> It is only needed if the application allows direct display of objects
<Regenaxer> eg the Wiki does
<beneroth> I guess @lib/form.l makes (extend '+Entity) ?
<sriram> so was just wondering how to find what methods should be overriden...
<beneroth> usually none, I guess. there should be sane default implementations.
<Regenaxer> Actually, lib/form.l does not extend +Entity
<beneroth> view it as hooks which you can adjust or replace
<sriram> I could not find any implementation for html> other than in pdfPage..
<Regenaxer> or even use these classes
<beneroth> ah alright
<Regenaxer> sriram, the Wiki has
<beneroth> wiki is not in standard distro, I think
<beneroth> well I'm not sure anymore
<Regenaxer> right
<Regenaxer> completely separate
<Regenaxer> I find html> in 5 projects here
Regenaxer has left #picolisp [#picolisp]
Regenaxer has joined #picolisp
<Regenaxer> Even more special in this sense is 'gui>' in @lib/db.l
<sriram> ah...but for gui i do see an implementation of gui> in db.l so may infer that can be overloaded in derived class
<Regenaxer> It is used for example in @lib/user.l
<sriram> to provide specific functionality
<Regenaxer> yes, because it is *called*
<Regenaxer> html> is only called when the app really supplies an external object in an URL
<sriram> but without any "default" implementation, the only way to tell html> is available to be "derived", is by noticing that it is :)
<Regenaxer> external symbol I mean
<beneroth> similar with (upd> '+Entity). I use this in my DB customization to log changes on objects
<Regenaxer> If you don't know html>, then you don't need it ;)
<beneroth> sriram, see debug function (methods)
<Regenaxer> It is like "!foo" in URLs
<sriram> Regenaxer ....agreed :)
<sriram> upd> is different, there is a definition in form.l
<Regenaxer> if you don't know that a Lisp function can be passed in URLs
<Regenaxer> because it is *called*
<beneroth> (upd>) is also called by the relationship classes
<Regenaxer> If it is called somewhere, it needs an empty def at least
<sriram> i know...but there is a default impl...so if one knows that ones class is derived from +Upd, then one can know that
<sriram> the upd> method can be redefined
<beneroth> yeah, else the ugly "Bad message" error appears :)
<Regenaxer> +Upd and upd> are not related here
<Regenaxer> upd> is called when an object is modified
<Regenaxer> +Upd is for upd> in +gui
<sriram> agreed....i was only pointing out that it is a different case anyway
<Regenaxer> which is called when a gui component is updated
<Regenaxer> T
<sriram> because the "default" upd> method already exists for +Upd and so the "signature" is clear as well
<sriram> perhaps html> is a bit unique that way
<Regenaxer> Unique perhaps because it is not often-used
<Regenaxer> gui> is even less used though
<sriram> agreed...i noticed that when items from db are displayed in the gui
<sriram> the : accessor is used, : nm etc to populate the fields
<sriram> so html> is not directly used
<Regenaxer> right, html> is an URL-shortenr
<Regenaxer> not really related to the form gui
<sriram> ok...perhaps i may not need it in my app..let me look at the osmgeo app for example where also there is a canvas
<Regenaxer> instead of https://foo.bar.com/!mumble?-123
<Regenaxer> you pass https://foo.bar.com?-123
<Regenaxer> "?-123" automatically sends 'html>' to the object {123}
<sriram> oh i see...
<Regenaxer> It is simply part of the pil URL syntax
<sriram> ah...i get it now..
<Regenaxer> like '!' for functions and ".l" for Lisp files
<sriram> yes it is like your !foo example
<sriram> it is a special case...
<sriram> in fact it can apply to any object then, even if not derived from +Entity
<sriram> no....because {123} is an
<Regenaxer> yes, but it must be an external symbol
<sriram> entity object
<Regenaxer> not necessarily
<sriram> ah may be i am confusing entity object and external symbol
<Regenaxer> Yes, {123} could be a low-level symbol, not an +Entity
<sriram> and as long as html> is defined for it, it would be valid to see it directly in browser
<Regenaxer> But typically it is some OOP object
<Regenaxer> cause it needs the method html>
<sriram> yes
<Regenaxer> T
<Regenaxer> This is the nice thing in pil
<Regenaxer> you can use a method without any pre-assumed context
<beneroth> duck typing
<Regenaxer> let alone a class
<beneroth> I love it
<Regenaxer> not sure if it is duck here
<Regenaxer> duck is about how it looks or behaves
<Regenaxer> like 123 looks like a number
<Regenaxer> A method is more hard
<beneroth> well if it accepts (html>) message, then you can call (html>) on it. object doesn't necessarily need to inherit (be of type) of some +HasHtmlMethod class/interface/bla
<Regenaxer> Either it is defined for the object or not
<beneroth> T
<Regenaxer> exactly
<Regenaxer> "necessarily need to inherit" is just to "protect" the programmer from himself
<Regenaxer> or herself (?)
<sriram> i guess the method call can be used
<sriram> to check if the html> method is indeed present for the object
<sriram> 'method'
<Regenaxer> yes, in this case with 'try'
<Regenaxer> (apply try L 'html> (extern (ht:Pack @X T)))
<sriram> ah i see...thats why apply try ...
<Regenaxer> yes, to avoid an error
<sriram> i was wondering about that paradigm...its used in a lot of places ...apply try
<Regenaxer> (try 'html> Obj ...
<sriram> powerful functional nesting
<Regenaxer> Like (send 'html> Obj ...
<Regenaxer> but 'send' would go into an error handler if not defined
<sriram> trying :) to understand example above
<Regenaxer> :)
<sriram> (apply try L 'html> (extern (ht:Pack @X T))) --> (try 'html> L ...)
<sriram> so the position of L is changed after the apply
<sriram> (reading apply)
<Regenaxer> (apply fun '(a b c) X Y) is (fun X Y a b c)
<Regenaxer> : (apply println '(a b c) 3 4)
<Regenaxer> 3 4 a b c
<Regenaxer> The order of arguments appears strange at first, but is useful this way
<Regenaxer> Same order rules for 'pass'
<sriram> (I had understood apply before, (thought i did) but in this context of try, I need to work it out again based on your example above :)
<Regenaxer> ok
<Regenaxer> It becomes (try 'html> '{123} L1 L2 L3 ...)
<sriram> from example aboeve it should become (try 'html> (extern (ht:Pack @X T)) L)
<sriram> because 'html is X, (extern....) is Y
<Regenaxer> kind of, just 'L' is "opened"
<Regenaxer> (try 'html> '{123} L1 L2 L3 ...)
<sriram> (apply try L 'html> (extern (ht:Pack @X T))) becomes (try 'html> L (extern (ht:Pack @X T)) ?
<sriram> just wondering why it does not become (try 'html> (extern (ht:Pack @X T)) L)
<Regenaxer> no
<sriram> (even if L is opened)
<Regenaxer> See the 'println' example above
<sriram> yes i see a b c is opened
<sriram> (is L the object? i.e {123})
<Regenaxer> no, the list
<Regenaxer> The second arg to 'apply' is always the lisw
<Regenaxer> list
<Regenaxer> optional further args are prepended
<sriram> yes two optional args: 1. html> 2. (extern (ht:Pack @X T))
<Regenaxer> T
mtsd has quit [Quit: Leaving]
<sriram> so i expect ( try html> (extern (ht:Pack @X T)) L1 L2 L3
<Regenaxer> yep
<Regenaxer> though html> must be quoted
<sriram> is (extern (ht:Pack @X T)) the object? maybe thats the source of my confusion
<sriram> object is not in L but in (extern....)
<Regenaxer> Yes, external object
<Regenaxer> right
<sriram> ah ok...so is clear now :)
<Regenaxer> L are the args to the URL
<Regenaxer> Sorry, phone
<sriram> back to main point...no need for using 'method' to check if html> is defined, since try will do it
<Regenaxer> Some conference with Paris
<sriram> np
<sriram> bye for now :)
<Regenaxer> yes, correct
<Regenaxer> bbl :)
<Regenaxer> done
<Regenaxer> But soon more conferencing
rob_w has quit [Quit: Leaving]
<beneroth> Regenaxer, I have an issue with namespaces and (=:). similar issue with (pp). I think I know how it came to be this way.. but it's a problem for me. maybe you have a solution?
<beneroth> : (symbols 'bar 'pico)
<beneroth> -> foo
<beneroth> bar: (de foo () (with (box) (=: desc "bla") This))
<beneroth> -> (pico)
<beneroth> bar: (symbols 'pico)
<beneroth> -> (bar pico)
<beneroth> : (pp 'bar~foo)
<beneroth> (de "foo" NIL
<beneroth> (with (box) (=: "desc" "bla") This) )
<beneroth> -> "foo"
<beneroth> : (bar~foo)
<beneroth> -> $177343543563170
<beneroth> : (show @)
<beneroth> $177343543563170 NIL
<beneroth> "desc" "bla"
<beneroth> -> $177343543563170
<beneroth> notice how the property name changed from being a symbol to a transient symbol, because it is interned within a namespace.
<beneroth> therefore (:) doesn't work as intended: (with '$177343543563170 (: desc)) -> NIL
<beneroth> maybe I do something completely wrong :)
<Regenaxer> Sorry, was busy
<Regenaxer> This behavior is correct. The property functions operate with ==
<Regenaxer> So best is to have the namespace in question in the search order
<Regenaxer> Instead of bar: (symbols 'pico)
<Regenaxer> better do (symbols '(pico bar))
<Regenaxer> What I do is:
<beneroth> how do mean? I have the function definition of 'foo in a file, and I would like to load it in another namespace
<Regenaxer> 1. In the libraries I do (symbols 'gis 'pico)
<Regenaxer> 2. Then in main.l I do (symbols '(pico gis))
<Regenaxer> An extensive example is @lib/android.l
<beneroth> 1. I did. 2. do you do this before or after loading the library?
<Regenaxer> Sorry, interrupt
<Regenaxer> bbl
<beneroth> kk cu
<beneroth> yeah works. I see.
<beneroth> I see now why this usage of (symbols) is correct
<beneroth> though its pretty difficult to use (symbols) correctly with the knowledge from the reference alone :|
<beneroth> [off-topic] lol, the censor took a break and this happened: https://twitter.com/eucopresident/status/996731038062862336
<Regenaxer> ret
<Regenaxer> sorry!
<Regenaxer> I did a lot of experimenting with symbols recently
<Regenaxer> And I'm quite content with the systematics I use
<beneroth> I believe you that :)
<Regenaxer> For example, for the new BTG I provide access to the old DB
<beneroth> two DBs ?
<Regenaxer> So I have a namespace with (parts of) the old model
<Regenaxer> many DBs in fact
<beneroth> yeah I mean open at the same time
<beneroth> parts of the schema in another namespace? that interests me!
<Regenaxer> Not open, I use 'blk' to access it
<Regenaxer> yes
<Regenaxer> eg:
<Regenaxer> (symbols 'leg 'pico)
<Regenaxer> +Currency +Land +Ort +Branche +Carrier +Anr +Ansp +Ves ]
<Regenaxer> (local) [
<Regenaxer> (class +Currency +Remote)
<Regenaxer> (rel pico~key (+Key +String) T)
<Regenaxer> (class +Land +Remote)
<Regenaxer> (rel pico~en (+Key +String) T) # Englisch
<Regenaxer> (rel pico~de (+Key +String) T) # Deutsch
<Regenaxer>
<Regenaxer> 'leg' is the old one
<beneroth> I see
<beneroth> ah and you use (rel pico~prop) haha
<Regenaxer> I access it as remote db (though locally via 'blk'
<Regenaxer> (de *Ext
<Regenaxer> (`CORE (Obj)
<Regenaxer> (let (Id (extId Obj) E (extFile Id))
<Regenaxer> (ext (caar Id)
<Regenaxer> (blk (car E) (cdr Id) (cadr E) (cddr E)) ) ) )
<Regenaxer> (`LEGACY (Obj)
<Regenaxer> (let (Id (id Obj T) E (legacyFile (- (car Id) `LEGACY)))
<Regenaxer> (symbols '(leg pico)
<Regenaxer> (ext `LEGACY
<Regenaxer> (blk (car E) (cdr Id) (cdr E)) ) ) ) ) )
<Regenaxer>
<Regenaxer> The line (symbols '(leg pico) ...
<beneroth> I see
<beneroth> nice
<Regenaxer> temporarily switches namespace while reading
<Regenaxer> Works perfectl
<Regenaxer> y
<beneroth> yeah the thing about the namespacing of relationship names was one of the topics i had problems with
<Regenaxer> We can search the old db normally, with the old dialogs
<beneroth> ok, I will think some more about the topic "database & namespacing"
<beneroth> yeah nice solution
<Regenaxer> When I need to load a system lib later, I do:
<Regenaxer> (symbols '(pico)
<Regenaxer> (load "@lib/adm.l") )
<Regenaxer> PilBox does this: (symbols '(pico gis android))
<beneroth> this discussion helped me now tremendously to grok namespacing. will take notes.
<Regenaxer> ok
<Regenaxer> Before that, PilBox does
<Regenaxer> (load
<Regenaxer> "@lib/http.l" "@lib/xhtml.l" "@lib/form.l" "@lib/canvas.l"
<Regenaxer> "@lib/android.l" "@lib/gis.l" )
<beneroth> yeah I understand. one has to be aware of the tree structure of all the stuff, then it becomes logical :)
<Regenaxer> So "@lib/android.l" does (symbols 'android 'pico) and
<Regenaxer> "@lib/gis.l" does (symbols 'gis 'pico)
<beneroth> the BTG legacy DB is indexed in the "main" DB ?
<Regenaxer> With that lib~ prefixes are seldom needed
<Regenaxer> no, it is an add-on
<Regenaxer> So that we do not export -> import the old one
<Regenaxer> Instead, they can search the old one
<Regenaxer> and then import only those objects really needed
<Regenaxer> The old db can only be searched
<Regenaxer> no write acces
<Regenaxer> 'blk', you know
<beneroth> searching without index?
<Regenaxer> no, everything
<Regenaxer> (rel pico~key (+Key +String) T)
<Regenaxer> Not the T
<Regenaxer> this is a +Hook
<Regenaxer> which is the *DB object of the old one
<beneroth> ah
<beneroth> ok, so yeah, you have loaded the old *DB object
<beneroth> {1}
<beneroth> ok
<beneroth> ah you just load {1} with (blk) ?
<Regenaxer> yes
<beneroth> alright, got it :)
<Regenaxer> like this:
<Regenaxer> : (collect 'nm 'leg~+Carrier (legacy) NIL T 'nm)
<Regenaxer> -> ("0" "AACL" "ABSA Aerolinhas Brasileiras"
<Regenaxer> : (legacy)
<Regenaxer> -> {A@@@1}
<Regenaxer> See? this is {1} with offset
<beneroth> I see. nice.
<Regenaxer> (de legacy @
<Regenaxer> (pass get (id `(inc LEGACY) 1)) )
<Regenaxer> Then there is also a CORE db shared by the individual applications
<Regenaxer> It is handled the same way
<Regenaxer> with 'blk' read-only
<beneroth> I see
<Regenaxer> Authorized users can log into that DB and work on it normally
<Regenaxer> And then there is one DB per User
<beneroth> I'm still on 17.12.30. I need to upgrade and start playing with 'blk
<Regenaxer> which resides on mobiles or on the server
<beneroth> I should have many use cases for it soonish
<Regenaxer> ok
<Regenaxer> yes, better update
<beneroth> in my extra database layer I manage schema too. this way, I could maybe separate it from the application DB
<Regenaxer> good
<beneroth> thanks! gained a lot understanding, and much fodder to think about :)
<Regenaxer> :)
<beneroth> bbl
<Regenaxer> cu
<beneroth> one more thing: reading with (blk) from a DB opened by another pil process would not affect the other process in any way, right? (the consistency between external symbols read via (blk) is not guaranteed though)
<Regenaxer> yes
<Regenaxer> The legacy database is assumed to be an archive only
<Regenaxer> No longer modified
<Regenaxer> The other is locked
<Regenaxer> (blk 'fd 'cnt 'siz ['fd2])
<Regenaxer> the fd2
<Regenaxer> (de *Ext
<Regenaxer> (`CORE (Obj)
<Regenaxer> (let (Id (extId Obj) E (extFile Id))
<Regenaxer> (ext (caar Id)
<Regenaxer> (blk (car E) (cdr Id) (cadr E) (cddr E)) ) ) )
<Regenaxer> ...
<Regenaxer> (cddr E) is the root object iirc
<Regenaxer> 'extId' and 'extFile' take care of this
<Regenaxer> they open the db files, and keep the file descriptors of opened files
<Regenaxer> (de extFile (Id) # (fd siz . fd2)
<Regenaxer> (if (assoc (car Id) *ExtFiles)
<Regenaxer> (cdar (rot *ExtFiles (index @ *ExtFiles)))
<Regenaxer> (let
<Regenaxer> (Path (pack "db/messe/" (srvName (caar Id)))
<Regenaxer> N (cdar Id)
<Regenaxer> Fd
<Regenaxer> (cdr
<Regenaxer> (or
<Regenaxer> (assoc Path *LockFiles)
<Regenaxer> (push '*LockFiles (cons Path (open (pack Path "/@")))) ) ) )
<Regenaxer> (prog1
<Regenaxer> (cons
<Regenaxer> (if (=1 N)
<Regenaxer> Fd
<Regenaxer> (open (pack Path "/" (hax (dec N)))) )
<Regenaxer> (get *Dbs N) # All Apps have the same *Dbs
<Regenaxer> Fd )
<Regenaxer> (push '*ExtFiles (cons (car Id) @)) ) ) ) )
<beneroth> alright, thanks!
<Regenaxer> Sorry for the flooding. My irc client does this by slowing down if there are more lines :)
<beneroth> brb
<Regenaxer> see you
orivej has quit [Ping timeout: 276 seconds]
<sriram> Hi Regenaxer...referring to above, when Pilbox does (symbols '(pico gis android))
<sriram> the pico namespace gets a copy of gis and a copy of android namespaces
<sriram> and becomes the defauly
<Regenaxer> No copying
<sriram> what if there is a function foo in both
<Regenaxer> This was the "old" namespaces in pil
<sriram> (oh i was referring to https://picolisp.com/wiki/?symbolnamespaces)
<sriram> i mean in both gis and android
<Regenaxer> Oh! the wiki is outdated
<Regenaxer> The normal docs are all fixed, but I did not think of that article
<sriram> ah ok...i did not see 'symbols' in the doc reference..so went looking for namespaces article
AnOddOne has joined #picolisp
<Regenaxer> ok
<sriram> where is a good place to read about the new behavior?
<Regenaxer> I would start with (doc 'symbols)
<Regenaxer> The old version had only a *single* namespace at a time
<sriram> (upto now I was using https://software-lab.de/doc/index.html and (doc 'xxx) interchangeably, thought it was the same
<Regenaxer> which was a copy + merge of the arguments
<Regenaxer> I never use index.html ;)
<Regenaxer> We have also (help 'symbols) now btw
<Regenaxer> The new system is *much* more efficient
<Regenaxer> A namespace may have only a handful of symbols
<sriram> (ah :) i have the index always open in browser...)
<Regenaxer> And the search order determines how a name is looking up a symbol
<Regenaxer> OK, this is also fine
<Regenaxer> This search order is inspired by Forth
<sriram> (but will check the (doc...) from now since it is more upto date)
<Regenaxer> Forth: only android also gis also pico
<Regenaxer> No, the docs are the same
<Regenaxer> Just a global index
<Regenaxer> ah
<Regenaxer> ok, (doc ) looks in the locally installed directory
<sriram> (then puzzled since looking for "symbols" in the bottom search field of the index.html does not return anything)
<Regenaxer> But the one at software-lab.de/doc/ is also always current
<Regenaxer> really
<sriram> yes thats the one I have in my browser...and the one I meant
<sriram> three frames
<sriram> oh no....momentary mistake
<Regenaxer> search in index.html does not work here
<sriram> :) i searched in the bottom most text field
<Regenaxer> w3m
<Regenaxer> no JS
<sriram> instead of in the "Reference lookup" text field...it works now
<beneroth> back :)
<Regenaxer> hi beneroth :)
<Regenaxer> In summary, I think only this new namespace system is really usable
<Regenaxer> ie. with a defined search order
<Regenaxer> And much smaller sizes
<Regenaxer> I will fix that article from Erik tomorrow
<sriram> so if there is a function foo in both gis and android...and pilbox main does not refer with ~
<sriram> then what happens
<beneroth> yeah the old one was a prototype to be trashed ;)
<Regenaxer> It has nothing to do with functions
<Regenaxer> it is all about symbols
<sriram> oh i did not realize it was a protype
<beneroth> it wasn't xD
<Regenaxer> hehe, a first try so to say
<sriram> so if 'foo is a function...in both namespaces...
<beneroth> it turned out it was one. liek Fred Brocks said, the first version will end in trash, always.
<Regenaxer> T
<beneroth> yeah, so 'foo is a symbol interned in both namespaces, having a function bound to it
<sriram> sometimes for me not just the first :)
<Regenaxer> sriram: So the first one is found by the reader
<Regenaxer> Also without definition or value it is important
grp has joined #picolisp
<Regenaxer> (get Location 'gis~lt)
<sriram> and possibly then an error..if the first..so maybe good practice to always use ~ ala std::cout?
<Regenaxer> (get Location 'lt) may not work
<Regenaxer> For example, @lib/gis.l has 'nm' local
<Regenaxer> 'nm' is often used as a property in DBs
<Regenaxer> if you have (symbols '(gis pico)) and do (: nm) it will fail
<sriram> so if it is local then ~ is *needed*, but optional otherwise ?
<grp> (you could always keep an assoc or tree with transient symbols meant to be used specifically as attributes for get, so you don't need to fiddle with namespaces and symbol uniqness)
<Regenaxer> Wit (symbols '(pico gis)) you are fine
<Regenaxer> Hi grp!
<grp> yo~!
<Regenaxer> grp, but with namespaces it is pure and clean
<Regenaxer> no need to fiddle with hand-made structures
<grp> well.. honestly, I haven't really used them since they were restructured
<grp> so my concept of 'em is outdated
<beneroth> it's a completely new concept
<beneroth> can't compare
<grp> they used to kind of suck
<beneroth> mixing DB and namespacing is still tricky, but probably actually doable xD
<Regenaxer> Some things like the multiple accessed DBs discussed above would not be possible without namespaces
alexshendi has joined #picolisp
<Regenaxer> or at least very hard
<Regenaxer> In my case those DBs have entity classes with the same names
<Regenaxer> but different definitions
<Regenaxer> To access them both at the same time you need namespaces
<beneroth> T
<Regenaxer> grp, yes, the old one really sucked
<Regenaxer> was a mistake
* grp nods
<grp> I remember we discussed extensively the issue back then
<Regenaxer> yeah
<beneroth> only inaction completely prevents mistakes.
<Regenaxer> very wise!
<beneroth> the best managers are ones never doing anything, so they never get any opponents ;)
<beneroth> I gave up with mixing old namespacing system with the DB. but.. now I'm convinced to attempt it one more
AnOddOne has quit [Quit: leaving]
<Regenaxer> For me, the key insight was to do the order different in the defining libs and in the application
<beneroth> Regenaxer, so as general rule you put pico~ in front of every DB relationship property and index. then it results in the same pointers being used.
<Regenaxer> in lib (mylib otherlib pico)
<beneroth> yeah, that insight I missed until the discussion today
<Regenaxer> in ap (pico otherlib mylib)
<Regenaxer> So the app always defaults to pico
<beneroth> the concept makes this namespacing system very flexible and powerful. but usual (mainstream) namespacing systems are much easier to use and less prone to programmer errors
<Regenaxer> then (... mylib~foo ...)
<Regenaxer> Perhaps, yes, but this does not fit well for symbols in the Lisp sense
<beneroth> T
<Regenaxer> in the 80s I implemented a CL-style namespace systom
<grp> anyway.. after going full throttle with structural design/calc, when everything was ready to begin constructing the basements, I had to first decide where to place them. When I made a 3d of the house, trees, current basements, etc... oh! surprise! it was all pointless. Every fucking antenna could be pointed without issue with no changes whatsoever. What was really needed was to be smart about which one
<grp> should point where.... what stunning display of incopetency. I was pissed as fuck. 2 weeks to waste. But the story didn't end there... so... here I am re-starting the DB... -_____-'
<Regenaxer> for Portable Standard Lisp
<Regenaxer> I found it not usable
<beneroth> grp, some more context for your story?
<Regenaxer> One thing I forgot to mention: What I find most tedious and the only drawback, is not to forget local symbols into the (local) statements
<Regenaxer> This is important
<Regenaxer> I got the habit to maintain (local) stuff while I write the lib
<Regenaxer> Currently these are: lib/gis.l, lib/android.l and lib/vip.l
<grp> the guy in charge of TV signals reception was bitching since december about trees and stuff obstructing the signal reception, so he wanted the antennas to be placed 3m above ground. The architect in charge of building them didn't do shit till 1 month ago. He made a stupid design that had no geometric stability, so I argued it would fail by fatigue and offered to prove it with calcs. He reacted like "I know
<grp> what I'm doing, I've been an architect for 20 years" and what not... So I talked to my boss about the issue and proposed an alternative where I could guarantee 4mm deflection in the highest point with 140km/h wind, hence, still operative. After making most preparatives to build them, I find out they weren't really necessary. I got so pissed at the TV guy... what a moron
<Regenaxer> oh
<grp> (the architect didn't present any calc whatsoever to back his design up)
<grp> (he actually knows shit about structures to be honest)
<Regenaxer> Can you already observe the fail by fatigue?
<grp> mind rephrasing that?
<Regenaxer> You predicted it will fail
<Regenaxer> Can you see signs for that?
<Regenaxer> just calc?
<grp> yes, it would definitely fail. When a structure has no geometric stability, it all deppends on the stiffness of the nodes, because they have a lot of flex effort instead of mostly just axial efforts. So, unless they are rigid enough (which they obviously weren't in this case), it will fail by fatigue sooner or later
<grp> this can be explained by the "fibers" of the material being flexed
<Regenaxer> ok, understand
<beneroth> you should find a better work environment. or find someone to get 'them' out of yours.
<grp> for simplicity's sake, flex sections are simplified putting the forces composing the flex moment in the geometrical centers of the distributed charge's distribution
<grp> but the outher fibers make a lot more force
<grp> you deal with that with security coefficients, but when you are close to break stress, it does matter, specially when fatigue is possible (like in steel)
<beneroth> sounds logical to me
<Regenaxer> Must go again, bbl
<Regenaxer> afp
<grp> beneroth: yeah, I've been doing other's work for about 1 month now. Now I'm back to deal with the DB I was trying to make last time I spoke here
<beneroth> cu Regenaxer! thank you for your time and explaining!
<Regenaxer> :)
<beneroth> grp, ok, I missed it or I forgot. I tend to forget much.
<grp> haha, no worries, it's not like I was talking a lot about it anyways
<beneroth> I would advise you to not mix namespacing into your DB until you really need it :)
<beneroth> I think I need it, but I must find out what the best ways are for my use cases first
<grp> s/'s distribution$//
<grp> well, I never really used the db-pilog stick for anything non-trivial, so this time's a first for me. Still figuring a lot of basic stuff...
<beneroth> pilog is a bit hard to get into, but once you grokked the essentials it is extremely handy
<beneroth> formulating big queries with just statements how the results should look like is simple and so useful
<grp> looks like it
<grp> I'm switching my brain back to programming. Munching the DB examples...
<beneroth> have fun :) and feel free to ask anything
<grp> well, I'm reeeeally short of time so I could use some assistance from time to time ;¬)
<beneroth> I like to help whenever I can :)
<grp> will take your word :¬D
orivej has joined #picolisp
<Regenaxer> ret
<Regenaxer> So (local) requires some discipline. Also because of its unusual semantics
<Regenaxer> BTW, a new quite useful function is 'nsp', to find the namespace of a symbol
<Regenaxer> Useful during debugging
<beneroth> oh nice
orivej has quit [Ping timeout: 240 seconds]
alexshendi has quit [Read error: Connection reset by peer]
grp has quit [Quit: box shutting down...]
freeemint_ has joined #picolisp
alexshendi has joined #picolisp
freeemint_ has quit [Ping timeout: 260 seconds]
orivej has joined #picolisp
alexshendi has quit [Ping timeout: 256 seconds]