<< 30-07-2018 >>

00:02:27*yglukhov[i] quit (Ping timeout: 240 seconds)
00:35:21*BitPuffin quit (Remote host closed the connection)
00:37:32*rockcavera joined #nim
00:43:15*yglukhov[i] joined #nim
00:47:27*yglukhov[i] quit (Ping timeout: 240 seconds)
00:56:36*stefanos82 quit (Quit: Quitting for now...)
01:00:00*Ven`` quit (Ping timeout: 256 seconds)
01:00:19zacharycarter[m]okay so I figured that issue out but now I'm facing a new one - I need to run some init code on the same thread I later run code in a parallel statement on
01:00:58zacharycarter[m]I know I can do pinnedSpawn - is there a way to run some code in a worker thread first and then re-use it in a parallel block?
01:13:05*yglukhov[i] joined #nim
01:13:27*Ven`` joined #nim
01:16:04*dddddd quit (Remote host closed the connection)
01:17:27*yglukhov[i] quit (Ping timeout: 240 seconds)
01:17:46*oprypin quit (Ping timeout: 264 seconds)
01:18:20*FromGitter quit (Ping timeout: 265 seconds)
01:18:35*avsej quit (Ping timeout: 245 seconds)
01:23:48*FromGitter joined #nim
01:24:02*avsej joined #nim
01:24:02*avsej quit (Changing host)
01:24:02*avsej joined #nim
01:24:40*oprypin joined #nim
01:31:07zacharycarter[m]hrm
01:31:41zacharycarter[m]anyone ever encountered this before - `Couldn't apply expression side effects : Couldn't dematerialize a result variable: couldn't read its memory` ?
01:43:18*yglukhov[i] joined #nim
01:47:27*yglukhov[i] quit (Ping timeout: 240 seconds)
01:53:05*Ven`` quit (Ping timeout: 268 seconds)
01:54:20*Ven`` joined #nim
01:58:08*yglukhov[i] joined #nim
02:02:32*Ven`` quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
02:02:35*yglukhov[i] quit (Ping timeout: 240 seconds)
02:13:04*yglukhov[i] joined #nim
02:17:27*yglukhov[i] quit (Ping timeout: 240 seconds)
02:25:13*zacharycarter[m] sent a long message: < https://matrix.org/_matrix/media/v1/download/matrix.org/gXTcyyzoZvPmPyRUFabgnNDk >
02:25:19zacharycarter[m]trying to use pinnedSpawn
02:25:58zacharycarter[m]https://gist.github.com/zacharycarter/520a4433c69dda9ac9eb741c4a88982c
02:28:08*yglukhov[i] joined #nim
02:32:30*yglukhov[i] quit (Ping timeout: 256 seconds)
02:43:09*yglukhov[i] joined #nim
02:47:45*yglukhov[i] quit (Ping timeout: 264 seconds)
02:48:08zacharycarter[m]ooph I have no idea what pinnedSpawn does
02:48:09zacharycarter[m]compiler magic
02:58:19*yglukhov[i] joined #nim
03:03:23*yglukhov[i] quit (Ping timeout: 268 seconds)
03:11:23*endragor joined #nim
03:18:28*yglukhov[i] joined #nim
03:22:56*yglukhov[i] quit (Ping timeout: 256 seconds)
03:26:39FromGitter<Varriount> zacharycarter: It pins down all the bugs that spawn from a program. :P
03:28:16*yglukhov[i] joined #nim
03:32:59*yglukhov[i] quit (Ping timeout: 268 seconds)
03:43:18*yglukhov[i] joined #nim
03:47:44*yglukhov[i] quit (Ping timeout: 256 seconds)
03:58:14*yglukhov[i] joined #nim
04:02:39*yglukhov[i] quit (Ping timeout: 260 seconds)
04:09:40zacharycarter[m]hehe
04:28:15*yglukhov[i] joined #nim
04:30:44zacharycarter[m]well... it almost works - https://gist.github.com/zacharycarter/3ded19677f0583d35fb734c3b5e15616
04:31:12zacharycarter[m]something is blocking though by the joinThread calls :/
04:33:04*yglukhov[i] quit (Ping timeout: 256 seconds)
04:43:25*yglukhov[i] joined #nim
04:47:29*yglukhov[i] quit (Ping timeout: 248 seconds)
04:58:15*yglukhov[i] joined #nim
05:02:45*yglukhov[i] quit (Ping timeout: 264 seconds)
05:27:36*leorize quit (Ping timeout: 256 seconds)
05:28:18*yglukhov[i] joined #nim
05:28:26*nsf joined #nim
05:28:27*arecaceae quit (Remote host closed the connection)
05:28:45*arecaceae joined #nim
05:32:46*yglukhov[i] quit (Ping timeout: 244 seconds)
05:43:19*yglukhov[i] joined #nim
05:47:49*yglukhov[i] quit (Ping timeout: 260 seconds)
05:50:06*leorize joined #nim
05:58:17*yglukhov[i] joined #nim
06:02:45*yglukhov[i] quit (Ping timeout: 264 seconds)
06:03:52*leorize quit (Quit: WeeChat 2.2)
06:07:45*leorize joined #nim
06:13:30*yglukhov[i] joined #nim
06:18:31*yglukhov[i] quit (Ping timeout: 276 seconds)
06:28:28*yglukhov[i] joined #nim
06:32:45*yglukhov[i] quit (Ping timeout: 245 seconds)
06:43:06*yglukhov[i] joined #nim
06:47:56*yglukhov[i] quit (Ping timeout: 256 seconds)
06:48:38*Vladar joined #nim
06:49:01*wildlander quit (Quit: Konversation terminated!)
06:58:26*yglukhov[i] joined #nim
07:02:45*yglukhov[i] quit (Ping timeout: 245 seconds)
07:13:24*yglukhov[i] joined #nim
07:17:42*tzekid joined #nim
07:17:59*yglukhov[i] quit (Ping timeout: 255 seconds)
07:24:30*tzekid quit (Ping timeout: 252 seconds)
07:27:23*Vladar quit (Quit: Leaving)
07:39:18*yglukhov[i] joined #nim
07:42:42*Vladar joined #nim
07:45:19FromGitter<mratsim> btw, I suppose createThread doesn’t compile on JS (i.e. is implemented as a web worker), is it planned?
07:45:40Araqnot on my radar
07:54:10FromGitter<mratsim> btw, I’m surprised there are codepath where the compiler can just quit/crash with no internal error or segfault: https://github.com/nim-lang/Nim/issues/8432#issuecomment-408591628
08:02:38*dddddd joined #nim
08:03:35*gmpreussner quit (Remote host closed the connection)
08:04:05*gmpreussner joined #nim
08:13:08FromGitter<gogolxdong> How to lower the first letter of a word?
08:15:45AraqtoLower(s[0]) & s[1 .. ^1]
08:15:57Araqmratsim: stack overflow?
08:18:56FromGitter<mratsim> I thought this was catched when the stack limit was reached
08:19:09FromGitter<gogolxdong> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b5ec9fd33154658457ae96b]
08:19:14FromGitter<mratsim> the one that was raised to 1 billion or something
08:19:41Araqah yeah, will revert it to something sane
08:19:53Araq50 million perhaps
08:20:10FromGitter<mratsim> 1) 337 million :P
08:20:24Araqwhy that number?
08:20:34FromGitter<mratsim> 1337 —> LEET —> Elite ;)
08:21:14Araq137 million then
08:21:55Araqhttps://en.wikipedia.org/wiki/Fine-structure_constant
08:23:01Araqsomebody needs to bring math multiletter variables
08:23:43Araqwhere:
08:23:43Araqe is the elementary charge;
08:23:43Araqπ is the mathematical constant pi;
08:23:43Araqħ =
08:23:44Araqh
08:23:45Araq
08:23:46Araq is the reduced Planck constant;
08:23:50Araqc is the speed of light in vacuum;
08:23:52Araqε0 is the electric constant or permittivity of free space;
08:24:03Araqthis is ridiculous
08:25:03AraqI don't mind short notations but their way has a serious scalability problem
08:25:57Araqesp since everbody knows 'e' is Euler's number, not the "elementary charge"
08:29:46FromGitter<mratsim> Well Fortran is not that extreme but still in the past 6 letters/numbers for an identifier: http://www.chem.ox.ac.uk/fortran/subprograms.html ⏎ ⏎ > Function names follow the same rules as for variable names: less than six letters or numbers and beginning with a letter.
08:32:24AraqI'm sure later versions of Fortran allow for more letters
08:39:58FromGitter<Bennyelg> ```const ⏎ x = 5 ⏎ ⏎ proc hello() = ⏎ echo(x)``` ⏎ ⏎ x should be global am I wrong ? [https://gitter.im/nim-lang/Nim?at=5b5ecedebf754466066f0cd8]
08:43:53AraqI'm sure this code compiles. what do you mean?
08:44:42FromGitter<Bennyelg> it's an example because I have some bigger code sample and I get something like ⏎ lib/pure/os.nim(275, 10) Error: cannot 'importc' variable at compile time
08:44:57FromGitter<Bennyelg> my const is ⏎ ⏎ ```migrationsDir = joinPath(getCurrentDir(), "migrations")``` [https://gitter.im/nim-lang/Nim?at=5b5ed009defc9823f5250b15]
08:45:14AraqgetCurrentDir() is not constable
08:45:33Araqand shouldn't, I like binaries that are not tied to your personal /home directory
08:45:54FromGitter<Bennyelg> yea now when I am over thinking about it I am stupid
08:45:55FromGitter<Bennyelg> thanks
08:53:58*BitPuffin joined #nim
08:54:29FromGitter<gogolxdong> How to make $ of xmltree not adding escaped attribution? or is there another way to post soap request?
08:59:07Araqwhy do the escapes harm? sounds to me $ does the right thing
09:03:12FromGitter<gogolxdong> ```fmt"""<Login xmlns=\"urn:vim25\"><_this type=\"SessionManager\">...``` ⏎ ⏎ doesn't. [https://gitter.im/nim-lang/Nim?at=5b5ed450d4527523f63e4fc0]
09:03:43FromGitter<gogolxdong> latter was generated from macro.
09:05:43Araqseems macro's $ is buggy then?
09:06:40FromGitter<gogolxdong> ```code paste, see link```
09:06:50FromGitter<gogolxdong> if it helps.
09:07:36FromGitter<gogolxdong> but I found `$` in xmltree does addEscapedAttr.
09:12:01FromGitter<gogolxdong> and body.attrs = newStringTable("xmlns","urn:vim25", modeCaseSensitive)
09:16:51FromGitter<gogolxdong> should xml attribution be escaped in `$`?
09:19:54Araqwhy shouldn't they?
09:22:31FromGitter<gogolxdong> then how to stop them being escaped?
09:22:50AraqI think macros' $ adds more escaping, making it wrong
09:25:22FromGitter<gogolxdong> you mean `$` in macro cause additional escaping?
09:26:12Araqyep.
09:28:05FromGitter<gogolxdong> didn't think of that.
09:28:49FromGitter<gogolxdong> how to check.
09:31:12*xet7 joined #nim
09:33:14Araqwell I just checked, that doesn't seem to be the case
09:33:25*fvs` joined #nim
09:33:28*ng0 joined #nim
09:33:59*fvs quit (Remote host closed the connection)
09:41:45FromGitter<gogolxdong> There are a lot of generated code like this, couldn't edit manually.
09:43:13Araqwell one way is to edit lib/pure/xmltree.nim
09:43:35Araq result.add("=???")
09:43:35Araq result.addEscapedAttr(val)
09:43:35Araq result.add('?')
09:43:47Araqand see if these are your "wrong" quotes
09:46:10*floppydh joined #nim
09:48:22dave24The escape \n becoming \p has affected parsecfg I think.
09:56:52Araqhow so?
10:11:03FromGitter<gogolxdong> yes, it becomes ``` var body = "<RetrievePropertiesEx xmlns=\"=???urn:vim25?\">\n <_this type=\"=???PropertyCollector?\">```
10:13:56*aguspiza joined #nim
10:15:24FromGitter<gogolxdong> ``` result.add("=") ⏎ result.addEscapedAttr(val) ⏎ # result.add('"')``` [https://gitter.im/nim-lang/Nim?at=5b5ee53c33154658457b57b2]
10:15:28FromGitter<gogolxdong> works
10:15:41Araqbut where does the \" come from?
10:16:07*noonien joined #nim
10:16:23FromGitter<gogolxdong> it was ⏎ ⏎ ```result.add("=\"")``` [https://gitter.im/nim-lang/Nim?at=5b5ee57633154658457b593c]
10:16:40FromGitter<Araq> that doesn't add a backslash
10:17:20FromGitter<gogolxdong> don't know but works.
10:20:02*leorize quit (Ping timeout: 244 seconds)
10:26:43FromGitter<gogolxdong> no ,it doesn't, lack of a pair of ""
10:27:17FromGitter<gogolxdong> becomes <Login xmlns=urn:vim25>\n<_this type=SessionManager>
10:29:21FromGitter<gogolxdong> yes, I don't know where does the \ come from.
10:30:13FromGitter<gogolxdong> there is a hiden issue.
10:35:01FromGitter<gogolxdong> @Araq do you know?
10:36:51FromGitter<Araq> well system.$ does that for compound types
10:39:54FromGitter<gogolxdong> you mean addQuoted*?
10:40:53FromGitter<gogolxdong> I found `proc `$`*T: tuple|object (x: T): string`
10:41:38FromGitter<gogolxdong> others in system.nim doesn't seem to apply to XmlNode.
10:43:33FromGitter<gogolxdong> I think it uses `$` of xmltree instead of system.$.
10:44:26*wildlander joined #nim
10:44:27*wildlander quit (Changing host)
10:44:27*wildlander joined #nim
10:48:56*NimBot joined #nim
10:51:52*ahmed____ joined #nim
10:53:52FromGitter<gogolxdong> I'm using `bodyXml.add(body,indWidth=0,addNewLines=false)`
10:54:19FromGitter<gogolxdong> got <Login xmlns=\"urn:vim25\"><_this type=\"SessionManager\">
11:00:41FromGitter<gogolxdong> it's the expected at the end of add.
11:07:36FromGitter<gogolxdong> it will add \ when using repr.
11:09:12FromGitter<gogolxdong> I write the generated code to file using result.add newLetStmt(newIdentNode("methods"), newLit repr wsdlModule)
11:10:36FromGitter<gogolxdong> probably comes out of here. so is there another way to write this output to file?
11:11:21FromGitter<gogolxdong> instead of repr
11:11:37*Arrrr joined #nim
11:17:44*ng0 quit (Quit: Alexa, when is the end of world?)
11:26:18*Arrrr quit (Ping timeout: 256 seconds)
11:28:23*Arrrr joined #nim
11:34:35FromGitter<Araq> don't repr it?
11:44:57*Arrrr quit (Ping timeout: 240 seconds)
11:45:20Araqplease give me a reproducible example
11:47:06*MyMind joined #nim
11:47:16*Sembei quit (Ping timeout: 256 seconds)
11:53:27*leorize joined #nim
12:01:55dave24Araq: sorry, afk. I meant on windows it uses \n resulting in single line ini files.
12:04:11Araqdave24, I want \L on Windows too fwiw, less problems with 'git diff' and other crappy tools
12:05:40dave24So it's intentional?
12:05:56Araqmostly. :-)
12:06:32dave24hm, it's a bit odd for configuration files on windows. A user would expect to be able to edit them with notepad probably.
12:06:43dave24Not that I would know, I don't really use windows.
12:07:05AraqWindows users use notepad++ or deserve the suffering
12:07:26dave24lel
12:07:54dave24well, if you're aware of it and don't mind then I don't care either.
12:08:17Araqand I heard recent versions of notepad understand Unix newlines
12:08:34Araqso eventually even 'notepad' will be able to handle it
12:09:13Araqbut we could add an option to the ini emitter
12:12:34FromGitter<gogolxdong> @Araq ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b5f00b2cb4d5b036ca7458f]
12:25:23*Ven`` joined #nim
12:26:05*Vladar quit (Remote host closed the connection)
12:26:31*Ven` joined #nim
12:29:21*yglukhov[i] quit (Ping timeout: 248 seconds)
12:30:05*Ven`` quit (Ping timeout: 256 seconds)
12:35:13*yglukhov[i] joined #nim
12:51:06*adeohluwa joined #nim
12:51:35*Vladar joined #nim
12:55:05*endragor quit (Remote host closed the connection)
12:56:23zacharycarter[m]anyone have a decent way to debug what thread is holding up a joinThreads call?
12:58:10*endragor joined #nim
13:00:13*Ven` quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
13:01:34*ahmed____ quit (Quit: Connection closed for inactivity)
13:02:46*endragor quit (Ping timeout: 260 seconds)
13:09:52*endragor joined #nim
13:14:38*endragor quit (Ping timeout: 265 seconds)
13:16:50FromGitter<Bennyelg> TDD (Test driven development) in nim
13:17:08FromGitter<Bennyelg> do we have any testing framework to ease the development in such method ?
13:19:44Araqtestament?
13:20:47FromGitter<mratsim> Some kind of robot that slaps you if you don’t test a new proc/type?
13:21:03FromGitter<mratsim> Otherwise this is super useful: https://github.com/alehander42/nim-quicktest
13:22:04FromGitter<Bennyelg> I''ll look into thanks
13:23:18FromGitter<mratsim> Or are you thinking about something like this? https://crystal-lang.org/api/0.25.1/Spec.html
13:33:49*SenasOzys joined #nim
13:35:15*SenasOzys quit (Remote host closed the connection)
13:35:35FromGitter<Bennyelg> thanks
13:35:37FromGitter<Bennyelg> yes
13:35:38FromGitter<Bennyelg> i do
13:36:24FromGitter<Bennyelg> Anyway to get the basename of some path for example: ⏎ let fullPath = '/Users/benny/Desktop/file.x' ⏎ baseName(fullPath) will result => file.x
13:36:47*arecaceae quit (Read error: Connection reset by peer)
13:37:05*arecaceae joined #nim
13:38:02FromGitter<mratsim> currentSourcePath
13:38:55FromGitter<Bennyelg> not such a connivance name python basename is much cleaner dont you think ? ⏎ thanks anyway!
13:38:55FromGitter<mratsim> ah sorry misunderstood.
13:39:13FromGitter<mratsim> it’s for any path, not just the file being compiled right?
13:39:34FromGitter<mratsim> https://nim-lang.org/docs/ospaths.html#extractFilename,string
13:40:03FromGitter<Bennyelg> pohh Oo How did I missed that
13:41:34*^GaveUp^ joined #nim
13:41:44*GaveUp quit (Ping timeout: 256 seconds)
13:41:45*^GaveUp^ is now known as GaveUp
13:44:59*GaveUp quit (Read error: Connection reset by peer)
13:45:11*GaveUp joined #nim
13:55:08Araqwe need basename, nexusname and hivename
14:04:36*cryptocat1094 joined #nim
14:07:51*yglukhov[i] quit (Remote host closed the connection)
14:08:26*yglukhov[i] joined #nim
14:09:03FromGitter<gogolxdong> @Araq ,put the string literals in nnkTripleStrLit rather than using newLit solve the problem.
14:10:00zacharycarter[m]how can I figure out where : `SIGSEGV: Illegal storage access. (Attempt to read from nil?)` is being thrown during compilation?
14:12:54*yglukhov[i] quit (Ping timeout: 256 seconds)
14:20:41Araqzacharycarter[m], koch temp c foo.nim
14:23:06zacharycarter[m]thanks
14:26:10*yglukhov[i] joined #nim
14:33:39*drazan quit (Remote host closed the connection)
14:34:06*drazan joined #nim
14:50:22*Vladar quit (Quit: Leaving)
14:57:19*Vladar joined #nim
14:57:44*brainproxy quit (Ping timeout: 260 seconds)
15:00:35*adeohluwa quit (Quit: Connection closed for inactivity)
15:09:09FromGitter<gogolxdong> Though I tried transform the same thing to json data and found it unviable, found this ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ doesn't work in packejson ,and otherwise in json. [https://gitter.im/nim-lang/Nim?at=5b5f2a1520d248394f672f75]
15:11:31*elrood joined #nim
15:16:01*icebattle joined #nim
15:19:24FromGitter<Bennyelg> funny thing
15:19:34FromGitter<Bennyelg> I wanted argparser I import parseopt2
15:19:51FromGitter<Bennyelg> and I got a deprecated message use parseopt
15:20:07FromGitter<Bennyelg> Oo why it's not the other way around
15:22:53dom96Politics
15:24:42*brainproxy joined #nim
15:25:08FromGitter<mratsim> renaming
15:25:44FromGitter<mratsim> cligen is good for arg parsing these days
15:28:42*Vladar quit (Quit: Leaving)
15:33:20*Vladar joined #nim
15:52:43*Vladar quit (Quit: Leaving)
15:52:46FromGitter<neckbosov> Why is system.cmp not used by default in sort, isSorted, binarySearch,etc?
15:54:36FromGitter<mratsim> maybe at the time you couldn’t pass closure/proc as default param
15:55:13FromGitter<mratsim> Also I think the arg shouldn’t be a closure, but it should be a {.nimcall.} for efficiency.
15:56:18FromGitter<neckbosov> Hmm, this code ⏎ `proc introSortT (a: var openArray[T], cmp: proc (x, y: T): int {.closure.} = system.cmp)` ⏎ successfully compiles
15:57:24*Vladar joined #nim
16:02:59*endragor joined #nim
16:09:42*Trustable joined #nim
16:13:28*natrys joined #nim
16:16:33*Ven`` joined #nim
16:17:05*aguspiza quit (Ping timeout: 248 seconds)
16:31:30*endragor quit (Remote host closed the connection)
16:34:07*clem16 joined #nim
16:38:19*Ven`` quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
16:38:58*clem16 quit (Quit: leaving)
16:40:44*Ven`` joined #nim
16:53:21*endragor joined #nim
16:57:24*nyeaa joined #nim
17:19:18*endragor quit (Remote host closed the connection)
17:23:03*dorelix joined #nim
17:24:00*Vladar quit (Quit: Leaving)
17:24:18*natrys quit (Quit: natrys)
17:29:54*Vladar joined #nim
17:33:50*rockcavera quit (Remote host closed the connection)
17:37:04*superbia joined #nim
17:38:23*superbia quit (Client Quit)
17:38:34*superbia joined #nim
17:39:12*superbia quit (Client Quit)
17:40:27*captainkraft joined #nim
17:42:57*Ven`` quit (Ping timeout: 240 seconds)
17:48:06*Ven`` joined #nim
18:00:49*chopzwei joined #nim
18:02:31*toofly[m] joined #nim
18:03:31FromGitter<kayabaNerve> ```import BN ⏎ ⏎ while true: ⏎ discard newBN(100)``` ⏎ ⏎ As long as BN has a destructor, the GC should stop this, correct? [https://gitter.im/nim-lang/Nim?at=5b5f52f333154658457daa33]
18:03:54FromGitter<kayabaNerve> Because I'm at 700 MB and rising and would like to verify it's BN and not the fact my code is written as so.
18:04:47*Ven`` quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
18:06:48*icebattle quit (Ping timeout: 268 seconds)
18:11:17*chopzwei left #nim ("Leaving")
18:13:59*icebattle joined #nim
18:13:59FromGitter<mratsim> destructors are for objects, while GC is for ref objects, seq and strings
18:14:25FromGitter<kayabaNerve> @mratsim This is for a ref object that's wrapping a C struct.
18:14:54FromGitter<mratsim> can you run that in a main() proc, global var live as long as the program.
18:14:59FromGitter<kayabaNerve> I'm trying to get the Nim GC to call the C... 'destructor' function the lib has.
18:15:00FromGitter<kayabaNerve> K
18:15:57FromGitter<mratsim> so when you call new, you also pass a finalizer with the proper release/destroy proc?
18:16:36FromGitter<kayabaNerve> ```code paste, see link``` ⏎ ⏎ 100 MB and rising. [https://gitter.im/nim-lang/Nim?at=5b5f56043cc395660732f8d6]
18:16:44FromGitter<kayabaNerve> I don't call new; I call a C init function.
18:19:44FromGitter<mratsim> I mean something like that: https://github.com/status-im/nim-eth-keys/blob/master/eth_keys/libsecp256k1.nim#L65-L72 ⏎ ⏎ 1) secp256k1_context_destroy is provided by the C lib, I wrap it in a shutdownLibsecp256k1, that is passed as a finalizer to `new(result, shutdownLibsecp256k1)` in the `newEthKeysContext` proc
18:20:01FromGitter<kayabaNerve> Got it
18:20:57FromGitter<kayabaNerve> So switch BN() to new(result, destroy)
18:25:22FromGitter<kayabaNerve> @mratsim Progress! Thank you.
18:36:41FromGitter<kayabaNerve> @mratsim So I got my destroy func except now it's not allocating memory
18:37:31FromGitter<mratsim> you probably need to pass result.addr to your C creation function
18:37:56FromGitter<mratsim> or result = newBN if it was what you wanted to do, after you initialized it with new
18:38:03FromGitter<kayabaNerve> One sec...
18:39:14*icebattle quit (Ping timeout: 260 seconds)
18:40:15FromGitter<kayabaNerve> ```code paste, see link``` ⏎ ⏎ My destroy function just dealloc's the one pointer in the struct since the C calls failed with no traceback. It's in a try/catch just because I don't want every BN function to have to raise "Exception". If I don't have that `if` statement, it works a few times before failing. With that if statement, on its first run, I get `virtualFree failing!Error: execution of an external
18:40:15FromGitter... program failed: 'build'` [https://gitter.im/nim-lang/Nim?at=5b5f5b8f3cc3956607330b30]
18:41:25FromGitter<kayabaNerve> I changed over to the C++ backend; now it works a few times before complaining: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b5f5bd5bf7544660671ea53]
18:41:58*nyeaa quit (Quit: Leaving)
18:43:06FromGitter<mratsim> if not x.isNil
18:43:43FromGitter<mratsim> you want to finalize the BN type, not the BN.number.digits field
18:44:13FromGitter<mratsim> if needed this digits field should have it’s own finalizer
18:44:25FromGitter<kayabaNerve> I want to get rid of the pointer in the struct that BN is a wrapper of.
18:44:48FromGitter<mratsim> ah.
18:44:57FromGitter<kayabaNerve> BN = `ref object` ⏎ number = `{.bycopy.} = object` ⏎ digits: ptr cuint
18:45:26FromGitter<kayabaNerve> I'm pretty sure that ptr IS the memory leak.
18:47:05FromGitter<kayabaNerve> Expanded the if to if not (x.isNil or x.number.digits.isNil); it runs longer but still has SIGSEGVs. I can't check if the number is nil though
18:47:17FromGitter<mratsim> This is probably the thing that most match your need, the array/pointer is allocated on GPU but on CPU it’s easier ;): https://github.com/mratsim/Arraymancer/blob/master/src/tensor/backend/cuda.nim#L23-L40. ⏎ ⏎ With Cuda Storage there: https://github.com/mratsim/Arraymancer/blob/master/src/tensor/data_structure.nim#L50-L58
18:47:39FromGitter<mratsim> Or this one is pure CPU: https://github.com/mratsim/Arraymancer/blob/master/src/tensor/fallback/blas_l3_gemm_data_structure.nim#L17-L30
18:48:03FromGitter<mratsim> and there is subfield deallocation as well via deallocShared
18:48:21FromGitter<kayabaNerve> I just want to stop the memory leak :P
18:51:42FromGitter<kayabaNerve> So you wrapped every ptr in ref and deallocShared'd the ref[] ?
18:51:52FromGitter<kayabaNerve> I can't do that. The ptr is in a C struct
19:00:25FromGitter<kayabaNerve> @mratsim Separating the joint if system did a lot; helped increase the count to almost 100.
19:01:35*Vladar quit (Quit: Leaving)
19:12:55*Vladar joined #nim
19:16:37*neckbosov joined #nim
19:17:15*neckbosov quit (Client Quit)
19:18:58*Vladar quit (Quit: Leaving)
19:22:34*rockcavera joined #nim
19:24:38FromGitter<kayabaNerve> @mratsim What if I realloc it to 1 byte and then dealloc it?
19:25:28FromGitter<mratsim> you can try but doesn’t the C lib manage the pointers internal to its struct?
20:00:16*Trustable quit (Remote host closed the connection)
20:26:25*stefanos82 joined #nim
20:42:31*noonien quit (Quit: Connection closed for inactivity)
20:52:23FromGitter<Varriount> @kayabaNerve What are you wrapping?
20:54:25Araqyay, I think I finally fixed that GC regression :-)
20:57:34*nsf quit (Quit: WeeChat 2.2)
20:59:25*Ven`` joined #nim
21:06:53*cryptocat1094 quit (Quit: later)
21:08:18FromGitter<kayabaNerve> The imath C lib.
21:13:25FromGitter<kayabaNerve> At this point, I have better things to do, it's not critical, and I'll make a bounty for it.
21:15:12dom96Boom: https://github.com/dom96/texttospeech
21:17:01Araqnice. I used something like that when I was 18 :-)
21:17:28Araqwas a COM thing for Windows back then, I imported the lib into Delphi and it just worked
21:18:06Araqthose were the days... software that worked
21:20:11dom96Yeah, you need to sign up into Google's ecosystem for this
21:20:32dom96But the text to speech is very good
21:20:59Araqwhat's your use case? secret?
21:23:50dom96yep :)
21:24:15dom96For my use case the quality isn't super important, but it does help
21:45:29*Jesin joined #nim
21:59:22FromGitter<rayman22201> move over Alexa, the Nim powered smart home is coming :-P
22:09:55*BitPuffin quit (Remote host closed the connection)
22:14:24*elrood quit (Quit: Leaving)
22:18:18*abeaumont joined #nim
22:30:24*Ven`` quit (Ping timeout: 260 seconds)
22:36:03*Ven`` joined #nim
22:47:52*icebattle joined #nim
22:48:01FromGitter<kayabaNerve> ^^
22:54:50FromDiscord<treeform> Hmm when I open 8 threads, everything works on my macOS computer, but when I open 9, 9th thread never runs. Even though 8 threads that spawned before are sleeping.
22:55:29*Ven`` quit (Ping timeout: 248 seconds)
22:55:35*Ven` joined #nim
22:55:49*yglukhov[i] quit (Remote host closed the connection)
23:02:25*Ven` quit (Ping timeout: 248 seconds)
23:04:46*Jesin quit (Quit: Leaving)
23:12:12FromDiscord<treeform> even with: setMaxPoolSize(100)
23:12:38FromDiscord<treeform> but if threads exit, i can start more threads
23:20:52FromDiscord<treeform> If i use threads instead of threadpool it works fine with more threads
23:22:55FromDiscord<treeform> just threads without pool appear to work even with 999 threads...
23:23:05FromDiscord<treeform> way more then I would need
23:35:08stefanos82@treeform: you can read more here https://github.com/nim-lang/Nim/issues/5499
23:36:30FromDiscord<treeform> interesting
23:36:55FromDiscord<treeform> so what is the use for a thread pool then?
23:37:04FromDiscord<treeform> its more like a "corepool"
23:39:22*xet7 quit (Quit: Leaving)
23:49:18stefanos82@treeform: based on the official documentation, the default value of setMaxPoolSize is MaxThreadPoolSize which is 256 threads