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