beneroth changed the topic of #picolisp to: PicoLisp language | The scalpel of software development | Channel Log: https://libera.irclog.whitequark.org/picolisp | Check www.picolisp.com for more information
seninha has quit [Remote host closed the connection]
chexum has quit [Ping timeout: 264 seconds]
avocadoist has quit [Ping timeout: 246 seconds]
chexum has joined #picolisp
isaneran has joined #picolisp
pablo_escoberg has joined #picolisp
<pablo_escoberg> Good morning all.  Is it a bad idea to refer to external symbols by e.g. '{nnn} ?  I'm getting some anomalous behavior, and I want to make sure it's not because of that before I paste the code in question.
<abu[7]> Hi pablo_escoberg! The recommendation is not to use explicit {nnn} inside application code, because it will not be garbage collected then
<abu[7]> This may give a memory leak
<abu[7]> But there is no hard reason
<abu[7]> Using it during debugging is perfectly fine
<abu[7]> (show '{nnn}) etc.
<pablo_escoberg> can it result in a "Bad ID" error?
<abu[7]> Only if this object really does not exist
<abu[7]> You can try (ext? '{nnn) T)
<pablo_escoberg> Well, the behavior is really weird.  1 sec.
<abu[7]> How did you obtain it?
<abu[7]> It must be referred to by other objects
<pablo_escoberg> entities! E
<pablo_escoberg> -> {235}
<pablo_escoberg> entities! R
<pablo_escoberg> -> start_addr
<pablo_escoberg> entities! (get E R)
<pablo_escoberg> !? (get E R)
<pablo_escoberg> {235} -- Bad ID
<pablo_escoberg> entities? (get E R)
<pablo_escoberg> -> NIL
<pablo_escoberg> entities? (get +Itinerary 'start_addr)
<pablo_escoberg> -> NIL
<pablo_escoberg> entities? (get '{235} 'start_addr)
<pablo_escoberg> -> NIL
<pablo_escoberg> entities? (getl '{235})
<pablo_escoberg> -> NIL
<pablo_escoberg> entities? (select +Itinerary)
<pablo_escoberg> {244} (+Itinerary)
<pablo_escoberg>    dt 739194
<abu[7]> Bad ID happens only at the first access
<abu[7]> Where does 'E' come from?
pablo_escoberg has quit [Quit: Client closed]
pablo_escoberg has joined #picolisp
<abu[7]> If 'E' is really found somewhere, then your DB is corrupt
<abu[7]> : (dbCheck)
<pablo_escoberg> that's what I figured
<pablo_escoberg> ok, I'm going back to generated id's.  I think I'm playing with fire here.  Thanks for the insights.
<abu[7]> I always start with @lib/too.l on the command line
<pablo_escoberg> For the record, I was using the nnn in `{nnn} as a record ID.  I'll go back to an incremental one.
<abu[7]> Using the object directly is fine, ĵust keep it unspecific
<abu[7]> i.e. no explicit '{nnn}' in the code
<pablo_escoberg> well, that is exactly what I was doing.  Seemed like a good idea at the time :)
<abu[7]> yep :)
<abu[7]> it is fine
<abu[7]> You use 'id'?
<abu[7]> (id n m) ?
<pablo_escoberg> No, I was just stripping the braces
<abu[7]> 'id' is more efficient than parsing
<abu[7]> The name "nnn" is expensive to generate and parse
<pablo_escoberg> well, it seems to be causing corruption of some sort, so I will just go back to incremental id's.
<abu[7]> ok, that's the best
<abu[7]> you mean a +Key ?
<pablo_escoberg> TY
<pablo_escoberg> yes, a +Key in a class between +Entity and the classes in question.
<pablo_escoberg> Worked fine, but '(extern ID)` seemed a lot more elegant the (db 'id '+Entity  ID)
<abu[7]> right
<abu[7]> and it is safe regarding gc, just 'id' is more efficient
<abu[7]> than 'extern'
<pablo_escoberg> Ooh, maybe I'll play with that rather that going back to a +Key.  If that doesn't work, I'll just got back.
<abu[7]> good
<abu[7]> In any case a good exercise :)
<abu[7]> OK, meeting now for 3 h
razzy has joined #picolisp
<razzy> abu[7]: if you are concerned by making "true" keyboard. why not emulate real USB keyboard with penti. transparent app with emulated USB input to OS.
isaneran has quit [Remote host closed the connection]
razzy has quit [Quit: leaving]
clacke has joined #picolisp
seninha has joined #picolisp
msavoritias has joined #picolisp
beneroth has quit [Quit: Leaving]
<abu[7]> razzy, you mean a physical keyboard?
<abu[7]> There is Nistur who actually built one
<Nistur> I am summoned!
<abu[7]> Hi Nistur! :)
<pablo_escoberg> I think razzy means emulated in software, though grabbing an esp32 and a breadboard and building a physical penti keyboard also sounds like a fun project.
<abu[7]> Yeah
<abu[7]> I don't know what it means to "emulate real USB keyboard with penti"
<Nistur> pablo_escoberg: it is! Highly recommended :P
<Nistur> I'll have to do it again some time :P
<Nistur> I used a teensy for mine, not an esp32 though
<pablo_escoberg> Sure, raspberry pi pico would work as well.
<Nistur> unfortunately the photos of mine are no longer around - I put them on a page I hosted on keybase, and they stopped their webhosting stuff
<Nistur> I could probably re-host them somewhere
<abu[7]> That would be nice! Unfortunately I lost the pics of your Penti too :(
<Nistur> Let me see if I can just grab the data, should still be on keybase
isaneran has joined #picolisp
avocadoist has joined #picolisp
beneroth has joined #picolisp
razzy has joined #picolisp
<razzy> abu[7]: I meant emulate in software. app-penti that can send keys to virtual USB connection.
<Nistur> abu[7]: https://nistur.co.uk/Penti/ I haven't touched the page since I made it originally, so it's still requires the browser window to be portrait (or opened on a phone) but I'll probably do a writeup of it and make it more viewable... and also add the completed images
<razzy> Nistur: are you still using your chorded keyboard?
<Nistur> unfortunately not. I designed it originally when MiniNisturette was just born, and I spent hours at a time sitting on the bed, with her next to me, so wanted to have somethin I could use "comfortably" with one hand, to type on a netbook on my lap, while the other hand was holding/rocking MiniNisturette etc. However by the time I finished this, I no longer needed to do this... and it turns out that while
<Nistur> it's ergonomic to have next to you on a bed, it's REALLY uncomfortable to use on a desk
<Nistur> actually, it's not _that_ uncomfortable, just tiring
<Nistur> but that's why I need to build another one :P
<abu[7]> razzy: "can send keys to virtual USB connection" how?
isaneran has quit [Read error: Connection reset by peer]
<razzy> abu[7]: very ugly and bad way would be: send letters to hardware device, emulate keyboard in another USB port, read in OS. as shown here https://superuser.com/questions/1128365/simulate-usb-keyboard-from-machine
<razzy> I think there will be better way of sending letters directly to some buffer in USB input device.
<abu[7]> yeah
<abu[7]> But I never heard of such a thing
<abu[7]> That's why I said you need a device driver
<abu[7]> I did it with evdev for my first Penti
<abu[7]> this worked: http://pb1n.de/?49eeda
<abu[7]> in September 2015
<abu[7]> The Linux device driver api changed with every Linux version though, so I gave up
<abu[7]> The Penti-relevant code in the above link starts at line 232 btw
<razzy> I think USB protocol should stay the same.
<abu[7]> But you cannot access from "outside"
<razzy> people created virtual USB devices in linux. Is it hard to route USB output to USB input?
<razzy> in software?
<razzy> It can be done in hardware.
<abu[7]> I don't know
razzy has quit [Quit: leaving]
<beneroth> hey Nistur o/
<beneroth> Nistur, so if your wife is like "lets have another baby" you reply with "wait, I have to build a keyboard first"?
<Nistur> ahah, maybe
pablo_escoberg has quit [Quit: Client closed]
pablo_escoberg has joined #picolisp
beneroth has quit [Remote host closed the connection]
beneroth has joined #picolisp
pablo_escoberg has quit [Quit: Client closed]
msavoritias has quit [Ping timeout: 256 seconds]
beneroth has quit [Read error: Connection reset by peer]
beneroth has joined #picolisp
razzy has joined #picolisp
<razzy> sigh, I want really secure phone with penti, 4G internet, and low energy consumption.
<razzy> any ideas?
<beneroth> pinephone maybe. The Librem 5 has too low battery capacity / too high consumption :/
<razzy> beneroth: I am using pinephone. problem to run penti
<razzy> beneroth: I am thinking having phone for penti and SSH and calls. https://shop.fairphone.com/fairphone-easy
razzy has quit [Ping timeout: 246 seconds]
razzy has joined #picolisp
razzy has quit [Quit: leaving]