ChanServ changed the topic of #picolisp to: PicoLisp language | Channel Log: | Picolisp latest found at | check also for more information
jibanes has quit [Ping timeout: 240 seconds]
jibanes has joined #picolisp
pierpal has joined #picolisp
_whitelogger has joined #picolisp
rob_w has joined #picolisp
<tankf33der> morning
<Regenaxer> Hi tankf33der
orivej has quit [Ping timeout: 260 seconds]
<tankf33der> so
<tankf33der> about NY Taxi
<tankf33der> i've got such scheme and can import data in it
<tankf33der> i'm not sure about +Ref everywhere
<Regenaxer> +Ref is fine here, as they are all numbers
<Regenaxer> I would suggest to use shorter symbols for the relations, as they directly take up space in the DB
<Regenaxer> And space == speed, due to disk buffer caching
<cess11> Usually I strip wovels.
<xificurC> what is the size distribution?
<Regenaxer> Not a big issue yet, may save 20 bytes per object
<Regenaxer> but for millions of objects ... ;)
<tankf33der> 9M now, one month
<xificurC> 1 char = x bytes, 7 chars = y bytes, 10 chars = z bytes
<tankf33der> very slow :(
<tankf33der> 10k was fast
<Regenaxer> xificurC: I char is one byte if ASCII
<xificurC> yes by char I mean byte, the C way :)
<Regenaxer> tankf33der, firt optim is to commit after every 10000 inserts or so
<tankf33der> i do after 100k, never seen
<Regenaxer> (at (0 . 10000) (commit))
<tankf33der> yea
<tankf33der> stopping
<Regenaxer> 100k may be fine toi
<xificurC> Regenaxer: aren't relation names symbols that would take up w/e a symbol takes up? I.e. at least 1 cons cell, 16 bytes
<Regenaxer> too
<Regenaxer> And (gc 2000) or so
<tankf33der> i do gc 400
<tankf33der> enough
<Regenaxer> xificurC, yes, in memory
<Regenaxer> But in disk blocks they are stored in PLIO
<Regenaxer> tankf33der, ok, you did (heap) after import to see how much it takes?
<tankf33der> no :)
<Regenaxer> How do you know 400?
<tankf33der> on eye
<Regenaxer> ok, should be fine anyway
<tankf33der> i switched to (at (0 . 10000) (prin "!") (commit))
<Regenaxer> good
<tankf33der> and dont see "!" char for minets
<Regenaxer> OK, next split into more files
<Regenaxer> with bigger blocks for indexes
<cess11> Try 'prinl instead, 'prin might not be visible until it is finished.
<Regenaxer> Heavy-used index is best in its own file
<Regenaxer> cess11, right, or better 'msg' as it uses stderr
<tankf33der> db file already 200MB
<tankf33der> yea, msg helped.
<cess11> Agreed, 'msg is better.
<tankf33der> switched to (0 . 50000)
<tankf33der> works.
<tankf33der> first i do 9M import for pool optimization
<tankf33der> and i dont know how to split into more files.
<Regenaxer> also, better make an +Aux for the date/time (slows down of coures, but is more useful)
<Regenaxer> or a (+Ref +Bag) for date and time
<Regenaxer> You don't need an index for the time
<Regenaxer> or perhaps?
<Regenaxer> Searching for all records between 11 and 11:30?
<Regenaxer> independent of the day?
<Regenaxer> If so, then I would take this:
<Regenaxer> (rel d (+Aux +Ref +Date) (t)) # Date
<Regenaxer> (rel t (+Ref +Time)) # Time
<Regenaxer> You have a combined index date.time
<Regenaxer> and also an independent time index
<tankf33der> ok
<Regenaxer> Now to multi-file
<Regenaxer> I prepare an example
<Regenaxer> OK, firt proposal:
<Regenaxer> For very big indexes, you could try 5 or 6 instead of 4
<Regenaxer> and perhaps put the times into separate files too
<Regenaxer> But I would start with this
<tankf33der> wow
<Regenaxer> I prepare an example for import. Moment
<tankf33der> my current import:
<tankf33der> i have to switch to real hardware server from vmware
<tankf33der> 1TB disk, 32GB RAM
<tankf33der> modern DELL.
<Regenaxer> Here a pseudo-code for an import:
<Regenaxer> (prune 0)
<Regenaxer> (gc 2000 400)
<Regenaxer> (while (moreRecords)
<Regenaxer> (new (db: +Cab)
<Regenaxer> 'pd (...)
<Regenaxer> 'pt (...)
<Regenaxer> 'dd (...)
<Regenaxer> ... )
<Regenaxer> (at (0 . 10000) (commit) (prune 256)) )
<Regenaxer> (commit)
<Regenaxer> (prune)
<Regenaxer> (gc 0)
<Regenaxer> Experiment with the numbers
<tankf33der> wow
<tankf33der> i will take it
<xificurC> for people like me who are behind a firewall that decided to block and some other famous paste sites it would be of great help if you used a site like
<xificurC> , no HTTPS apparently :D
<Regenaxer> oh, really?
<Regenaxer> I see
<xificurC> it is actually a nice alternative as you can throw a file at it in the command line, or your clipboard etc. and it will paste it and return the link
<Regenaxer> Cool indeed!
<Regenaxer> Is there a debian package for ix?
<xificurC> I'm not a mouse person so I enjoy minor boosts like this :) Anyway, this is a selfish request but I would be able to see your pastes :)
<Regenaxer> yeah, I always prefer command line tools
<xificurC> I don't think there's a package, the command line script is just 1 shell function
<Regenaxer> I see, just pipe eg. with curl?
<Regenaxer> What is that 'f:1=<-' argument doing4
<xificurC> There's examples on the page I sent, but the most basic way is
<Regenaxer> ?
<xificurC> curl -F 'f:1=<-' which sends stdin, so
<xificurC> curl -F 'f:1=<-' <file
<Regenaxer> yes
<xificurC> curl -F 'f:1=<-' < <(xsel -b)
<xificurC> -F is for form, f is the name of the field of the form, :1 I don't know, <- is "take stdin" curl notation
<Regenaxer> ok
<Regenaxer> Just tried for the above pastebin:
<Regenaxer> oups, wrong file, ignore!
<Regenaxer> Hmm, this one worked:
<xificurC> actually f:1 might be the name of the field
<Regenaxer> Now it worked:
<Regenaxer> Why not before?
<Regenaxer> I repeated the same call
<xificurC> in a different folder? I don't know, not watching over your shoulder :)
<Regenaxer> no, it was the same file
<Regenaxer> anyway, really cool, I keep in my bash history
<xificurC> :)
rob_w has quit [Quit: Leaving]
<Regenaxer> I should put an "" command into Vip, so I can send directly the current buffer :)
<Regenaxer> Until now I always save to a file, start w3m on pastebin, navigate, edit the text area (also with Vip), save and create paste. A lot of work!
<cess11> When I'm on the bus I'll see if I can work out some tinies for using that service, looks nice.
andyjpb has joined #picolisp
alexshendi has joined #picolisp
<xificurC> Regenaxer: shouldn't be too hard to add it I guess :) I would advise to call it "pb" for pastebin (or pastebuffer :) , I used before but it died for a while and people switched to a new backend
alexshendi has quit [Ping timeout: 268 seconds]
pierpal has quit [Quit: Poof]
pierpal has joined #picolisp
<Regenaxer> ok, though I thought here (opposed to my usual taste) to use a longer command name. The reason is not to paste something to the public unintentionally ;)
<tankf33der> importing data, speed!
<xificurC> publishBuffer ? :)
<Regenaxer> hmm, well, not sooo long ;)
<Regenaxer> just ""
<Regenaxer> Perhaps there is another such service in the future?
<xificurC> inbefore you write your own pasting service
<Regenaxer> exactly
<tankf33der> Regenaxer:
<tankf33der> so i've import a month
<tankf33der> fast
<tankf33der> and dir 10k.db is empty.
<Regenaxer> oh, sorry, my mistake
<Regenaxer> (setq *Pool "10k.db/")
<Regenaxer> needs a slash
<Regenaxer> otherwise it creates all files in the current dir
<xificurC> (doc 'new!) why does the example quote each key but the last?
<xificurC> (rel env (+String)) means I can (new! '(+Deploy) 'env "Foo") right?
<Regenaxer> Uh, another mistake! Thanks!
<Regenaxer> yes, correct
<xificurC> I haven't given up on my project Regenaxer, I was just out for a week, sick kid
<tankf33der> Re
<Regenaxer> I hope nothing serious?
<tankf33der> Regenaxer: can i do this?
<tankf33der> : (count (tree 'pd '+Cab))
<tankf33der> :
<tankf33der> -> 0
<Regenaxer> xificurC, fixed it
<Regenaxer> tankf33der, yes, 'count' should work
<tankf33der> 0
<xificurC> Regenaxer: well our newborn (3mo) is fighting atopic dermatitis, she was in a hospital for a week. Nothing life threatening but still
<Regenaxer> OK, best wishes!
<xificurC> means I had to stay home with my other kid
<Regenaxer> tankf33der, looks like no 'pd' values were imported
<tankf33der> maybe i import 800MB of empty.
<tankf33der> how to check one record ?
<Regenaxer> Hehe, yeah
<Regenaxer> Thats why it was fast ;)
<Regenaxer> Single step during the first few imports
<tankf33der> but now after import
<tankf33der> ?
<Regenaxer> (edit *DB)
<Regenaxer> then click down into +Cab
<Regenaxer> or (show *DB '+Cab)
<Regenaxer> eg:
<Regenaxer> : (show *DB '+User)
<Regenaxer> nam (82 . {F6})
<Regenaxer> {5} 7
<Regenaxer> nm (7 . {F2})
<Regenaxer> em (2 . {F4})
<cess11> Or try a 'collect on another field, or check for dangling objects and inspect one of those.
<Regenaxer> Means 2 users
<Regenaxer> yes
<Regenaxer> I meant "7 users"
<Regenaxer> 2 have emails 'em'
<Regenaxer> 'nam' is a +Sn +IdxFold, so it has more entries
<xificurC> the +QueryChart example uses '(goal '(@Nr ... (select (@@) (..) (range @Nr @@ nr)))). What is @@?
<Regenaxer> @@ is a normal Pilog variable, but kind of "standard" used implicitly in many places
<Regenaxer> eg in GUI
<xificurC> ah, ok, so no magic there
<Regenaxer> T
<tankf33der> can i do it like this ?
<tankf33der> after import.
<Regenaxer> yes
<tankf33der> ok
<tankf33der> so i dont see imported data.
<Regenaxer> The above code contains no import yet
<tankf33der> checking import again.
<tankf33der> full import
<tankf33der> full code for import:
<Regenaxer> (new 1 '(+Cab) 'pd (date) 'pt (time))
<Regenaxer> shows something?
<Regenaxer> 1 = (db: +Cab)
<Regenaxer> (new `(db: +Cab) '(+Cab) 'pd (date) 'pt (time))
<Regenaxer> is better
<Regenaxer> (select +Cab)
<Regenaxer> should show this one
<tankf33der> -> {45037055}
<tankf33der> : (new `(db: +Cab) '(+Cab) 'pd (date) 'pt (time))
<Regenaxer> oh, *very* big
<Regenaxer> I would expect {2} or so
<tankf33der> import 9M lines
<xificurC> (doc 'diaform) has another typo, it starts talking about diaForm but there's no capital F
<tankf33der> # wc -l yellow_tripdata_2017-01.csv
<tankf33der> 9710126 yellow_tripdata_2017-01.csv
<Regenaxer> Better delete the DB before each import try
<tankf33der> yea
<Regenaxer> ok, but you shoul see the data
<tankf33der> so, i see data on recreated db.
<Regenaxer> yeah
<Regenaxer> (select +Cab) shows it?
orivej has joined #picolisp
<tankf33der> shows.
<Regenaxer> good
<Regenaxer> So the import itself is faulty
<tankf33der> checking big import again.
<Regenaxer> you 'split' each line in the CSV?
<tankf33der> (new (db: +Cab)
<tankf33der> ($dat (read) "-")
<tankf33der> 'pd
<tankf33der> in import i do ^^^
<tankf33der> but
<Regenaxer> 'read' is a bad idea
<tankf33der> on simple try you paste this one
<tankf33der> (new `(db: +Cab) '(+Cab) 'pd (date) 'pt (time))
<Regenaxer> it creates *lots* of internal symbols like 2018-...
<Regenaxer> (while (line) (let L (split @ "\t')
<tankf33der> (new (db: +Cab) ...) vs. (new `(db: +Cab) '(+Cab) ...)
<tankf33der> is it ok ?
<Regenaxer> ... 'pt ($dat (pack (++ L)))
<Regenaxer> yes, (db: +Cab) is ok, just `(db: +Cab) is faster
<Regenaxer> read-macro
<tankf33der> but in my import no '(+Cab0
<tankf33der> )
<Regenaxer> ah
<Regenaxer> yes, (new `(db: +Cab) '(+Cab) is needed
<tankf33der> !!!
<tankf33der> good.
<Regenaxer> Sorry!
<Regenaxer> Anyway, never 'read' on import
<Regenaxer> clobbers the internal symbol namespace
<tankf33der> i see. i will try all.
<xificurC> % pil @lib/http.l @lib/xhtml.l @lib/form.l --server 8080 main.l + . A button press causes a 400 Bad Request. I have (allowed NIL "!upload")
<xificurC> tried adding "main.l" but same
<cess11> If it is a permission error it should show in the REPL.
<Regenaxer> main.l is in current dir?
<xificurC> : *Get [::ffff:] not allowed
<xificurC> yes
<Regenaxer> In the above call everything should be allowed
<Regenaxer> better load the "@" files in main.l *after* (allowed ...)
<Regenaxer> @lib/form.l etc allow additional things then
<xificurC> removing the allowed call makes the bad request go away :)
<Regenaxer> if you have (allowed ...) in main only these things are allowed
<Regenaxer> yes
<xificurC> ok so I will pil main.l + and do what I did on the command line inside the script
<Regenaxer> yeah
<xificurC> won't that load all the libraries again and again on *every* request?
<Regenaxer> or pil --server main.l
<Regenaxer> only on each first connect, not in the session
<xificurC> I have the class and rel definitions inside this 1 file and it's already shouting "+Deploy env redefined" etc
<Regenaxer> How is your command line now?
<xificurC> my mind hasn't settled yet
<Regenaxer> :)
<xificurC> I want to pre-load as much as possible :)
<Regenaxer> yes
<Regenaxer> so pil main.l +
<Regenaxer> and load all in main
<Regenaxer> then (server) at the end
<xificurC> (doc 'server) shows nothing
<Regenaxer> http funs are not documented, sorry
* xificurC sad
<Regenaxer> yeah, form things are, but not the stuff below
<Regenaxer> you can do:
<Regenaxer> pil @lib/... --server 8080 main.l -wait
<Regenaxer> then in main.l:
<xificurC> so I want localhost:8080 to run a function called page and I want localhost:8080/!upload... to run a function called upload
<Regenaxer> yes, good
<xificurC> so I should end as (app) (server 8080 "!page") ?
<Regenaxer> So best is to allow in main.l, then load the libs
<Regenaxer> "!page" is the default then
<Regenaxer> just call localhost:8080
<Regenaxer> take app/main.l as an example
<Regenaxer> "!work" is the start function there
<Regenaxer> main.l does:
<Regenaxer> (allowed ("app/")
<Regenaxer> "!work" "!stop" "@lib.css" "!psh" )
<Regenaxer> (scl 2)
<Regenaxer> "@lib/http.l" "@lib/xhtml.l" "@lib/form.l" "@lib/svg.l"
<Regenaxer> (load
<Regenaxer> "@lib/adm.l" )
<Regenaxer> ie first allow, then load libs
<xificurC> now I screwed something up really hard :)
<Regenaxer> :)
<xificurC> ? : !? (key)
<xificurC> Select error: Bad file descriptor
<Regenaxer> Destroyed stdin somehow :)
<xificurC> app/main.l doesn't call (app)
<Regenaxer> yes, done in 'work'
<Regenaxer> in app/gui.l
<xificurC> maybe that's the problem?
<Regenaxer> no, without (app) you get single-shots, just no session
<xificurC> I had (app) (server 8080 "!work"), that didn't work :)
<xificurC> now I added a call to (app) in work
<xificurC> works.
<xificurC> what doesn't work as intended is this snippet
<xificurC> (gui 'what '(+TextField) 100)
<xificurC> '(set> (: home what) (list *Server *Env *Prjs *Name)))))))
<xificurC> (gui '(+JS +Button) "Search"
<Regenaxer> It should set a text, a string
<xificurC> the globals are defined elsewhere but the textfield doesn't show their values as expected, on first click it shows nothing and on second _____
<Regenaxer> not sure what happens with a list
<xificurC> how do you turn it into an e.g. space-joined string?
<Regenaxer> try (set> ... (glue " " (list *Server *Env ...
<Regenaxer> :)
<xificurC> ok
<xificurC> [/usr/lib/picolisp/lib.css:3] !? (c)
<xificurC> c -- Undefined
<Regenaxer> You 'load' the css file somehow
<xificurC> disregard :)
<Regenaxer> :)
<xificurC> yeah I wanted to put @lib.css into allowed put into load
<Regenaxer> hehe
<xificurC> I still don't see the value in the field
<xificurC> I put values in the field but get just 3 spaces
<Regenaxer> hmm, I can see no obvious error
<Regenaxer> The globals have all values?
<xificurC> here's the full source, running as pil main.l +
<xificurC> I put values in some fields, not all
<Regenaxer> ok
<xificurC> querying the values in the debugger REPL shows NIL for everything but I'm not sure, would it show the session's values?
<Regenaxer> What if you do '(set> (field -1) ... ?
<Regenaxer> should be the same though
<Regenaxer> Yes, I meant in the REPL
<Regenaxer> : *Server
<Regenaxer> should be there
<xificurC> still just 3 spaces
<cess11> You probably need a submit to actually store the values in the variables, or perhaps just '+JS on those fields or something.
<Regenaxer> The submit is done by the button
<xificurC> all vars are NIL in the REPL
<Regenaxer> This why nothing is stored
<Regenaxer> only " "
<Regenaxer> But why are they empty?
<xificurC> hey, that's my question! :)
<Regenaxer> Looks like the session is not unique ;)
<xificurC> hm?
<Regenaxer> you get a : prompt, in the normal way?
<xificurC> % pil main.l +
<xificurC> 11589 = 52393 33391547664262078~
<xificurC> -> NIL
<xificurC> : *Server
<Regenaxer> ok, let me try here
<xificurC> do I need to allow globals as well?
<xificurC> that's just for URL referencing no?
<Regenaxer> yes, no need to allow
<Regenaxer> They are not passed in transactions
<xificurC> I want to build a +QueryChart in the end, thinking that's what I need :) It's just a simple query into the DB to show the values. I wanted to start things simple, so I thought a few globals and 1 button showing their values should be simple, right? :)
<Regenaxer> yep
<xificurC> so why no work? :(
<tankf33der> i switch to while (line)
<Regenaxer> hmm, I simplified, and it works
<Regenaxer> This works:
<Regenaxer> (de page ()
<Regenaxer> (app)
<Regenaxer> (form NIL
<Regenaxer> (html 0 "Deployment Tracker" '("@lib.css") NIL
<Regenaxer> (action
<Regenaxer> (<grid> 2
<Regenaxer> "Server" (gui 'server '(+Var +TextField) '*Server 20)
<Regenaxer> (gui '(+Button) "Search"
<Regenaxer> '(msg *Server) ]
<Regenaxer> But why?
<Regenaxer> What is wrong in the rest? Binary search
<Regenaxer> must be something trivial, mistype or so
<Regenaxer> Found it!
<Regenaxer> it is *Env
<xificurC> I don't follow, yet
<Regenaxer> it is the 'env propert
<Regenaxer> This line works: "Environment" (gui '(+Var +TextField) '*Env 20)
<Regenaxer> btw, you don't need the gui labels here
<xificurC> yeah, I know. But why is the env property wrong?
<Regenaxer> In lib/form.l
<Regenaxer> (de "form" ("*App" "Attr" "Prg")
<Regenaxer> (job (: env)
<Regenaxer> (with "*App"
<Regenaxer> 'env' *is* already a property of the form :)
<Regenaxer> So the (: env) becomes NIL
<Regenaxer> Nasty conflict
<xificurC> that's nasty
<Regenaxer> indeed :(
<Regenaxer> I avoid gui labels usually, and do relative accesses
<Regenaxer> (field -1)
<Regenaxer> the only way in charts anyway
<Regenaxer> Only in search dialogs I put labels into all fields
<Regenaxer> to pass to the reset button
<xificurC> this is a search dialog, no?
<Regenaxer> It may become one, now it is still a form
<xificurC> relative access is kind of volatile, isn't it? If I decide to add a new field in between it moves everything
<Regenaxer> Most accesses are near, but yes, if you insert something between you must change the offsets
<Regenaxer> The reset button could also do (off *Server *Env ...
<xificurC> does a +Button need a +JS?
<Regenaxer> If you have +Var fields, you usually don't need accel to the gui component
<xificurC> sounds reasonable
<Regenaxer> no, but it works faster and with flicker
<Regenaxer> *if* it does not reload the page
<xificurC> without you mean
<Regenaxer> with +JS
<xificurC> without flicker, not with flicker
<Regenaxer> above: accel -> access
<Regenaxer> With +JS buttons which set fields do not flicker :)
<Regenaxer> and are faster
<xificurC> ok
<Regenaxer> only the contents are reloaded
<Regenaxer> But for some buttons they do not help
<Regenaxer> if they redraw the page, eg closing a dialog
<xificurC> time to read about +QueryChart and select/goal/prove etc
<Regenaxer> ok
<xificurC> re-read actually, 10th time :D
<Regenaxer> The gui should give an error for conflicts like 'env'
<Regenaxer> reserver properties
<xificurC> thanks for the quick help
<Regenaxer> reserved
<Regenaxer> np
<Regenaxer> I will put such error checks
<xificurC> you can also use more "hidden" names like _env
<Regenaxer> yes, or better transients like "env"
<xificurC> "_________env_gensym001_transient_incoming____"
<Regenaxer> haha
<xificurC> I didn't say transients because I didn't bother to check the scope
<Regenaxer> No, just "env" will never conflict with application code
<xificurC> but the end user (a.k.a. me) probably won't use transients for names
<Regenaxer> No, this is not the issue
<xificurC> ah yes, it's file local
<Regenaxer> "env" is local to @lib/form.l
<Regenaxer> yes
<xificurC> so if you switch env to a transient you won't need to do error checks
<xificurC> sounds like a win to me
<Regenaxer> yes, but sometimes it is desirable that the application can access the internals
<Regenaxer> a namespace would be best
<Regenaxer> but this breaks pil32
<xificurC> or a feature that allows accessing transients from other sources
<Regenaxer> This exists
<Regenaxer> 'loc'
<Regenaxer> (val (loc "sym" othersym))
<xificurC> then you can use transients :)
<xificurC> (and still access internals)
<Regenaxer> yeah
<Regenaxer> Needs a lot of rewriting in form.l :(
<Regenaxer> I don't dare, may break my production code
<xificurC> you mean a lot of sed -i :)
<Regenaxer> no, '*' in vip or vim is enough
<Regenaxer> * to find env, then ce and then repeatedly n and .
<xificurC> that's fine for 10 cases, not for 200
<Regenaxer> If it were only 'env', but I suspect there are more
<Regenaxer> I never do an automatic replace in my sources
<xificurC> names, names break everything
<Regenaxer> I always want to see all cases
<xificurC> well yeah, I often sed something and then check with git diff
<Regenaxer> So I often do n and . in hundreds of cases, across several files :)
<xificurC> I still have to check all the cases
<Regenaxer> yeah
<Regenaxer> In diff the context is more difficult to spot
<Regenaxer> In fact I do both
<xificurC> need to write more java so one can press some magic button REFACTOR
<Regenaxer> first ., thed diff
<xificurC> why in a chart the first value is fetched with (gui 1) and not (gui 0)
<Regenaxer> PicoLisp is 1-based everywhere
<Regenaxer> zero-based makes sense only in pointer arithmetics
<xificurC> oh, missed that
<Regenaxer> and pil has no pointers :)
<xificurC> of course it has!
<xificurC> a cons cell is 2 pointers!
<Regenaxer> yes, true, but not on the language level
<xificurC> :)
<Regenaxer> no arithmetics at least :)
<xificurC> did fifo?
<xificurC> or was it lifo
<Regenaxer> you mean lifo?
<xificurC> I often mix the names up
<Regenaxer> It was also 1 based
<Regenaxer> :)
<Regenaxer> I Forth it used to be 1-based
<Regenaxer> but Forth-83 changed all to 0
<xificurC> was it old-school forth like with compiled words or the new-kind with quotations and objects
<Regenaxer> '2 pick' was 'over'
<Regenaxer> now '1 pick' iirc
<Regenaxer> old one, I don't know later versions
<xificurC> not later versions of ANS forth, but forth derivatives
<Regenaxer> But object orientation existed too
<Regenaxer> yeah
<xificurC> Factor, Retro
<Regenaxer> ok
<Regenaxer> Somehow it became chic to be zero based
<xificurC> I really enjoyed reading freeforth's source code
<Regenaxer> So in Forth now '2 roll' rolls *3* elements :/
<Regenaxer> uh, forth at its power! ;)
<Regenaxer> messing with the return stack
<xificurC> I'm still dreaming of writing my own forth. And lisp
<Regenaxer> I'd loved to write a Lisp *in* Forth, if it were not a performance issue
<xificurC> on a forth chip it wouldn't :p
<Regenaxer> I think Forth is inherently slow, due to excessive stack handling
<xificurC> I'm sure Chuck would disagree :)
<Regenaxer> The whole stack needs to be in registers
<Regenaxer> yes, I know
<Regenaxer> But all claims about the speed of Forth never turned true
<xificurC> his chip claims to have register-like-speed access of the stack
<Regenaxer> Just like Java/JIT
<Regenaxer> But iirc his chip has an extremely tiny stack
<xificurC> I remember 9, might be a bit more
<Regenaxer> yeah
<xificurC> "chosen as effectively infinite"
<Regenaxer> no chance for recursion
<xificurC> I was talking about the datastack
<xificurC> but the callstack is of same depth I think
<Regenaxer> yes, is needed in recursion too
<Regenaxer> data stack
<xificurC> his words are usually : foo something IF finish THEN something foo ;
<xificurC> which is basically a tail-call optimized call (a jump)
<Regenaxer> T
<Regenaxer> only a loop
<xificurC> yes
<Regenaxer> no tree traversal etc
<xificurC> but you are right that the data stack is used in some recursion schemes too
<Regenaxer> I think it is needed in all
<xificurC> . (number printing) in freeforth e.g. uses the datastack
<Regenaxer> yes, reversing
<xificurC> well depends on the case. Some loops just do side effects
<Regenaxer> But where recursion is *needed* is tree traversal
<xificurC> T
<Regenaxer> and there you recurse on data, keeping the state on the stack
<xificurC> his chips have something like 64K RAM. No big trees there :D
<xificurC> 64 words actually
<Regenaxer> true, but trees can be abstract, eg a search with backtracking
<Regenaxer> not in memory
<Regenaxer> a robot moving around
<xificurC> yes, I understand
<xificurC> the chip is limited, on purpose
<Regenaxer> yeah, and massively parallel iirc
<xificurC> whether we agree with the purpose or not is a different discussion :)
<xificurC> yes, they sell a board with 144 chips
<Regenaxer> It is fascinating, I just don't have a use case at the moment ,)
<Regenaxer> :)
<xificurC> anyway, there are a few ANS forth that have pretty advanced optimizing compilers (swiftforth and the other I forgot)
<Regenaxer> The code speed is not the problem
<xificurC> oh?
<Regenaxer> it is data access due to the stack architecture
<Regenaxer> over dup swap etc
<Regenaxer> direct register operations are faster
<Regenaxer> add A (X CDR)
<xificurC> optimizing compilers do compile those away. If they load the top 3 stack items into 3 registers they don't need to xchg
<xificurC> only on word boundaries
<Regenaxer> yeah, but when it gets deeper they need to flush to the stack
<Regenaxer> too complex
<Regenaxer> such a compiler also adds complexity
<xificurC> I will believe you, my knowledge is theoretical and blog-post-based :)
<Regenaxer> I finally gave up Lifo because it is tedious to program, not for performance
<Regenaxer> in fact Lifo was faster than Pil
<Regenaxer> But the stack handling is simply tedious
<xificurC> but I believe the claims that working with the stack forces the dev to think about optimal data flow and data structures, often leading to superior design, which might at some point outrun a typical C solution
<Regenaxer> keeping track of the stack
<Regenaxer> Perhaps, but I found it does not match my way of thinking
<xificurC> I have yet to write enough forth code do form my opinion on stack juggling
<xificurC> *to form*
<Regenaxer> Short examples are elegant and nice
<xificurC> I don't think it matches anyone's kind of thinking :D
<Regenaxer> But programming it all day is tiresome
<Regenaxer> yeah, perhaps
<xificurC> <- this guy has a company that created their own color forth ( ) which they were to release into open source last september :)
<Regenaxer> It is only elegant as long as factor a lot and use short definitions
<Regenaxer> But then you must invent new names all the time
<xificurC> He would be a good guy to look at source code and see what someone who is converted thinks like and what code he writes
<xificurC> unfortunately I stopped believing they will ever open source their language
<Regenaxer> I see
<xificurC> business is more important and open sourcing brings no revenue
<Regenaxer> true
<Regenaxer> so I must continue here too :)
<xificurC> he was pretty enthusiastic about it on reddit though, so maybe one day he will find the time, who knows
<xificurC> yeah, sorry :)
<Regenaxer> :)
<xificurC> I must run for today anyway, nice talking with you
<Regenaxer> no problem, interesting discussion
<Regenaxer> Must go soon too
<Regenaxer> some duties
alexshendi has joined #picolisp
pierpal has quit [Quit: Poof]
pierpal has joined #picolisp
pierpal has quit [Quit: Poof]
pierpal has joined #picolisp
pierpal has quit [Read error: Connection reset by peer]
pierpal has joined #picolisp
<beneroth> hi
<beneroth> interesting log read today :)
<Regenaxer> hi beneroth :)
<beneroth> hi Regenaxer :)
orivej has quit [Ping timeout: 260 seconds]
<Regenaxer> Added command to Vip :)
<Regenaxer> Also Z as alias for :x
styx has joined #picolisp
orivej has joined #picolisp
<beneroth> :D
<beneroth> good point about the "better a longer command to not trigger it by accident"
<beneroth> I do similar stuff in such cases
styx has quit [Quit: styx]
<Regenaxer> good to know :)
<Regenaxer> I think is sufficiently difficult to type to be safe
<beneroth> T
xificurC has quit [Quit: - A hand crafted IRC client]
<beneroth> gn8