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
andyjpb has quit [Ping timeout: 264 seconds]
andyjpb has joined #picolisp
andyjpb has quit [Ping timeout: 268 seconds]
pierpal has joined #picolisp
pierpal has quit [Ping timeout: 240 seconds]
pierpal has joined #picolisp
pierpa has quit [Quit: Page closed]
aw- has joined #picolisp
pierpal has quit [Quit: Poof]
pierpal has joined #picolisp
pierpal has quit [Ping timeout: 240 seconds]
orivej has quit [Ping timeout: 240 seconds]
<yunfan> just finish reading the official tutorial.html, but still not familliar with the syntax, any recommendation?
<Regenaxer> Hi yunfan, PicoLisp syntax in general?
<yunfan> i think i need some document describing contorl flow variable creation, such things
<yunfan> just like any other normal language book does
<yunfan> Regenaxer: yes, as i had saw many variation of set, i need a overview
<Regenaxer> Like 'let' or 'use' or 'for'?
<yunfan> yes, that's it
<Regenaxer> There is nothing special about them, just functions
<Regenaxer> I would study simply examples
<yunfan> of course, but if i dont know they were there, how can i use them :D
<Regenaxer> eg. in rosettacode
<Regenaxer> yeah, a chicken-egg problem :)
<yunfan> maybe i should re-read the little schemer?
<Regenaxer> No, Scheme is far too different
<Regenaxer> Forth is closer in my opinion
<Regenaxer> Rosettacode, and things on picolisp.com
<yunfan> then you need to tell me which could be use when i need, many language's tutorial will give you a overview info like chapter 1 veriable chapter 2 control flow chapter 3 module system, etc
<yunfan> i think picolisp need some information like that too
<Regenaxer> anddam, found it. The figure was in the original paper, but never in the Wiki article. I removed that line.
<aw-> yunfan: it might help to read actual code instead of tutorial
<Regenaxer> Hi aw-!
<Regenaxer> Yeah, I think there is nothing so very special about these functions
<aw-> yunfan: or maybe you can read one of my EXPLAIN.md documents: https://github.com/aw/picolisp-nanomsg/blob/master/EXPLAIN.md
<aw-> Regenaxer: hi
<aw-> yunfan: i've written a few of those actually, if you want they're all posted here: https://picolisp.a1w.ca/
<Regenaxer> A general overview about the "modules" is doc/ref.html
<yunfan> i prefer to got the overview first ,then read the actual code. :D
<yunfan> anyway, found a book about picolisp by tj64
<Regenaxer> I would simply start with e.g. (doc 'let) and then follow the "See also" links
<Regenaxer> The book by tj64 is also just a collection of the docs existing at that time
<Regenaxer> docs and examples from picolisp.com and rosettacode
<yunfan> then if i may ask, why you guys dont gave a document like what i said? i saw many language has that in their official site
<Regenaxer> What would you expect? It would be a list of links to let, use, bind etc
<Regenaxer> Exactly what you see in the "See also" links
<Regenaxer> the section doc/ref.html#fun groups functions to some of your criteria
<Regenaxer> Remember: Lisp has almost no "syntax"
<Regenaxer> Everything is in individual functions
<Regenaxer> "semantics" is in doc/ref.html#ev and "syntax" is what the reader expects in doc/ref.html#io
<yunfan> i know that just like forth
<Regenaxer> "syntax" is "open paren, function with args, close paren" :)
<Regenaxer> yes, Forth is just reversed
<Regenaxer> and even less syntax (or none?)
<yunfan> but you should at least intro some basic functions or `words` for reader to practise
<yunfan> in forth, at least every tutorial will tell you cell,allot,begin, next,etc
<yunfan> and you could make you own after practising them for a while
<Regenaxer> Again, I think these basics are in doc/ref.html
<Regenaxer> it is the ultimative core reference
<yunfan> ok , i'll ask one by one
<yunfan> what's the differences between set and setq? also are there any other set* ?
<Regenaxer> yes, that's easier :)
<Regenaxer> The difference is only evaluation
<Regenaxer> (set 'A 1) is the same as (setq A 1)
<Regenaxer> the first arg is not evaluated in setq
<yunfan> ok, any other set* varous? like seta setb or setblah
<Regenaxer> 'def' is also similar to 'set'
<yunfan> yes, i saw de and def
<Regenaxer> it does the same but returns the 'var' instead of the value
<Regenaxer> *and* does a check for "redefining", ie a non-NIL value was changed
<Regenaxer> 'de' is the non-evaluating version of 'def'
<yunfan> got it
<Regenaxer> So I think we have only these 4
<Regenaxer> Similar are the propery functions
<Regenaxer> put, get, :, =: et
<Regenaxer> c
<Regenaxer> They do not operate on the value but on properties
<yunfan> ok then what about flow control? are there any defferences on flow mode?
<yunfan> as i know almost every languages has if/else/elseif do/while/begin/loop
<Regenaxer> I think they are quite "normal", like in other langs
<Regenaxer> yes
<Regenaxer> if, when, unless, while, until, for
<Regenaxer> do, loop
<yunfan> ok, that i had practised with clojure
<Regenaxer> And since ancient Lisp, 'cond'
<Regenaxer> 'cond' plus recursion was all Lisp had originally
<yunfan> and then what about list manipulation?
<yunfan> like clojure's update-in
<Regenaxer> List manipulations are probably the greatest number of functions
<yunfan> yes, any documents about the differences?
<Regenaxer> yes, (doc 'cons) etc :)
<Regenaxer> 'cons' is the core of all
<Regenaxer> like 'allot' in Forth perhaps
<yunfan> that's two low level
<Regenaxer> Then there is the group of mapping funs
<Regenaxer> map, mapc, mapcar, filter etc
<yunfan> ok i use them everyday in my python jobs
<Regenaxer> You should understand the differences of destructive and non-destructive operations
<yunfan> we could skip that, but i am interesting if there're funcs for complex manipulation
<Regenaxer> What is complex?
<yunfan> like i said, like clojure's `update-in`
<Regenaxer> No idea what that is
<yunfan> which could update a small piece of data deep in a complex list
<yunfan> hold on, will find that
<Regenaxer> This is a destructive operation
<Regenaxer> (set (caddr (cddar L)) 123)
groovy2shoes has quit [Ping timeout: 260 seconds]
<Regenaxer> Clojure needs such fiddling as it tries to make *everything* non-destructive
<yunfan> by destructive, do you mean that it will consumming some lazy list?
<Regenaxer> In pil you just 'set'
<Regenaxer> no
<Regenaxer> Clojure is all "non-mutable"
<Regenaxer> Pil is not, *you* decide
<Regenaxer> Some functions are, some not
<Regenaxer> eg 'append' is non-destructive while 'conc' is the same destructively
<yunfan> ok, thought its concept is based on non-mutable, but those functions really convenients
<Regenaxer> Again: Compare the code in rosetta between Clojure and PicoLisp
<yunfan> its just like the difference of using do/loop to update every member of a list than using map to do that
<Regenaxer> You will see it is a lot simpler in pil
<yunfan> i will check
<Regenaxer> yes, loop vs. map is a good example
<Regenaxer> you can do both usually
<Regenaxer> so it depends what is better on the situation
<yunfan> its just that in my daily job using python, i found same problem exists too, which in python, we dont have update-in, made the code very ugly
<Regenaxer> OK, I see
<Regenaxer> Python has its own strengths
<Regenaxer> I don't know Python well though
<yunfan> my python code just like lisp, there're many ( and )
<Regenaxer> :)
<yunfan> that's why i decide to learn picolisp
<yunfan> why not use a real lisp instead of blame by the python community
<Regenaxer> True
<yunfan> btw, in the rosetta code of associative array. i saw picolip's code is to use put to build the array, so we dont have any literal building solution?
<Regenaxer> Which task is that?
<Regenaxer> Associative arrays/Creation
<Regenaxer> yes
<Regenaxer> Well, just (de A (foo . 5) (bar . 10) ... )
<yunfan> also , what's the implementation details of symbol propertise? i am worried about if its O(N)
<Regenaxer> or (setq A '((foo . 5) (bar . 10) ... ))
<Regenaxer> Implementation is shown in doc64/structures
<Regenaxer> also in doc/ref.html
<Regenaxer> They are a "property list"
<yunfan> sorted ?
<yunfan> ordered?
<Regenaxer> No, but re-organizing
<Regenaxer> Recently-used scheme
<yunfan> then its o(n)
<Regenaxer> yes
<Regenaxer> or less, if accessing repeatedly
<yunfan> do we have any vector like struct ?
<Regenaxer> No, only individual cells
<yunfan> Regenaxer: well, that article just like our goverment, solving problems by deniel problems.
<yunfan> i think arrays were useful cause its the base of many o(logN) struct
<yunfan> but since i knew picolisp could easilly interactive with .so
<yunfan> i could accept the current situation
<Regenaxer> No, the article explain why arrays make absolutely *no* sense in PicoLisp
<Regenaxer> yes, with native it makes sense, but not in the language
<yunfan> but i dont agree with his choice from chapter 3
<Regenaxer> What does it say?
<yunfan> he said list has lots of advantages which i agree , so we could ignore the time efficenty in O(N/2) which i disagree
<Regenaxer> There is no gain
<Regenaxer> Thats what the article tries to explain
<Regenaxer> It makes sense only for very long vectors, and then something else is wrong in the design
<yunfan> in most place he might be right, but i am doing backend developing, O(N) is not acceptable
<Regenaxer> Lisp does not access lists by numeric index
<Regenaxer> Wrong thinking
<Regenaxer> No sense to use numbers
<yunfan> especially in today's clouding era, O(N) , no matter in time or storage, means much more money i need to pay
<Regenaxer> No for (i = 0; ...; ++i) loops
<Regenaxer> No, nonsense
<Regenaxer> You have big databases, not dump lists of thousands of elements
mtsd has joined #picolisp
<Regenaxer> dumb I mean
<mtsd> Good morning!
<Regenaxer> And for short lists O(N) does not matter
<yunfan> actually i do have some server side apps need to manipulate thousands of datas
<Regenaxer> the interpreter is the bottleneck
<Regenaxer> Good morning mtsd!
<yunfan> its like facebook's information flow
<Regenaxer> yunfan, yes, millions of data!
<Regenaxer> but not in dumb arrays!!!
<Regenaxer> Something is wrong then
<Regenaxer> Anyway, stop this issue. Makes me tired
<yunfan> Regenaxer: you could imaging what will you do if you developing a facebook like site with large scale users
<yunfan> i had once met that problem
<Regenaxer> I tried to explain in the article, if it does not help I vive up
<Regenaxer> bye
<yunfan> ok
<mtsd> Hello Regenaxer!
<mtsd> A friend of mine has started learning Penti :)
<Regenaxer> Wise decision :)
<mtsd> I showed him the article in the wiki and he got very enthusiastic :)
<yunfan> also i should say, what you prove in the bench indicate that there's only 0.1 second between the two solution
<mtsd> Practising in meetings at work
<yunfan> actually in backend developing, we measure it in ms
<yunfan> so 0.1s is really huge
<Regenaxer> I spent the last 30 years with backend development
<yunfan> but like i said, i could accept this, since i could use native implementation if i really care about the performance
<Regenaxer> You don't *ever* need a vector here
<yunfan> i dont think we care about 1000 qps a decade ago
<yunfan> this is the today's problem
<Regenaxer> sigh
<Regenaxer> You don't understand at all
<yunfan> well maybe i should find a better job in european countries :D , we chinese were too focus on such things
<Regenaxer> I focus a lot on efficiency
<Regenaxer> If you put a million database objects in an *array*, you are a very bad designer
<Regenaxer> Very bad performance
<Regenaxer> You need high-level structures, searchable for multiple criteria
<Regenaxer> *Never* with a numeric index into a huge array
<yunfan> not millions but thousands
<Regenaxer> even hundreds
<yunfan> 1k-10k such scale
<Regenaxer> *never*
<Regenaxer> bye
Regenaxer has left #picolisp [#picolisp]
<yunfan> ok, seems i really made him bored, sorry about that
<aw-> yunfan: i don't know why you come here to argue the design concepts of PicoLisp
<aw-> if you're not satisfied with it, just choose a different language
<aw-> the reason people are here now is because we appreciate the way it's designed
<aw-> it's fine to want to understand _why_ certain things work the way they do, but to tell the original designer that his ideas are bad and not suitable for YOU.. well of course you will be dismissed
<yunfan> aw-: i am sorry for that, i might talked too much, but i am not intense to argue
groovy2shoes has joined #picolisp
<aw-> there's no need to argue, if you don't agree, just go somewhere else
<aw-> nobody is forcing you to use a language that's not suited to YOUR problem
<aw-> there's plenty of choice out there
<yunfan> ok i will watch my talking, wont argue again, but i am really dont want to argue in my heart
<yunfan> please forgive my fault
<aw-> i don't care
<aw-> it doesn't concern me
<aw-> i just think you misunderstood some aspect of the discussion
<yunfan> i talk because i really want to use it. so i was worried about those hosting bills
<yunfan> but like you said, i have my choice, ok, i will follow the rules
<aw-> i wouldn't say these are rules, but rather common sense. If you question the author's intelligence then you are choosing to fight... at your risk
<aw-> if you want to deal with 10k size datasets, you have to understand maybe PicoLisp isn't suited for that.. and that's fine.. there's lots of languages for that specific type problem.
<aw-> anyways, i also have work to do, no time to discuss such topics. bbl
aw- has quit [Read error: Connection reset by peer]
aw- has joined #picolisp
orivej has joined #picolisp
alexshendi has joined #picolisp
orivej has quit [Ping timeout: 260 seconds]
aw- has quit [Quit: Leaving.]
<anddam> yunfan: from what I read it's not much what you said, but that you refused to understand what Regenaxes was saying
<anddam> even the mention of blaming from the "python community" seemed argumentative, Python is highly opinionated on code, and that's clearly stated
<anddam> can you make an example of the kind of code that is made ugly by the lack of update-in in python?
<yunfan> anddam: my english is not that good, maybe i misunderstand regenaxes, and i appologize, also i promise dont argue now, so i wont continue to talking about this,
<yunfan> right now i just want to learn picolisp as much as possible and use it for developing my website
andyjpb has joined #picolisp
<xificurC> yunfan: I don't think he's especially hurt, no need to apologize that much :) Just point at a sample of code in language XYZ that you think would pose a problem in picolisp and see what the author has to say. Maybe what you consider a problem to do in picolisp is actually an antipattern here and he will show you a different solution that is even m
<xificurC> ore performant.
<xificurC> yunfan: generally when changing paradigms it's not good to ask "how can I do X here". It's like asking "how can I open this door with a key" when the new door is electric. The right question is "how does one open this door?".
<xificurC> yunfan: if you know forth you should already be accustomed to this :)
styx has joined #picolisp
andyjpb has quit [Ping timeout: 256 seconds]
pierpal has joined #picolisp
styx has quit [Quit: styx]
<beneroth> yunfan, also, this community is not missionary. we don't care so much (as other communities) about actively getting new people into using picolisp. all public resources about picolisp is freely donated work (mostly MIT-licensed), made by very few community members in their free personal time. we're happy to help when someone shows true interest and also tries to read up and learn themselves. but we are tired of people who try to argue about things which be
<beneroth> long to the core picolisp concepts, which were carefully made the way they are and based of multiple decades of experience and usage in practical, real-world settings. often these concepts were a lot more thoughtfully constructed and much longer tested in the real-world than the time some other fashionable languages even exist. it's correct that many things in picolisp are very radical, but questioning them quickly turns into questioning the personal abili
<beneroth> ty and experience of it's designer.
<mtsd> Well said, beneroth
<xificurC> I'm looking at the database "API", can someone clear some thoughts up for me? Given an external object X and 2 processes editing it in parallel, if p1 changes A to 10 and calls (commit 'upd) and afterwards p2 changes B to 20 and calls (commit 'upd) then the DB will correctly contain A:10 and B:20? That is commit will tell p2 about the change and p2
<xificurC> 's commit will include that change?
<beneroth> and this happens from time to time, that someone shows up, not understanding why in picolisp some things are done in what seems to be against common knowledge, and then wanting to debate about it. but Regenaxers opinions are clear and available in his essays. we have no interested in discussing this things, especially if the asking person behaves demanding and like we would owe them anything. quite the opposite.
<beneroth> xificurC, yes. (commit 'upd) tells all other processes ("database sessions") to call (upd) on all external symbols which they hold in memory
<xificurC> beneroth: ok, building on that question, does that mean both p1 and p2 send the whole object to the database? Was this ever a bottleneck?
<xificurC> like cases where objects would be MBs huge
<beneroth> it's very unlikely to be a bottleneck. the object should not be too big
<xificurC> holding blobs and such
<beneroth> blobs are handeld differently
<mtsd> Objects holding blobs only hold a stub, the path to the file
<mtsd> Not the file itself
<beneroth> blobs are not stored in the database files, but as real files in a folder structure within the *Blob directory (which you set with the argument to (pool))
<beneroth> they don't even store the path, just a boolean (symbol) if the blob/file is present or not. the path is constructed from the name of the external symbol and the name of the property, see (blob) function.
<xificurC> I see. And change propagation via daemons? If I change an object's field that is jointly connected to another, how does the update take place? Is the object read into memory and written back too?
<xificurC> I could imagine changing 1 object that is heavily linked to other objects to grow in size exponentially
<beneroth> all affected objects (external symbols) are loaded into memory when accessing, and written back to the physical file upon (commit)
<beneroth> this can happen, but then you probably should not design your database schema in that way :) no technology helps against bad design.
<xificurC> ah, so if I request an object, all objects that relate to it are also loaded, right from the start
<beneroth> no, only when you access it
<beneroth> if you don't access it, then there are also no changes to write
<xificurC> beneroth: of course. These are theoretical questions. But understanding what happens in the background is crucial to good design
<beneroth> true!
<xificurC> but this is indirect access, no? Like the family DB example in the tutorial. If I change someone's mate I haven't touched the other object directly but the relation does affect it
<xificurC> or by access you meant this too?
<beneroth> in the beginning of the transaction you should call (dbSync), this checks for incomming (upd) messages from other processes/db sessions. (upd) comes with a list of changed objects, and the other process basically calls (wipe) on them, meaning it clears them from memory, so when they get accessed again then they get loaded freshly from the database file -> now you have the changes from the other session
<beneroth> (dbSync) .... (commit 'upd)
<beneroth> that is a transaction
<beneroth> blocks other transactions at the same time (pessimistic locking). therefore transactions should be short and quick. usually that is not a problem in real-world applications.
<xificurC> beneroth: thanks. Final question (for now :) - taking my first example, what happens when 2 processes are changing common attributes of the object? p1 changes A to 10 and calls (commit 'upd) while p2 also changed A to 20 and now an update flows in
<beneroth> p2 removes the A object from its memory within the (dbSync), and loads it freshly from the file upon accessing A. so A is 10 now. p2 can check about this (if it likes), or just change it to 20 and save this.
<xificurC> what if p2 called (dbSync) before p1 called (commit 'upd)?
<beneroth> important to understand is, that unlike with other DBMS, in pilDB there is no additional layer doing any analysis or optimizations in the background. so your query or changes are as bad or as good as you do them. but all in all this makes the architecture simpler and more easy to understand, and holds less surprises.
<beneroth> then p2 is stuck in (dbSync) until p1 called (commit), or process p1 got killed/quitted
<beneroth> or p2 called (rollback)
<beneroth> (dbSync) is asking for a read-lock on the (whole) database, and ensures that your process has the current real view of the database.
<beneroth> wrong
<beneroth> I meant (dbSync) is asking for a WRITE-LOCK
<xificurC> I see, that makes sense. dbSync doc also says it can request a write-lock on any object, not the whole database
<beneroth> T
<xificurC> it also says it calls sync which "Waits for pending data from all family processes". I don't understand what that means
<beneroth> for the beginning I would use the simpler version of (dbSync), which locks the *DB symbol ({1}), which locks everything. once you can see that this really becomes a bottleneck, you can try more advanced schemes.
<xificurC> I understand what family processes are
<beneroth> that means commits from other processes
<xificurC> but what pending data can there be?
<beneroth> changes made by another process
<xificurC> so dbSync blocks until others commit?
<beneroth> yes
<beneroth> or other processes call (rollback) or the other process which holds the lock gets killed
<xificurC> how can there be others making modifications if everyone was to call dbSync?
<xificurC> wouldn't that mean only 1 process can commit?
<xificurC> or better said that there's always only 1 process that can be making modifications
<beneroth> T. but that goes very fast, so the multiple "concurrent" changes just get serialized one after another.
<beneroth> yes
<beneroth> I recommend you to start this way, and look into optimizing it not before you actually measure problems with this
<beneroth> it works surprisingly better and more efficiently than one would expect
<xificurC> I'm just trying to wrap my head around data consistency. Efficiency is important, but consistency even more :)
<xificurC> The place I work has several projects running on mongodb and I don't see any consistency guarantees in the applications using it (because there aren't any)
<beneroth> yes, consistency is fully guaranteed
<beneroth> haha
<beneroth> yeah mongoDB is famous for losing data
<xificurC> e.g. 2 processes making modifications, first one writes, second one writes, ta-daa, changes from the first were just overwritten by the historical data
<beneroth> some companies (e.g. bitcoin trading hubs) got killed because of it
<beneroth> in pilDB is guaranteed that your process has the most recent state of the data before applying its changes.
<beneroth> (well, when you properly use transactions)
<xificurC> so what I'm taking away is that there is an exclusive write lock and when another process calls dbSync it is guaranteed to have the modifications and that noone else will be making more in the meantime it is doing them
<beneroth> yes
<xificurC> but many processes can read data without asking for a write lock with dbSync
<beneroth> yes, it then just gets the current state of the object as it was in the database file when it first accessed it
<beneroth> (it = the object)
<xificurC> if a long running process has an external object read in will it get the updates from (commit 'upd)?
<xificurC> I guess that's the whole point of the 'upd argument, right?
<beneroth> only if this long running process calls (dbSync) or (wait) or (wipe 'object) from time to time
<beneroth> yes.
<beneroth> you have a parent picolisp process, which shouldn't do much work (maybe listening for sockets or such, but not much more)
<beneroth> every child picolisp process, created with (fork), is connected to the parent process by 2 pipes (one for reading, one for writing)
mtsd has quit [Quit: Leaving]
<beneroth> when the process calls (commit 'upd), it sends (upd) with a list of changed objects to the parent process, which fowards it to every child process
<beneroth> when a child process calls (wait) (which is called within dbSync), then the child process checks the incoming pipe and receives these (upd) calls
<beneroth> the parent process is kind of a message broker
<beneroth> therefore it should spend most time within (wait) to handle this
<xificurC> thank you beneroth, I have a better understanding of the picolisp machinery :)
<beneroth> the 2 pipes per child process also brings in a limit of about 500 child processes, because each pipes requires a file descriptor, which are in linux usually limited to 1024 per process (so the parent may run into that limit)
<beneroth> this can be mitigated by setting a higher limit on the linux server
<xificurC> that will take some time to hit :)
<beneroth> if this is not enough then you probably have to find a way how you can work with less "worker processes" instead of the simple "one process per connection" architecture
<beneroth> yeah
<beneroth> happy to help :)
<beneroth> have a look into the optional arguments of (pool)
<beneroth> if you works with +Blob, you have to set a directory there where the blobs should be stored
<beneroth> also you can set there an additional journal log (to mirror db changes to another server/database, as live-backup) and you can also add an file to be used as "transaction log" which ensures database consistency even in case of sudden power failures or such (which otherwise can corrupt the database file if the power outage is unlucky enough to hit the small timeframe when a write happens)
orivej has joined #picolisp
<beneroth> work at first with a single DB file, and when you have some data and finished your DB schema you can check out the average sizes of your objects, and then spread them over multiple database files, where each database file can have another block size
<xificurC> yeah I forgot about that question, about a power outage and db consistency
<beneroth> not guaranteed unless you give the transaction file in (pool)
<beneroth> then all changes get first written into that file, and then copied from there into the real file within an atomic write
<beneroth> so this file should always be empty (or only extremely shortly have something in it)
<xificurC> so typically you do use a transaction file. Or are you making cron backups or something
<beneroth> yes, or both
<xificurC> thanks
<beneroth> there is also a very useful scripts called "snapshot" with which you can make iterative backups of a folder (or multiple ones)
<beneroth> best practice is to have a cronjob which locks the DB, runs snapshot, and then unlocks the DB again. this way you can have diff backups of your DB (especially the blobs) or other files.
<beneroth> snapshot creates versioned backups, but uses hardlinks to save storage space when a file hasn't changed
<beneroth> the other good practice is to have a journal file (also one of the arguments to pool), and then send the content of this file immediately to another server (replicate mechanism)
<beneroth> than you have 1) versioned backups on the same machine 2) live backup on another machine
<xificurC> no toy this language is
<beneroth> the script @lib/too.l has useful database tools, e.g. checking the database for consitency etc. unfortunately, its not yet publicly documented
<beneroth> no. its grown up. Regenaxers whole working career of the last 30+ years is based on this. so battletested :)
<xificurC> ah, that reminds of another question, if you're not tired yet :)
<beneroth> I'm tired because I'm ill right now, but I'm happy to answer more questions. I enjoy this now :)
<xificurC> beneroth: yeah I know that, I'm just joking because the public view might be different
<xificurC> hope you get better soon
<xificurC> consistency is what triggered the question
<xificurC> the next question*
<xificurC> the relation daemons take care about consistency and propagation (what are these daemons by the way?)
<beneroth> well we're happy to help whenever we have time. especially Regenaxer, he is like 12 hours a day here and happy to help. unless one does in fact question his ability and experience, that pisses him off, understandably
<beneroth> ah, ok. this doesn't mean a background process (like linux daemon)), but basically the mechanism with the (rel) relationship logic
<xificurC> in real life surely there will be cases where the consistency gets damaged, often by human mistakes
<xificurC> what happens then?
<beneroth> which is kinda a structure of mixins which control the behaviour, and automatically update related structures, e.g changing an entry in the index when you edit a +Key or +Ref property, etc
<xificurC> yeah but who runs these automatic updates and via what mechanism
<beneroth> the only likely source of consistency damage comes from changes in the database schema without correctly adapting the existing data to it
<beneroth> you use (put> 'Obj 'prop) to change a rel property, right?
<beneroth> when you do that, the (put>) implementation of 'Obj gets called, which then calls another put> method depending on the type of the property (which you defined in the DB schema, and which lives in memory when you loaded the db schema)
<beneroth> and this property/relationship-specific (put>) might do additional work, like updating an index (or multiple) etc
<beneroth> "relation daemon" is the name of the structure which holds the logic for this things
<beneroth> it lives in memory when you loaded the schema
<beneroth> the schema is not stored in the database itself
<xificurC> so when you define an e.g. joint relationship the methods will somehow through the object hierarchy know where to go to make the modifications
<beneroth> yes!
<beneroth> here is a good description of the mechanism, and further information about the pilDB : https://software-lab.de/dbui.html
<beneroth> see the part about Relation Daemons theree
<beneroth> the code for all this is in @lib/db.l
<xificurC> I read that once a few years ago. Long enough to make me shut up for a while :)
<beneroth> hehe
<beneroth> the index and query stuff is in @lib/btree.l
<xificurC> I'm slowly infecting this company with lisp. So far I managed to get common lisp in. My manager is thinking about using clojure because most of the projects here run on the JVM. Getting picolisp into the repertoire would be a great win :)
<beneroth> its a good (but time-intense) training to e.g. go through the implementation of (db) (in @lib/db.l)
<beneroth> nice :)
<beneroth> the beautiful thing about picolisp is, that its all made from the same basic principles, and you can read all the implementation code and understand it
<beneroth> most stuff is implemented in picolisp.
<beneroth> some stuff is implemented within the picolisp VM, so in pilASM (or C, for the older picolisp variant)
<beneroth> but the pilASM has like comments on every line of code. understandable, even without much experience with asm
<beneroth> and its MIT license, so no dependency on any third party company or such
<beneroth> just a strong dependency on having good programmers. but every company likes to believe they have good ones anyway, eh? :)
<beneroth> if a company cannot attract good programmers, and/or likes to work with many programmers on single projects, then picolisp is not good for them. then they should go with C#, Java and thelike, where some minimum productivity and some minimum of fail-safety is guaranteed by the technology (but well, also settles a top limit on how well and quick a good programmer can work)
<xificurC> I'm slowly getting a feeling there's huge redundancy in these workshops
<beneroth> my background is originally C/C++, I wanted to get into Lisp for the reputation of productivity gains, I didn't want to get into Common Lisp as it seems to have similar platform and library problems as C/C++, so I got into picolisp :)
<beneroth> yes there absolutely is
<beneroth> which results in more "stability"
<xificurC> e.g. 12-15 people working on a project in Java that 1-2 competent could do in something smarter
<beneroth> exactly
<beneroth> all good systems in the history of IT were designed (maybe not implemented, but designed) by like 1-2 persons.
<beneroth> design by committee doesn't work in the long-run, eventually personal politics and other non-technical reasons influence the design and result in a mess
<xificurC> the arguments often go like "this is huge, we need 10-15 people!" "no, 1-2 can do it in X" "... yeah, right"
<beneroth> only thing where it works surprisingly well is maybe C++, but this is debatable :)
<beneroth> often managers don't understand that software programming is completely unlike factory work.
<xificurC> well if you look at programming languages you can see that many languages evolve under the hands of *one* person
<beneroth> its like 9 woman cannot produce a baby in 3 months
<beneroth> yeah
<xificurC> picolisp isn't special in this case :)
<beneroth> no
<xificurC> even clojure was done mostly by Rich. C++ by Bjarne I guess, at least in the beginnings :)
<xificurC> C by what, 2?
<xificurC> Forth by Chuck
<beneroth> all there is to know about software project management was written down by Fred Brooks decades ago
<beneroth> C# is also mostly one guy, even now
<beneroth> (C# is a mess)
<xificurC> almost everything that isn't a lisp or forth is a mess :)
<xificurC> because the language doesn't bend
<beneroth> also I believe in the 10X (or 100X) programmer.. you know that different programmers can be much more different in productivity than what you can have in other professions between two people
<beneroth> I don't think this is biological or anything thelike, but mostly good principles and A LOT self-discipline
<beneroth> but for most people this is both too simple and too much work :)
<beneroth> well C++ is a mess because it became so broad
<beneroth> C is a nice language. much more easy to audit. but well, not much more powerful than asm :)
<xificurC> the 10x and more programmer I really got to feel from reading about forth and Chuck
<xificurC> programming is creating. Creation is hard
<beneroth> this claims that all this studies about "productivity gain my methodology X" (insert Extreme programming, or Agile, or whatnot) is all bonkers because it turns out all the successful projects just had pretty good people and the failed ones less so
<beneroth> so the difference between programmers is probably much much bigger than any difference in project methodology
<beneroth> fits my experience
<beneroth> now I feel better and managed to eat something. thanks for your company, xificurC :D
<xificurC> beneroth: glad to exchange help :)
andyjpb has joined #picolisp
orivej has quit [Ping timeout: 268 seconds]
<tankf33der> there several demo code for atomic updates
<tankf33der> xificurC: ^^^
<tankf33der> whats to checkout?
<xificurC> tankf33der: hi, sure
<tankf33der> whats -> want
<tankf33der> wait
<tankf33der> last one: 100 courutines inc the same number and check sum result at the end
<xificurC> tankf33der: interestingly the rosetta code example is quite longer than of CL or clojure. While I don't know by heart all the db functions the code is pretty self explanatory by now :)
<xificurC> the coroutine example took a bit longer to grok but I understand it now, except the `(== 64 64) call at the top
<tankf33der> just let run on pil64 version
<tankf33der> if reader reads NIL it stops
<tankf33der> try in repl
<tankf33der> (== 64 64)
<xificurC> I understand it yields T on pil64 and NIL on 32
<tankf33der> yea
<xificurC> I didn't know that the reader stops on NIL
<xificurC> so one can write NIL at the end of the file and include freestyle comments?
<tankf33der> like
<xificurC> off, back tomorrow, thanks for the help
alexshendi has quit [Ping timeout: 240 seconds]
sriram has joined #picolisp
<sriram> Hi Regenaxer...I was trying to use the right-align feature in svg (with ps T "text")
<sriram> but it was too close to the right window...so I thought I could add a space as follows "A\u0020", but that does not work..
<tankf33der> regenaxer is out
<sriram> hi..yes (i saw...but just left it in case he is back later...) thanks...
<sriram> addressed the question specifically to him, as i thought it was referring specifically to ps function..but perhaps it is more general
orivej has joined #picolisp
Regenaxer has joined #picolisp
arievw has joined #picolisp
<arievw> Hi!
<Regenaxer> Hi arievw!
<arievw> Just posted a link to a survey on Wiki stuff in the ml. To take the survey please go here: https://eSurv.org?s=MOIEMH_753ad7ff
<arievw> bbl
arievw has quit [Quit: Leaving]
<Regenaxer> Sorry yunfan, I had a lot to do today an was tired and fed up with the old array discussion. Not your fault!
pierpal has quit [Quit: Poof]
pierpal has joined #picolisp
<sriram> hi Regenaxer...I was experimenting with the ps functionality in svg..and noted a couple of things...
<Regenaxer> Hi sriram!
<sriram> a. the superscript facility is there, but not subscript
<sriram> I added it at my end and tested
<sriram> it
<sriram> (s # Subscript (prin (when X (pack "<tspan baseline-shift=\"sub\">" X "</tspan>"))) )
<sriram> and it seems to work
<Regenaxer> cool, I think I omitted it cause TinyMCE does not support it (?)
<sriram> the other thing I noticed that none of the bold/italic etc seem to include X in the <tspan></tspan> like I did above...so maybe I am missing something
<sriram> oh not sure...I included in my version of svg.l and tested with ps as follows: (font ( 30 . "Courier") (ps 0 "A" '(s "1")))
<Regenaxer> The X is the list, should not be includer I think
<sriram> the only thing I was left wanting to do was to have a separate font for the subscript and the superscript
<sriram> but was not sure how that could be specified
<Regenaxer> The whole 'ps' stuff goes in sync with 'htmlText' in @lib/tinyMce.l
<sriram> oh i see.I could not see an example anywhere of ps using superscript or bold/italic...but now that I think about it, it should be in pdfPage
<sriram> since there is a bold button there
<sriram> I think my implementation of subscript is wrong...and also perhaps the way I am calling it ....(ps 0 "A" '(s "1"))
<Regenaxer> iirc these tags are used as starting and closing tags separately
<Regenaxer> That's why the 'if' in (prin (if X "<tspan baseline-shift=\"super\">" "</tspan>"))
<Regenaxer> Perhaps not a very wise design
<Regenaxer> They are *all" "</tspan>" if NIL :)
<Regenaxer> only color with C is different
<Regenaxer> Don't remember why
<Regenaxer> I think I will tackle this whole issue later this year
<Regenaxer> We want to get BlitzMenu going
<Regenaxer> continue with it
andyjpb has quit [Ping timeout: 256 seconds]
<sriram> yes i was wondering why color is different...no problems..just experimenting with my setup here...and making progress :)
<Regenaxer> Great! :)
<sriram> but still did not understand the if ...(prin (if X "<tspan baseline-shift=\"super\">" "</tspan>"))...
<sriram> the above should mean that if X is not nil then "<tspan baseline-shift=\"super\">" will be printed
<sriram> and if X is NIL then "</tspan>" will be printed
<Regenaxer> I think it appears as (B . T) text (B)
<Regenaxer> yes
<sriram> but in the former case, where is the tspan closed i.e </tspan>
<Regenaxer> ((= S '`(chop "strong"))
<Regenaxer> (link '(B . T))
<Regenaxer> (recurse S)
<Regenaxer> (link '(B)) )
<Regenaxer> from @lib/tinymce.l
<Regenaxer> This is where the markup format is generated normally
<sriram> oh i see...so you cant just call directly from repl to test
<Regenaxer> (though I also wrote it by hand iirc)
<sriram> (ps 0 "test message" '(S . "superscript"))
<Regenaxer> Should work from the REPL too I think
<Regenaxer> no
<Regenaxer> it is (S . T) to start superscript
<Regenaxer> and (S) to stop it
<sriram> oh ...i see
<Regenaxer> ((= S '`(chop "sup"))
<Regenaxer> (link '(S . T))
<Regenaxer> (recurse S)
<Regenaxer> (link '(S)) )
<sriram> so maybe (ps 0 "test" (S . T) "superscript" (S))
<Regenaxer> yes, exactly
<sriram> perfect...and if i wanted the text for superscript in another font?
<Regenaxer> The reason is that it may overlap
<Regenaxer> not only nest
<sriram> just wrap it in (font ...)
<Regenaxer> (ps 0 "test" (S . T) (B . T) "super" (B) "script" (S))
<sriram> great..ah nice
<sriram> or also (ps 0 "test" (S . T) (font (30 . "Courier") "superscript") (S) )
<Regenaxer> yeah
<sriram> very nice! thanks.... will continue ..:)
<Regenaxer> OK :)
<Regenaxer> I have a Whisky now :)
<sriram> enjoy :) bye :)
<Regenaxer> :)
sriram has quit [Ping timeout: 260 seconds]
pierpal has quit [Quit: Poof]
pierpal has joined #picolisp
jibanes has quit [Ping timeout: 248 seconds]
jibanes has joined #picolisp
pierpal has quit [Quit: Poof]
pierpal has joined #picolisp
alexshendi has joined #picolisp
alexshendi has quit [Ping timeout: 260 seconds]
pierpa has joined #picolisp
xificurC has quit [Ping timeout: 276 seconds]
andyjpb has joined #picolisp
orivej has quit [Ping timeout: 256 seconds]
alexshendi has joined #picolisp