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
clacke has quit [Read error: Connection reset by peer]
chexum has quit [Quit: No Ping reply in 180 seconds.]
chexum has joined #picolisp
chexum has quit [Remote host closed the connection]
chexum has joined #picolisp
chexum has quit [Write error: Connection reset by peer]
chexum has joined #picolisp
chexum_ has joined #picolisp
chexum has quit [Ping timeout: 255 seconds]
chexum_ has quit [Remote host closed the connection]
chexum has joined #picolisp
chexum_ has joined #picolisp
chexum has quit [Ping timeout: 255 seconds]
<Hunar> Finally a project that I finished :) the neural network thing now wroks, just needs to be cleaned and made into a class ix.io/4gmB I think there is a memory leak somewhere since the main loop isn't suppose to slow down over time
<Hunar> I think I found it
<Hunar> no
<abu[m]> Hi Hunar!
<Hunar> Hello abu:)
<abu[m]> Just to be picky: The 'mapcar' at the end creates garbage. 'mapc' is better.
<Hunar> Oh, you are right. I don't need the output
<abu[m]> No, not the output. 'mapca' builds a list from the results
<abu[m]> There are more such cases
<Hunar> Yes, I meant to say the output list that mapcar creates
<abu[m]> So in (for I 100000 you also vall mapcar and builds thousands of lists
<Hunar> Aloot of cleaning :)
<abu[m]> yes, the result list
<abu[m]> Easy, Just replace mapcar with mapc if you are interested only in side effects but not the total result list
<Hunar> Thanks, I will
<abu[m]> But this is not a real bottleneck or leak
<Hunar> No, I need to inspect alot of variables.. the loop basically coputes some stuff and puts it in a list, then resets the list
<abu[m]> And it gets slower over time?
<Hunar> yes, I noticed it in termux, the pc was fast
<abu[m]> So it generates very many data?
<abu[m]> What does (heap) say after a long run?
<Hunar> 32
<Hunar> I modified it, not the result of the file I shared
<abu[m]> Perhaps the mapcars indeed slow it down. Replace it in lines 46, 101,128, 152 and 156 with 'mapc'
<abu[m]> And put (gc 40) in the beginning
<abu[m]> to pre-allocate some heap. Causls less frequent garbage collections
<Hunar> I'll have to try later, I become busy at work :(
<abu[m]> No hurry!
<Hunar> Found it, *Delta and *DeltaB weren't being reset, I also changed mapcar
<abu[m]> Ah, so they got longer and longer
<abu[m]> What does (heap) say now?
<Hunar> Says 2 :) which is the default i think.. is resetting just (setq *Delta)
<abu[m]> Perfect! ☺
<abu[m]> Or (off *Delta)
<Hunar> Great :D
chexum_ has quit [Quit: No Ping reply in 180 seconds.]
chexum has joined #picolisp
<Hunar> I have a small problem, my class has out of order optional parameters, is a single association list as parameter the only option? I like to have this instead but it isn't PILy (new '(+NN) 'a 1 'b 2))
<abu[m]> I think it is Pily. There are some tasks in rosetta, like "Named parameters" or "Variadic function"
<abu[m]> wait, not "Variadic function"
<abu[m]> I think the convention ... 'var 'arg ... is fine
<abu[m]> What do you mean with 'new'?
<abu[m]> I think it *does* it this way
<Hunar> its the constructor of a class
<Hunar> ok, I'll checkout rosseta code :)
<abu[m]> 'new' does this for +Entity
<abu[m]> (new '(+Cls) 'var1 'val1 ...
<abu[m]> In fact it is not 'new' but the initializer
<abu[m]> : (vi T '+Entity)
<Hunar> Wait, so it is already the way I want it
<abu[m]> yeah ☺
<Hunar> :D
<abu[m]> I thought you want it for other functions or classes
<abu[m]> non-DB for example
<Hunar> I thought they were the same :)
<Hunar> I get a='B b=1
<abu[m]> You pass two arguments, 'B' and '1', so the parameter A is 'B' and B is '1'
<abu[m]> +Thing is no entity
<abu[m]> Look at (vi T '+Entity) to see how +Entity does it
<Hunar> Aha
<Hunar> Now I get it :)
<abu[m]> Basically it boils down to:
<abu[m]> (dm T @ (while (args) (put> This (next) (next)]
<abu[m]> +Entity is a little more variadic
<abu[m]> BTW, I often have subclasses of Entity
<abu[m]> The do (dm T @ (pass super 'x 7 'y 9]
<abu[m]> so it *add* values to those in the call
<Hunar> :D
<abu[m]> An arbitrary example file: http://pb1n.de/?a3a0ce
<abu[m]> Search for "pass super"
<Hunar> (class +Thing +Entity)
<Hunar> (dm T @ (pass super 'x 1 'y 2))
<Hunar> now when I use (new '(+Thing)) it says (new T 1) Bad DB file
<abu[m]> How did you open the DB? The 'pool' call.
<Hunar> Oh, my bad.. I forgot to open DB
<abu[m]> ok ☺
pfd has quit [Quit: Client closed]
pfd has joined #picolisp
hrberg has quit [Ping timeout: 246 seconds]
hrberg has joined #picolisp
hrberg has quit [Ping timeout: 260 seconds]
hrberg has joined #picolisp
pfd has quit [Ping timeout: 260 seconds]