ChanServ changed the topic of #picolisp to: PicoLisp language | Channel Log: https://irclog.whitequark.org/picolisp/ | Check also http://www.picolisp.com for more information
razzy has quit [Remote host closed the connection]
razzy has joined #picolisp
shpx has joined #picolisp
orivej has joined #picolisp
freemint has quit [Remote host closed the connection]
_whitelogger has joined #picolisp
xkapastel has quit [Quit: Connection closed for inactivity]
orivej has quit [Ping timeout: 268 seconds]
<Regenaxer> Checking (and this is relevant also printing) for circular lists is done only on the top level list, otherwise it would be too expensive
<Regenaxer> All other cases behave as infinite lists
<Regenaxer> "Top level" is the wrong term. It is rather "circular within the same level"
orivej has joined #picolisp
<Regenaxer> (1 2 (3 4 .) 5 6) for example is fine
<tankf33der> 111 lectures of knuth
freemint has joined #picolisp
<freemint> Regenaxer Good Morning
<Regenaxer> Hi tankf33der, freemint
<Regenaxer> tankf33der, thanks for the link
<freemint> i was sad that pilIO did not handle all PicoLisp "lists"
<Regenaxer> It does
<Regenaxer> Did you read my comment this morning in the log?
<Regenaxer> PLIO does not more nor less than the rest of the system
<Regenaxer> read/print
<Regenaxer> length/size/mapping etc
<freemint> It doesn't handle all possible cell constructions. And i see why. Furthermore i expected (from the documentation) of circ? that it would handle my C
<Regenaxer> The ref refers to 'circ'
<Regenaxer> And 'circ' does only such a thing
<Regenaxer> Connecting the CDR of a cell to a cell outside this domain is not checked for
<Regenaxer> (as you saw)
<freemint> Returs the circular list tail if any is a circular list, else
<Regenaxer> yes, what you have is not a circular list lisw
<Regenaxer> list
<Regenaxer> it is a graph
<freemint> where is circular defined then?
<Regenaxer> It says "connecting the CDR of the last cell to the first cell"
<Regenaxer> so this implies also (1 2 . (3 4 5 .))
<Regenaxer> ie to the first cell of a tail of the list
<Regenaxer> but not to a totally unrelated cell
<freemint> But it does not say that circular lists need to look like that.
<Regenaxer> I think it does
<Regenaxer> How else would you say that?
<freemint> maybe add an. a list is circ? if it can be constructed with circ
<freemint> That way you have the reference to circ too and the relationship is clear
<Regenaxer> No, this is more restrictive
<freemint> example?
<Regenaxer> 'read' also constructs circular lists
<Regenaxer> 'circ' cannot do directly (1 2 . (3 4 5 .))
<Regenaxer> it always connects to the first cell
<Regenaxer> here it connects to the third cell
<freemint> Mhh good point
<Regenaxer> Anyway it is not a problem of PLIO
<Regenaxer> It is unfortunate
<Regenaxer> a design decision for practical reasons
<freemint> It destroyed some things i wanted to do. I get that practical decision.
<freemint> how is circ implemented currently?
<Regenaxer> There should be a workaround usually
<Regenaxer> 'circ' is simple, like what you did explicitly
<freemint> circ?
<Regenaxer> Using 'set' or 'con'
<freemint> i was curious about circ?
<Regenaxer> circ? and print and pr mark the structure internally
<Regenaxer> iirc
<freemint> ahh... why would a graph be to expensive then9
<freemint> (to mark)
<Regenaxer> For which use case?
<Regenaxer> It is a bit expensive, traverses the structure multiple times
<Regenaxer> and is not reentrant, so cannot be used in higher level functions
<Regenaxer> because the marks are global
<freemint> graph-y code which was optimized, to detect to compressed trees which share branches.
<freemint> You need to traverse two times right?
<Regenaxer> You can always do it if needed
<Regenaxer> I "mark" usually with 'push'
<Regenaxer> yes, two times
<freemint> so you build a list of all visited stuff?
<Regenaxer> right
<Regenaxer> checking with 'memq'
<freemint> ok then i get why it is expensive
<freemint> it is O(N^2)
<Regenaxer> yes
<Regenaxer> with direct marks it is better
<Regenaxer> no memq search reqpired
<freemint> way better
<freemint> It is O(2N)
<freemint> is there a way to turn of the GC inside a region?
<Regenaxer> I think using circular cell structures is not common
<Regenaxer> Typically you use symbols
<Regenaxer> GC is not the problem
<Regenaxer> it is the reentrancy
<Regenaxer> or list operations in general
shpx has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<Regenaxer> the mark modifies the pointer
<freemint> It is not common, because it is not "possible" in many languages and there is no tooling to use it in picolisp
<Regenaxer> so traversing the list crashes
<freemint> but not marked in the same way as the GC would?
<Regenaxer> No, I mean not common because usually you need more info
<Regenaxer> objects
<Regenaxer> plain cells are not flexible enough
<Regenaxer> An application has graphs of symbols
<Regenaxer> pointing to each other in many ways
<freemint> why are cells not flexible enough? you are speaking in mysteries
<Regenaxer> And then all the I/O and traversal problems disappear
<Regenaxer> A cell has no properties, only CAR and CDR
<freemint> yes
<freemint> how big is the size of a chessboard tile?
<Regenaxer> 'grid' is a good example
<freemint> in grid i mean
<Regenaxer> you can have circularities in all 4 directions
<Regenaxer> to get an infinite world
<freemint> how many cells do you need for a grid entity?
<Regenaxer> Each node is a symbol, and at least 4 properties for the neighbors
<Regenaxer> So 5 cells
<Regenaxer> no
<Regenaxer> 9 cells
<freemint> and one more the piece standing on it?
<Regenaxer> each property takes 2 cells
<freemint> so 11
<Regenaxer> no, the piece exists already
<freemint> the piece is in the value?
<Regenaxer> I don't remember, but could be
<Regenaxer> If the value is not used for a class
<Regenaxer> In chess it is in the value I think
<freemint> ok with graphs you need 4 cells including storage for the piece on it
<Regenaxer> ah, no
<Regenaxer> I tried
<Regenaxer> : (show 'a1)
<Regenaxer> a1 ((NIL . b1) NIL . a2)
<Regenaxer> piece "WhiteRook"
<Regenaxer> whAtt ("WhiteQueen")
<Regenaxer> y 1
<Regenaxer> color
<Regenaxer> x 1
<Regenaxer> grid stores the neighbors in the value
<freemint> (N . (E . (S . (W . P))))
<freemint> what is (size 'a1)
<Regenaxer> It is rather ((W . E) . (S . N))
<Regenaxer> 3 cells
<freemint> you need N-1 cells for N properties with pure lists instead of (2N+1) with objects
razzy has quit [Ping timeout: 250 seconds]
<freemint> is the marking done by circ? done at the same place as a GC would mark?
<Regenaxer> It uses the "other" bit in the cell
<Regenaxer> GC uses bit 0 in the CDR
<Regenaxer> and in other mark cases it is the one in the CAR
<Regenaxer> or (A) 1 # Mark
<freemint> ahh good
<freemint> what would happen if you expose that mark in "user space"
<Regenaxer> It would crash immediately
<Regenaxer> All marked pointers can no longer be used
<Regenaxer> And users cant handle it
orivej has quit [Ping timeout: 250 seconds]
<Regenaxer> They will call high level functions, which may cause reentrance of the mark logic
<freemint> what is reentrance?
<freemint> Vielleicht auf deutsch
<freemint> ahhh i get it
<Regenaxer> ok :)
<Regenaxer> In German also "reentrant"
<freemint> imagine that a timer is called and runs over the modified list. Even if graph? is designed so it does not crash a normal function surely will
<Regenaxer> For example if user codes starts to mark, then calls 'size' or 'circ?'
<freemint> you would need a "disable all interrupts" like function
<Regenaxer> You need to recode the interpreter
<Regenaxer> all pointers must be masked
<freemint> would size crash on my C?
<Regenaxer> no
<freemint> they are not masked right now?
<Regenaxer> 'size' will crash, it recurses infinitely it seems
<freemint> mhh it does
<Regenaxer> I dont remember the details, you could check the source as a good exercise
<Regenaxer> (vi 'size)
<Regenaxer> then ^] on the subroutine
xkapastel has joined #picolisp
<Regenaxer> ie 'sizeCE_C'
<Regenaxer> So it does not fully crash, but overflows the stack
<freemint> because size only marks the top level list?
<Regenaxer> I don't remember
<freemint> pilASM is an untraceable mystery to me too.
<Regenaxer> It marks all cells
<Regenaxer> But recursion happens before the mark of course
<Regenaxer> otherwise the pointer is tagged
<Regenaxer> You can also look in pil32 C source in this case
<freemint> so to fix this we would need an rewrite of the function call convention
<Regenaxer> fix?
<freemint> so that size does not crash
<Regenaxer> Nothing to do with function calls
<Regenaxer> It recurses
<Regenaxer> because you 'set' the CAR of the cell
<Regenaxer> Anyway, what we discuss here is rather useless
<Regenaxer> For practical apps you use graphs of symbols
<freemint> circ? in C is implemented very differently
<freemint> I think
<Regenaxer> I don't remember
<freemint> i am puzzling that out
<freemint> at least picolisp not handling circular structures as i would wish it to shortens my weird idea list
razzy has joined #picolisp
<freemint> circ? works exactly as you told me it would
<Regenaxer> It is not much that does not work
<Regenaxer> Mostly printing such structures
<Regenaxer> Just don't call 'size' and such ;)
<Regenaxer> What practical application do you want to use plain cell structures for?
<Regenaxer> as opposed to objects/symbols?
<Regenaxer> You are doing preliminary optimization
orivej has joined #picolisp
<Regenaxer> Already debugging such an application is a nightmare
<Regenaxer> You cant inspect any data
<Regenaxer> At every breakpoint your screen is spilled with infinite output :)
<freemint> you it is premature optimization but if i have my own lisp on day it will make have use of such arcane features because it can
<freemint> also i was really shocked by how simple you mad pilIO
<freemint> Regenaxer yeah picolisp is really not tooled for cyclic lists
<freemint> *graphs
<freemint> Regenaxer is there a way to have read macros in pilIO?
<Regenaxer> No, it would also be dangerous
<Regenaxer> Use 'read' if you need read macros
<Regenaxer> The point of PLIO is that it is low level
<Regenaxer> So that it can be used to communicate with the GUI
<Regenaxer> Imagine the huge security hole!
* razzy imagined huge hole :)
<Regenaxer> Making a Lisp supporting what you have in mind is not practical
<Regenaxer> Circular structures on that cell level are simply too seldom to introduce such big overhead throughout the whole system
<Regenaxer> An academic exercise, but not practical
<Regenaxer> You are focusing on a single point you think is cool, but you don't consider the overall picture
<freemint> T
<freemint> Regenaxer i was just curious and you got me to get rid of many "projects of mine"
<Regenaxer> Oh, sorry! ;)
<Regenaxer> I don't want to stop you from anything
freemint has quit [Ping timeout: 258 seconds]
freemint has joined #picolisp
shpx has joined #picolisp
orivej has quit [Ping timeout: 245 seconds]
orivej has joined #picolisp
freemint2 has joined #picolisp
freemint3 has joined #picolisp
freemint has quit [Ping timeout: 246 seconds]
freemint2 has quit [Read error: Connection reset by peer]
orivej has quit [Ping timeout: 250 seconds]
freemint has joined #picolisp
freemint2 has joined #picolisp
freemint3 has quit [Ping timeout: 250 seconds]
orivej has joined #picolisp
freemint has quit [Ping timeout: 272 seconds]
razzy has quit [Ping timeout: 244 seconds]
orivej has quit [Ping timeout: 245 seconds]
freemint has joined #picolisp
freemint2 has quit [Ping timeout: 250 seconds]
freemint2 has joined #picolisp
freemint has quit [Read error: Connection reset by peer]
freemint has joined #picolisp
freemint2 has quit [Ping timeout: 246 seconds]
orivej has joined #picolisp
<beneroth> hi all
<freemint> hi beneroth
<freemint> Regenaxer not that is good, my schedule should clear
freemint has quit [Remote host closed the connection]
<Regenaxer> Hi beneroth
freemint has joined #picolisp
<beneroth> well if freemint does something useful instead of going down paths others already walked down and found them leading nowhere...than its good if Regenaxer stopped him. But yeah, there might be a small chance that it stops him from inventing something really useful new thing ^^
<beneroth> hey Regenaxer :)
<beneroth> how much snow shipping today?
<Regenaxer> right
<Regenaxer> Only once :) Now it is melting, 2 C
<freemint> beneroth i got more useful stuff on my pipeline than an arcane lisp dialect
<freemint> Regenaxer here too.
<freemint> I find that sad
<beneroth> Regenaxer, here everything is melting.
<Regenaxer> That's life :)
<freemint> 🙄
<freemint> beneroth what are you up to
<beneroth> fighting some ugly C# and SQL code
<beneroth> how are your studies going, freemint =
<beneroth> ?
<freemint> badly
<Regenaxer> oh, why?
<freemint> i am doing much less for it than i should
<Regenaxer> Not interesting enough?
orivej has quit [Ping timeout: 250 seconds]
<freemint> No just not good at setting priorities
orivej has joined #picolisp
freemint2 has joined #picolisp
freemint has quit [Ping timeout: 272 seconds]
freemint has joined #picolisp
freemint2 has quit [Ping timeout: 250 seconds]
<beneroth> you can train that, freemint
<beneroth> use paper notebook or calendar or such for tasks lists in the meantime
freemint2 has joined #picolisp
freemint has quit [Ping timeout: 246 seconds]
ubLIX has joined #picolisp
freemint has joined #picolisp
freemint2 has quit [Ping timeout: 250 seconds]
freemint2 has joined #picolisp
freemint has quit [Ping timeout: 258 seconds]
freemint has joined #picolisp
freemint3 has joined #picolisp
freemint2 has quit [Ping timeout: 258 seconds]
freemint has quit [Ping timeout: 244 seconds]
freemint has joined #picolisp
freemint3 has quit [Ping timeout: 244 seconds]
freemint2 has joined #picolisp
freemint has quit [Ping timeout: 240 seconds]
freemint has joined #picolisp
freemint2 has quit [Ping timeout: 272 seconds]
freemint2 has joined #picolisp
freemint has quit [Ping timeout: 258 seconds]
xkapastel has quit [Quit: Connection closed for inactivity]
freemint has joined #picolisp
alexshendi has joined #picolisp
freemint2 has quit [Ping timeout: 240 seconds]
_whitelogger has joined #picolisp
freemint2 has joined #picolisp
freemint has quit [Ping timeout: 268 seconds]
ubLIX has quit [Quit: ubLIX]
andyjpb has joined #picolisp
andyjpb has quit [Ping timeout: 250 seconds]