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
chexum has quit [Remote host closed the connection]
chexum has joined #picolisp
chexum has quit [Ping timeout: 258 seconds]
chexum has joined #picolisp
seninha has quit [Remote host closed the connection]
<abu[m]> Done ☺
<abu[m]> I released a new pil21
<abu[m]> @Hunar In the demo you see the change. (when (>= Dly -1) is changed to (unless F
<abu[m]> Note that this must be outside the make. The 'make' has to be done in any case (updates etc.), it is just the animation which is skipped.
<abu[m]> I'll also release a new PilBox now
<Hunar> That's great news :D I'm waiting for the PilBox :)
<abu[m]> ☺
<abu[m]> Released PilBox to PlayStore. May take a few hours to propagate
<abu[m]> Also, I released a new demo.zip with an updated "Forest Fire" canvas
<Hunar> is https://software-lab.de/pilBox.apk the latest version? I installed it and I still have the same problem
<abu[m]> You shoud see the version in setup
<abu[m]> 20220511
<abu[m]> I think the problem is the cache
<Hunar> it says 20220901
<abu[m]> ah, that's not the new one
<abu[m]> Sorry, wrong paste above. It is 20220903
<abu[m]> But pilBox.apk on software-lab is from today
<abu[m]> Can you check again? And also clear the cache in the REPL before testing.
<Hunar> Sorry I constantly get interrupted at work
<abu[m]> No hurry
<Hunar> I just downloaded/installed it again and still 20220901 .. I cleared REPL cache, then PilBox cache still the same
<abu[m]> hmm, the version must be ...03
<abu[m]> I checked the version on software-lab. It is definitely ...03
<abu[m]> Also md5sum is the same as I have here
<abu[m]> d70f05d37492a61b2650627082b6a0cc
<Hunar> I dont want to delete the app then reinstall, I have some hanging projects
<Hunar> would a reboot help?
<abu[m]> Does the md5sum match your pilBox.apk ?
<Hunar> e30b1d1de4e76487926831d1a762f515
<abu[m]> That's not the right one
<Hunar> finally :) I downloaded it with another peogram instead of chrome, now its 03
<abu[m]> Great! Yeah, Chrome is obscure with its downloads. It creates new versions of the file each time ☺
<Hunar> I still have the canvas problem :/ it's like nothing changed .. and if I only put the update commands in (unless F) then the problem is worse .. returning anything back except NIL causes problems
<abu[m]> Hmm, here it fixed everything
<abu[m]> Can you pastebin again?
<Hunar> this should update the ball position every second
<Hunar> If I move my finger it gets updated uncontrollably
<abu[m]> I'm not at home. I will run it later.
<abu[m]> Can you try the Zappel demo? Does it show the same behavior? For me the changes fixed it.
<abu[m]> Just try it here: https://picolisp.com/canvas
<Hunar> That has a new problem, when I move my finger over the canvas the animation stops, slows down such that it updates every 5 seconds .. If I move my finger more then the refresh rate becomes evern more slow
<abu[m]> Uh, strange!
<abu[m]> Can you (trace 'drawCanvas) in your version to see if 'T' is passen upon touch events?
hrberg has joined #picolisp
<abu[m]> I just tried https://picolisp.com/canvas on Chrome in Android, and all touches are perfectly ignored
<abu[m]> Are you sure you cleared the cache in every involved browser?
<abu[m]> Now I tested your code too. Works perfectly!
<abu[m]> I modified it to http://ix.io/49ww
<abu[m]> and stated as: ../pil21/pil hunar.l -go +
<Hunar> I can't currently test them .. but I just launched a browser on desktop and I will make a video
<abu[m]> OK
<Hunar> as soon as I click&drag, the animation slows down
<Hunar> So the opposite problem .. yesterday the mouse movement was speeding up the animation.. I think the ping pong is not in equilibrium yet
<abu[m]> I can't see the URL. Is this picolisp.com/canvas ?
<Hunar> yes
<abu[m]> And you cleared the browser cache?
<Hunar> this is the first time I open that webside here so I think clearing cache is not needed
<Hunar> I'll try another browser now
<abu[m]> true
<abu[m]> For me it works fine in Chrome on Android. No effect if I touch it.
<Hunar> I just tested in in windows 7 virtual machine on firefox, same problem
<Hunar> I'm holding click then jerking the mouse in all directions, are you doing the same? in android same thing but with touch
<abu[m]> I have no mouse, only touches. But this morning I also tested with a kind of mouse on Firefox/Linux
<Hunar> I don't understand how we are not getting the same problem :(
<abu[m]> Indeed!
<abu[m]> Can you (trace 'drawCanvas) your local version? To see if 'T' gets passed
<abu[m]> And if T is passed, no increment of the position happens, right?
<Hunar> I'll try it in the following 30minutes
<abu[m]> Thanks! ☺
<abu[m]> I traced it now in the Zappel demo
<abu[m]> Swichted to single
<abu[m]> then youch and move in the canvas: gives
<abu[m]> drawCanvas : single -2 0
<abu[m]> or
<abu[m]> single -2 -1
<abu[m]> or
<abu[m]> single -2 T
<abu[m]> So 'F' is never NIL
<abu[m]> One thing we have to keep in mind: the (unless F) only inhibits the change
<Hunar> At the start it's NIL each frame (1 second)
<Hunar> if I click once it becomes sends three updates 1 then T then NIL .. so 3 updates each frame
<abu[m]> The transfer of the whole list and the drawing still happens
<abu[m]> So this may explain the slowdown
<abu[m]> ok, so T is good
<abu[m]> Best it is seen in single in Zappel, as the continuous animation is stopped
<Hunar> I think each interaction appends a new update to the usual update
<abu[m]> Before the change yesterday touching in "single" triggered stepping
<Hunar> but then isn't cleared
<abu[m]> They are queued
<abu[m]> If you move your finger rapidly, you create dozens of updates per second
<abu[m]> On a slow network or browser it can't keep up
<abu[m]> Better test locally
<Hunar> yes
<Hunar> Shouldn't they only be in the queue once?
<abu[m]> Perhaps, but this queue is in the TCP socket
<abu[m]> drawCanvas is called whenever something changed
<abu[m]> So the trick is to update only what really changed
<abu[m]> See e.g. chess/gui.l
<abu[m]> It moves only the single piece if you drag it
<abu[m]> (I'm not sure if chess work smoothly over the distance. The server is in Germany)
<Hunar> I was about to say it is unplayable for me :/
<abu[m]> I see.What does "ping picolisp.com" say?
<abu[m]> I have 24 msec
<Hunar> 60 to 103 ms .. but mostly 70
<abu[m]> this is good enough I think
<Hunar> no
<Hunar> wait
<Hunar> I mistyped the url, its 100ms
<abu[m]> still ok I think
<abu[m]> What happens if you drag a piece?
<Hunar> I'll show you :)
<Hunar> I dont understand, it's now very normal and playable :/
<abu[m]> hehe ☺
<abu[m]> glitches
<abu[m]> nevermind
<abu[m]> Great
<abu[m]> You could also install "chess" on PilBox, should be best
<Hunar> I have it :)
<abu[m]> ☺
<Hunar> What should we do about the canvas problem .. my bouncing ball program didn't improve with the update :( do you have more ideas
<Hunar> On desktop, updated queue and slow down the animation, on PilBox they speed up like yesterday
<Hunar> updates*
<abu[m]> If you run bouncing ball locally, and touch the canvas, it gets confused?
<abu[m]> With the version I posted above, it works very fine
<abu[m]> Only if I work around heavily for a few seconds, it stops for a moment, I think because of overload
<abu[m]> But touches or short scrolls have no effect
<abu[m]> I have to stirr several seconds to see anything
<abu[m]> And after that it continues normally
<Hunar> Hmm, I didn't notice that, it does become normal again after I let go.. but the drawCanvas calls are being called far too much, can I manually clear it? I just tried moving the mouse far too much and the cpu usage got very high and the animation didn't recover this time
<Hunar> It's a memory leak that will bite me in the future, I plan to make interactive canvas programs
<abu[m]> For the little bouncing ball?
<abu[m]> And why a memory leak?
<Hunar> Yes, after click&dragging for a minute, the process for pil was constantly consuming %1 cpu and the ball was updating like every 4 seconds
<Hunar> after I released the mouse
<abu[m]> and the memory size?
<Hunar> The task manager was saying %0 memory the whole time
<Hunar> let me check the bytes
<abu[m]> I mean, it draws only 2 rects. A handfull of bytes being transferred
seninha has joined #picolisp
<Hunar> the task manager I'm using is very confusing and basic, I don't know where the memory is :/
<Hunar> yeah, but it still was slowed down :(
<abu[m]> 0% memory means the memory of the whole PC is exhausted? ;)
<Hunar> I think I read the wrong number sorry
<Hunar> This is after like 80 seconds of dragging and clicking .. then waited for a while and didn't get better .. as you see in the video it's glitching sometimes
<abu[m]> Hard to see
<abu[m]> I have no desktop atm
<abu[m]> But anyway, I have no idea
<abu[m]> I think I can reproduce what you mean with picolisp.com/canvas
<abu[m]> I'm walking in the fields and have only mobile network
<abu[m]> Then if I make it "Faster" and faster, and then swipe around heavily, it slows down noticibly
<abu[m]> This cannot be avoided I think
<abu[m]> If there is more traffic than the connection can handle, it slows down
<abu[m]> I can achieve maximally around 10 Hz here
<abu[m]> The same on localhost (Termux/Phone) it goes up to 50 Hz
<abu[m]> So I think this is what you mean
<abu[m]> The question is if that can be avoided
<abu[m]> Throw away updates? Which ones, and, most of all, how?
<abu[m]> The other question is, why would you want do drag around?
<abu[m]> I tested yesterday only mouse clicks and mouse-leave
<abu[m]> producing almost zero data compared to dragging
<Hunar> Yes, I'm expecting an update each frame
<Hunar> If i click then the next frame I'm expecting 2 updates one for the click, but no further updates the following frames
<Hunar> currently anything you do will be an update for the rest of time each frame
<abu[m]> You can check 'F' for le0
<abu[m]> and then send nothing
<abu[m]> 0 is start, and -1 is drag
<abu[m]> If you want to drag something, call (csDef "someName") to save the canvas
<abu[m]> Then on each update call (csDraw "someName") plus the desired components
<abu[m]> This makes drawing parts of the screen very fast
<abu[m]> The chess program uses this to move peaces by dragging
<abu[m]> To ignore all touch events, put the 'make' also inside the 'F' check
<abu[m]> or do (unless F (change the state)) (when (gt0 F) (make ...)) to ignore only drag events
<Hunar> Here is the detailed information of what I consider the problem http://ix.io/49xu
<abu[m]> I see, there is some useless echoing
<abu[m]> You mean the events with "1", right?
<abu[m]> They happen only upon overrun?
<abu[m]> Because normally clicks work fine
<abu[m]> Or, not overrun, but during auto-repeat, right?
<Hunar> It happens forever, I click once but it keeps echoing forever
<abu[m]> (I use clicks in several applications, and they work exactly as needed, but never used them in auto-repeating canvasses)
<abu[m]> So this is a bug in the repeating
<abu[m]> It sends the wrong flag
<Hunar> Yes, I'm assuming that this causes the slowing down of the animation, since I make aloot of clicks and drags
<abu[m]> I think the slow down will also happen with another flag. A click is not the problem, only the drag I think
<abu[m]> The relevant line is 196 in @lib/canvas.js I think
<abu[m]> It passes along the flag it received
<abu[m]> What if you remove ", flg" again?
<abu[m]> This is how it was before yesterday
<Hunar> I don't know, maybe I try it tomorrow, currently I'm very busy my head hurts
<abu[m]> ok
<abu[m]> I see no -1 (i.e. drag in your logs)
<Hunar> Drag would create sooo many logs that I don't know which is which
<abu[m]> yeah
<abu[m]> In any case, the 1 may be wrong, but I think it will not change the total number of drawings
<abu[m]> Basic question: Do you really need an auto-repeat?
<abu[m]> I never had a real app that needed it
<abu[m]> Normally you draw if you have data
<Hunar> Sorry, what is auto-repeat exactly .. I don't think I used auto-repeat
<abu[m]> It is a positive Dly
<abu[m]> 1000 in the bouncing ball
<abu[m]> So the canvas repeats every second
<abu[m]> For example, the chess program redraws when data are available
<abu[m]> e.g. after a move is done, perhaps after an hour ;)
<abu[m]> It would be a huge waste to draw all the time
<Hunar> Aha, then yes I do .. I use auto-repeat for simple games :) or maybe complex in the future .. I need moving things on the screen
<abu[m]> Yes, but move when necessary, not all the time
<abu[m]> Still, the "1" may be wrong, it is complicated
<Hunar> It should be waste to draw all the time, but not un-nessesarly wasefull, just waste enough :)
<abu[m]> So there may be a bug in auto-repeat
<abu[m]> passing the wrong flg
<Hunar> When I finish click or drag etc.. and not touching anything, I want drawCanvas to only be called once each frame.. that is all my problem :)
<abu[m]> There is no end-drag. While dragging, it needs to call drawCanvas to send the -1 flag
<abu[m]> Click sends "1" only once. It may be a bug that auto-repeat resends it as I said
<abu[m]> I will debug this
<Hunar> :) my head is full, I'll go now
<Hunar> good bye
<abu[m]> ☺
seninha has quit [Quit: Leaving]
seninha has joined #picolisp
<abu[m]> Released another @lib/canvas.js
<abu[m]> Hope I improved the protocol
<abu[m]> My stuff seems to work so far
seninha has quit [Ping timeout: 240 seconds]
seninha has joined #picolisp
mario-goulart has quit [Remote host closed the connection]
mario-goulart has joined #picolisp
seninha has quit [Quit: Leaving]
Iacob has quit [Ping timeout: 268 seconds]
Iacob has joined #picolisp