00:02:33 | * | druonysus quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.) |
00:02:46 | FromGitter | <gogolxdong> push to channel, sleep every 3 seconds. |
00:03:24 | FromGitter | <bung87> it's about syntax |
00:08:11 | FromGitter | <gogolxdong> ```import posix β β while sleep(3) == 0: β do something``` [https://gitter.im/nim-lang/Nim?at=5b95b5ebe481f854a694e915] |
00:14:44 | FromGitter | <bung87> thanks , but I'm asking about syntax,I want code exactly write as that. |
00:15:37 | FromGitter | <bung87> seems `do` will treats 3.seconds as a proc ,I give up |
00:16:13 | * | druonysus joined #nim |
00:16:13 | * | druonysus quit (Changing host) |
00:16:13 | * | druonysus joined #nim |
00:21:23 | FromGitter | <gogolxdong> have no idea there is schedule and every syntax. |
00:22:47 | FromGitter | <kayabaNerve> @bung87 A macro. |
00:23:01 | FromGitter | <kayabaNerve> You can have a macro parse that and emit valid Nim code. |
00:24:03 | FromGitter | <bung87> @kayabaNerve I tried, but the `do` command will take left as proc first |
00:24:58 | FromGitter | <kayabaNerve> Write a better macro |
00:25:12 | FromGitter | <kayabaNerve> π€ |
00:25:22 | FromGitter | <bung87> ```code paste, see link``` β β these 3 ways I have now. [https://gitter.im/nim-lang/Nim?at=5b95b9f1a04db554a700f274] |
00:25:52 | FromGitter | <kayabaNerve> That is unhelpful af. I know. That said, to get that exact line of Nim to work properly... You need a macro. |
00:28:34 | FromGitter | <bung87> hmm not familar with macro, I tried template and macro even not implements just leave `discard` , the `do` requires left is proc will first come up. |
00:29:59 | FromGitter | <bung87> that says I need 3.seconds return a proc that would rewrites procs in `times` module |
00:30:03 | * | seni quit (Quit: Leaving) |
00:31:36 | FromGitter | <kayabaNerve> I don't know macros myself. I'm just commenting it's the only surefire way to have the compiler see invalid statement X as valid statement Y. |
00:32:21 | FromGitter | <kayabaNerve> Depending on what of `schedule.every 3.seconds do:` is actually valid, you may be able to not need macros. I just don't know what module you're working off of. |
00:32:43 | FromGitter | <gogolxdong> do is a syntax sugar alias of closure in you context I think. |
00:32:45 | FromGitter | <bung87> thanks! anyway I'm fine now with current I have, 3 ways to do same thing I think that's enough. |
00:33:43 | FromGitter | <bung87> I push it to github https://github.com/bung87/scheduler/blob/master/src/scheduler.nim |
00:34:11 | FromGitter | <gogolxdong> spend some time on macro ,might findd it helpful. |
00:34:23 | FromGitter | <bung87> I'll think about what's next lib I'm interested to write. |
00:40:06 | FromDiscord | <exelotl> I'm so confused on how to achieve what I want in Nim :( |
00:42:31 | FromGitter | <bung87> I'm using vscode with Nim extension, the nimsuggest will tell me whats wrong I'm doing. think it helpful. |
00:42:51 | * | Calinou quit (Remote host closed the connection) |
00:44:00 | * | Calinou joined #nim |
00:44:19 | * | xomachine[m] quit (Ping timeout: 264 seconds) |
00:44:33 | FromGitter | <gogolxdong> why don't you just define Scheduler as ref object? |
00:44:54 | * | sg-james[m] quit (Ping timeout: 264 seconds) |
00:45:49 | * | xomachine[m] joined #nim |
00:46:20 | * | sg-james[m] joined #nim |
00:47:21 | FromGitter | <bung87> to simply init a Scheduler with one line? I think |
00:51:30 | FromDiscord | <exelotl> I think Nim's methods are a poor fit for my game engine idea because there will be a broad, shallow heirarchy (everything extends Entity). My understanding is that with dispatch trees, the more subclasses you have, the slower each method call becomes. |
00:51:37 | FromDiscord | <exelotl> So I need a vtable or something. But I have no idea how to implement that with the available tools (how does 'of' work at runtime? Can I get that info too? is it possible to pull internal info out of a typedesc?) |
00:54:13 | FromGitter | <gogolxdong> you can do that with ref object too , new returns ref managed by GC, once uses ptr ,you manage memory by yourself. |
00:56:43 | FromGitter | <gogolxdong> result is an implicit variable of proc, better not define a variable named result explicitly. |
01:00:39 | FromGitter | <bung87> didnot see much differences in my case. and second every implements base on copy first implements that's why there's result,but have no return type |
01:06:14 | FromGitter | <bung87> @exelotl I tried `method` once ,feels like an alias to `proc` but less mentioned on documents. |
01:09:17 | * | SenasOzys joined #nim |
01:14:12 | FromGitter | <gogolxdong> How about the memory of a ptr Scheduler which addr references to ? |
01:15:11 | * | dddddd quit (Remote host closed the connection) |
01:24:19 | FromGitter | <bung87> can you show some code explain what would be a problem? |
01:30:22 | * | krux02 quit (Remote host closed the connection) |
02:00:38 | FromGitter | <gogolxdong> No. I just wonder whether the memory allocated by object constructor and passed its address to an object field via ptr will leak. ptr declares untraced references. |
02:06:13 | FromGitter | <gogolxdong> There is no difference if it doesn't since Nim syntax is flexible enough to achieve the same goal, except I wouldn't like to write ref in every proc arguements list. |
02:15:55 | * | SenasOzys quit (Remote host closed the connection) |
02:16:20 | * | SenasOzys joined #nim |
02:17:58 | FromGitter | <DanielSokil> What is the difference between `assert` and `doAssert`? |
02:23:56 | FromGitter | <gogolxdong> https://github.com/nim-lang/Nim/blob/devel/lib/system.nim#3790 |
02:24:13 | * | SenasOzys quit (Ping timeout: 245 seconds) |
02:24:21 | FromGitter | <gogolxdong> assert raises Raises ``AssertionError`` |
03:19:13 | * | druonysus quit (Read error: No route to host) |
03:42:55 | FromGitter | <arnetheduck> bumped `nlvm` to latest upstream - though it's a bit of a pain, I'm happy that so many globals are gone - first step towards compiler-as-a-library which can open up a wide array of uses cases - nice @Araq ! |
04:16:32 | FromGitter | <DanielSokil> @gogolxdong Thanks! |
04:37:39 | * | darithorn joined #nim |
04:38:41 | * | endragor joined #nim |
05:32:18 | * | nsf joined #nim |
06:07:57 | * | darithorn quit (Quit: WeeChat 2.2) |
06:22:00 | * | couven92 joined #nim |
07:18:33 | FromGitter | <Grabli66> Hi! I want to find a way to build dynamic libraries in Nim, with async io. And i see that i can't use async io and compile dynamic library with nimrtl. Will my dynamic library work as it should, if i compile it with gc:stack and without nimrtl? |
07:36:26 | * | tiorock joined #nim |
07:36:26 | * | rockcavera quit (Killed (livingstone.freenode.net (Nickname regained by services))) |
07:36:26 | * | tiorock is now known as rockcavera |
07:36:26 | * | rockcavera quit (Changing host) |
07:36:26 | * | rockcavera joined #nim |
07:37:44 | * | floppydh joined #nim |
07:44:54 | * | cwilby joined #nim |
07:51:05 | * | PMunch joined #nim |
08:03:47 | * | gmpreussner quit (Ping timeout: 240 seconds) |
08:03:52 | * | gmpreussner_ joined #nim |
08:10:19 | * | cwilby quit (Remote host closed the connection) |
08:10:33 | * | cwilby joined #nim |
08:11:22 | * | xet7 joined #nim |
08:16:54 | * | ginger_bill_ joined #nim |
08:18:00 | * | Vladar joined #nim |
08:25:17 | * | ginger_bill_ quit (Quit: Page closed) |
08:26:32 | * | ginger_bill joined #nim |
08:37:18 | * | ginger_bill quit (Ping timeout: 252 seconds) |
09:12:36 | * | stefanos82 joined #nim |
09:14:50 | * | ftsf joined #nim |
09:29:18 | FromDiscord | <gingerBill> Hello |
09:29:50 | FromDiscord | <gingerBill> Could some help me with a syntax question/design decision? |
09:30:05 | FromDiscord | <gingerBill> Why are both of these allowed? |
09:30:05 | FromDiscord | <gingerBill> ```nim |
09:30:05 | FromDiscord | <gingerBill> proc foo(a, b: int; c, d: int): int = # semicolon as separator |
09:30:05 | FromDiscord | <gingerBill> return a+b+c+d |
09:30:05 | FromDiscord | <gingerBill> |
09:30:06 | FromDiscord | <gingerBill> proc foo(a, b: int, c, d: int): int = # comma as separator |
09:30:07 | FromDiscord | <gingerBill> return a+b+c+d |
09:30:07 | FromDiscord | <gingerBill> ``` |
09:30:17 | FromDiscord | <gingerBill> Reading the compiler shows that it allows both, but I question why. |
09:30:17 | FromDiscord | <gingerBill> https://github.com/nim-lang/Nim/blob/c033ff990acceac6d2095242fa17501e98555973/compiler/parser.nim#L1031 |
09:34:50 | * | ftsf quit (Quit: Leaving) |
09:36:47 | * | kapil___ joined #nim |
09:42:14 | PMunch | Well, you are also allowed to do (x, y, z: int, a, b, c: string) |
09:42:28 | PMunch | In this case it might be clearer to do (x, y, z: int; a, b, c: string) |
09:43:00 | PMunch | Araq in fact wants to use ; as the separator, but most people seem to prefer , |
09:43:23 | PMunch | I think both are allowed because of this, you can choose between clarity or familiarity |
09:48:07 | * | Sembei joined #nim |
09:48:27 | FromDiscord | <gingerBill> That just seems like a very weird and arbitrary decision. |
09:48:43 | FromDiscord | <gingerBill> So you support both because some people like one way. |
09:48:47 | * | Pisuke quit (Ping timeout: 240 seconds) |
09:50:08 | FromGitter | <mratsim> no |
09:50:17 | FromDiscord | <gingerBill> So you support both because some people like one way? |
09:50:23 | FromGitter | <mratsim> comma carries the type declaration to the next argument |
09:50:36 | FromGitter | <mratsim> while semicolon does not |
09:50:54 | FromGitter | <mratsim> proc foo(a, b: int) is valid, proc foo(a; b: int) is invalid |
09:50:55 | FromDiscord | <gingerBill> Could you give me an example, please? |
09:51:09 | PMunch | Oh yeah, they are functionally different |
09:51:12 | FromDiscord | <gingerBill> `proc foo(a, b: int; c, d: int)` and `proc foo(a, b: int, c, d: int)` are same, is what I am talking about. |
09:51:27 | FromDiscord | <gingerBill> How is that functionally different? |
09:51:47 | PMunch | a, b: int is allowed a; b: int is not, that's how they differ |
09:51:52 | FromGitter | <mratsim> this is useful for generics `proc fooT; U: SomeInteger (a: T, b: U)` is very different from `proc fooT, U: SomeInteger (a: T, b: U)` |
09:52:07 | PMunch | a: int, b: string and a: int; b: string does the same thing |
09:52:11 | FromGitter | <mratsim> in the first case T can be anything while U is an integer types |
09:52:25 | FromGitter | <mratsim> in the second both T and U are integer types (but an differ from each other) |
09:52:30 | FromGitter | <mratsim> can* |
09:53:20 | PMunch | Hmm strange, the FromGitter bot removes [] in your code snippets.. |
09:53:39 | FromGitter | <mratsim> gitter is broken with brackets :/ |
09:53:58 | FromDiscord | <gingerBill> To be clear `a: int, b: string` and `a: int; b: string` are identical then? |
09:54:04 | FromGitter | <mratsim> yes |
09:54:09 | FromDiscord | <gingerBill> Is this just a quirk of the syntax or a design choice? |
09:54:29 | FromGitter | <mratsim> itβs less rules when parsing |
09:54:54 | FromGitter | <mratsim> comma carries unless a type is declared, semicolon never carries type. |
09:54:54 | FromDiscord | <gingerBill> Interesting. |
09:55:23 | FromGitter | <mratsim> otherwise you would have to add an extra rule to prevent either semicolon or comma |
09:55:25 | FromDiscord | <gingerBill> Thank you for the help. I was a little confused as I have seen most people use `,` but the official docs use `;`. |
09:55:52 | FromGitter | <mratsim> it might be that when generating docs the compiler uses semicolon by default as well |
09:56:36 | FromDiscord | <gingerBill> I was reading the source and it seems that the `when defined(nimpretty2)` uses semicolons. |
09:57:01 | FromGitter | <mratsim> ah that :P there is a RFC/debate on that iirc |
09:57:04 | PMunch | Yes according to NEP-1 you should use ; |
09:57:47 | PMunch | Oh wait, maybe not |
09:57:54 | PMunch | But araq certainly prefers ; |
09:58:39 | FromDiscord | <gingerBill> I'm on Pascal programmer and I do like `;` so neither bothers me. |
09:59:03 | FromDiscord | <gingerBill> *I'm an old |
10:04:17 | * | cwilby quit (Ping timeout: 250 seconds) |
10:04:49 | FromDiscord | <gingerBill> Thank you all your help everyone. This was a little confusing to see that was all. |
10:04:59 | * | cwilby joined #nim |
10:07:10 | FromGitter | <mratsim> youβre welcome |
10:21:58 | * | endragor_ joined #nim |
10:22:21 | FromGitter | <Grabli66> People. Is it possible to create working dll, with async io, GC, and without nimrtl? |
10:22:47 | * | endragor quit (Ping timeout: 240 seconds) |
10:24:07 | PMunch | Grabli66, last time I tried to create a Nim dll I ran into lots of trouble with the GC |
10:25:25 | PMunch | https://github.com/nim-lang/Nim/issues/6886 |
10:26:05 | PMunch | Plus I think nimrtl is required to let Nim connect to the GC, why do you want to do without it? |
10:32:52 | FromGitter | <Grabli66> PMunch, cause it's impossible to use async with nimrtl https://github.com/nim-lang/Nim/issues/6855 |
10:33:54 | PMunch | Ah |
10:34:06 | PMunch | Well, I think dynlibs in Nim is broken atm.. |
10:34:15 | PMunch | The GC doesn't seem to work at all |
10:34:52 | FromGitter | <Grabli66> It's sad :( |
10:37:11 | PMunch | Yeah.. |
10:38:35 | FromGitter | <Grabli66> Maybe it's possible to turn on --gc:stack, and don't use nimrtl in DLL. But i don't know will it work right or not :( |
10:40:33 | PMunch | Hmm, maybe |
10:40:37 | PMunch | Haven't tried it |
10:43:22 | * | pwntus joined #nim |
10:46:06 | * | krux02 joined #nim |
10:48:24 | FromGitter | <krux02> @kaushalmodi are you still planning to fix issues on nim-mode in emacs? |
10:49:39 | FromGitter | <krux02> I was digging very deep into creating a major mode in emacs, and it is a real pain for me to do so. |
10:50:18 | FromGitter | <krux02> I could find out what is causing pig preformance problems in nim-mode, but I don't have the expertise alone to fix it. |
10:50:44 | FromGitter | <krux02> maybe you have a better idea |
10:58:50 | * | vivus joined #nim |
11:01:12 | vivus | hi all. I have a table type that has an object (of 2 strings) stored in each key:value set of the table. How do I print out each string from the table on its own? |
11:02:18 | * | dddddd joined #nim |
11:03:05 | vivus | https://www.zerobin.net/?650ab716226743a8#qXFwcRjvsBshM52X9S/gpd6ZZS1aCI2K/lGifc3nIYQ= |
11:03:20 | PMunch | vivus, for obj in myTable: echo obj.strA; echo obj.strB |
11:03:25 | PMunch | Something like that? |
11:04:07 | vivus | PMunch: current I am doing this: for key, value in myitems: echo value ... but it shows both the strings when I echo value. |
11:04:32 | PMunch | Yes, because value is the object |
11:04:39 | PMunch | key is the key in the table |
11:04:54 | vivus | PMunch: how do I access each value separately? |
11:05:09 | PMunch | Like you normally would with an object |
11:06:44 | vivus | PMunch: im unfamiliar with that. I tried: `value.name` but got a compile error |
11:06:58 | FromGitter | <xmonader> what was the command to autoformat nim code? is it a separate package? nimfmt or nimpretty? or is it in core bins? |
11:08:35 | FromGitter | <narimiran> @vivus: `for key in myitems: for category in myitems[key]: echo category.name, category.color` ? |
11:09:13 | PMunch | Or just myitems.items |
11:09:51 | vivus | it says .items is an undeclared field |
11:10:39 | PMunch | Hmm, maybe it's called something else. Look under iterators in the manual page for tables |
11:13:10 | FromGitter | <bung87> nimpretty your.nim |
11:14:22 | FromGitter | <xmonader> @bung87 is that in 0.18 binaries? |
11:14:51 | FromGitter | <bung87> I build all from source not sure if it packed with release |
11:15:02 | vivus | here is my code and the compile error I get: https://www.zerobin.net/?88e517c6464a95c3#0EUuDEuB1peYiDKZQvQE7SzY1uPXO/cBezE+kXucme8= |
11:18:00 | vivus | okay I fixed it |
11:18:12 | vivus | needed to understand sequences |
11:25:27 | * | zachcarter quit (Ping timeout: 252 seconds) |
11:28:34 | FromGitter | <kaushalmodi> @krux02 I'll find some time this week to analyze what part of nim-mode degrades the performance, even with nimsuggest disabled. |
11:29:24 | FromGitter | <kaushalmodi> @xmonader nimpretty is in devel branch |
11:29:52 | FromGitter | <xmonader> I see. thanks |
11:31:09 | FromGitter | <xmonader> can someone approve this? https://github.com/nim-lang/packages/pull/853 β β also do i've to release the packages to be used as dependency in my local system? or do they have to be under 1 project? because it's not the case |
11:36:28 | FromGitter | <mratsim> use nimble develop |
11:39:47 | FromGitter | <xmonader> thanks @mratsim |
11:40:00 | * | jxy quit (Read error: Connection reset by peer) |
11:40:11 | * | jxy joined #nim |
11:49:57 | * | kapil___ quit (Quit: Connection closed for inactivity) |
11:53:44 | FromGitter | <kaushalmodi> > also do i've to release the packages to be used as dependency in my local system? |
11:53:46 | FromGitter | <kaushalmodi> No |
11:54:21 | FromGitter | <kaushalmodi> You can just do `nimble install` on the local dependencies without first publishing them. |
11:54:34 | vivus | is `id` a special keyword in nim? |
11:54:35 | * | Etheco joined #nim |
11:56:54 | FromGitter | <mratsim> no |
12:04:28 | PMunch | vivus, oh sorry. I couldn't look at your code and didn't realize you had a sequence of objects |
12:04:32 | PMunch | Sorry if I confused you |
12:04:57 | vivus | PMunch: np :) not your fault, I just needed to investigate and understand it better myself |
12:16:16 | FromGitter | <krux02> @kaushalmodi according to my benchmarks most performance is lost in nim-backtick-matcher |
12:16:42 | FromGitter | <krux02> and within that, it is syntax-pps |
12:16:54 | FromGitter | <krux02> so fewer calls to syntax-ppss would be an improvement |
12:18:10 | krux02 | @kaushalmodi I really wonder if there is a better way to support a language within a language. |
12:18:57 | vivus | what string proc can I use to convert a float to a string? |
12:19:10 | krux02 | I would search for parse float |
12:20:12 | krux02 | vivus, parseFloat is the acutal name |
12:20:29 | vivus | like this: parseFloat(id) ? |
12:20:51 | krux02 | what do you mean with id? |
12:21:00 | krux02 | parseFloat("123.456") should work |
12:21:22 | vivus | do I need to import strutils? |
12:21:32 | krux02 | that functoin is in strutils, yes |
12:22:26 | vivus | krux02: parseFloat converts a string to a float, I want to to from float to string |
12:23:09 | krux02 | oh, sorry |
12:23:19 | krux02 | $ should work |
12:23:45 | krux02 | there should also be a format float proc somewhere |
12:23:49 | krux02 | not sure about the syntax |
12:24:18 | * | Sembei quit (Read error: Connection reset by peer) |
12:25:09 | vivus | ty, I found the formatFloat in strutils |
12:25:26 | * | Sembei joined #nim |
12:26:54 | vivus | how do I reduce my float to 1 decimal? |
12:27:16 | krux02 | reduce? |
12:27:21 | krux02 | you mean truncate |
12:28:51 | vivus | yeah reduce it from: 1.100000000000000 to 1.1 |
12:30:01 | FromGitter | <jrfondren> 1) 100000.formatFloat(ffdecimal, 1) |
12:32:44 | vivus | ty |
12:32:45 | vivus | that worked |
12:34:51 | * | nsf quit (Quit: WeeChat 2.2) |
12:35:41 | FromGitter | <Bennyelg> check the length of set? |
12:35:47 | FromGitter | <Bennyelg> var t1 = set[char] |
12:35:51 | FromGitter | <Bennyelg> t1.len ? not working |
12:35:53 | FromGitter | <tim-st> card? |
12:36:14 | FromGitter | <Bennyelg> thanks I would never guess it alone |
12:36:20 | FromGitter | <Bennyelg> why not just do len? |
12:36:25 | FromGitter | <tim-st> len is there in devel |
12:36:36 | FromGitter | <tim-st> cardinality is math term for length of set |
12:37:00 | FromGitter | <krux02> well in "math" I use "number of elements" |
12:37:12 | FromGitter | <Bennyelg> how do I get the first element in my set |
12:37:18 | FromGitter | <Bennyelg> t1[0] not working too :| |
12:37:25 | FromGitter | <jrfondren> if you put 10x of the same element a set, it only has 1 item |
12:37:26 | FromGitter | <tim-st> set is not ordered |
12:37:37 | FromGitter | <Bennyelg> I know |
12:38:04 | FromGitter | <krux02> and in Nim ``len`` means "number of elements" |
12:38:04 | FromGitter | <tim-st> only ordered collection can be indexed |
12:38:04 | FromGitter | <Bennyelg> so tell me the "number of elements" in my set :) |
12:38:14 | FromGitter | <krux02> @tim-st these terms are stupid, maybe they make sense in math, but in Nim a set is very much ordered |
12:38:47 | FromGitter | <krux02> it is always ordered the same way, and there is no way to change the order, but it is ordered |
12:39:10 | FromGitter | <tim-st> https://nim-lang.org/docs/sets.html#OrderedSet should have index |
12:39:35 | FromGitter | <Bennyelg> tRIED ORDEREDsET |
12:39:40 | FromGitter | <Bennyelg> tried orderset * no index. |
12:40:21 | FromGitter | <tim-st> not implemented, likely because array has wholes, but can be implemented |
12:40:45 | FromGitter | <krux02> don't use OrderedSet |
12:40:48 | FromGitter | <Bennyelg> So said sets not beahive like seq / array at most of the time |
12:40:53 | FromGitter | <jrfondren> same reason that hash tables don't have numerical indexes, even though the backing array is certainly ordered |
12:40:55 | FromGitter | <krux02> I never had a use case for that data structure |
12:41:17 | FromGitter | <Bennyelg> I have one now and I impleminted it using seq and then deduplicate |
12:41:28 | FromGitter | <Bennyelg> but I want more efficiant solution with set |
12:41:40 | FromGitter | <krux02> is it a performance bottleneck? |
12:41:55 | FromGitter | <tim-st> it's only more efficient with a bigger size, how much entries expected? |
12:41:57 | FromGitter | <Bennyelg> It can be, |
12:42:24 | FromGitter | <Bennyelg> not much I assume now that Im thinking of it |
12:42:34 | FromGitter | <Bennyelg> But set solution is more programatic |
12:42:48 | FromGitter | <krux02> people underestimate the performance of flat data structures |
12:42:58 | FromGitter | <krux02> seq[T] is very fast |
12:43:05 | FromGitter | <krux02> when T is POD |
12:43:09 | FromGitter | <krux02> (plain old data) |
12:43:20 | FromGitter | <Bennyelg> I roll it back to seq ;] |
12:43:36 | FromGitter | <krux02> good. |
12:43:45 | FromGitter | <jrfondren> anyway you might want an OrderedSet with .items.toSeq after you populate it, as an alternate to building a seq and then deduping it |
12:43:53 | FromGitter | <krux02> when it really becomes big, it might be worth it to use something more intelligent |
12:44:04 | FromGitter | <Bennyelg> yea |
12:44:29 | FromGitter | <krux02> @jrfondren no |
12:44:37 | FromGitter | <tim-st> I now test if `async` really makes problems or if socket is the real problem regarding memory leaks |
12:46:07 | FromGitter | <krux02> @jrfondren the point is that is is faster to scan through the entire seq of elements that hashing a single element, look in the hash table and do the comparison there. |
12:47:12 | FromGitter | <krux02> hashing has O(1) performance, but it is not fast |
12:48:12 | FromGitter | <jrfondren> the only part of the intended work that I've followed is "I want to build a seq of arbitrary size and then dedupe it". For that it should be hard to beat OrderedSet for time and space efficiency. but if it's some trivial task, fine |
12:51:42 | FromGitter | <tim-st> without `async` it leaks too, but like 10mb less, but still too much |
12:52:39 | FromGitter | <tim-st> I also tested Pythons version: click download it increases 2mb ram, download finished: goes back to normal ram size |
12:55:05 | FromGitter | <tim-st> for the first two calls it goes up then for the next it stays at this memory amount, I cannot trust this |
12:56:35 | FromGitter | <dm1try> @tim-st what are you testing? is this repo https://github.com/tim-st/nim-zim? |
12:57:03 | FromGitter | <tim-st> yes, different commits (latest and older before changing to async) |
12:57:23 | FromGitter | <tim-st> but many people (also in on forum and jester and mofuw and so on) reported this |
12:57:36 | FromGitter | <dm1try> I tested it yesterday and did not notice some memory leaks |
12:57:54 | FromGitter | <tim-st> Did you chose "Project Gutenberg" that ships out pdf files? |
12:58:05 | FromGitter | <tim-st> with html you will have to open many files |
12:58:44 | FromGitter | <dm1try> > Did you chose "Project Gutenberg" that ships out pdf files? β β nope, will try later to reproduce |
12:58:57 | FromGitter | <tim-st> ok, thanks, I tested windows and linux |
12:59:01 | FromGitter | <tim-st> sync and async |
12:59:18 | * | zacharycarter joined #nim |
13:01:30 | FromGitter | <dm1try> actually I tried to open many links and when tested one link with `wrk`; memory usage had some "plato" value ~20Mb; it is on MacOS |
13:02:25 | FromGitter | <tim-st> dont know if wrk is good, it doesnt react to the response |
13:02:59 | FromGitter | <tim-st> I will try to play with gc settings, I read a few times: "It's not a bug it's a feature" (memory strategy) |
13:03:37 | zacharycarter | If I passed an untyped parameter a macro that has some Nim code in it - how can I execute that Nim code and put the result in the code's place in the AST? |
13:03:45 | zacharycarter | to a macro* |
13:07:27 | krux02 | so you want to pass code to a macro that generates the code |
13:08:14 | zacharycarter | let me give you an example |
13:08:36 | krux02 | zacharycarter, you can create a local macro with the body, and call that |
13:09:12 | zacharycarter | https://gist.github.com/zacharycarter/fb5e29214fd9f06fe7d2e9ad8c0a4652 |
13:09:50 | FromGitter | <dm1try> > I will try to play with gc settings, I read a few times: "It's not a bug it's a feature" (memory strategy β β when digging in `coro` module I noticed that GC does not return the memory to OS if `alloc0` is used and the memory chunk is "small enough"(on my machine this value is 1GB), so if some code uses `alloc0` and this allocation is less than 1GB the memory is not returned to OS but "reserved" to the future usage |
13:10:09 | FromGitter | <dm1try> is this correct? could someone to confirm?) |
13:10:29 | zacharycarter | I want to execute the Nim code after the ! |
13:10:33 | zacharycarter | and stick the result in its place |
13:11:01 | zacharycarter | I'll try putting a local macro in krux02 |
13:11:11 | zacharycarter | what should I create in that macro? a call node? |
13:11:15 | FromGitter | <dm1try> @tim-st how do you measure a memory stats btw? |
13:11:33 | FromGitter | <xmonader> do i need special configurations for nimble tests using a package i ran `nimble develop` on ? ? |
13:11:57 | krux02 | zacharycarter, http://ix.io/1mop |
13:12:16 | FromGitter | <tim-st> @dm1try I look in the taskmgr (the same like for python) |
13:12:50 | zacharycarter | krux02: thank you |
13:14:20 | * | TheLemonMan joined #nim |
13:20:01 | FromGitter | <tim-st> @dm1try I think there is a problem with the gc, when I add `getOccupiedMem` and `getOccupiedMem` for each request sometimes the number of free mem just doubles without need |
13:24:00 | FromGitter | <dm1try> @tim-st ok, will try to reproduce/re-test the issue a little bit later and let you know) |
13:24:34 | FromGitter | <tim-st> thanks, do you know how I can set a gc strategy? |
13:25:08 | FromGitter | <tim-st> I want GC_Strategy.gcOptimizeSpace |
13:25:21 | FromGitter | <tim-st> and see if it behaves different |
13:26:31 | FromGitter | <tim-st> ok, I read it's deprecated and is a nop |
13:29:31 | zestyr | tim-st: you can run `GC_getStatistics()` to print some proper info about the memory usage |
13:29:52 | FromGitter | <tim-st> zestyr: thanks, will try |
13:31:02 | krux02 | @kaushalmodi gl.nim is full of backticked identifiers that are not in comments at all. I guess this cases a lot af trouble and performance problems |
13:35:22 | FromGitter | <Grabli66> How to efficent store HashSet in Table? HashSet is not a referrence object. It will be copied everytime when i take it from table? |
13:36:38 | leorize | you certainly can make a table of `ref HashSet` |
13:36:50 | FromGitter | <xmonader> ```code paste, see link``` β β How to debug this? [https://gitter.im/nim-lang/Nim?at=5b9673720fb4232e38a239ac] |
13:37:52 | FromGitter | <tim-st> @xmonader if you found the bug, please report the `???` thing, that's an import bug |
13:37:58 | FromGitter | <tim-st> important |
13:37:59 | FromGitter | <krux02> @xmonader you check out the nim source code and search for "n is not nil" as error message |
13:38:19 | leorize | xmonader: it's in sem pass IIRC |
13:38:19 | FromGitter | <krux02> and then you see how that bug can occur |
13:38:47 | FromGitter | <Grabli66> leorize, i tried to do so. But i dont undertand how to create new ref HashSet. There is initSet procedure but it creates HashSet, not a ref HashSet |
13:38:47 | FromGitter | <tim-st> @xmonader here: https://github.com/nim-lang/Nim/issues/7268 |
13:38:47 | FromGitter | <krux02> @tim-st befere reporting, the bug needs to be analyzed |
13:39:33 | FromGitter | <xmonader> I'm using 0.18 is that still a problem? I can't tell ppl in the company to use devel branch |
13:40:59 | FromGitter | <Vindaar> @xmonader I think that's a known issue, see here: https://github.com/nim-lang/nimble/issues/456 |
13:41:12 | leorize | Grabli66: use this proc https://nim-lang.org/docs/sets.html#init,HashSet[A],int |
13:41:50 | leorize | use new to generate a reference, then pass it to that proc for initialization |
13:48:24 | * | cspar_ joined #nim |
13:50:28 | FromGitter | <xmonader> @Vindaar thank you, i'll try :( i wish it was smoother... |
13:51:42 | * | cspar quit (Ping timeout: 244 seconds) |
13:53:33 | FromGitter | <tim-st> From my tests with gc I'd it works quite good as long as the total amount of memory is enough, if not it makes it larger but then does not make it smaller again (or maybe at a time in a future) |
13:54:49 | FromGitter | <tim-st> because of this people only reported this problem "when shipping out big files" because for small files the total amount is always enough |
13:55:17 | FromGitter | <Grabli66> leorize, init does not work β type mismatch: got <ref HashSet[collector_device.CollectorDevice]> β β but expected one of: β proc initA (s: var OrderedSet[A]; initialSize = 64) ... [https://gitter.im/nim-lang/Nim?at=5b9677c433ebb72e37f81584] |
13:56:20 | leorize | you have to de-reference it like this `init(hash[], ...)` |
13:56:39 | leorize | the `[]` is the dereference operator |
13:59:08 | FromGitter | <Grabli66> Great. Now it works. Thanks |
14:00:20 | FromGitter | <Grabli66> Don't understand why HashSet is not a referrence type by default. |
14:07:37 | Guest21953 | Ok guys, I have to give up on Nim again, I'll (we) probably revisit it again. The major reason seems to be "unpredictability" of asyncdispatch and related. |
14:08:32 | FromGitter | <Grabli66> Is there a possibility to pretty print content of Table to console? |
14:08:59 | TheLemonMan | unpredictability? |
14:09:23 | TheLemonMan | Grabli66, $table ? |
14:09:31 | Guest21953 | eaten exceptions, "hidden dragons" |
14:10:00 | Guest21953 | or weird behaviours like socket.send("SOMETHING") always finshes without error when socket was connected and some transmission was done through it |
14:10:24 | FromGitter | <arnetheduck> @Guest21953 you might be interested in https://github.com/status-im/nim-asyncdispatch2 which is a fork to deal with some of the problems and start using it in a p2p setting that should stress it to its core |
14:10:31 | Guest21953 | at least that's how it behaves now, because pretty sure that some time ago it was behaving differently (fut.failed is false which means that it succeeeded) |
14:10:59 | Guest21953 | I checked it already |
14:11:06 | Guest21953 | it also had critical bug |
14:12:06 | * | Guest21953 is now known as pigmej |
14:12:28 | pigmej | basically you change code in one place other place explodes |
14:13:42 | pigmej | I wanted to also check reactor but then dom96 said (he was right) that for language consistency I should try asyncdispatch |
14:15:23 | TheLemonMan | zacharycarter, ping |
14:15:33 | zacharycarter | hi TheLemonMan |
14:16:26 | TheLemonMan | pigmej, if you didn't already please open a few tickets on github, that's the only way to improve the ecosystem:) |
14:16:35 | * | endragor_ quit (Remote host closed the connection) |
14:16:36 | pigmej | I already did :) |
14:16:47 | pigmej | even submitted PR for async dispatch |
14:16:52 | pigmej | (it have been merged) |
14:17:22 | pigmej | The thing is .... I can't trust the code |
14:18:39 | TheLemonMan | zacharycarter, sorry, wrong person (and chan, and window :)! How's your templating lib going? |
14:19:25 | pigmej | and the funny thing is that I still hope that nim will rock, but it seems to be too inmature for me (at least async part) to trust it enough for production system |
14:19:36 | zacharycarter | TheLemonMan - good thank you! I finished the initial port of hyperHTML, and switched gears to working on a macro to produce ES2015 classes and CustomElements etc... |
14:20:21 | zacharycarter | so at this point it's just improving and iterating the macro and porting a few remaining bits of hyperHTML - hopefully will have our first web component done later today with Nim |
14:21:45 | TheLemonMan | noice, I've seen the gist you posted yesterday(?) and was amazed heh, you can do so much with some macros |
14:22:09 | zacharycarter | thanks! yeah :D they are super powerful; |
14:23:08 | TheLemonMan | an ES6-targeting backend would also be a nice side project... |
14:25:45 | FromGitter | <gogolxdong> Will there be a demo or example of hyperHTML, what's the concept behind? |
14:30:51 | FromDiscord | <awr> hi |
14:30:58 | zacharycarter | gogolxdong: https://viperhtml.js.org/hyperhtml/documentation/ |
14:35:51 | FromGitter | <gogolxdong> which would you suggest our production frontend migrate to , karax or hyperHtml? |
14:36:05 | * | Etheco- joined #nim |
14:36:50 | FromGitter | <gogolxdong> we use vue.js at the moment. |
14:40:06 | * | Etheco quit (Ping timeout: 264 seconds) |
14:40:54 | * | PMunch quit (Quit: Leaving) |
14:41:05 | FromGitter | <gogolxdong> I want frontend be material design style, only succeed partially using DOM. |
14:42:29 | FromGitter | <tim-st> @gogolxdong do you use a http server written in nim? |
14:42:55 | FromGitter | <gogolxdong> yes. |
14:43:16 | FromGitter | <gogolxdong> which we have worked on for half a year. |
14:43:30 | FromGitter | <tim-st> does it work without leaks? how many requests at max and how long does it run? |
14:44:59 | * | leorize quit (Read error: Connection reset by peer) |
14:45:43 | * | leorize joined #nim |
14:46:31 | FromGitter | <krux02> @kaushalmodi are you online? |
14:46:55 | FromGitter | <kaushalmodi> Yep |
14:47:15 | FromGitter | <krux02> I would really like to contribute to nim-mode, but I need support to do so |
14:47:17 | FromGitter | <gogolxdong> good question, you can test https://www.bafang.cloud |
14:47:52 | FromGitter | <krux02> nim-mode is really quite complex and big and I only understand a fraction of what is going on |
14:47:58 | FromGitter | <kaushalmodi> @krux02 I am not the nim-mode developer. But you can start an issue/PR in the nim-mode repo and I will join in |
14:48:23 | FromGitter | <krux02> then who is the nim-mode developer? |
14:49:11 | FromGitter | <gogolxdong> memory leakage is what I am concerning , but with packedjson, the memory usage has been reduced dramatically. |
14:49:20 | FromGitter | <kaushalmodi> @krux02 https://github.com/nim-lang/nim-mode |
14:49:39 | FromGitter | <kaushalmodi> https://github.com/nim-lang/nim-mode/graphs/contributors |
14:50:07 | FromGitter | <kaushalmodi> It's mainly Yuta Yamada |
14:50:14 | FromGitter | <tim-st> @gogolxdong ok, do you use `asynchttpserver` with nims default gc? |
14:50:30 | FromGitter | <DanielSokil> Hello, I have a question regarding `iterator`. |
14:50:33 | FromGitter | <tim-st> I thought about finishing my jsonstream lib that uses nearly no memory |
14:50:33 | FromGitter | <gogolxdong> --gc:regions |
14:50:35 | FromGitter | <kaushalmodi> I see that he's not very active lately.. but if you open an issue/PR and if he doesn't respond in timely manner, then I can fork it |
14:50:45 | FromGitter | <krux02> I need to chat in person with Yuta Yamada otherwise there is no chance for me to improve nim-mode |
14:50:45 | * | zacharycarter quit (Ping timeout: 252 seconds) |
14:50:50 | FromGitter | <gogolxdong> good to know. |
14:51:00 | pigmej | krux02: why? |
14:51:10 | FromGitter | <gogolxdong> might help. |
14:51:19 | FromGitter | <kaushalmodi> @krux02 Just ping him in an issue and explain this issue |
14:51:47 | FromGitter | <krux02> I have several issues in nim-mode |
14:51:52 | FromGitter | <krux02> no response |
14:52:05 | FromGitter | <tim-st> @gogolxdong thanks, I will test this regions thing, maybe this helps |
14:52:16 | FromGitter | <krux02> https://github.com/nim-lang/nim-mode/issues/198 |
14:52:21 | * | gangstacat quit (Quit: Δis!) |
14:52:26 | pigmej | I'm pretty sure that I still have merge rights if sth |
14:52:29 | pigmej | (in nim-mode) |
14:53:06 | krux02 | pigmej: do you understand emacs and nim-mode? |
14:53:40 | krux02 | I need someone to talk to, it is very frustrating to fix nim-mode issues in isolation and then get refused pull requests |
14:53:49 | pigmej | I authored some stuff there ~3y ago |
14:53:49 | krux02 | that is my experience with nim-mode in the past |
14:54:02 | krux02 | what did you author? |
14:54:24 | pigmej | company afair |
14:54:34 | krux02 | I disabled company mode |
14:54:37 | pigmej | ;D |
14:54:38 | krux02 | in nim |
14:54:40 | krux02 | too slow |
14:54:44 | pigmej | hmmm |
14:54:57 | krux02 | basically everything in nim-mode is too slow to work with |
14:54:59 | krux02 | even font lock |
14:55:05 | pigmej | nimsuggest is probably the cause |
14:55:08 | krux02 | yes, syntax highlighting is too slow |
14:55:11 | FromDiscord | <awr> yeah i had to disable nimsuggest too |
14:55:14 | FromGitter | <gogolxdong> asynchttpserver yes , another thing is public resource runs out of 8G memory in 2 mins, because the response of different providers from different regions concurrently is memory consuming, which have not been profiled. |
14:55:15 | FromDiscord | <awr> company mode too |
14:55:38 | pigmej | let me check something, there was some setting that I used to enable |
14:55:42 | FromDiscord | <awr> eldoc too |
14:55:46 | krux02 | I do computer graphics programming, I know how to implement things fast |
14:56:10 | krux02 | and what I understood so far from font-lock mode, it is horribly slow |
14:56:12 | pigmej | some parts that are used to connect to nimsuggest are in sync mode |
14:56:24 | pigmej | but font-lock mode .... that would be weird |
14:56:40 | krux02 | yes font-lock mode is freezing my editor |
14:56:42 | FromDiscord | <awr> honestly we really need a whole new emacs for the 21st century rather than an emacs that pretends like it's in the 21st century |
14:56:46 | krux02 | and I found out the problem |
14:56:51 | krux02 | it is the backtick matching |
14:56:57 | krux02 | I don't understand fully how it works |
14:57:23 | krux02 | I don't like the coding stylie of nim-syntax very much, I have problems reading the code |
14:57:31 | krux02 | I need a day to understand 20 lines of code |
14:57:38 | krux02 | full time |
14:57:48 | krux02 | because everything is new in there |
14:57:53 | pigmej | that's a part that is mystery to me too ;/ |
14:57:57 | krux02 | every used function I need to look up, then I need to learn it |
14:57:58 | krux02 | etc |
14:59:18 | FromGitter | <kaushalmodi> krux02: The font-lock freezing up would be, I think, just bad code |
14:59:18 | krux02 | pigmej, but you can try to fix the performance problems with nimsuggest |
14:59:32 | FromGitter | <kaushalmodi> Org mode, et al use much more complex font locking and those don't freeze up |
14:59:44 | pigmej | there is one easy fix that I'm trying to remind myself now |
15:00:32 | * | vivus quit (Remote host closed the connection) |
15:00:36 | pigmej | for sure you can try to remove --refresh option from nimsuggest |
15:00:41 | krux02 | kaushalmodi: yeas the code is bad. But "your code sucks in every possible way" it is not the best opener to get help |
15:00:45 | pigmej | because it tend to explode everything |
15:01:09 | krux02 | pigmej, no I don't dig into nimsuggest now |
15:01:18 | krux02 | syntax highlighting is more important |
15:01:30 | pigmej | frankly speaking I never had problem with syntax highlighting |
15:01:32 | krux02 | but you can try to fix the problem it is important |
15:01:35 | pigmej | maybe it's because of my environment |
15:01:54 | pigmej | krux02: I have literaly 0 time, and as I wrote I'm probably stepping back from Nim again ;/ |
15:02:09 | pigmej | but company should be fast enough with `--refresh` removed |
15:02:15 | krux02 | pigmej, did you ever open the opengl bindings file in nim-mode? |
15:02:21 | pigmej | no |
15:02:21 | FromGitter | <kaushalmodi> krux02: I can help intermittently this week; step by step we will improve the syntax highlighting |
15:02:29 | krux02 | that is a file that is for the most part generated from the openGL spec |
15:02:37 | krux02 | much bigger than other files |
15:02:51 | krux02 | 3300 lines |
15:02:58 | krux02 | but still not vastly big |
15:03:12 | krux02 | but that just kills the syntax highlighting |
15:03:44 | krux02 | kaushalmodi, as I said, it is the backtick matcher |
15:03:46 | pigmej | link |
15:04:27 | krux02 | aparently to highlight the ``backticks`` in comments, there is a function that scans to a comment start, then scanns to all backticks from there |
15:04:43 | krux02 | no matter if they are still in the comment or not |
15:04:49 | pigmej | aha |
15:04:56 | pigmej | ok then I can imagine how bad it becomes |
15:04:58 | FromGitter | <kaushalmodi> krux02: Yes, I read that. |
15:05:05 | krux02 | `nim-syntax.el' |
15:05:14 | krux02 | `nim-backtick-matcher' |
15:05:19 | pigmej | krux02: I meant opengl file :) |
15:05:25 | krux02 | ah |
15:05:30 | FromGitter | <kaushalmodi> I'd start by first disabling that matcher altogether and see what that could break. |
15:05:53 | krux02 | https://github.com/krux02/opengl-sandbox/blob/master/glad/gl.nim |
15:06:17 | pigmej | hmm you can safely remove it nothing will break |
15:06:28 | krux02 | I modified that file to disable font-lock-mode but still enable syntax highlighting once |
15:07:05 | pigmej | submit PR to disable backtick highlihgting? |
15:07:30 | krux02 | pigmej, for sure that will be rejected |
15:08:29 | FromGitter | <kaushalmodi> pigmej: That's not a solution. I suggested that as a means to start debugging. |
15:09:08 | krux02 | this is the end of my nim-mode hook:http://ix.io/1moR |
15:09:11 | FromGitter | <kaushalmodi> The solution should allow doing the backtick highlighting without notable performance impact. |
15:09:38 | FromGitter | <kaushalmodi> krux02: Pinging on emacs help mailing list would also help. Post the offending snippet and the profiler report |
15:11:52 | pigmej | I don't know that part of a code that much that I could help folks |
15:14:03 | krux02 | kaushalmodi: I am in emacs irc, and I got the hint to do fontlock-studio |
15:14:06 | krux02 | it helped |
15:14:46 | FromGitter | <kaushalmodi> krux02: Yes, I have heard of that package. That dev is Emacs font locking pro |
15:15:07 | FromGitter | <kaushalmodi> Anders Lindgren |
15:16:05 | FromGitter | <kaushalmodi> I see that he responds to font locking issue emails on the emacs devel mailing list |
15:19:40 | * | kapil___ joined #nim |
15:20:40 | FromGitter | <gogolxdong> Is there any way to test memory leakage? |
15:22:28 | * | Trustable joined #nim |
15:22:52 | leorize | gogolxdong: there's LeakSanitizer if you use gcc/clang |
15:24:15 | * | gangstacat joined #nim |
15:24:28 | FromGitter | <gogolxdong> thanks, will check out. |
15:29:43 | FromGitter | <tim-st> this is a minimum reproducable example without dependencies to see what I mean with leaks: https://gist.github.com/tim-st/30eb88b2a96fdd77623be945dff5fc2a |
15:31:15 | FromGitter | <tim-st> After the file is downloaded the RAM should go down but for `http://localhost:8080/blob/size/100000000` it stays at 436mb, and I dont want to try bigger downloads... |
15:32:20 | TheLemonMan | well, that's not a memory leak |
15:32:27 | FromGitter | <tim-st> what is it? |
15:32:30 | TheLemonMan | it's just how the GC behaves |
15:33:07 | FromGitter | <tim-st> it always stays at the biggest size that was requested once and increases from this size slowly by time |
15:33:20 | FromGitter | <tim-st> why not go down again like python? |
15:33:36 | FromGitter | <tim-st> I heard the nim forum servr crashes after a month or so |
15:34:07 | TheLemonMan | hmm, it should not increase if the heap becomes large enough |
15:34:13 | * | cwilby quit (Ping timeout: 245 seconds) |
15:34:46 | FromGitter | <tim-st> My guess is that `resize` is called for increasing and decreasing but `resize` only increases |
15:34:50 | pigmej | anyone have exp with reactor.nim ? |
15:35:13 | pigmej | probably besides zielmicha__ |
15:36:02 | TheLemonMan | yeah but once you make the heap big enough to handle the peak value its size should be quite constant (unless another bigger chunk is requested) |
15:36:19 | TheLemonMan | but yeah, GC are often very reluctant to release memory back to hte OS |
15:37:19 | FromGitter | <tim-st> no, there is another problem: once the total gc amount was resized (increased) the current occupied amount is now higher than it was in a smaller total amount although the same "work" was done or nothing was done at all |
15:37:55 | pigmej | TheLemonMan: for me it always grows too |
15:38:05 | FromGitter | <tim-st> you can see this by following gcStatistics after some time |
15:38:17 | FromGitter | <tim-st> I tried ~60 minutes |
15:38:32 | pigmej | I'm already at GC_getStatistics: [GC] total memory: 112558080 |
15:38:55 | pigmej | GC_getStatistics: [GC] total memory: 151158784 now |
15:39:09 | FromGitter | <tim-st> the total memory is not a hard problem, the hard problem is the currentOccupied Memory is not consistent but grows too |
15:39:34 | FromGitter | <tim-st> the total memory could be made smaller but the totcal occupied not, that's a bug/leak imo |
15:39:43 | FromGitter | <tim-st> but I'm not an expert of course |
15:41:40 | pigmej | I ran wrk against it |
15:41:51 | pigmej | and well.... memory ended on my server :) |
15:45:05 | FromGitter | <krux02> @kaushalmodi I wrote Anders Lindgrep a personal e-mail |
15:45:19 | FromGitter | <krux02> I don't want to be part of any mailing list. |
15:46:03 | FromGitter | <krux02> I never worked with mailing lists and I don't want to. I fear too much spam in mail mail inbox. |
15:46:09 | FromGitter | <krux02> It is already too much today |
15:46:18 | pigmej | Try notmuch :) |
15:46:21 | FromGitter | <kaushalmodi> @krux02 You have some wrong notion about mailing lists |
15:46:34 | FromGitter | <kaushalmodi> You just email to the list and request that you be CC'd |
15:46:39 | FromGitter | <kaushalmodi> You don't have to subscribe to one. |
15:46:48 | * | zacharycarter joined #nim |
15:47:05 | FromGitter | <kaushalmodi> For the record, I have been subscribing to emacs-help, emacs-devel, org mode mailing list for about 8 years now; 0 spike in spam |
15:47:37 | FromGitter | <krux02> that is unknown technology to me |
15:47:51 | FromGitter | <kaushalmodi> umm.. it's plain email |
15:48:00 | FromGitter | <krux02> yea |
15:48:02 | FromGitter | <krux02> I kno |
15:54:08 | FromGitter | <tim-st> TheLemonMan: if I download repeadetly from `http://localhost:8080/blob/size/100000000` not at the same time it still increases ram by much; now I'm from 365mb at 925mb |
15:56:49 | TheLemonMan | I think that happens because the cycle checker threshold grows as the heap gets larger and you end up overallocating |
15:57:13 | FromGitter | <tim-st> so it's a bug? |
15:58:06 | FromGitter | <tim-st> on Python I never reach more than 80mb |
16:00:12 | FromGitter | <tim-st> why does it say: `[GC] occupied memory: 704745664` isnt that cleaned before increasing size? |
16:01:33 | TheLemonMan | let Araq tell if it's a bug or not (a feature perhaps? :) |
16:03:00 | FromGitter | <tim-st> I mean I understand that the gc increases total amount when it thinks it doesnt has enough free memory left, but afaik I shouldnt have any occupied mem and it tells me I have 700mb occupied |
16:08:08 | * | miran joined #nim |
16:09:15 | miran | hey all! i've (finally) started experimenting with macros. is there any tutorial about macros? |
16:12:31 | miran | `dumpAstGen` is great, but i still have trouble connecting everything into a coherent macro |
16:14:24 | FromGitter | <Vindaar> @miran: `dumpTree` or from within a macro `treeRepr` as well as `repr` itself are really useful too. I don't know about any real tutorials though (besides what's in Nim in Action, but to me that was way too advanced when I first read it) |
16:15:53 | FromGitter | <Vindaar> for me just playing around (sometimes with macros other people wrote) helped the most |
16:16:28 | FromGitter | <Vindaar> I wanted to learn macros in the beginning, but looking back what held me back the most, was not realizing what might be possible with a macro and what isn't |
16:17:39 | miran | ok, i've manged to create a type declaration for a ref object, and a proc that receives an instance of that object and does something with it. now i need to create an instance and call the proc - i'm not sure how to do it |
16:17:48 | FromGitter | <kaushalmodi> Sorry @Vindaar, I was supposed to get back to you after trying out Nim macros.. I am faced with some block that just prevents me from doing that. |
16:17:50 | FromGitter | <kaushalmodi> some day .. |
16:18:31 | FromGitter | <Vindaar> @kaushalmodi haha, no worries at all! :) I get lost "getting back to things" all the time too |
16:19:21 | FromGitter | <Vindaar> @miran: that sounds like you're already well under way |
16:20:04 | miran | @Vindaar: as i said, `dumpAstGen` is the real hero. i just copy-pasted stuff produced by it |
16:20:24 | FromGitter | <Vindaar> haha, ok. I've been surprised by how well that worked, too :D |
16:20:59 | FromGitter | <Vindaar> If you have some code you want to produce from what kind of input, I |
16:21:12 | FromGitter | <Vindaar> I'm happy to try to help |
16:21:44 | miran | ok, let me make an example, just a sec |
16:21:52 | TheLemonMan | don't forget about "quote" |
16:22:17 | FromGitter | <Vindaar> good point, that's even more useful :) |
16:23:50 | miran | http://ix.io/1mpg |
16:24:10 | miran | under the line is what i'm trying to do curently |
16:24:41 | miran | TheLemonMan: i have seen `quote do` here and there, but haven't used/understood it yet |
16:25:32 | FromGitter | <Vindaar> `quote do` basically allows you to write normal Nim code and have that converted to the `NimNode` representation |
16:26:33 | TheLemonMan | yeah, but it allows you to plug various pieces (NimNodes) from the outer scope |
16:29:26 | FromGitter | <mratsim> think of it as interpolating compile-time with run-time |
16:29:57 | FromGitter | <mratsim> just like &βMy fixed and {interpolated} string" |
16:30:39 | FromGitter | <Vindaar> hehe, I should let smarter people than me talk :D β miran: I assume that `Shape` and the `kind` enum would already be defined, yes? |
16:31:02 | miran | yes, they are defined, as is `calcArea` proc |
16:36:46 | * | abm joined #nim |
16:36:46 | miran | i did this in my macro: http://ix.io/1mpn and `a` is `IntLit` - don't know how to pass that to a proc which creates an instance of `Shape`, there is no `IntLit` type!? |
16:37:02 | * | nsf joined #nim |
16:38:48 | * | shadowbane quit (Remote host closed the connection) |
16:40:31 | * | shadowbane joined #nim |
16:42:20 | FromGitter | <Vindaar> using `quote do`, something like what you did there and a lot of hardcoded things (:P), you can do something like this: http://ix.io/1mps/nim |
16:43:46 | miran | thanks @Vindaar! from a quick look, it seems like `toNimIdent` is what i need |
16:44:24 | miran | and it seems this `quote do` is something i really need to start using :) |
16:44:36 | FromGitter | <Vindaar> yes, it's *really* helpful |
16:46:55 | miran | OMG, this `quote do` is magic!! |
16:47:21 | miran | sorry `dumpAstGen`, i now have a new best friend! |
16:47:22 | FromGitter | <kaushalmodi> miran: Please enlighten with a blog post or something :) |
16:47:48 | FromGitter | <kaushalmodi> I need to bookmark this conversation for now |
16:48:00 | miran | @kaushalmodi: once i get more familiar with it β i'll do it |
16:48:05 | FromGitter | <Vindaar> and it's good to keep in mind that you can just define compile time procs, which handle certain parts of the code you construct by having them work on `NimNode`. e.g. refactoring the above to: http://ix.io/1mpu/nim |
16:48:54 | miran | i'll post my coplete code when i finish it, so y'all can take a look (and give me advice what to change :)) |
16:49:33 | FromGitter | <Vindaar> :) |
16:50:11 | miran | i managed to do it!!! wooohooo! |
16:50:33 | miran | @Vindaar thank you very much for the example, it was very helpful! |
16:51:46 | FromGitter | <Vindaar> cool, glad I could be of service :D |
16:53:47 | * | Trustable quit (Remote host closed the connection) |
16:56:13 | miran | here it is: http://ix.io/1mpv/ |
16:59:23 | miran | and with some comments to see what each proc does: http://ix.io/1mpw/ |
17:00:18 | FromGitter | <Vindaar> nice! |
17:00:31 | miran | procs were created with `dumpAstGen`, don't know if this was the way to go, or there is some simpler way to do these things |
17:00:41 | FromGitter | <Vindaar> and the types defined like this make a lot more sense :D |
17:00:46 | FromGitter | <dm1try> > this is a minimum reproducable example without dependencies to see what I mean with leaks: https://gist.github.com/tim-st/30eb88b2a96fdd77623be945dff5fc2a β β yep, I'm playing around with this code and notice that on every request there is at least 3 allocations (each of them equal a body size) and only 2 deallocations later |
17:01:34 | FromGitter | <dm1try> used `logAlloc = true` and call `GC_full_collect` before each request |
17:06:08 | FromGitter | <razuit> is it possible to import a const with .importc? Looking at importing a const from a C .h header file without redefining it |
17:07:29 | FromGitter | <mratsim> yes but only as a var |
17:08:25 | FromGitter | <tim-st> @dm1try very good catch, exactly my feeling when I recognized it had the same ram grow curve like no gc at all |
17:08:54 | FromGitter | <tim-st> I tried GC_full_collect already didnt change |
17:10:09 | FromGitter | <razuit> @mratsim how would that look like? |
17:12:37 | * | voice_ftp joined #nim |
17:15:53 | * | voiceftp quit (Ping timeout: 276 seconds) |
17:22:20 | * | a_b_m joined #nim |
17:23:24 | * | darithorn joined #nim |
17:25:28 | * | abm quit (Ping timeout: 245 seconds) |
17:39:21 | * | PMunch joined #nim |
17:40:47 | * | smt` joined #nim |
17:41:13 | * | smt` quit (Max SendQ exceeded) |
17:42:49 | FromGitter | <mratsim> var foo {.importc βCnameβ, header: βpath/to/header.hβ.} |
17:43:27 | * | smt quit (Ping timeout: 240 seconds) |
17:44:17 | * | epmor joined #nim |
17:45:42 | * | epmor quit (Client Quit) |
17:45:55 | * | epmor joined #nim |
17:48:40 | FromGitter | <DanielSokil> Hello, What is a good example of when to use `reference types` vs `non-reference types`? β β *Here is a non-ref object:* β β ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b96ae77728ddf02828ad364] |
17:51:37 | FromGitter | <glassofethanol_twitter> So ref allocates heap storage? |
17:52:49 | * | epmor quit (Quit: leaving) |
17:55:32 | FromGitter | <DanielSokil> "Traced references point to objects of a garbage collected heap" β https://nim-lang.org/docs/manual.html#types-reference-and-pointer-types |
17:55:56 | FromGitter | <glassofethanol_twitter> Ah I see |
18:05:10 | FromGitter | <Vindaar> @DanielSokil aside from potential performance differences, it makes a big difference regarding mutability of the underlying object |
18:10:03 | * | krux02 quit (Remote host closed the connection) |
18:12:54 | * | erratic quit (Ping timeout: 252 seconds) |
18:14:59 | FromGitter | <DanielSokil> @Vindaar Could you please further explain what you mean by: "mutability of the underlying object"? |
18:18:12 | FromGitter | <kayabaNerve> If I pass an object from A to B and alter it in B, the one in A is also altered |
18:18:19 | FromGitter | <Vindaar> if you use `let` on a non ref object, it cannot be modified, while using `let` on a ref object you can happily modify the underlying object (just not the reference) |
18:18:45 | FromGitter | <kayabaNerve> (because it's the same object and you're just passing a reference) |
18:19:15 | FromGitter | <unreadable> how long till Nim reaches v1.0? |
18:19:15 | FromGitter | <Vindaar> in your example for the ref object, `person1` can also be declared as `let` and it will still change the name of `person1` |
18:19:26 | FromGitter | <kayabaNerve> And sure. Let behaves very differently. It makes sense why. |
18:19:54 | FromGitter | <Vindaar> if you wanted to change a name of a non ref object, you'd need to 1. declare it as a `var` and 2. (if done via a proc) have that proc take a `var Person` argument |
18:20:56 | miran | @unreadable: that is the forbidden question here :P |
18:21:20 | FromGitter | <kayabaNerve> Or take in ref Object and use ref Object from the start. |
18:24:21 | miran | @DanelSokil: http://ix.io/1mpJ/ notice the difference in declaring persons (let vs var) and in procedures (PersonRef vs var PersonObj) |
18:27:06 | FromGitter | <unreadable> oke |
18:40:24 | FromGitter | <tim-st> @dm1try the same for sync version of httpserver: https://gist.github.com/tim-st/abbb86a591172a7b997c853fcda5cff9 |
18:40:43 | FromGitter | <tim-st> the problem is gc or socket |
18:40:58 | FromGitter | <kayabaNerve> EZ |
18:41:01 | FromGitter | <kayabaNerve> Just disable the GC |
18:43:17 | FromGitter | <tim-st> I try to find out if my nim code can be used in production or if I need parts in go, I think "disable gc" is not the best help here |
18:43:22 | miran | @unreadable: v0.19 should be out soon (TM), and from what i know, v1.0 is planned after that |
18:43:48 | FromGitter | <kayabaNerve> No. It's not. I was trying to make a joke. |
18:44:09 | FromGitter | <kayabaNerve> Disabling the GC actually disables a lot of features. |
18:44:33 | FromGitter | <tim-st> actually it compiles fine without gc but the system crashes after a few minutes |
18:45:07 | FromGitter | <kayabaNerve> Interesting. |
18:45:23 | FromGitter | <tim-st> well of course there are warnings |
18:47:14 | FromGitter | <unreadable> @miran that's great |
18:51:19 | FromGitter | <DanielSokil> @unreadable Probably close to 2019, v19 in 2019, make sense to me. |
18:51:37 | FromGitter | <DanielSokil> beta release could be earlier. |
18:52:41 | FromGitter | <DanielSokil> @kayabaNerve @Vindaar Thanks, I really appreciate it. |
18:56:24 | TheLemonMan | tim-st, there's an interesting section in gc.rst about how to dump the heap |
18:56:37 | TheLemonMan | you may want to use that to further debug that problem |
18:57:40 | FromDiscord | <exelotl> anybody know how I can make this work? https://gist.github.com/geckojsc/e1b68d957bc4bdf4008b716341fe163a |
18:59:19 | * | druonysus joined #nim |
18:59:19 | * | druonysus quit (Changing host) |
18:59:19 | * | druonysus joined #nim |
19:01:33 | * | zacharycarter quit (Ping timeout: 252 seconds) |
19:04:56 | PMunch | exelotl, well I did it this way in SDLGamelib: https://github.com/PMunch/SDLGamelib/blob/master/gamelib/ticker.nim |
19:05:53 | FromGitter | <tim-st> TheLemonMan: thanks, that's a good hint, the number of allocs and deallocs is completely different... |
19:06:06 | FromGitter | <tim-st> [Heap] allocs/deallocs: 159/97 |
19:06:58 | PMunch | It's not perfect as it wraps Tickables in an extra proc |
19:07:38 | FromGitter | <tim-st> for repeated calls the number of allocs increases linear and the number of deallocs stays const |
19:08:03 | PMunch | But it's very generic, anything that can tick with a milliseconds count can be added to the ticker |
19:08:35 | FromDiscord | <exelotl> ah yeah I see you're doing it with an anonymous proc |
19:09:49 | * | cyraxjoe quit (Remote host closed the connection) |
19:10:02 | FromGitter | <tim-st> TheLemonMan: If I understand this correct I have 43 strings on heap with nearly 400mb which fits with the number of occupied bytes in gc, so they just dont get collected |
19:10:38 | TheLemonMan | have you tried forcing a fullcollect after the response is sent? |
19:10:41 | FromDiscord | <exelotl> I was hoping to avoid wrapping the call because I'm guessing there's some overhead involved |
19:11:09 | FromGitter | <tim-st> TheLemonMen: I did this before at start but can do it again at start and end |
19:15:15 | PMunch | exelotl, if it's not important for you to give them different names you can simply call them both update |
19:15:26 | PMunch | And let Nim sort of which one to use when you call an object |
19:16:24 | FromGitter | <tim-st> TheLemonMan: this works better but still allocs are ~ +50; the ram still stays at largest that was requested and dont goes back |
19:16:25 | PMunch | Hmm, that doesn't work for putting them in a list though.. |
19:18:20 | * | riidom quit (Ping timeout: 268 seconds) |
19:19:35 | FromDiscord | <exelotl> yeah exactly. Nim provides methods instead of procs to solve this exact problem, except my understanding is that Nim method calls compile into 'dispatch trees' |
19:19:42 | PMunch | exelotl, you can have a look at how yglukhov does it here: https://github.com/yglukhov/ecs |
19:19:43 | FromDiscord | <exelotl> which are effectively a bunch of if statements to check the type at runtime and call the correct procedure. Therefore the more types you have, the slower your program gets. |
19:20:48 | PMunch | Basically what he does is every time you try to add an entity of a new kind to a world it creates a new sequence of that type. When you add an entity that's seen before it's added to the corresponding sequence. |
19:32:54 | FromGitter | <tim-st> TheLemonMan: It seems like nondeterministic behaviour sometimes it cleans a bit then it does not at last I had it at 592mb ram for small request and fullCollect two times in proc: https://gist.github.com/tim-st/abbb86a591172a7b997c853fcda5cff9 |
19:35:06 | TheLemonMan | weird, memory usage stays stable for me |
19:35:41 | FromGitter | <tim-st> what do you mean by memory usage? occupied or total? |
19:35:47 | FromGitter | <tim-st> are you on linux? |
19:35:55 | TheLemonMan | both and yes |
19:36:10 | FromGitter | <tim-st> I'm on windows |
19:36:57 | FromGitter | <tim-st> when you download like 100mb does it go back under 100mb some time? |
19:39:06 | TheLemonMan | no, but I've already told you countless times that memory is not released to the OS |
19:40:05 | FromGitter | <tim-st> so once it's over 1gb a nim program can never use less ram than 1gb? |
19:41:27 | FromGitter | <tim-st> I have like 50 processes open, every one of them goes up and down with ram usage, only the nim program does never |
19:43:08 | TheLemonMan | I'll bite...when should the GC release memory to the OS then? |
19:43:09 | FromGitter | <tim-st> I'm now implementing the same example code in go to see if it does down there (I think it does) |
19:44:02 | * | erratic joined #nim |
19:44:18 | FromGitter | <tim-st> it should do this by looking at the growth factor, when it has too much total memory it should resize by div 2 if it has too less it should resize by mul 2 |
19:44:41 | pigmej | TheLemonMan: That's not true using examples from tim-st I can easily use all memory on system |
19:44:42 | pigmej | on linux |
19:44:43 | FromGitter | <unreadable> somehow I couldn't compile a simple nim app because gcc couldn't find libisl.so.15 |
19:44:59 | FromGitter | <unreadable> doing a quick check, found I have libisl.so.19 oO |
19:45:10 | FromGitter | <unreadable> should I reinstall the lib? |
19:45:42 | FromGitter | <tim-st> pgmej: I think the behaviour is not normal, on Python they dont use lots of gigabytes forever too, but I will implement in golang now, too see if I'm wrong |
19:46:25 | pigmej | yup |
19:47:04 | zestyr | it seems most of the memory is caused by lots of overhead by using multipartdata objects |
19:47:47 | zestyr | sending a ~40 MB file can easily jump to 200 MB occupied because the file is read into a string, which is added to a multipartdata object, which is then formatted into another string, and then sent via a socket |
19:48:29 | zestyr | in the httpclient library that is |
19:49:03 | * | zacharycarter joined #nim |
19:49:03 | * | kungtotte quit (Read error: Connection reset by peer) |
19:49:34 | zacharycarter | question - is it possible to define an operator as a macro with a symbol like `${}` ? |
19:49:43 | * | kungtotte joined #nim |
19:50:06 | zestyr | the GC not letting go of that memory afterwards is pretty annoying since that can lead to an otherwise very lightweight program constantly using a lot of system memory |
19:55:05 | * | rockcavera quit (Remote host closed the connection) |
20:06:41 | * | rockcavera joined #nim |
20:08:04 | * | Etheco- quit (Read error: Connection reset by peer) |
20:13:36 | * | zacharycarter quit (Ping timeout: 252 seconds) |
20:16:23 | dom96 | zestyr: please make issues for this |
20:17:24 | FromGitter | <dm1try> @tim-st could you try with `--gc:markAndSweep`? |
20:19:43 | FromDiscord | <Shield> Is there a reason why this doesn't work |
20:19:43 | FromDiscord | <Shield> ``` |
20:19:43 | FromDiscord | <Shield> var socket = newAsyncSocket() |
20:19:43 | FromDiscord | <Shield> while true: |
20:19:43 | FromDiscord | <Shield> try: |
20:19:44 | FromDiscord | <Shield> waitFor connect(socket, server_address) |
20:19:44 | FromDiscord | <Shield> break |
20:19:45 | FromDiscord | <Shield> except: |
20:19:47 | FromDiscord | <Shield> echo "Retrying in 5sec" |
20:19:48 | FromDiscord | <Shield> waitFor sleepAsync 5000 |
20:19:50 | FromDiscord | <Shield> ``` |
20:19:51 | FromDiscord | <Shield> while this does |
20:19:52 | FromDiscord | <Shield> ``` |
20:19:54 | FromDiscord | <Shield> var socket = newAsyncSocket() |
20:19:55 | FromDiscord | <Shield> while true: |
20:19:57 | FromDiscord | <Shield> try: |
20:19:58 | FromDiscord | <Shield> waitFor connect(socket, server_address) |
20:20:00 | FromDiscord | <Shield> break |
20:20:01 | FromDiscord | <Shield> except: |
20:20:02 | FromDiscord | <Shield> echo "Retrying in 5sec" |
20:20:04 | FromDiscord | <Shield> waitFor sleepAsync 5000 |
20:20:05 | FromDiscord | <Shield> socket.close() # not sure if this needed |
20:20:07 | FromDiscord | <Shield> socket = newAsyncSocket() |
20:20:08 | FromDiscord | <Shield> ``` |
20:21:39 | PMunch | Shield, please use a paste service like pastebin or ix.io when sharing code |
20:23:30 | zestyr | dom96: sorry, I will. still investigating the causes and possible solutions |
20:23:32 | FromGitter | <dm1try> @tim-st with `markAndSweep ` there is 3 allocations and 3 deallocations for the response body vars; and this works fine because a new memory is required if there is no reserved memory as we expected before |
20:24:16 | FromGitter | <dm1try> btw I tested `devel` branch =) |
20:25:01 | FromDiscord | <Shield> my apologies, calling connect again on a socket will keep failing unless you assign a new socket again via newAsyncSocket(), is this the normal behaviour? |
20:41:13 | dom96 | AFAIK this is OS behaviour |
20:47:18 | * | PMunch quit (Remote host closed the connection) |
20:57:44 | * | kapil___ quit (Quit: Connection closed for inactivity) |
20:58:28 | * | miran quit (Ping timeout: 244 seconds) |
21:00:13 | * | xet7_ joined #nim |
21:00:23 | FromDiscord | <exelotl> PMunch: hey I did it! |
21:00:26 | FromDiscord | <exelotl> https://gist.github.com/geckojsc/e1b68d957bc4bdf4008b716341fe163a |
21:00:58 | FromDiscord | <exelotl> solution was to use {.nimcall.} so that it doesn't try to convert them to closures |
21:01:04 | * | xet7 quit (Ping timeout: 240 seconds) |
21:01:06 | FromDiscord | <exelotl> then I can do an unsafe cast |
21:05:43 | FromDiscord | <exelotl> now what I wonder is... do I really need the `tid` field? I'm sure Nim already exposes some type info at runtime which I might be able to use instead, but I don't know how to use it. |
21:08:25 | FromGitter | <mratsim> you can use if Foo is I think |
21:09:11 | FromGitter | <mratsim> or just use methods |
21:09:30 | * | TheLemonMan quit (Quit: "It's now safe to turn off your computer.") |
21:09:49 | FromGitter | <mratsim> instead of proc updateFoo use method updateFoo |
21:14:07 | FromGitter | <arnetheduck> @Araq, now that there's `func`, should all `nosideeffects` pragmas be purged from std lib, as a way of providing a good example? or is `func` uncertain still? |
21:14:08 | FromDiscord | <exelotl> yeah I'm intentionally trying to avoid methods because I don't think they scale well (100 subclasses = 100 else-ifs) |
21:20:41 | FromDiscord | <Shield> what kind of thing you're working on that needs optimization on dynamic dispatch level? |
21:26:05 | * | nsf quit (Quit: WeeChat 2.2) |
21:37:04 | * | zachcarter joined #nim |
21:40:40 | * | Vladar quit (Remote host closed the connection) |
21:46:44 | * | xet7_ is now known as xet7 |
21:51:58 | FromDiscord | <exelotl> @Shield it's just a personal project to see if I can make a really fast 2D game engine that's also clean and easy to use |
21:58:06 | FromDiscord | <exelotl> a reasonably sized game can end up with hundreds of different entity types. Given my understanding of how Nim's multimethods / dispatch trees work, simply adding more types to the game will slow down the update loop, even if those types are rarely used. |
22:00:34 | FromDiscord | <exelotl> I can force there to be a different list for each entity type, then just use static dispatch. But that ruins the 'clean and easy to use' part. |
22:03:32 | FromDiscord | <Shield> oh nice, good luck |
22:07:21 | FromDiscord | <exelotl> thx :) |
22:12:56 | FromGitter | <zetashift> @exelotl good luck! I would love to see the code |
22:23:29 | FromDiscord | <exelotl> thanks, I still have quite a few problems that I'm not sure how to solve (e.g. how to check inside a macro if a procedure exists for a given type) |
22:38:59 | * | xet7 quit (Quit: Leaving) |
22:44:16 | * | stefanos82 quit (Quit: Quitting for now...) |
23:00:50 | FromDiscord | <emekoi> does anyone here know how to use azure pipelines? |
23:02:11 | * | a_b_m quit (Quit: Leaving) |
23:35:47 | FromGitter | <gogolxdong> @bung87 this is a piece of illustrative code for the problem I mentioned yesterday. https://nim-lang.org/docs/manual.html#type-bound-operations-destructors |
23:40:05 | * | sz0 quit (Quit: Connection closed for inactivity) |
23:41:18 | FromGitter | <bung87> oh thanks, seems this is not my use case. |
23:51:26 | * | brainproxy quit (Quit: WeeChat 2.2) |
23:51:59 | FromGitter | <gogolxdong> Your Job features a field with destructable type and you did not provided an explicit implementation. |
23:55:33 | FromGitter | <bung87> I think the example will safe for without gc |
23:56:58 | * | noonien quit (Quit: Connection closed for inactivity) |
23:59:46 | FromGitter | <gogolxdong> I am trying to prove that doesn't leak, also to detect for our backend. |