| 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:19 | zacharycarter[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:58 | zacharycarter[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:07 | zacharycarter[m] | hrm |
| 01:31:41 | zacharycarter[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:19 | zacharycarter[m] | trying to use pinnedSpawn |
| 02:25:58 | zacharycarter[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:08 | zacharycarter[m] | ooph I have no idea what pinnedSpawn does |
| 02:48:09 | zacharycarter[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:39 | FromGitter | <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:40 | zacharycarter[m] | hehe |
| 04:28:15 | * | yglukhov[i] joined #nim |
| 04:30:44 | zacharycarter[m] | well... it almost works - https://gist.github.com/zacharycarter/3ded19677f0583d35fb734c3b5e15616 |
| 04:31:12 | zacharycarter[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:19 | FromGitter | <mratsim> btw, I suppose createThread doesn’t compile on JS (i.e. is implemented as a web worker), is it planned? |
| 07:45:40 | Araq | not on my radar |
| 07:54:10 | FromGitter | <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:08 | FromGitter | <gogolxdong> How to lower the first letter of a word? |
| 08:15:45 | Araq | toLower(s[0]) & s[1 .. ^1] |
| 08:15:57 | Araq | mratsim: stack overflow? |
| 08:18:56 | FromGitter | <mratsim> I thought this was catched when the stack limit was reached |
| 08:19:09 | FromGitter | <gogolxdong> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b5ec9fd33154658457ae96b] |
| 08:19:14 | FromGitter | <mratsim> the one that was raised to 1 billion or something |
| 08:19:41 | Araq | ah yeah, will revert it to something sane |
| 08:19:53 | Araq | 50 million perhaps |
| 08:20:10 | FromGitter | <mratsim> 1) 337 million :P |
| 08:20:24 | Araq | why that number? |
| 08:20:34 | FromGitter | <mratsim> 1337 —> LEET —> Elite ;) |
| 08:21:14 | Araq | 137 million then |
| 08:21:55 | Araq | https://en.wikipedia.org/wiki/Fine-structure_constant |
| 08:23:01 | Araq | somebody needs to bring math multiletter variables |
| 08:23:43 | Araq | where: |
| 08:23:43 | Araq | e is the elementary charge; |
| 08:23:43 | Araq | π is the mathematical constant pi; |
| 08:23:43 | Araq | ħ = |
| 08:23:44 | Araq | h |
| 08:23:45 | Araq | 2π |
| 08:23:46 | Araq | is the reduced Planck constant; |
| 08:23:50 | Araq | c is the speed of light in vacuum; |
| 08:23:52 | Araq | ε0 is the electric constant or permittivity of free space; |
| 08:24:03 | Araq | this is ridiculous |
| 08:25:03 | Araq | I don't mind short notations but their way has a serious scalability problem |
| 08:25:57 | Araq | esp since everbody knows 'e' is Euler's number, not the "elementary charge" |
| 08:29:46 | FromGitter | <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:24 | Araq | I'm sure later versions of Fortran allow for more letters |
| 08:39:58 | FromGitter | <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:53 | Araq | I'm sure this code compiles. what do you mean? |
| 08:44:42 | FromGitter | <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:57 | FromGitter | <Bennyelg> my const is ⏎ ⏎ ```migrationsDir = joinPath(getCurrentDir(), "migrations")``` [https://gitter.im/nim-lang/Nim?at=5b5ed009defc9823f5250b15] |
| 08:45:14 | Araq | getCurrentDir() is not constable |
| 08:45:33 | Araq | and shouldn't, I like binaries that are not tied to your personal /home directory |
| 08:45:54 | FromGitter | <Bennyelg> yea now when I am over thinking about it I am stupid |
| 08:45:55 | FromGitter | <Bennyelg> thanks |
| 08:53:58 | * | BitPuffin joined #nim |
| 08:54:29 | FromGitter | <gogolxdong> How to make $ of xmltree not adding escaped attribution? or is there another way to post soap request? |
| 08:59:07 | Araq | why do the escapes harm? sounds to me $ does the right thing |
| 09:03:12 | FromGitter | <gogolxdong> ```fmt"""<Login xmlns=\"urn:vim25\"><_this type=\"SessionManager\">...``` ⏎ ⏎ doesn't. [https://gitter.im/nim-lang/Nim?at=5b5ed450d4527523f63e4fc0] |
| 09:03:43 | FromGitter | <gogolxdong> latter was generated from macro. |
| 09:05:43 | Araq | seems macro's $ is buggy then? |
| 09:06:40 | FromGitter | <gogolxdong> ```code paste, see link``` |
| 09:06:50 | FromGitter | <gogolxdong> if it helps. |
| 09:07:36 | FromGitter | <gogolxdong> but I found `$` in xmltree does addEscapedAttr. |
| 09:12:01 | FromGitter | <gogolxdong> and body.attrs = newStringTable("xmlns","urn:vim25", modeCaseSensitive) |
| 09:16:51 | FromGitter | <gogolxdong> should xml attribution be escaped in `$`? |
| 09:19:54 | Araq | why shouldn't they? |
| 09:22:31 | FromGitter | <gogolxdong> then how to stop them being escaped? |
| 09:22:50 | Araq | I think macros' $ adds more escaping, making it wrong |
| 09:25:22 | FromGitter | <gogolxdong> you mean `$` in macro cause additional escaping? |
| 09:26:12 | Araq | yep. |
| 09:28:05 | FromGitter | <gogolxdong> didn't think of that. |
| 09:28:49 | FromGitter | <gogolxdong> how to check. |
| 09:31:12 | * | xet7 joined #nim |
| 09:33:14 | Araq | well 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:45 | FromGitter | <gogolxdong> There are a lot of generated code like this, couldn't edit manually. |
| 09:43:13 | Araq | well one way is to edit lib/pure/xmltree.nim |
| 09:43:35 | Araq | result.add("=???") |
| 09:43:35 | Araq | result.addEscapedAttr(val) |
| 09:43:35 | Araq | result.add('?') |
| 09:43:47 | Araq | and see if these are your "wrong" quotes |
| 09:46:10 | * | floppydh joined #nim |
| 09:48:22 | dave24 | The escape \n becoming \p has affected parsecfg I think. |
| 09:56:52 | Araq | how so? |
| 10:11:03 | FromGitter | <gogolxdong> yes, it becomes ``` var body = "<RetrievePropertiesEx xmlns=\"=???urn:vim25?\">\n <_this type=\"=???PropertyCollector?\">``` |
| 10:13:56 | * | aguspiza joined #nim |
| 10:15:24 | FromGitter | <gogolxdong> ``` result.add("=") ⏎ result.addEscapedAttr(val) ⏎ # result.add('"')``` [https://gitter.im/nim-lang/Nim?at=5b5ee53c33154658457b57b2] |
| 10:15:28 | FromGitter | <gogolxdong> works |
| 10:15:41 | Araq | but where does the \" come from? |
| 10:16:07 | * | noonien joined #nim |
| 10:16:23 | FromGitter | <gogolxdong> it was ⏎ ⏎ ```result.add("=\"")``` [https://gitter.im/nim-lang/Nim?at=5b5ee57633154658457b593c] |
| 10:16:40 | FromGitter | <Araq> that doesn't add a backslash |
| 10:17:20 | FromGitter | <gogolxdong> don't know but works. |
| 10:20:02 | * | leorize quit (Ping timeout: 244 seconds) |
| 10:26:43 | FromGitter | <gogolxdong> no ,it doesn't, lack of a pair of "" |
| 10:27:17 | FromGitter | <gogolxdong> becomes <Login xmlns=urn:vim25>\n<_this type=SessionManager> |
| 10:29:21 | FromGitter | <gogolxdong> yes, I don't know where does the \ come from. |
| 10:30:13 | FromGitter | <gogolxdong> there is a hiden issue. |
| 10:35:01 | FromGitter | <gogolxdong> @Araq do you know? |
| 10:36:51 | FromGitter | <Araq> well system.$ does that for compound types |
| 10:39:54 | FromGitter | <gogolxdong> you mean addQuoted*? |
| 10:40:53 | FromGitter | <gogolxdong> I found `proc `$`*T: tuple|object (x: T): string` |
| 10:41:38 | FromGitter | <gogolxdong> others in system.nim doesn't seem to apply to XmlNode. |
| 10:43:33 | FromGitter | <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:52 | FromGitter | <gogolxdong> I'm using `bodyXml.add(body,indWidth=0,addNewLines=false)` |
| 10:54:19 | FromGitter | <gogolxdong> got <Login xmlns=\"urn:vim25\"><_this type=\"SessionManager\"> |
| 11:00:41 | FromGitter | <gogolxdong> it's the expected at the end of add. |
| 11:07:36 | FromGitter | <gogolxdong> it will add \ when using repr. |
| 11:09:12 | FromGitter | <gogolxdong> I write the generated code to file using result.add newLetStmt(newIdentNode("methods"), newLit repr wsdlModule) |
| 11:10:36 | FromGitter | <gogolxdong> probably comes out of here. so is there another way to write this output to file? |
| 11:11:21 | FromGitter | <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:35 | FromGitter | <Araq> don't repr it? |
| 11:44:57 | * | Arrrr quit (Ping timeout: 240 seconds) |
| 11:45:20 | Araq | please 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:55 | dave24 | Araq: sorry, afk. I meant on windows it uses \n resulting in single line ini files. |
| 12:04:11 | Araq | dave24, I want \L on Windows too fwiw, less problems with 'git diff' and other crappy tools |
| 12:05:40 | dave24 | So it's intentional? |
| 12:05:56 | Araq | mostly. :-) |
| 12:06:32 | dave24 | hm, 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:43 | dave24 | Not that I would know, I don't really use windows. |
| 12:07:05 | Araq | Windows users use notepad++ or deserve the suffering |
| 12:07:26 | dave24 | lel |
| 12:07:54 | dave24 | well, if you're aware of it and don't mind then I don't care either. |
| 12:08:17 | Araq | and I heard recent versions of notepad understand Unix newlines |
| 12:08:34 | Araq | so eventually even 'notepad' will be able to handle it |
| 12:09:13 | Araq | but we could add an option to the ini emitter |
| 12:12:34 | FromGitter | <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:23 | zacharycarter[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:50 | FromGitter | <Bennyelg> TDD (Test driven development) in nim |
| 13:17:08 | FromGitter | <Bennyelg> do we have any testing framework to ease the development in such method ? |
| 13:19:44 | Araq | testament? |
| 13:20:47 | FromGitter | <mratsim> Some kind of robot that slaps you if you don’t test a new proc/type? |
| 13:21:03 | FromGitter | <mratsim> Otherwise this is super useful: https://github.com/alehander42/nim-quicktest |
| 13:22:04 | FromGitter | <Bennyelg> I''ll look into thanks |
| 13:23:18 | FromGitter | <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:35 | FromGitter | <Bennyelg> thanks |
| 13:35:37 | FromGitter | <Bennyelg> yes |
| 13:35:38 | FromGitter | <Bennyelg> i do |
| 13:36:24 | FromGitter | <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:02 | FromGitter | <mratsim> currentSourcePath |
| 13:38:55 | FromGitter | <Bennyelg> not such a connivance name python basename is much cleaner dont you think ? ⏎ thanks anyway! |
| 13:38:55 | FromGitter | <mratsim> ah sorry misunderstood. |
| 13:39:13 | FromGitter | <mratsim> it’s for any path, not just the file being compiled right? |
| 13:39:34 | FromGitter | <mratsim> https://nim-lang.org/docs/ospaths.html#extractFilename,string |
| 13:40:03 | FromGitter | <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:08 | Araq | we 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:03 | FromGitter | <gogolxdong> @Araq ,put the string literals in nnkTripleStrLit rather than using newLit solve the problem. |
| 14:10:00 | zacharycarter[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:41 | Araq | zacharycarter[m], koch temp c foo.nim |
| 14:23:06 | zacharycarter[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:09 | FromGitter | <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:24 | FromGitter | <Bennyelg> funny thing |
| 15:19:34 | FromGitter | <Bennyelg> I wanted argparser I import parseopt2 |
| 15:19:51 | FromGitter | <Bennyelg> and I got a deprecated message use parseopt |
| 15:20:07 | FromGitter | <Bennyelg> Oo why it's not the other way around |
| 15:22:53 | dom96 | Politics |
| 15:24:42 | * | brainproxy joined #nim |
| 15:25:08 | FromGitter | <mratsim> renaming |
| 15:25:44 | FromGitter | <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:46 | FromGitter | <neckbosov> Why is system.cmp not used by default in sort, isSorted, binarySearch,etc? |
| 15:54:36 | FromGitter | <mratsim> maybe at the time you couldn’t pass closure/proc as default param |
| 15:55:13 | FromGitter | <mratsim> Also I think the arg shouldn’t be a closure, but it should be a {.nimcall.} for efficiency. |
| 15:56:18 | FromGitter | <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:31 | FromGitter | <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:54 | FromGitter | <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:59 | FromGitter | <mratsim> destructors are for objects, while GC is for ref objects, seq and strings |
| 18:14:25 | FromGitter | <kayabaNerve> @mratsim This is for a ref object that's wrapping a C struct. |
| 18:14:54 | FromGitter | <mratsim> can you run that in a main() proc, global var live as long as the program. |
| 18:14:59 | FromGitter | <kayabaNerve> I'm trying to get the Nim GC to call the C... 'destructor' function the lib has. |
| 18:15:00 | FromGitter | <kayabaNerve> K |
| 18:15:57 | FromGitter | <mratsim> so when you call new, you also pass a finalizer with the proper release/destroy proc? |
| 18:16:36 | FromGitter | <kayabaNerve> ```code paste, see link``` ⏎ ⏎ 100 MB and rising. [https://gitter.im/nim-lang/Nim?at=5b5f56043cc395660732f8d6] |
| 18:16:44 | FromGitter | <kayabaNerve> I don't call new; I call a C init function. |
| 18:19:44 | FromGitter | <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:01 | FromGitter | <kayabaNerve> Got it |
| 18:20:57 | FromGitter | <kayabaNerve> So switch BN() to new(result, destroy) |
| 18:25:22 | FromGitter | <kayabaNerve> @mratsim Progress! Thank you. |
| 18:36:41 | FromGitter | <kayabaNerve> @mratsim So I got my destroy func except now it's not allocating memory |
| 18:37:31 | FromGitter | <mratsim> you probably need to pass result.addr to your C creation function |
| 18:37:56 | FromGitter | <mratsim> or result = newBN if it was what you wanted to do, after you initialized it with new |
| 18:38:03 | FromGitter | <kayabaNerve> One sec... |
| 18:39:14 | * | icebattle quit (Ping timeout: 260 seconds) |
| 18:40:15 | FromGitter | <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:15 | FromGitter | ... program failed: 'build'` [https://gitter.im/nim-lang/Nim?at=5b5f5b8f3cc3956607330b30] |
| 18:41:25 | FromGitter | <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:06 | FromGitter | <mratsim> if not x.isNil |
| 18:43:43 | FromGitter | <mratsim> you want to finalize the BN type, not the BN.number.digits field |
| 18:44:13 | FromGitter | <mratsim> if needed this digits field should have it’s own finalizer |
| 18:44:25 | FromGitter | <kayabaNerve> I want to get rid of the pointer in the struct that BN is a wrapper of. |
| 18:44:48 | FromGitter | <mratsim> ah. |
| 18:44:57 | FromGitter | <kayabaNerve> BN = `ref object` ⏎ number = `{.bycopy.} = object` ⏎ digits: ptr cuint |
| 18:45:26 | FromGitter | <kayabaNerve> I'm pretty sure that ptr IS the memory leak. |
| 18:47:05 | FromGitter | <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:17 | FromGitter | <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:39 | FromGitter | <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:03 | FromGitter | <mratsim> and there is subfield deallocation as well via deallocShared |
| 18:48:21 | FromGitter | <kayabaNerve> I just want to stop the memory leak :P |
| 18:51:42 | FromGitter | <kayabaNerve> So you wrapped every ptr in ref and deallocShared'd the ref[] ? |
| 18:51:52 | FromGitter | <kayabaNerve> I can't do that. The ptr is in a C struct |
| 19:00:25 | FromGitter | <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:38 | FromGitter | <kayabaNerve> @mratsim What if I realloc it to 1 byte and then dealloc it? |
| 19:25:28 | FromGitter | <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:23 | FromGitter | <Varriount> @kayabaNerve What are you wrapping? |
| 20:54:25 | Araq | yay, 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:18 | FromGitter | <kayabaNerve> The imath C lib. |
| 21:13:25 | FromGitter | <kayabaNerve> At this point, I have better things to do, it's not critical, and I'll make a bounty for it. |
| 21:15:12 | dom96 | Boom: https://github.com/dom96/texttospeech |
| 21:17:01 | Araq | nice. I used something like that when I was 18 :-) |
| 21:17:28 | Araq | was a COM thing for Windows back then, I imported the lib into Delphi and it just worked |
| 21:18:06 | Araq | those were the days... software that worked |
| 21:20:11 | dom96 | Yeah, you need to sign up into Google's ecosystem for this |
| 21:20:32 | dom96 | But the text to speech is very good |
| 21:20:59 | Araq | what's your use case? secret? |
| 21:23:50 | dom96 | yep :) |
| 21:24:15 | dom96 | For my use case the quality isn't super important, but it does help |
| 21:45:29 | * | Jesin joined #nim |
| 21:59:22 | FromGitter | <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:01 | FromGitter | <kayabaNerve> ^^ |
| 22:54:50 | FromDiscord | <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:12 | FromDiscord | <treeform> even with: setMaxPoolSize(100) |
| 23:12:38 | FromDiscord | <treeform> but if threads exit, i can start more threads |
| 23:20:52 | FromDiscord | <treeform> If i use threads instead of threadpool it works fine with more threads |
| 23:22:55 | FromDiscord | <treeform> just threads without pool appear to work even with 999 threads... |
| 23:23:05 | FromDiscord | <treeform> way more then I would need |
| 23:35:08 | stefanos82 | @treeform: you can read more here https://github.com/nim-lang/Nim/issues/5499 |
| 23:36:30 | FromDiscord | <treeform> interesting |
| 23:36:55 | FromDiscord | <treeform> so what is the use for a thread pool then? |
| 23:37:04 | FromDiscord | <treeform> its more like a "corepool" |
| 23:39:22 | * | xet7 quit (Quit: Leaving) |
| 23:49:18 | stefanos82 | @treeform: based on the official documentation, the default value of setMaxPoolSize is MaxThreadPoolSize which is 256 threads |