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]
BitPuffin has joined #picolisp
BitPuffi` has joined #picolisp
BitPuffin has quit [Ping timeout: 260 seconds]
seninha has joined #picolisp
seninha has quit [Remote host closed the connection]
seninha has joined #picolisp
BitPuffi` has quit [Ping timeout: 260 seconds]
<aw-> abu[m]: hi, i wrote a wrapper for sqlite in picoLisp, have been using it for +5 years
<abu[m]> Hi aw-! Cool, good to know.
<abu[m]> Let's see if pablo_escoberg turns up again
<aw-> but it forks a new sqlite3 process for each call, nothing special haha
<abu[m]> That's fine I think. Usually I expect this fast enough.
<aw-> it is, the use-case for keeping a pipe open for the file is probably for extremely high concurrency, which is like.. a handful of companies
<aw-> and i think keeping the filehandle open for sqlite DB will be prone to errors and DB corruption
<aw-> because you need to implement locking and other mechanisms
<aw-> as opposed to just open the file, read/write, close file
<abu[m]> yeah, and it is also an issue of flushing
<aw-> yes that too
<aw-> a database like mysql or postgres would be better suited for keeping a *FD open and making multiple/concurrent calls
<abu[m]> Or perhaps use direct calls, e.g. a C library
<aw-> for sqlite to get that kind of performance/scalability, you would need to serialize the writes through a queue, to ensure only one write is ever made at once. That's an sqlite design, there's no other way around it
<abu[m]> I see
<aw-> i'll be happy to answer any sqlite+picolisp questions when pable_escoberg returns
<aw-> err pablo_escoberg ;)
<abu[m]> Seems he turns up more in the evening here, so very early in the morning for you
<aw-> OK thanks
razzy has joined #picolisp
<razzy> Good day i wish to all! :)
<abu[m]> Good day razzy!
<razzy> I want to wait for string comming from serial link and than measure time between strings. miliseconds would be enough. I am thinking (coroutine ) that every 1ms, check serial link for strings.
<razzy> am i correct?
<abu[m]> A coroutine is probably not useful. A 'task' would be somethig to run periodically.
<abu[m]> But for such a measurement direct (usec) calls are best I think
<abu[m]> : (task -999 0 (msg (- (usec) (swap (0) (usec)))))
<abu[m]> After the first call this prints the microseconds elapsed since last call
<abu[m]> So you call (- (usec) (swap (0) (usec))) in the receiving part of the serial data
<razzy> strings are IDtags for race. I will have many different strings
<razzy> I will look up task
<abu[m]> I do not understand how a task helps to *measure* times
<abu[m]> or do you mean the task waits for data? That makes sense
<abu[m]> not running every 1ms
<razzy> abu[m]: task will wait for data and than write to DB. (task) seems fine, thank you :)
<abu[m]> ok, now I understood
<abu[m]> I was confused because of the "1ms"
<abu[m]> check every 1 ms
<razzy> I do not know about way to trigger interupt from serial link.
<abu[m]> You dont need an interrupt
<abu[m]> (task (open "/dev/serial") (msg (- (usec) (swap (0) (usec)]
<abu[m]> Whenever data on /dev/serial are available, the task runs
<razzy> seems like magic to me
<abu[m]> Of course the task needs to do more things, like (line T) to read off the data
<abu[m]> The task is needed only if you want to do these measurements in the background
<abu[m]> Otherwise just 'open' and then 'in'
<razzy> i do want them in background
<razzy> I am missing how the task know there are data in /dev/serial
<abu[m]> This is a feature of the operating system
<abu[m]> It is called "I/O multiplexing"
<abu[m]> In Unix it is done via select(2) or poll(2)
<razzy> I will test several cases. :) thx.
<abu[m]> What kind of serial device is that?
<razzy> abu[m]: RFID reader. funny race for kids :]
<abu[m]> interesting
<razzy> If you are interested, i will send you pictures. :]
<abu[m]> yes
razzy has quit [Ping timeout: 258 seconds]
razzy has joined #picolisp
avocadoist has quit [Ping timeout: 240 seconds]
msavoritias has joined #picolisp
abu[7] has quit [Ping timeout: 240 seconds]
abu[7] has joined #picolisp
<razzy> how can i sort results of (collect). something like order by.
<razzy> I am propably poisoned from SQL. I will use (sort)
<abu[m]> (by '((This) (: nm)) sort (collect 'nr '+Cls From To]
seninha has quit [Remote host closed the connection]
<razzy> abu[m]: weird, i am testing (task (open "my.file") (msg (- (usec) (swap (0) (usec)] with assumption that it will show usec between acess of file. correct?
<razzy> it shows average 15usec. which does make sense only if something accessig files al the time.
avocadoist has joined #picolisp
<abu[m]> No, task is for asynchronous input, a socket or some device. Won't work on a file
<abu[m]> It wakes up if data are available
<abu[m]> A file descriptor *always* has data available
<razzy> good to know, I was thinking that /dev/serial is file like everybody else. :]
<razzy> everything else :]
<abu[m]> yes, this *is* the case
<abu[m]> $ man 2 poll
<abu[m]> or
<abu[m]> $ man 2 select
<abu[m]> And look up examples of 'task' in the sources
<razzy> if I do not have man, am I missing some software?
<abu[m]> Really, I thought man is installed by default
<razzy> i mean no man poll, man select
<abu[m]> I think just "apt install man" should do
<razzy> I wanted to tell you that I am missing manuals for select and poll. I am reading them online.
<abu[m]> ok, still strange
<abu[m]> so online is all right
<razzy> abu[m]: will you have some free-ish window tomorrow?
<abu[m]> I think so, but I cannot tell now *when* exactly
<abu[m]> Just ping me
msavoritias has quit [Ping timeout: 240 seconds]
<razzy> Thank you. :) Good night.
razzy has quit [Quit: leaving]
seninha has joined #picolisp