00:16:17 | * | rockcavera joined #nim |
00:16:17 | * | rockcavera quit (Changing host) |
00:16:17 | * | rockcavera joined #nim |
00:29:36 | * | rockcavera quit (Remote host closed the connection) |
00:30:46 | * | rockcavera joined #nim |
00:30:46 | * | rockcavera quit (Changing host) |
00:30:46 | * | rockcavera joined #nim |
00:31:28 | FromDiscord | <retkid> how can i add multiple header values |
00:31:32 | FromDiscord | <retkid> currently its like |
00:31:43 | FromDiscord | <retkid> {"Cookie" : cookie} |
00:31:52 | FromDiscord | <retkid> but tables cant have multiple values? |
00:32:26 | * | vicfred quit (Quit: Leaving) |
00:33:32 | FromDiscord | <treeform> headers are not tables, create newHttpHeaders() then just .add multiple to it |
00:33:53 | FromDiscord | <retkid> oh wait |
00:33:59 | FromDiscord | <retkid> nevermind i had already figured out this problem |
00:34:06 | FromDiscord | <retkid> they're separated by semicolons |
00:34:09 | FromDiscord | <retkid> đ€Šââïž |
00:41:51 | FromDiscord | <Elegantbeef> table constructors should be able to have multiple values, `{a: b, c: d}` is a shorthand of `array[len, (typeof(a), typeof(b))`â”(@retkid) |
00:42:10 | FromDiscord | <retkid> In reply to @Elegantbeef "table constructors should be": aint that ugly tho |
00:42:19 | FromDiscord | <Elegantbeef> Aint what ugly? |
00:43:46 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3QyX |
00:44:25 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3QyY |
00:46:13 | FromDiscord | <Elegantbeef> So what is ugly? |
01:03:43 | * | jmdaemon quit (Quit: ZNC 1.8.2 - https://znc.in) |
01:05:01 | * | jmdaemon joined #nim |
01:47:54 | NimEventer | New question by itil memek cantik: Nim overloaded operator on infix has failed, see https://stackoverflow.com/questions/71246114/nim-overloaded-operator-on-infix-has-failed |
01:48:59 | FromDiscord | <Rika> In reply to @NimEventer "New question by itil": who is this in the chat again? |
01:49:00 | FromDiscord | <Rika> https://nim-lang.org/docs/manual_experimental.html#special-operators-dot-operators |
01:49:08 | FromDiscord | <Rika> .= is a special operator i believe |
01:49:19 | FromDiscord | <Rika> ah seems like its behind a flag anyway |
01:49:37 | FromDiscord | <Rika> not sure what the behavior is other wise |
01:49:39 | FromDiscord | <Rika> (edit) "other wise" => "otherwise" |
01:51:51 | * | fowl quit (Quit: Ping timeout (120 seconds)) |
01:52:10 | * | fowl joined #nim |
01:53:14 | FromDiscord | <huantian> @abdu |
01:58:41 | FromDiscord | <Rika> ah |
01:58:41 | FromDiscord | <Rika> lol |
01:58:47 | FromDiscord | <Rika> the error is not related to .= |
02:13:04 | * | mahlon quit (Ping timeout: 272 seconds) |
02:24:21 | FromDiscord | <Elegantbeef> Yea the issue is just wrong code |
02:24:35 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#ix=3QzA works fine |
02:48:06 | * | rockcavera quit (Remote host closed the connection) |
02:51:46 | * | rockcavera joined #nim |
02:51:46 | * | rockcavera quit (Changing host) |
02:51:46 | * | rockcavera joined #nim |
04:01:40 | * | krux02 quit (Remote host closed the connection) |
04:06:01 | * | supakeen quit (Quit: WeeChat 3.4) |
04:06:31 | * | supakeen joined #nim |
04:09:53 | * | arkurious quit (Quit: Leaving) |
04:51:07 | NimEventer | New thread by Mardiyah: Create overloaded operator as infix , see https://forum.nim-lang.org/t/8944 |
05:13:18 | * | ltriant quit (Ping timeout: 256 seconds) |
05:38:47 | * | mahlon joined #nim |
05:44:18 | FromDiscord | <Rika> Same question |
05:53:16 | * | rockcavera quit (Remote host closed the connection) |
05:59:12 | * | slowButPresent quit (Quit: leaving) |
06:07:06 | FromDiscord | <retkid> alright |
06:07:17 | FromDiscord | <retkid> do you think theres anyway to manipulate the scroll wheel when i crawl a page |
06:07:28 | FromDiscord | <retkid> or should i try and manipulate the JS |
06:07:33 | FromDiscord | <retkid> or should i switch to selenium |
06:13:33 | * | ltriant joined #nim |
06:21:35 | * | ltriant quit (Ping timeout: 256 seconds) |
07:25:24 | * | jjido joined #nim |
07:53:36 | * | wyrd quit (Remote host closed the connection) |
07:58:48 | * | wyrd joined #nim |
08:15:53 | * | PMunch joined #nim |
08:23:06 | * | gsalazar joined #nim |
08:29:31 | * | gsalazar_ joined #nim |
08:29:38 | * | gsalazar_ quit (Remote host closed the connection) |
08:29:48 | * | gsalazar_ joined #nim |
08:30:11 | * | gsalazar_ quit (Remote host closed the connection) |
08:31:48 | * | gsalazar quit (Ping timeout: 240 seconds) |
08:35:07 | FromDiscord | <dangbinghoo> hi, is there any way to control nim GC heap (Max) size ? |
08:36:45 | FromDiscord | <Rika> What would the program do on max reached? |
08:45:08 | FromDiscord | <dangbinghoo> In reply to @Rika "What would the program": I have no idea, I'm just using nim's json module, and as you said, esp32 may have not enough mem for running this module |
08:45:27 | FromDiscord | <dangbinghoo> https://media.discordapp.net/attachments/371759389889003532/946326951935758346/unknown.png |
08:45:30 | FromDiscord | <Rika> I think there are ways to get the current used memory within code |
08:46:03 | FromDiscord | <Rika> Then you can just periodically check that and crash or whatever, send info I donât know when you reach a threshold |
08:47:24 | FromDiscord | <Rika> If you use refc https://nim-lang.org/docs/refc.html |
08:53:48 | FromDiscord | <lantos> Should be easy in jsâ”Simple implementation is just to use something like window.scrollto or use a jQuery library. |
08:55:50 | FromDiscord | <dangbinghoo> In reply to @Rika "If you use refc": ok, thanks, but I 1st need to check-out what the esp32 core-dump message really is, make sure it's telling memory related issues |
09:00:07 | * | cheer[m] quit (Quit: You have been kicked for being idle) |
09:30:50 | * | krux02 joined #nim |
09:31:38 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzzâŠ) |
09:36:38 | PMunch | Does the 32 have the same kind of watchdog that the 8266 does? |
09:38:21 | PMunch | Maybe try packedjson, I believe that would be friendlier on the GC |
09:39:52 | PMunch | @dangbinghoo, and which flags are you compiling with? If you use the default GC it will try to load memory in chunks and manage it itself, which can easily cause you to use more memory than you actually need. |
09:40:19 | PMunch | Try with --gc:arc -d:useMalloc |
09:57:21 | PMunch | Hmm, what is the best command-line parser out there nowadays? |
10:01:58 | FromDiscord | <SolitudeSF> cligen |
10:06:12 | PMunch | Ooh, cligen looks good indeed |
10:06:25 | PMunch | Has it gotten an upgrade lately? |
10:06:38 | PMunch | I remember having evaluated it in the past and not used it for some reason |
10:07:50 | FromDiscord | <SolitudeSF> it may be cumbersome for some very specific usage patters, but its still the king |
10:12:05 | FromDiscord | <Rika> Probably a preference thin g but I like argparse better |
10:17:29 | FromDiscord | <ajusa> Is there a way to define a type conversion? Eg, how I can do uint32(6), do I just make a proc with the same name as the type? |
10:18:17 | FromDiscord | <dangbinghoo> In reply to @PMunch "Try with --gc:arc -d:useMalloc": yes, I'm using Malloc flag, I had a test that turns out, it may not the problem about memory, I linked the generated .a file in IDF env with my simple C main, and it actually works with nothing wrong. |
10:18:59 | PMunch | Yeah I looked up the EXCCAUSE and it seemed like it tried to touch memory it wasn't allowed to somehow |
10:19:35 | FromDiscord | <Rika> In reply to @ajusa "Is there a way": That wouldnât work, youâll have to make a regular procedure |
10:20:51 | FromDiscord | <dangbinghoo> the dump error pic I put on is that I'm giving nim generated .a with --os:freertos, but I used the static lib actally on nuttx( As if I set os to any, says os.nim is not supported, if I set to linux, nuttx seems lacking of API impl. of `flockfile` |
10:24:31 | PMunch | nuttx? |
10:24:56 | FromDiscord | <Rika> Another RTOS |
10:25:13 | PMunch | Yeah.. os.nim isn't supported for --os:any (which makes sense), but the test is super aggressive. Just import the file (without using any of it) and your program will fail to compile |
10:28:58 | FromDiscord | <dangbinghoo> so, json, jsonutils module can availble for os: any ? |
10:29:20 | PMunch | @dangbinghoo, please like my issue if you want this OS thing to be fixed: https://github.com/nim-lang/Nim/issues/19414 |
10:33:06 | PMunch | @dangbinghoo, the json module should work with os:any |
10:34:35 | FromDiscord | <dangbinghoo> yes, json is all about mem opt actually |
10:35:58 | PMunch | Ouch, I tried to compile a simple snippet with the JSON module |
10:36:08 | PMunch | Let's just say that it takes a lot of memory |
10:37:47 | FromDiscord | <dangbinghoo> In reply to @PMunch "Let's just say that": my c struct from json to json test case used 10KB mem on esp32 with gc: arc |
10:39:01 | PMunch | http://ix.io/3QB7 |
10:39:17 | PMunch | It doesn't run though, I think it just runs out of memory during the parse step |
10:39:33 | FromDiscord | <dangbinghoo> i waited 20seconds after the test and it shows that arc is keeping that mem |
10:41:08 | FromDiscord | <dangbinghoo> In reply to @PMunch "It doesn't run though,": atmel meg chip mem is not big |
10:41:40 | PMunch | Hmm, I tried packedjson, but it doesn't seem to compile on anything but 64bit architectures |
10:41:52 | PMunch | @dangbinghoo, I know |
10:43:13 | FromDiscord | <dangbinghoo> i have 100KB heap on esp32 |
10:44:06 | FromDiscord | <dangbinghoo> yes, json is bad for MCU |
10:45:30 | PMunch | Hmm, if I don't actually try to parse the JSON on the controller it's not that bad: http://ix.io/3QB8 |
10:46:31 | PMunch | Cool, I'm even able to call $ on the data object and write it out over serial |
10:46:55 | PMunch | That uses about twice the program size though :P |
10:47:19 | PMunch | http://ix.io/3QBa |
10:49:18 | FromDiscord | <dangbinghoo> yeah nim is cool for big MCU |
10:52:12 | PMunch | I'm able to build and run with jsony: http://ix.io/3QBc |
10:52:19 | PMunch | Nim is cool for small MCUs as well ;) |
10:52:43 | PMunch | You just need to be careful with memory allocations |
10:52:47 | FromDiscord | <dangbinghoo> đ |
10:53:48 | FromDiscord | <dangbinghoo> jsony and os: any ? |
10:53:53 | PMunch | I mean with the strings stored in an array it's actually not thatbad: http://ix.io/3QBd |
10:53:55 | PMunch | Yup |
10:54:13 | PMunch | I'm compiling with the config from here: https://ratel.peterme.net/gettingstarted.html |
10:55:24 | PMunch | Of course it's nothing compared to using progmem allocated strings: http://ix.io/3QBe |
10:56:48 | FromDiscord | <dangbinghoo> ok, great, now ratel has json support via jsonyđ |
10:57:26 | FromDiscord | <dangbinghoo> selling point increase |
10:57:37 | PMunch | Ratel has support for anything that doesn't import the `os` module :P |
10:58:04 | PMunch | I mean the json module worked as well, as long as you didn't try to parse anything on runtime |
10:58:21 | FromDiscord | <dangbinghoo> In reply to @PMunch "Ratel has support for": yeah, on AVR ! |
10:58:38 | FromDiscord | <dangbinghoo> i mean even |
11:00:19 | PMunch | Haha, it will support ESP32 soon enough. I'm working on the build script logic now, when that is done I think I'll try to do a Nesper binding for Ratel |
11:01:25 | PMunch | But first I'll probably knock out the Attiny85 implementation |
11:01:36 | FromDiscord | <dangbinghoo> great work |
11:03:06 | PMunch | Or maybe I'll do the nim-esp8266-sdk thing first.. |
11:03:13 | PMunch | Or SPI for the existing platforms.. |
11:03:56 | PMunch | Okay, how about I wrap nim-esp8266-sdk while I write the "Implementing a board" guide. Then you can wrap Nesper using that guide ;) |
11:18:10 | * | ltriant joined #nim |
11:21:32 | FromDiscord | <dangbinghoo> yeah, that's ok |
11:23:26 | * | ltriant quit (Ping timeout: 272 seconds) |
11:29:39 | * | vicecea quit (Remote host closed the connection) |
11:30:41 | * | vicecea joined #nim |
11:32:41 | * | jmdaemon quit (Ping timeout: 256 seconds) |
12:06:01 | * | supakeen quit (Quit: WeeChat 3.4) |
12:06:54 | * | supakeen joined #nim |
12:17:26 | * | jjido joined #nim |
12:17:52 | FromDiscord | <Forest> Does Nim have a way to use incremental compiling like other compilers do? |
12:18:05 | FromDiscord | <Forest> Or would i have to use something like zig cc? |
12:20:41 | PMunch | Nim currently doesn't support incremental compilation, but I think it's one of the primary things being worked on at the moment |
12:21:03 | PMunch | Do you feel compilation takes long enough that you need it? |
12:25:16 | FromDiscord | <Forest> Ah fair |
12:25:49 | FromDiscord | <Forest> I'm going to be repeatedly rebuilding the compiler with gradual modifications so yes |
12:25:50 | FromDiscord | <Forest> https://cdn.discordapp.com/emojis/837285319636025366.png?size=48 |
12:26:00 | FromDiscord | <Forest> That's a pineapple emoji- |
12:26:59 | FromDiscord | <Rika> đ |
12:28:48 | PMunch | That's a pumpkin.. |
12:29:05 | PMunch | Have you seen ./koch temp or whatever it's called? |
12:29:24 | PMunch | There's also -d:nimLeanCompiler or something like that |
12:36:49 | NimEventer | New thread by Mardiyah: Knowledge on the failure in overloaded operator of two operands infix ?, see https://forum.nim-lang.org/t/8945 |
12:37:52 | FromDiscord | <Rika> hes back again... |
12:37:59 | FromDiscord | <Rika> were his other posts ignored? |
12:47:22 | FromDiscord | <haolian9 (髿”©äșź)> is there a tutorial for GC, especially for ORC? i read docs for two days, and i still can not figure out how to use. |
12:48:54 | FromDiscord | <Rika> technically, for ORC, you just turn the switch on and use as usual |
12:48:57 | PMunch | ARC/ORC is unfortunately quite under-documented yet |
12:49:02 | FromDiscord | <Rika> what are you finding specifically? |
12:49:14 | PMunch | https://play.nim-lang.org/#ix=3QBL hmm, why can't I push a custom pragma? |
12:49:29 | FromDiscord | <Rika> idk either but afaik it is documented |
12:57:38 | FromDiscord | <haolian9 (髿”©äșź)> sent a long message, see http://ix.io/3QBP |
13:00:09 | PMunch | @Rika, his forum titles are super cryptic, borderline impossible to understand. But his questions aren't too stupid. Probably just a language barrier thing |
13:00:36 | PMunch | Likely it's easier for him to create a forum question instead of asking here and trying to understand in live chat |
13:01:20 | PMunch | haolian9_(髿”©äșź), to just use the ORC gc you should be able to just do `--gc:orc` and then don't worry about it |
13:01:36 | FromDiscord | <Rika> In reply to @PMunch "<@259277943275126785>, his forum titles": i wasnt really talking about the "oh no its this damn dude again" it was more of "oh no did no one answer him" |
13:04:09 | FromDiscord | <Stuffe> Is there any good way to generate hashes where the order of the hashed items don't matter? I was considering hashing each item separately and then adding the hashes, but in this case I don't know how I can turn off overflow check for a specific addition |
13:04:12 | PMunch | Oooh, I try to answer them whenever they post a question :) |
13:04:41 | PMunch | @Stuffe, you could hash every element, then sort them and hash them in that order |
13:04:53 | PMunch | That would mean that no matter the original order they would all have the same hash |
13:04:59 | FromDiscord | <Rika> does hash mixing stuff in another order change the final? huh |
13:05:07 | PMunch | Of course |
13:05:14 | FromDiscord | <Rika> me brain no work |
13:05:15 | FromDiscord | <Rika> pls |
13:05:21 | PMunch | "Hello" isn't the same as "llHoe" |
13:06:07 | FromDiscord | <Rika> yeah my brain is off sorry |
13:07:25 | FromDiscord | <Stuffe> In reply to @PMunch "<@579300975618293801>, you could hash": Actually I should have explained myself better, I also need to be able to combine the hashes in a different order |
13:07:49 | FromDiscord | <Stuffe> Which is why I like the addition idea (a + b) + c == a + (b + c) |
13:08:26 | FromDiscord | <Stuffe> so my idea was to hash the elements first and then just add them |
13:09:51 | PMunch | Ah, yeah that's a different matter |
13:10:18 | PMunch | I mean as long as you just add hashes they should compose like that |
13:10:23 | PMunch | Hashes are just numbers after all |
13:10:41 | PMunch | (as long as the overflow behaviour is deterministic) |
13:11:35 | FromDiscord | <Stuffe> well it is |
13:12:04 | FromDiscord | <Stuffe> I wish there was an integer type with no overflow checking |
13:13:34 | PMunch | Like uint? |
13:16:01 | FromDiscord | <Stuffe> you can still overflow a uint |
13:17:06 | FromDiscord | <Stuffe> oh wait it doesn't error |
13:17:20 | FromDiscord | <Stuffe> ok well then that solves the problem |
13:18:31 | FromDiscord | <demotomohiro> Nim's uint doesn't have over/underflow checks and can be used for pseudo random number generators, hashes or crypt algorithms. |
13:18:58 | * | kenran joined #nim |
13:20:29 | FromDiscord | <Stuffe> nice |
13:21:57 | FromDiscord | <Rika> i still thikn maybe it should have been a separate type |
13:23:22 | FromDiscord | <demotomohiro> `uintX` type for making random bits and `uintY` type for other thing? |
13:23:37 | FromDiscord | <Rika> for overflow checks i mean |
13:31:38 | * | slowButPresent joined #nim |
13:58:06 | * | rockcavera joined #nim |
13:58:06 | * | rockcavera quit (Changing host) |
13:58:06 | * | rockcavera joined #nim |
13:58:39 | FromDiscord | <exelotl> @haolian9_(髿”©äșź) - `=destroy` is called when the object goes out of scope, or when the number of references drops to zero. Here is an example: https://wandbox.org/permlink/zmcba2oek9QBY2tk |
14:08:14 | FromDiscord | <auxym> In reply to @Rika "for overflow checks i": being able to disable overflow checking per module, or with a distinct type, would be pretty neat tbh |
14:08:47 | FromDiscord | <Rika> yeah |
14:09:04 | FromDiscord | <auxym> eg when you want an "unsafe" hot loop for performance critical numerical code |
14:09:06 | FromDiscord | <Rika> same with ints though those dont really make sense but ig the choice is nice |
14:09:23 | FromDiscord | <Rika> actually i recall being able to "enable overflow checking" kinda with ranges |
14:09:30 | FromDiscord | <Rika> actually wait |
14:09:36 | FromDiscord | <Rika> theres a range for unsigned no? |
14:09:40 | FromDiscord | <Rika> Natural i think |
14:09:53 | FromDiscord | <auxym> pretty sure natural is a subrange of `int` |
14:10:31 | FromDiscord | <Rika> i mean a "range" as in a range that covers like uint |
14:11:37 | FromDiscord | <mratsim> In reply to @Stuffe "Is there any good": `{.push overflowCheck:off.}` or something like that |
14:17:20 | FromDiscord | <mratsim> sent a long message, see http://ix.io/3QCp |
14:19:27 | FromDiscord | <ynfle> Is there a way to get the location of the definition of a symbol like with `owner` or something? |
14:20:05 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzzâŠ) |
14:22:20 | FromDiscord | <mratsim> only for generic proc and templates with instantiationInfo. |
14:45:31 | PMunch | @ynfle, you mean like macros.lineInfo? |
14:48:28 | FromDiscord | <haolian9 (髿”©äșź)> sent a code paste, see https://play.nim-lang.org/#ix=3QCz |
14:51:58 | FromDiscord | <Pegacraffft> Hey, a question, what nim UI libs do you guys recommend me to learn. Im really curios ^^ |
14:53:25 | PMunch | @Pegacraffft, depends on what you're trying to make |
14:56:35 | FromDiscord | <exelotl> In reply to @haolian9 (髿”©äșź) "thanks for the example;": how did you allocate `f`? Is `name` a string? |
14:58:39 | FromDiscord | <exelotl> if `f` is a pointer then you can't make a `=destroy` proc for it. `=destroy` can only be defined for `object` types, and will be called for `ref object` but _not_ `ptr object`. |
14:59:31 | * | arkurious joined #nim |
15:02:34 | FromDiscord | <exelotl> arc is just the same as orc, except arc leaks memory when you have cycles in your data structure. Besides that you don't have to do anything differently between them |
15:02:57 | FromDiscord | <haolian9 (髿”©äșź)> oh, you reminded me the different between ref and ptr in nim; dealloc should be used to a ptrâ”(@exelotl) |
15:03:24 | FromDiscord | <exelotl> yeah, and `ref` will be automatically deallocated for you. |
15:04:10 | FromDiscord | <exelotl> you only need `=destroy` if you need to do special cleanup for an object |
15:05:02 | FromDiscord | <exelotl> for example if you allocate a GPU texture when creating the object, you should free it in `=destroy` |
15:08:03 | FromDiscord | <haolian9 (髿”©äșź)> thanks, i'm getting to understand |
15:10:54 | * | Gustavo6046 joined #nim |
15:16:36 | * | kayabaNerve quit (Ping timeout: 240 seconds) |
15:16:44 | * | kayabaNerve joined #nim |
15:24:46 | * | jjido joined #nim |
15:24:57 | * | Gustavo6046 quit (Ping timeout: 240 seconds) |
15:27:34 | * | Gustavo6046 joined #nim |
15:33:31 | FromDiscord | <haolian9 (髿”©äșź)> @\_discord\_570268431522201601\:t2bot.io thanks! if my understand is correct, thenâ”â `=destroy` is a user-defined proc, with or without it, the ref will always be deallocated by nim, so user did not need to dealloc the variable (actually i can find any way to dealloc a ref)â”â `cursor` is similar to python's weakref, but different with owned; both can avoid cycle reference.â”(@mratsim) |
15:37:30 | PMunch | haolian9_(髿”©äșź), correct, you don't need `=destroy` with normal refs, all that is handled for you |
15:37:47 | PMunch | The `=destroy` hook is just a way to hook in custom data types into the GC |
15:49:09 | FromDiscord | <haolian9 (髿”©äșź)> thanksâ”(<@709044657232936960_=50=4dunch=5b=49=52=43=5d>) |
15:57:44 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzzâŠ) |
16:09:40 | * | PMunch quit (Quit: leaving) |
16:33:37 | * | jjido joined #nim |
16:36:18 | FromDiscord | <mratsim> In reply to @haolian9 (髿”©äșź) "thanks (<@709044657232936960_=50=4dunch=5b=49=52=43": For example I use `=destroy` to implement custom threadsafe atomic refcounting:â”- https://github.com/mratsim/weave/blob/master/weave/cross_thread_com/flow_events.nim#L176-L191 |
16:38:44 | FromDiscord | <mratsim> There is one situation that might need `=destroy` on a ref type, it's when on ref dealloc you want to also specify custom handling of inner data type, for example I tie deallocating Cuda/GPU memory to Nim memory here: https://github.com/mratsim/Arraymancer/blob/master/src/arraymancer/tensor/backend/cuda.nim#L29-L39â”â”(this uses an old syntax `new(ref Foo, deallocProc)` called finalizer that will be replaced by `=destroy`) |
16:44:12 | * | kenran quit (Ping timeout: 240 seconds) |
16:45:09 | * | kenran joined #nim |
16:54:59 | FromDiscord | <blabla3131> guys i need a help |
16:55:36 | FromDiscord | <blabla3131> im trying to build a exe which gonna list installed applications on computer |
16:56:47 | FromDiscord | <huantian> Whatâs the issue? |
16:56:49 | FromDiscord | <blabla3131> but im having a problem with Regex redirection |
16:57:31 | FromDiscord | <blabla3131> sent a long message, see http://ix.io/3QDG |
16:58:39 | FromDiscord | <blabla3131> this is my code the First part is working good but second part im getting a Error which says path not exists |
17:01:20 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzzâŠ) |
17:09:45 | * | ltriant joined #nim |
17:11:01 | * | vicfred joined #nim |
17:14:37 | * | ltriant quit (Ping timeout: 250 seconds) |
17:19:47 | FromDiscord | <enthus1ast> please format your code correctly[blabla3131](https://matrix.to/#/@blabla3131:matrix.org) |
17:19:57 | FromDiscord | <enthus1ast> or use https://play.nim-lang.org/ |
17:20:35 | FromDiscord | <blabla3131> okay thank you |
17:20:35 | FromDiscord | <blabla3131> https://play.nim-lang.org/#ix=3QDK |
17:21:12 | FromDiscord | <enthus1ast> still not correct |
17:22:03 | FromDiscord | <huantian> You forgot the indentation |
17:37:49 | NimEventer | New thread by Blabla: Having a Problem w WinRegistry while try to Read subkeys of HKEY_LOCAL_MACHINE, see https://forum.nim-lang.org/t/8948 |
17:42:58 | * | pro joined #nim |
18:04:11 | FromDiscord | <ynfle> In reply to @PMunch "<@757977788056600719>, you mean like": It doesn't give me the delcaration filename and linenumber |
18:08:31 | * | kenran quit (Quit: WeeChat info:version) |
19:03:53 | FromDiscord | <ShalokShalom> Discriminated unions are a thing in Nim? |
19:14:49 | * | jjido joined #nim |
19:17:42 | FromDiscord | <ynfle> Is it not just an object variant? |
19:18:08 | FromDiscord | <ynfle> In reply to @ShalokShalom "Discriminated unions are a": Is it not just an object variant? |
19:25:08 | * | jmdaemon joined #nim |
19:25:25 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzzâŠ) |
19:28:24 | FromDiscord | <ShalokShalom> Yes, it says so |
19:28:44 | FromDiscord | <ShalokShalom> sent a code paste, see https://play.nim-lang.org/#ix=3QEb |
19:28:55 | FromDiscord | <ShalokShalom> How define the next state of an object, then? |
19:29:11 | FromDiscord | <ShalokShalom> This is FSharp |
19:29:20 | FromDiscord | <ynfle> What's the `` operator? |
19:29:31 | FromDiscord | <ShalokShalom> Next state of the object |
19:29:35 | FromDiscord | <ShalokShalom> What is right of it |
19:29:59 | FromDiscord | <ynfle> Like a state machine? |
19:31:07 | FromDiscord | <ynfle> So passableexit has a string, What does next state mean in this context? Room id isn't on there in that union? |
19:33:14 | FromDiscord | <ShalokShalom> https://youtu.be/hsTmLhnzRhE?t=315 |
19:33:24 | FromDiscord | <ShalokShalom> There is it explained |
19:34:03 | FromDiscord | <ShalokShalom> And here is the complete code |
19:34:04 | FromDiscord | <ShalokShalom> https://github.com/thedevaspect/aspect-fsharp/blob/7a1502ff685f962f58a9af57eb549441d752f3e4/Game.fs#L15 |
19:34:22 | FromDiscord | <ShalokShalom> I like taking that example, and comparing it to other languages |
19:38:47 | FromDiscord | <Forest> In reply to @PMunch "That's a pumpkin..": Pineapple- |
19:38:56 | FromDiscord | <Forest> In reply to @PMunch "There's also -d:nimLeanCompiler or": Ah okay, thanks! |
19:39:05 | FromDiscord | <Forest> In reply to @PMunch "Have you seen ./koch": No idea what it is :p |
19:39:46 | FromDiscord | <ynfle> In reply to @Forest "No idea what it": It builds a temp version of the compiler in tens of seconds. For sure less than a minute |
19:40:21 | FromDiscord | <Forest> Huh neat |
19:40:27 | FromDiscord | <Forest> In reply to @ynfle "It builds a temp": Even with my changes? |
19:41:14 | * | kayabaNerve quit (Ping timeout: 272 seconds) |
19:41:36 | FromDiscord | <ynfle> In reply to @Forest "Even with my changes?": Yes |
19:42:02 | FromDiscord | <Forest> Nice! |
19:42:11 | FromDiscord | <Forest> Is there any drawback to it? |
19:42:53 | FromDiscord | <ynfle> My guess is it's not as "good" whatever that means. So use it for testing the compiler, not for benchmarking or production |
19:45:11 | FromDiscord | <ShalokShalom> @ynfle does this give you an idea? |
19:45:18 | FromDiscord | <ShalokShalom> Is there something in Nim? |
19:45:25 | FromDiscord | <ShalokShalom> Can you remodel that? |
19:47:11 | FromDiscord | <ynfle> I'll have to take a look at the video |
19:47:42 | FromDiscord | <Forest> In reply to @ynfle "My guess is it's": Ah fair |
19:50:41 | FromDiscord | <ShalokShalom> So basically to extends object variants like that |
19:50:52 | FromDiscord | <ShalokShalom> (edit) "extends" => "extend" |
19:55:34 | FromDiscord | <ceramicskate0> is it possible to call a nim function in an emit section (c code) in a dll? |
19:56:32 | FromDiscord | <ynfle> In reply to @ceramicskate0 "is it possible to": As long as it has the pragmas `exportc, dynlid` |
20:00:13 | FromDiscord | <Phil> Wait a second... does nim logging work on a "per-file" basis? |
20:00:36 | FromDiscord | <Phil> So do I have to specify a log level etc. in every file individually? |
20:00:39 | FromDiscord | <ynfle> In reply to @ShalokShalom "<@767093711112241162> does this give": `` is basically a tuple or object in nim `next` doesn't seem to be an official keyword and is just a field in the union. So basically just straight object variant |
20:10:02 | * | jjido joined #nim |
21:11:20 | * | ltriant joined #nim |
21:16:52 | * | ltriant quit (Ping timeout: 272 seconds) |
21:42:50 | * | pro quit (Ping timeout: 260 seconds) |
21:54:45 | FromDiscord | <pmunch> Depends on what logging library you useâ”(@Phil) |
21:54:58 | FromDiscord | <Phil> std |
22:01:02 | FromDiscord | <SoicBR> sent a code paste, see https://play.nim-lang.org/#ix=3QES |
22:04:39 | FromDiscord | <ynfle> In reply to @SoicBR "What's the correct way": Which nim version are you using? |
22:04:50 | FromDiscord | <SoicBR> 1.6.4 |
22:05:16 | FromDiscord | <Elegantbeef> That's the proper way to loop a table it calls the `pairs` iterator |
22:05:26 | FromDiscord | <Elegantbeef> What data is in your table? |
22:05:54 | FromDiscord | <SoicBR> uint64 (an id), one struct |
22:06:05 | FromDiscord | <SoicBR> object |
22:06:11 | FromDiscord | <SoicBR> (edit) "struct" => "object" |
22:06:39 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#ix=3QET |
22:06:44 | FromDiscord | <Elegantbeef> Runs fine for instance |
22:07:28 | FromDiscord | <Elegantbeef> Are you sure you havent added the same key multiple times? |
22:13:27 | FromDiscord | <SoicBR> Yes but I found the problem |
22:15:15 | FromDiscord | <ynfle> In reply to @SoicBR "Yes but I found": What is it? |
22:17:55 | * | ltriant joined #nim |
22:34:35 | FromDiscord | <ShalokShalom> In reply to @ynfle "`*` is basically a": But how would it look like in Nim? |
22:35:06 | FromDiscord | <ShalokShalom> Since the documentation seems to not show all the details to compare it to 1:1 |
22:35:20 | FromDiscord | <Elegantbeef> What are we talking about? |
22:35:27 | FromDiscord | <Elegantbeef> Looks like a HKT or union? |
22:36:37 | FromDiscord | <ShalokShalom> Union |
22:36:51 | FromDiscord | <ShalokShalom> But idk how to express that |
22:38:48 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3QEX |
22:48:28 | FromDiscord | <ShalokShalom> For what is the ek? |
22:48:45 | FromDiscord | <ShalokShalom> Just abbreviating ExitKind? |
22:51:13 | FromDiscord | <Elegantbeef> I dont like pure enums, overlodable enums arent enabled by default, so least bad thing |
22:54:41 | FromDiscord | <ShalokShalom> Why aren't they enabled by default? |
22:54:59 | FromDiscord | <Elegantbeef> They were added in 1.6 and will be default in a future version |
22:55:04 | FromDiscord | <ShalokShalom> What would it look like with pure enums? |
22:55:07 | FromDiscord | <ShalokShalom> Ah, I see |
22:55:15 | FromDiscord | <ShalokShalom> So I could just omit it then |
22:55:27 | FromDiscord | <ShalokShalom> I like to compare it 1:1 as possible |
22:55:36 | FromDiscord | <ShalokShalom> To contextualize it in my head |
22:55:40 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3QEZ |
22:56:02 | FromDiscord | <ShalokShalom> And what you dont like about them? |
22:56:06 | FromDiscord | <ShalokShalom> Thanks |
22:56:14 | FromDiscord | <Elegantbeef> They namespace the enum |
22:56:39 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3QF0 |
22:56:53 | FromDiscord | <Elegantbeef> Well they dont force a namespace, only with ambiguity is it forced |
22:57:04 | FromDiscord | <Elegantbeef> Overloadable is the best since it uses static logic to reason the type |
22:58:02 | FromDiscord | <ShalokShalom> sent a code paste, see https://play.nim-lang.org/#ix=3QF3 |
22:58:17 | FromDiscord | <Elegantbeef> Yep, it usaes the `kind`'s type to reason the type |
22:58:17 | FromDiscord | <ShalokShalom> Ok |
22:58:25 | FromDiscord | <ShalokShalom> Nice |
22:58:40 | FromDiscord | <ShalokShalom> Reason in the sense of type inference? |
22:58:46 | FromDiscord | <Elegantbeef> Yes |
22:58:49 | FromDiscord | <ShalokShalom> Yeah |
22:58:52 | FromDiscord | <ShalokShalom> Thx |
22:59:30 | FromDiscord | <Elegantbeef> https://nim-lang.github.io/Nim/manual_experimental.html#overloadable-enum-value-names |
22:59:38 | FromDiscord | <ShalokShalom> Is this kinda less used in it Nim?â”Considering support for overloaded enums comes so late? |
22:59:48 | FromDiscord | <Elegantbeef> What? |
22:59:53 | FromDiscord | <ShalokShalom> What else is coming? |
22:59:57 | FromDiscord | <ShalokShalom> Of functional stuff |
22:59:59 | FromDiscord | <Elegantbeef> It's a new feature so it's relatively unused yes |
23:00:10 | FromDiscord | <ShalokShalom> I mean, why is it new |
23:00:20 | FromDiscord | <ShalokShalom> Opposed to be a standard feature |
23:00:23 | FromDiscord | <Elegantbeef> Cause features have to be thought of and added by people |
23:00:35 | FromDiscord | <ShalokShalom> Yeah sure |
23:00:37 | FromDiscord | <Elegantbeef> I dont get the question of "Why is it new" |
23:00:53 | FromDiscord | <Elegantbeef> An RFC was made that suggested it, it was accepted and implemented |
23:01:35 | FromDiscord | <ShalokShalom> I mean, it seems the culture here is embracing a different style of coding, since it seems unusual to me, that what seems a basic feature gets added so late into a languages history |
23:01:48 | FromDiscord | <ShalokShalom> Considering it has so many edge cases covered a lot |
23:02:05 | FromDiscord | <ShalokShalom> But I guess that is an edge case in the imperative world |
23:02:29 | FromDiscord | <ShalokShalom> I just start coding and come from the functional world. |
23:02:50 | FromDiscord | <Elegantbeef> I mean it's a feature which needs to be implemented, so it has to come somewhere |
23:03:06 | FromDiscord | <Elegantbeef> The general convention was to use prefixes like i suggested before this |
23:03:15 | FromDiscord | <Elegantbeef> So it wasnt really needed, but is a nice to have |
23:03:50 | FromDiscord | <ShalokShalom> And what do you use in place of record types? |
23:04:08 | FromDiscord | <Elegantbeef> Objects are records |
23:04:14 | FromDiscord | <ShalokShalom> Ah, ok |
23:04:31 | FromDiscord | <ShalokShalom> So objects are not what objects are in the OO world? |
23:04:46 | FromDiscord | <ShalokShalom> Like, are they unmutable? |
23:05:03 | FromDiscord | <Elegantbeef> They're mutable if declared mutable |
23:05:11 | FromDiscord | <ShalokShalom> Ah, I see. |
23:05:13 | FromDiscord | <Elegantbeef> Nim's objects dont care mutabillity their declaration does |
23:07:31 | FromDiscord | <ShalokShalom> Seems like you can accomplish similar things with a very different approach |
23:07:36 | FromDiscord | <ShalokShalom> Or syntax, at least |
23:07:53 | FromDiscord | <Elegantbeef> Nim doesnt have HKT or ADTs so yea |
23:08:00 | FromDiscord | <Elegantbeef> You have to use tagged unions |
23:08:09 | FromDiscord | <ShalokShalom> I would suggest a "Nim for FSharp/OCaml/Haskell" section in the docs. |
23:08:24 | FromDiscord | <Elegantbeef> Well the wiki exists so have fun đ |
23:08:25 | FromDiscord | <ShalokShalom> FSharp doesnt have HKT either |
23:08:35 | FromDiscord | <ShalokShalom> ADT would be nice |
23:08:59 | FromDiscord | <ShalokShalom> I guess some community library might exist |
23:09:17 | FromDiscord | <ShalokShalom> In reply to @Elegantbeef "Well the wiki exists": For that, first I have to know |
23:09:24 | FromDiscord | <ShalokShalom> Egg/hen issue. |
23:09:54 | FromDiscord | <ShalokShalom> You are connecting via a bridge, thats why you are having the Bot label on? |
23:10:12 | FromDiscord | <Elegantbeef> Yes i'm using matrix |
23:12:12 | FromDiscord | <ShalokShalom> Cool |
23:12:44 | FromDiscord | <ShalokShalom> I just looked, and Wikipedia actually quote a very similar example to yours, and says its an ADT |
23:13:16 | FromDiscord | <Elegantbeef> Oh i wasnt talking about the wikipedia |
23:13:19 | FromDiscord | <Elegantbeef> was talking about https://github.com/nim-lang/Nim/wiki |
23:13:38 | FromDiscord | <ShalokShalom> I kinda like, how it uses more basic parts of the language, and builds something that can achieve something comparable |
23:14:33 | FromDiscord | <ShalokShalom> https://en.wikipedia.org/wiki/Comparison_of_programming_languages_(algebraic_data_type)#Nim |
23:14:58 | FromDiscord | <ShalokShalom> I looked into Wikipedia, didnt mean or suggested you said something about it |
23:15:21 | FromDiscord | <ShalokShalom> Just googled "Nim ADT" to find a community repo, and found its article. |
23:19:06 | * | ltriant quit (Ping timeout: 272 seconds) |
23:24:11 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzzâŠ) |
23:27:40 | FromDiscord | <ShalokShalom> sent a code paste, see https://play.nim-lang.org/#ix=3QF6 |
23:28:07 | FromDiscord | <ShalokShalom> And that's giving me a record? |
23:31:30 | FromDiscord | <Elegantbeef> I dont know what a "Record" is really |
23:31:45 | FromDiscord | <Elegantbeef> The record i know is synonymous with a struct or object in nim |
23:32:05 | FromDiscord | <Elegantbeef> So reading that I'd make it `type Item = distinct Details` |
23:33:34 | FromDiscord | <ynfle> In reply to @Elegantbeef "So reading that I'd": It's not. it's a struct with field Details |
23:36:11 | FromDiscord | <Elegantbeef> Which is just a dumb distinct |
23:36:50 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3QF8 |
23:40:51 | FromDiscord | <ShalokShalom> Would mine be correct? |
23:42:22 | FromDiscord | <ynfle> In reply to @ShalokShalom "Would mine be correct?": Yes |
23:42:51 | FromDiscord | <ynfle> sent a code paste, see https://play.nim-lang.org/#ix=3QF9 |
23:43:59 | FromDiscord | <ShalokShalom> Thanks |
23:49:26 | FromDiscord | <Elegantbeef> Sure but the 1\:1 translation sucks |