00:01:31 | FromDiscord | <voidwalker> `info_hash: urlencoded 20-byte SHA1 hash of the value of the info key from the Metainfo file. Note that the value will be a bencoded dictionary, given the definition of the info key above.` |
00:02:53 | FromDiscord | <voidwalker> how do I solve this ? If I pass %ab%cd%.. to URI queries, it converts '%' to '%25' |
00:06:41 | FromDiscord | <voidwalker> also btw, why isn't there even a trace of torrent library for nim ? |
00:14:17 | FromDiscord | <voidwalker> I guess I was wrong, there is something: https://github.com/aeaea-project/rentor |
00:28:36 | FromDiscord | <ynfle> sent a code paste, see https://play.nim-lang.org/#ix=4faB |
00:38:03 | * | derpydoo joined #nim |
00:50:43 | FromDiscord | <demotomohiro> In reply to @ynfle "I'm trying to compile": Maybe backend C compiler targets linux is not used? |
00:52:34 | * | krux02 quit (Remote host closed the connection) |
01:24:10 | * | tanami quit (Ping timeout: 252 seconds) |
01:30:53 | * | jmdaemon joined #nim |
01:50:22 | * | nyeaa49284 quit (Ping timeout: 272 seconds) |
01:54:19 | * | Jjp137 quit (Ping timeout: 248 seconds) |
01:54:38 | * | Jjp137 joined #nim |
02:12:53 | * | tanami joined #nim |
02:29:21 | * | nyeaa49284 joined #nim |
02:37:19 | * | rockcavera joined #nim |
02:37:19 | * | rockcavera quit (Changing host) |
02:37:19 | * | rockcavera joined #nim |
04:07:31 | * | derpydoo quit (Ping timeout: 252 seconds) |
04:12:12 | * | arkurious quit (Quit: Leaving) |
04:21:11 | FromDiscord | <ynfle> In reply to @demotomohiro "Maybe backend C compiler": How do I fix that? |
04:31:56 | FromDiscord | <ynfle> Or what is the problem? |
05:01:27 | * | derpydoo joined #nim |
05:05:58 | * | rockcavera quit (Remote host closed the connection) |
05:06:24 | * | rockcavera joined #nim |
05:06:24 | * | rockcavera quit (Changing host) |
05:06:24 | * | rockcavera joined #nim |
05:32:42 | FromDiscord | <demotomohiro> In reply to @ynfle "How do I fix": run nim cmd with `--listcmd` option. That shows how Nim call backend C compiler. |
05:33:11 | FromDiscord | <demotomohiro> So you can check if Nim call the right backend C compiler. |
05:35:15 | FromDiscord | <ElementalX> Hi, this might be a dumb question to ask, but can something like this be done in Nim? https://blog.finxter.com/daily-python-puzzle-how-to-modify-sequence-while-iterating/ I.e., adding an element to a mutable sequence while iterating also is there any module or function which helps in printing the size of each element in case of the array has 5 strings and each has 4 characters each! Thank you! |
05:35:39 | FromDiscord | <Elegantbeef> It can be done just not with Nim's built in iterator |
05:36:08 | FromDiscord | <ElementalX> would be great if you could let me know more about it |
05:38:18 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4fbi |
05:41:33 | termer | when working with asynchttpserver and ORC GC, is it common to see huge amounts of memory allocation that never goes away? |
05:41:45 | termer | It doesn't always continue to grow, so I don't know if it can be considered a memory leak |
05:41:51 | termer | but I've noticed this with seemingly all async IO |
05:42:26 | termer | although it seems that sometimes it does grow more |
05:42:55 | FromDiscord | <ElementalX> sent a code paste, see https://play.nim-lang.org/#ix=4fbj |
05:43:09 | FromDiscord | <Elegantbeef> I dont think Nim's allocatr returns to the OS iirc |
05:43:18 | FromDiscord | <Elegantbeef> Iterate over each element and count the length |
05:44:12 | FromDiscord | <ElementalX> In reply to @Elegantbeef "Iterate over each element": some help would be appreciated |
05:44:39 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4fbk |
05:45:07 | FromDiscord | <ElementalX> thank you very much! |
05:45:14 | FromDiscord | <Elegantbeef> `inc result, x.len` rather or `result += x.len` |
05:45:40 | FromDiscord | <ElementalX> thank you! |
05:47:02 | FromDiscord | <Elegantbeef> I guess that should be `T: seq or string or array` |
05:47:17 | FromDiscord | <Elegantbeef> I'll just say "I was hoping you'd learn" |
05:57:22 | * | dtomato4 quit (Ping timeout: 272 seconds) |
05:58:21 | * | dtomato4 joined #nim |
05:59:09 | FromDiscord | <ynfle> In reply to @demotomohiro "run nim cmd with": What is the correct backend c compiler for this? |
06:14:06 | FromDiscord | <demotomohiro> I'm sorry but I don't know how to get gcc or clang that runs on your OS and compile to Linux. |
06:14:58 | FromDiscord | <Elegantbeef> Just use zig-cc 😄 |
06:19:38 | NimEventer | New thread by koistinen: Would Futo be good for Nim, see https://forum.nim-lang.org/t/9583 |
06:25:26 | FromDiscord | <ynfle> In reply to @demotomohiro "I'm sorry but I": I'm on a macos m1 |
06:25:44 | FromDiscord | <ShalokShalom> Yep, Zig CC |
06:25:47 | * | ltriant quit (Ping timeout: 248 seconds) |
06:25:49 | FromDiscord | <ShalokShalom> That cross compiles |
06:26:00 | FromDiscord | <ynfle> How do I get that setup? |
06:26:15 | FromDiscord | <ShalokShalom> You can also try to use Cosmopolitan |
06:26:33 | FromDiscord | <ShalokShalom> I think its probably really on time, to write a guide for that. |
06:27:30 | FromDiscord | <ShalokShalom> @ynfle https://zig.news/kristoff/compile-a-c-c-project-with-zig-368j |
06:27:59 | FromDiscord | <ShalokShalom> You just compile the Nim code to C or C++ and then do this |
06:28:07 | FromDiscord | <Elegantbeef> https://github.com/enthus1ast/zigcc |
06:29:47 | termer | why does zig cc matter over gcc |
06:29:57 | FromDiscord | <Elegantbeef> It has a cross platform linker |
06:30:00 | termer | and is it actually its own compiler or does it leverage a different compiler under the hood |
06:30:05 | FromDiscord | <Elegantbeef> It's basically Clang + linker |
06:30:16 | termer | cool |
06:38:38 | FromDiscord | <albassort> how would I write something that sits inbetween the os and an application's text box's recording what you type? |
06:38:56 | FromDiscord | <albassort> my original idea was a kernel module but thats kinda hard |
06:39:19 | FromDiscord | <ChocolettePalette> X server↵(@albassort) |
06:39:36 | FromDiscord | <albassort> i need to interact with xserver |
06:39:41 | FromDiscord | <albassort> hmm |
06:52:18 | FromDiscord | <albassort> lets hope i dont need to wrap c |
06:54:10 | FromDiscord | <Rika> You most likely will |
06:56:30 | FromDiscord | <albassort> im either going to do bash shenanigans or https://github.com/luked99/libevdev.nim |
06:56:55 | FromDiscord | <ynfle> How can I get zig c to statically link against glibc? |
07:13:16 | termer | have any of you tried using httpbeast with the ORC GC? |
07:13:40 | termer | Whenver I try it, I get illegal storage access errors when firing requests quickly and concurrently |
07:13:53 | termer | no such issues with refc |
07:15:26 | FromDiscord | <Elegantbeef> Is the error inside Orc's procedures? |
07:16:38 | FromDiscord | <Elegantbeef> If so it's likely that it uses behaviour that doesnt work well with Orc and it needs to be changed a bit |
07:19:31 | FromDiscord | <albassort> welp |
07:20:13 | FromDiscord | <albassort> time to figure out how scancodes work because i dont wanna wrap the standard libraryr |
07:20:15 | FromDiscord | <albassort> (edit) "libraryr" => "library" |
07:20:33 | FromDiscord | <Phil> In reply to @termer "have any of you": Only indirectly, my prologue project uses a fork of httpbeast |
07:20:43 | FromDiscord | <Phil> Since prologue uses said fork |
07:22:51 | FromDiscord | <Elegantbeef> I'd wager httpx works better with orc |
07:23:07 | FromDiscord | <albassort> historically I've had problems with http and orc |
07:23:13 | FromDiscord | <albassort> but i had some cursed code |
07:23:22 | FromDiscord | <albassort> no problems nowadays |
07:23:39 | * | PMunch joined #nim |
07:23:49 | FromDiscord | <Elegantbeef> Most issues from orc are caused by not understanding it's semantics as they tend to jumpout and bite you |
07:26:27 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4fbO |
07:35:05 | FromDiscord | <albassort> ok turns out scancodes are pretty uh... not ufn |
07:35:07 | FromDiscord | <albassort> (edit) "ufn" => "fun" |
07:36:16 | FromDiscord | <Rika> :baqua: |
07:36:59 | FromDiscord | <Elegantbeef> `XStringToKeySym` `XStringToKeyCode` 😄 |
07:37:09 | FromDiscord | <albassort> YO DO WE HAVE THAT |
07:37:17 | FromDiscord | <Elegantbeef> Of course in xlib |
07:37:24 | FromDiscord | <albassort> thank god |
07:38:12 | FromDiscord | <Elegantbeef> I dont know how one uses it outside of a WM context, but i know it exists |
07:38:37 | FromDiscord | <albassort> now all i need to do is figure out how when someone clicks on a message box |
07:39:10 | FromDiscord | <ElementalX> Hi am trying to create and empty array of size 10 : `var a: array = [10, int]`↵and then trying to iterate over numbers from 0..100 and only add those numbers which are divisible by 10 but as soon I try to iterate `for i in 0..100` it throws error, am doing some basic mistake help will be appreciated |
07:39:31 | FromDiscord | <Elegantbeef> `var a: array[10, int]` |
07:39:54 | FromDiscord | <Elegantbeef> `var a: array = [10, int]` certainly doesnt compile |
07:40:16 | FromDiscord | <albassort> In reply to @Elegantbeef "Of course in xlib": this isn't in stdlib... |
07:40:26 | FromDiscord | <Elegantbeef> Of course not |
07:40:33 | FromDiscord | <ElementalX> sent a code paste, see https://play.nim-lang.org/#ix=4fbP |
07:40:54 | FromDiscord | <Elegantbeef> I dont know what you point is elemental the code you provided is invalid |
07:41:20 | FromDiscord | <albassort> In reply to @Elegantbeef "Of course not": c bindings? |
07:41:35 | FromDiscord | <Elegantbeef> Of course |
07:42:17 | FromDiscord | <ElementalX> so its like : am trying these basic exercises which says create an empty array which can hold 10 integers and then fill that array with numbers 10,20,30,40 till 100 |
07:42:34 | FromDiscord | <Elegantbeef> What does the compiler say? |
07:42:59 | FromDiscord | <ElementalX> Error: unhandled exception: index 11 not in 0 .. 9 [IndexDefect] |
07:43:24 | FromDiscord | <ElementalX> not sure what other way I could traverse from 0 to 100 and add it to the empty array |
07:43:25 | FromDiscord | <ElementalX> 😅 |
07:43:36 | FromDiscord | <ElementalX> https://narimiran.github.io/nim-basics/#_exercises_3 |
07:43:37 | FromDiscord | <Elegantbeef> `countUp` exists |
07:43:48 | FromDiscord | <ElementalX> yeah tried that too |
07:44:00 | FromDiscord | <Elegantbeef> What do you have now? |
07:44:28 | FromDiscord | <ElementalX> still the same error I tried `for i in countUp(0,100,10)` the same IndexDefect comes up |
07:45:32 | FromDiscord | <Elegantbeef> Well `0` and `100` are inclusive so that's not where the issue is |
07:45:41 | * | tiorock joined #nim |
07:45:41 | * | tiorock quit (Changing host) |
07:45:41 | * | tiorock joined #nim |
07:45:41 | * | rockcavera is now known as Guest726 |
07:45:41 | * | tiorock is now known as rockcavera |
07:45:47 | FromDiscord | <Elegantbeef> It helps if you go to the right line |
07:47:43 | FromDiscord | <ElementalX> sent a code paste, see https://play.nim-lang.org/#ix=4fbQ |
07:48:24 | FromDiscord | <Elegantbeef> The array can only hold 10 elements and you're attempting to index \> 9 |
07:48:28 | FromDiscord | <Elegantbeef> That's what an index defect is |
07:48:33 | FromDiscord | <Elegantbeef> `a[10] = 10` is invalid |
07:48:40 | * | Guest726 quit (Ping timeout: 260 seconds) |
07:49:52 | FromDiscord | <ElementalX> so where shall I fix it I mean at code |
07:50:22 | FromDiscord | <Elegantbeef> I can spoonfeed the answer then you learn nothing |
07:50:48 | FromDiscord | <ElementalX> sure lemme try once again I will get back to you |
07:51:07 | FromDiscord | <ElementalX> appreciate the time |
07:57:12 | FromDiscord | <ynfle> How can I find why my binary is trying to load a .so? |
07:57:43 | FromDiscord | <ynfle> sent a code paste, see https://play.nim-lang.org/#ix=4fbS |
08:05:05 | PMunch | Kind of hard to tell I think |
08:05:27 | PMunch | Are you doing any kind of HTTP work? |
08:05:45 | FromDiscord | <ynfle> Not me, but perhaps any of the dependencies |
08:06:07 | FromDiscord | <ynfle> Shouldn't they not be allowed to unless I compile with -d:ssl? |
08:06:12 | FromDiscord | <ynfle> https that is |
08:06:29 | FromDiscord | <ynfle> Which std lib procs use it? |
08:06:48 | PMunch | Well it depends if the library author uses a `when defined(ssl)` switch or if they just assume it's there |
08:08:07 | FromDiscord | <ynfle> Is there a way to undefine something? |
08:09:23 | FromDiscord | <ringabout> `--undef:ssl` |
08:10:23 | FromDiscord | <ynfle> No way... |
08:11:37 | PMunch | I'm pretty sure thats only for disabling things enabled by global configuration files |
08:12:29 | PMunch | By the way @ynfle you can grep the Nim sources to get an idea about what uses ssl |
08:12:32 | FromDiscord | <ynfle> Does status bearssl load it? How would I checkout? |
08:13:04 | FromDiscord | <Elegantbeef> bearssl is statically linked there |
08:13:48 | FromDiscord | <ynfle> But if bearssl loads it would that make a difference? |
08:14:00 | PMunch | http://ix.io/4fbX/ |
08:14:52 | PMunch | You can probably run through execution in gdb as well |
08:14:59 | FromDiscord | <Elegantbeef> Bearssl doesnt use any dynamically linked libraries |
08:16:21 | FromDiscord | <ElementalX> sent a code paste, see https://play.nim-lang.org/#ix=4fbY |
08:16:32 | FromDiscord | <Elegantbeef> do not index with a value above the length of the array |
08:16:41 | FromDiscord | <Elegantbeef> the highest valid index is `9` |
08:16:54 | FromDiscord | <Elegantbeef> `for i in 0..100: a[i] = ..` will index with `10..100` |
08:16:59 | FromDiscord | <Elegantbeef> Those are all invalid |
08:19:20 | FromDiscord | <ElementalX> sure |
08:19:32 | FromDiscord | <ElementalX> thanks |
08:22:36 | FromDiscord | <ynfle> In reply to @Elegantbeef "Bearssl doesnt use any": I use awslambda which uses httpclient, but that only uses `http` |
08:55:15 | * | anddam joined #nim |
08:55:22 | anddam | /autojoin apply |
08:55:27 | * | anddam oopses |
08:55:48 | anddam | so leading spaces *do matter* |
08:56:03 | anddam | that's proof |
08:57:46 | FromDiscord | <Rika> On your client |
09:03:56 | madprops | /ping |
09:20:00 | FromDiscord | <Rika> Pong! |
09:27:31 | * | ltriant joined #nim |
09:30:45 | * | derpydoo quit (Ping timeout: 260 seconds) |
09:34:38 | FromDiscord | <albassort> So far I've tried to directly read from hardware devices but I appear to be reading from some form of clock and not actually scan lines |
09:35:01 | FromDiscord | <albassort> It's completely trolled me because I was typing a b c every second and then it lined up and I thought it worked |
09:35:16 | FromDiscord | <albassort> But really it was just iterating over ASCII |
09:37:01 | * | neceve_ is now known as neceve |
10:36:56 | * | ormiret quit (Ping timeout: 246 seconds) |
10:37:43 | * | LuxuryMode quit (Read error: Connection reset by peer) |
10:38:26 | * | ormiret joined #nim |
10:38:50 | * | LuxuryMode joined #nim |
10:52:06 | FromDiscord | <luteva> is there a lib/helper that has procs for introspection? So that i can easily get the properties/fields of a type, the type of the parameters of a proc etc.? This would be much easier for many people than using macros and handling the hierarchy of the nodes imo. |
11:05:07 | PMunch | You mean like macros.getImpl? |
11:05:32 | PMunch | I agree that someone could wrap those in a nicer API for easy introspection though |
11:05:55 | FromDiscord | <luteva> ... maybe, don't know.... xet 😄 |
11:06:03 | FromDiscord | <luteva> (edit) "xet" => "yet" |
11:14:16 | PMunch | @Elegantbeef, did you look more into the semcheck issue for static fields in objects? |
11:14:25 | PMunch | I was considering to create a GitHub issue for it |
11:29:07 | FromDiscord | <dlesnoff> sent a code paste, see https://play.nim-lang.org/#ix=4fcG |
11:29:35 | Zevv | hehe. I PR a one-liner and get a mail saying "Thanks for your hard work on this PR!" |
11:31:53 | FromDiscord | <dlesnoff> My first Nim commit was a sed command, that converted procs into funcs 😅 I can relate ^^ |
11:32:18 | FromDiscord | <dlesnoff> (edit) "My first Nim commit was ... a" added "the result of" |
11:32:37 | FromDiscord | <dlesnoff> In reply to @Zevv "hehe. I PR a": Was this an automatic email ? |
11:34:00 | PMunch | @dlesnoff, how did you figure out what could be converted to a func by using sed? |
11:35:02 | FromDiscord | <dlesnoff> In our file, accidentally all the procs (maybe at a few exceptions) did not use sideEffects. |
11:35:27 | FromDiscord | <dlesnoff> (edit) "our" => "the Bigint project" |
11:35:38 | FromDiscord | <planetis> did you test with strictEffects? Because now its the default and it will break stuff |
11:35:40 | FromDiscord | <dlesnoff> (edit) "sideEffects." => "side effects." |
11:36:46 | FromDiscord | <dlesnoff> I don't understand. func is basically a wrapper of the pragma {.strictEffects.}. What has gone default? |
11:37:32 | FromDiscord | <planetis> the stricteffects it breaks for example status libs where they used func quite liberaly |
11:38:17 | * | vicecea quit (Remote host closed the connection) |
11:39:27 | FromDiscord | <planetis> well the fix is simple actually you just need to make it a var |
11:40:02 | FromDiscord | <planetis> for ref objects that are mutated |
11:40:29 | FromDiscord | <dlesnoff> Well I don't use ref objects that is why |
11:40:43 | FromDiscord | <dlesnoff> https://github.com/nim-lang/bigints/commit/bc3b2fa8ac77a5b6201824e06047ca4c234ef804 |
11:40:52 | FromDiscord | <dlesnoff> I made that commit a long time ago |
11:46:37 | FromDiscord | <ringabout> Well, `stricteffects` become default on the devel branch but `strictfuncs` doesn't. |
11:46:52 | FromDiscord | <ringabout> (edit) "become" => "becomes the" |
11:47:48 | FromDiscord | <ringabout> `bigints` should be tested against `experimental:strictfuncs`. |
11:49:12 | FromDiscord | <ringabout> Oh, it does test with `strictfuncs` https://github.com/nim-lang/bigints/blob/a63df24b60e91e0d55bf7bd197c573b57ca852ef/bigints.nimble#L20 |
11:51:48 | FromDiscord | <ringabout> In reply to @planetis "the stricteffects it breaks": I used some status libs with the devel branch. There are lots of problems caused by `stricteffects`. I stopped trying. |
12:20:32 | * | xet7 joined #nim |
12:22:39 | * | dtomato4 quit (Quit: The Lounge - https://thelounge.chat) |
12:23:25 | * | dtomato4 joined #nim |
12:28:41 | * | dtomato4 quit (Quit: The Lounge - https://thelounge.chat) |
12:33:00 | * | dtomato4 joined #nim |
12:34:19 | * | jmdaemon quit (Ping timeout: 248 seconds) |
12:46:43 | * | vsantana joined #nim |
12:47:03 | FromDiscord | <Tanguy> In reply to @flywind "I used some status": Do you know if https://github.com/nim-lang/RFCs/issues/435 be done for V2? Seems to me that strictEffect broke a lot of code (at least for people actually using gcsafe) |
12:49:37 | FromDiscord | <Tanguy> I'd rather wait for the compiler to be correct than add tons of temporary workarounds |
12:50:47 | FromDiscord | <ringabout> I don't the solution of that rfc. `legacy:laxeffects` should be useful for transition periods. There seems to be some other bugs for `stricteffects` which cannot be solved with `laxeffects` should be fixed indeed |
12:50:57 | FromDiscord | <ringabout> (edit) "I don't ... the" added "know" |
12:51:26 | FromDiscord | <ringabout> (edit) "There seems to be some" => "The" |
12:54:42 | * | dtomato4 quit (Quit: The Lounge - https://thelounge.chat) |
12:55:04 | * | dtomato4 joined #nim |
13:13:13 | FromDiscord | <ElementalX> In reply to @Jiezron "There are actually two": Thank you, that helps! |
13:18:26 | FromDiscord | <dlesnoff> In reply to @ElementalX "Thank you, that helps!": Don't hesitate to share your code once done (and ping me again). |
13:21:40 | FromDiscord | <ElementalX> sent a code paste, see https://play.nim-lang.org/#ix=4fd4 |
13:26:06 | FromDiscord | <dlesnoff> sent a code paste, see https://play.nim-lang.org/#ix=4fd6 |
13:31:03 | * | derpydoo joined #nim |
13:31:40 | FromDiscord | <dlesnoff> sent a code paste, see https://play.nim-lang.org/#ix=4fd8 |
13:32:54 | FromDiscord | <ElementalX> sent a code paste, see https://play.nim-lang.org/#ix=4fd9 |
13:32:59 | FromDiscord | <dlesnoff> (edit) "https://play.nim-lang.org/#ix=4fd8" => "https://play.nim-lang.org/#ix=4fda" |
13:33:30 | FromDiscord | <ElementalX> appreciate your help! |
13:36:34 | FromDiscord | <vindaar> sent a code paste, see https://play.nim-lang.org/#ix=4fdb |
13:37:45 | FromDiscord | <vindaar> (or well, in this case you can also do `echo collect(for i in 0 ..< 10: 10i)` to be more in line with the python case) |
13:38:53 | FromDiscord | <dlesnoff> I did not follow up on my python code sorry |
13:41:42 | FromDiscord | <dlesnoff> sent a code paste, see https://play.nim-lang.org/#ix=4fdc |
13:42:06 | * | arkanoid joined #nim |
13:43:43 | FromDiscord | <dlesnoff> sent a code paste, see https://play.nim-lang.org/#ix=4fde |
13:45:50 | arkanoid | my projects have classic structure: src/ for project, and tests/test_*.nim for tests. I have two problems with this: vscode doesn't work on test files but only on project files, and when I run "nimble tests" it doesn't give me an aggregate view of the different test_*.nim files, but just runs each test_*.nim file separately and stdout is a mix of stuff that doesn't really feel like a test report |
13:46:39 | arkanoid | do you know how can I improve this? I was thinking abount merging all test_*.nim files into test_all.nim and `include` all tests into that one. But this is smelly code, in my opinion |
13:48:15 | FromDiscord | <vindaar> keep the distinction in mind that this variant (while I use it a lot out of habit), actually loops twice over 10 elements. The `collect` one is a single loop (but has the downside of currently starting from a seq without explicit size, thus may lead to multiple reallocations, depending on use case)↵(@dlesnoff) |
13:49:12 | FromDiscord | <dlesnoff> In reply to @arkanoid "do you know how": Maybe you can make a new nimble task instead, that parse stdout, collect each timing/test results and outputs them nicely in a table or so. |
13:49:38 | FromDiscord | <vindaar> you don't need to use `include`. A simple `import` is fine. All top level code will still run↵(<@709044657232936960_arkanoid=5b=49=52=43=5d>) |
13:50:47 | FromDiscord | <dlesnoff> In reply to @vindaar "keep the distinction in": But this uses std/sugar, which makes compile time and running time much slower (at least for the few small programs I tested this on). |
13:51:51 | FromDiscord | <dlesnoff> (edit) "In reply to @vindaar "keep the distinction in": ... But`collect`" added "Indeed!" | "this" => "`collect`" |
13:51:58 | * | vsantana quit (Ping timeout: 260 seconds) |
13:52:37 | FromDiscord | <vindaar> run time should only depend on what I just mentioned. Whether two loops with preallocated memory is faster vs one loop with reallocations will be use case dependent. `std/sugar` shouldn't really be that expensive to import though |
13:56:52 | FromDiscord | <pietroppeter> for the collect version you can use `collect(newSeqOfCap(10)):` to make sure memory is allocated correctly during sequence initialization. runtime performance wise I think it should be the same as the array (you will not get compile checks on indices in later usages). |
13:57:21 | FromDiscord | <pietroppeter> (and you cannot put it anymore in a single line) |
13:57:35 | FromDiscord | <dlesnoff> I am testing both versions on my machine |
14:00:54 | FromDiscord | <huantian> In reply to @arkanoid "do you know how": You might also want to think about using a different testing framework like balls which will give you a nice output |
14:01:42 | arkanoid | vindaar: thanks, I'm trying the single test_project.nim with all the imports |
14:02:05 | arkanoid | dlesnoff, wow, no thanks, don't want to re-create the wheel for tests |
14:02:30 | arkanoid | huantian: thanks! didn't know about alternative test frameworks. I only know unittest and testament |
14:05:48 | FromDiscord | <dlesnoff> @Arkanoid Sorry for the very bad proposition. There are other tests framework: https://github.com/ringabout/awesome-nim#testing |
14:06:24 | arkanoid | dlesnoff, no problem! It was not really a bad proposition, just an admission of my lazyness :P |
14:06:34 | FromDiscord | <dlesnoff> But you can have a look in the #nimble channel where we discussed about testing framework |
14:06:59 | arkanoid | vindaar: it works! I have many "imported and not used" in my test_all.nim, but I get a much faster and nicer output |
14:07:29 | arkanoid | I've also solved the vscode issue by adding src/myproject.nim and tests/test_all.nim as projects in my settings.json |
14:07:33 | arkanoid | all good! thanks |
14:08:43 | FromDiscord | <dlesnoff> In reply to @arkanoid "<@150345911057252352>: it works! I": since these are hints, you may try --hints:off or something more selective |
14:10:16 | arkanoid | I like hints and I generally want to keep them on. Is it possible to turn them off for test_all.nim only? |
14:11:03 | FromDiscord | <vindaar> ah, thanks! Had forgotten about that, as I hardly ever use `collect`↵(@pietroppeter) |
14:11:34 | FromDiscord | <dlesnoff> --hints:on|off|list. `on|off` enables or disables hints.↵ `list` reports which hints are selected. |
14:12:00 | arkanoid | dlesnoff, I want them all for all files, except one |
14:12:03 | FromDiscord | <dlesnoff> --hint:X:on|off turn specific hint X on|off. `hint:X` means `hint:X:on`,↵ as with similar flags. `all` is the set of all hints↵ (only `all:off` is supported). |
14:12:41 | FromDiscord | <dlesnoff> I don't know what is X for "imported and not used" |
14:14:24 | arkanoid | dlesnoff, it's UnusedImport, I have it as "warningAsError" |
14:14:54 | arkanoid | well, I used to have it, but it gives error in system.nim |
14:15:47 | FromDiscord | <dlesnoff> In reply to @arkanoid "<@610977647601909781>, I want them": maybe you can add a .cfg with an if clause and something to get your module filename but I don't find how to get the name of the module you are compiling |
14:16:07 | FromDiscord | <dlesnoff> (edit) ".cfg" => "nim.cfg" |
14:19:17 | FromDiscord | <! Nilts> Does anyone know a storage option like json except focused on less memory use? |
14:19:28 | FromDiscord | <! Nilts> and if i can use it in nim? |
14:20:50 | * | vicecea joined #nim |
14:21:10 | PMunch | protobuf? |
14:22:12 | FromDiscord | <dlesnoff> @! Nilts There are many serialization options, see e.g. at the end of https://youtu.be/aKg5PxUi_eA?t=2102 |
14:22:48 | FromDiscord | <dlesnoff> (edit) "https://youtu.be/aKg5PxUi_eA?t=2102" => "[NimConf2022 - Scratch built game](https://youtu.be/aKg5PxUi_eA?t=2102)" |
14:22:49 | FromDiscord | <Rika> protobuf is more an on the wire protocol though |
14:23:09 | PMunch | Sure, but you can just dump the output to a file if you'd like |
14:23:17 | PMunch | OpenStreetMap stores data this way |
14:23:46 | PMunch | Well, they also have XML. But if you don't want to download a massive file then the protobuf format is the way to go |
14:27:04 | ehmry | Nilts there is also CBOR and Preserves, which are self describing formats |
14:27:17 | FromDiscord | <dlesnoff> In reply to @Jiezron "maybe you can add": @Arkanoid Sorry I checked and actually you can't be certain of the module name you are compiling, since the name of os.getAppFilename will actually give you the name of the generated C(++)/obj/js file you compile to. |
14:27:20 | FromDiscord | <pietroppeter> In reply to @arkanoid "<@610977647601909781>, I want them": I think a pragma {.push hints:off.} at the top of your test file should work, example: https://github.com/bluenote10/NimData/blob/d8b0d9744c3960fd75966e2b71ecc8557a8e31ee/tests/all.nim |
14:27:35 | * | arkurious joined #nim |
14:30:42 | FromDiscord | <pietroppeter> In reply to @pietroppeter "I think a pragma": (btw using github search for snippets of nim code it can be a nice way to discover code usages 😉 e.g the above was found with https://github.com/search?q=language%3Anim+%7B.push%3Ahints%3Aoff.%7D&type=code) |
14:32:18 | FromDiscord | <pietroppeter> and this is the manual for push/pop pragmas https://nim-lang.org/docs/manual.html#pragmas-push-and-pop-pragmas |
14:32:21 | arkanoid | pietroppeter, seems not handled correctly by nimsuggests, it seems to ignore it completely |
14:32:38 | FromDiscord | <pietroppeter> ah, bummer! |
14:34:01 | FromDiscord | <ElementalX> sent a code paste, see https://play.nim-lang.org/#ix=4fdq |
14:34:31 | FromDiscord | <ElementalX> (edit) "https://play.nim-lang.org/#ix=4fdq" => "https://play.nim-lang.org/#ix=4fdr" |
14:34:59 | FromDiscord | <dlesnoff> In reply to @vindaar "cthis is not (even": I compared the sugar.collection version to the array one. For big integers, the sugar.collection is a little bit slower. The seqTo/mapIt version is ofc horrible. |
14:36:25 | FromDiscord | <Tanguy> Your first snipped implictly discards the return value of `x`, you have to use `discard x(h)` |
14:36:42 | FromDiscord | <dlesnoff> sent a long message, see http://ix.io/4fds |
14:36:58 | PMunch | @dlesnoff, not sure what you are discussing. But wouldn't instantiationInfo help? |
14:37:53 | FromDiscord | <dlesnoff> In reply to @Jiezron "<@210739784761475072> Sorry I checked": @PMunch are you talking of this ? |
14:38:17 | PMunch | Yes |
14:39:41 | FromDiscord | <ElementalX> In reply to @Tanguy "Your first snipped implictly": Thank you for the help! |
14:42:53 | FromDiscord | <dlesnoff> sent a code paste, see https://play.nim-lang.org/#ix=4fdu |
14:43:30 | FromDiscord | <dlesnoff> sent a code paste, see https://play.nim-lang.org/#ix=4fdv |
14:44:05 | FromDiscord | <dlesnoff> But instantiationInfo needs to be inside a template |
14:46:39 | PMunch | Yeah, you can use it like this: https://play.nim-lang.org/#ix=4fdw |
14:46:51 | PMunch | Not sure what the problem of it being inside a template is.. |
14:47:02 | FromDiscord | <dlesnoff> In reply to @ElementalX "hey <@610977647601909781> ,": Rather than saying that your program does not work, please precise whether you run into an error during compilation or during execution, or whether you got an incorrect output.↵(Even though I could test snippets in my editor). |
14:48:30 | FromDiscord | <ElementalX> sure, I would do that, thank you! |
14:48:35 | PMunch | Hmm, maybe I should auto-import a `module` macro in the playground. So that people can write `module mymodule: echo "Hello world"` and all it does is write the contents to a file by that name with the .nim extension so it can be loaded by the main module |
14:53:46 | FromDiscord | <pietroppeter> or write a package with this module macro inside and add it as available packages in playground 🙂 (so people can use it even outside the playground) |
14:54:33 | FromDiscord | <Jessa> sent a code paste, see https://play.nim-lang.org/#ix=4fdz |
14:54:55 | FromDiscord | <Jessa> (edit) "https://play.nim-lang.org/#ix=4fdz" => "https://play.nim-lang.org/#ix=4fdA" |
14:55:10 | FromDiscord | <Jessa> (edit) "https://play.nim-lang.org/#ix=4fdA" => "https://play.nim-lang.org/#ix=4fdB" |
14:56:30 | PMunch | @pietroppeter, sure, that's probably the cleaner solution :P |
14:56:31 | arkanoid | pietroppeter, found it, is "{.warning[UnusedImport]: off.}" at the end of the file |
14:56:40 | arkanoid | check https://forum.nim-lang.org/t/5461#34187 |
15:00:28 | FromDiscord | <pietroppeter> In reply to @arkanoid "<@869267093110026320>, found it, is": ah sorry, I did not follow the initial part of the conversation and did not know what you were actually trying to shut off! |
15:02:33 | FromDiscord | <pietroppeter> In reply to @PMunch "<@869267093110026320>, sure, that's probably": I would like such a macro 🙂 the only thing that is unclear to me with respect to feasability is: the module macro should write the file at compile time; will the import statement that comes next be able to see the file written a moment earlier? |
15:03:20 | arkanoid | I like having problem list clean of hints and warning, but I get some from stdlib. For example times.nim "'parse' cannot raise 'Defect' [XCannotRaiseY]". |
15:03:30 | arkanoid | Should I just give up on this? |
15:03:49 | NimEventer | New thread by drkameleon: LinearScanEnd caveats?, see https://forum.nim-lang.org/t/9587 |
15:04:00 | PMunch | @pietroppeter, sure, that shouldn't be a problem |
15:05:03 | FromDiscord | <demotomohiro> @Jessa Calling convension in dll.nim and main.nim is different in your code. That might causig the error. |
15:06:04 | FromDiscord | <Jessa> calling convension?↵how do you mean |
15:06:52 | FromDiscord | <Bung> https://nim-lang.org/docs/manual.html#types-procedural-type |
15:08:56 | FromDiscord | <Jessa> i.. think i'm too tired at the moment to really understand anything that i'm reading↵maybe 3 hours wasn't enough haha↵↵i'll look through that documentation later, i suppose |
15:09:21 | PMunch | @Jessa, |
15:09:29 | PMunch | http://ix.io/4fdW |
15:09:31 | PMunch | That works |
15:10:37 | FromDiscord | <pietroppeter> In reply to @PMunch "<@869267093110026320>, sure, that shouldn't": I guess it should be something more sophisticated than this, then (does not work on playrgound nor locally): https://play.nim-lang.org/#ix=4fdV |
15:11:40 | PMunch | A couple of things you missed, exportc/dynlib to make sure the symbol is exported correctly (no name mangling). Type signatures need to match exactly, having var in one definition and not in the other causes issues becaues it informs Nim how it is supposed to pass the data. And when doing things with dynamic libraries it is best to use ARC/ORC otherwise you'll need to link to the garbage collector as a separate library from both modules |
15:11:50 | PMunch | At least I think ORC/ARC should work without requiring that.. |
15:12:32 | FromDiscord | <Jessa> I see |
15:14:06 | PMunch | @pietroppeter, https://play.nim-lang.org/#ix=4fdX |
15:14:08 | PMunch | That works fine |
15:14:24 | FromDiscord | <Bung> why PMunch text in grey color am using Element |
15:14:37 | FromDiscord | <Jessa> sent a long message, see http://ix.io/4fdY |
15:15:17 | * | derpydoo quit (Ping timeout: 252 seconds) |
15:15:48 | PMunch | @Bung, because I'm a bot, bleep-bloop |
15:16:28 | FromDiscord | <Bung> ok, I see |
15:16:29 | PMunch | @Jessa, ah if you used those then it was probably just the var missing which tripped you up |
15:16:53 | PMunch | Essentially that makes Nim pass a pointer to the variable on the caller stack so it can be modified in-place |
15:17:25 | FromDiscord | <pietroppeter> In reply to @PMunch "That works fine": ah nice, indeed my snippet locally does not work when using `nim r` but works with `nim c -r` (which I guess makes sense since nim r uses a temp folder) |
15:17:29 | PMunch | And ORC/ARC are the new memory management schemes that will become default in Nim 2.0 |
15:17:57 | FromDiscord | <Jessa> In reply to @PMunch "<@268111216277323779>, ah if you": Cool! ↵good to know, don't think i'll miss that next time now :P |
15:18:52 | FromDiscord | <Jessa> In reply to @PMunch "And ORC/ARC are the": and, i see. I don't know much about the memory management side of the language, or any language for that matter.↵↵How influencial would it be? |
15:20:31 | PMunch | Not sure what you mean by how influential it will be |
15:21:09 | PMunch | It makes interop, threading, and dynamic libraries easier |
15:21:16 | PMunch | But I've gotta go |
15:21:18 | * | PMunch quit (Quit: Leaving) |
15:25:24 | FromDiscord | <Jessa> i see, thank you for your help |
15:54:34 | NimEventer | New post on r/nim by nim_rod_: How to write performant Nim?, see https://reddit.com/r/nim/comments/yor0ue/how_to_write_performant_nim/ |
16:08:50 | FromDiscord | <Cheesy Brik> Type for seq’s with multiple types? |
16:09:58 | FromDiscord | <dlesnoff> In reply to @Rika "Then avoid excessive indirection,": I asked about the same question as the Reddit post yesterday and got a nice answer from @Rika and @auxym . |
16:10:18 | FromDiscord | <demotomohiro> In reply to @Cheesy Brik "Type for seq’s with": https://internet-of-tomohiro.netlify.app/nim/faq.en.html#coding-how-to-store-different-types-in-seqqmark |
16:36:49 | * | PMunch joined #nim |
16:43:51 | FromDiscord | <planetis> nice |
16:43:57 | FromDiscord | <planetis> (edit) "nice ... " added "faq" |
16:44:13 | FromDiscord | <demotomohiro> thank you! |
16:53:55 | * | vsantana joined #nim |
16:54:17 | * | vsantana quit (Remote host closed the connection) |
17:01:53 | FromDiscord | <untoreh> mmh, `std/xmltree` uses `std/strtabs` for attributes, but strtabs doesn't preserve the order, it always seem to sort alphabetically by keys (attr names) so you end up with mismatching I/O |
17:05:24 | * | derpydoo joined #nim |
17:08:41 | FromDiscord | <untoreh> well not alphabetically but still |
17:36:55 | FromDiscord | <Slazaa> Hi, how can I change the path I want my executable to be compiled to ? |
17:39:37 | FromDiscord | <Elegantbeef> `--outdir:/here/you/go` |
17:39:47 | FromDiscord | <Slazaa> Thank you :3 |
17:40:09 | FromDiscord | <Slazaa> It doesnt show on the help command |
17:40:14 | FromDiscord | <Slazaa> (edit) "doesnt" => "doesn't" |
17:40:19 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/nimc.html |
17:40:30 | FromDiscord | <Slazaa> Thanks :D |
17:40:33 | FromDiscord | <Slazaa> That's the link I needed |
17:41:24 | FromDiscord | <ShalokShalom> @Slazaa --outdir:DIR |
17:41:41 | FromDiscord | <ShalokShalom> Ah, too late ^^ |
17:42:12 | FromDiscord | <ShalokShalom> @Elegantbeef#0000 Is this intended, that it doesnt show up with the help command? |
17:42:30 | FromDiscord | <Elegantbeef> How am i supposed to know |
17:48:30 | FromDiscord | <dlesnoff> In reply to @Slazaa "It doesn't show on": Doesn't it show with ’--fullhelp’ ? |
17:48:55 | FromDiscord | <dlesnoff> (edit) "’--fullhelp’" => "'--fullhelp'" |
17:48:58 | FromDiscord | <Slazaa> In reply to @Jiezron "Doesn't it show with": Oh I didn't know about this command |
17:49:23 | FromDiscord | <Slazaa> Yeas it does |
17:49:39 | FromDiscord | <Slazaa> (edit) "Yeas" => "Yes" |
17:50:31 | FromDiscord | <dlesnoff> —fullhelp does show when outputting nim -h or nim —help |
17:51:11 | FromDiscord | <Slazaa> Yeah, I just assumed all commands were shown with a simple help |
17:51:36 | FromDiscord | <dlesnoff> But maybe we should add --outdir to --help since it is frequent to search for it. |
17:52:04 | FromDiscord | <Slazaa> Thanks for this info :3 |
17:52:33 | PMunch | The fuck.. Copied some C code from a pdf and converted it to Nim. Apparently it used en-dashes instead of minuses.. |
17:56:28 | FromDiscord | <dlesnoff> Try to copy a code from a pdf is hell, especially on linux. It depends heavily on the backend of your viewer like mupdf or poppler. |
17:57:09 | FromDiscord | <dlesnoff> (edit) "Try to copy" => "Copying" | "hell," => "deceptive," |
17:59:41 | FromDiscord | <dlesnoff> I wonder if there are tools to extract text from a pdf, it may help |
18:06:50 | FromDiscord | <dlesnoff> In reply to @PMunch "The fuck.. Copied some": You can always apply some sed to change all en-dash to minuses |
18:06:54 | FromDiscord | <auxym> I have used this in the past to extract data tables from PDFs, worked great. Not sure how it would do with code? https://tabula.technology/ |
18:07:02 | PMunch | Yeah, that's what I did |
18:07:13 | PMunch | Or rather I used search and replace in Vim |
18:09:37 | FromDiscord | <Elegantbeef> Typical vim users telling you they use vim |
18:10:22 | FromDiscord | <Elegantbeef> You dont hear anyone say "I used search and replace in Netbeans IDE 15.3.2" |
18:11:43 | FromDiscord | <dlesnoff> You probably mean hyphen, because there is a minus sign and that is not the same symbol … (and we use hyphens to represent minus) |
18:13:27 | FromDiscord | <auxym> beef is such a typical KATE user |
18:13:29 | FromDiscord | <auxym> 🙂 |
18:16:43 | FromDiscord | <dlesnoff> I guess it is time for a novel entry in your vimrc:↵nnoremap <F2> :%s/—/-/g<CR> |
18:17:55 | FromDiscord | <dlesnoff> But I guess you already did it |
18:18:11 | * | phytolizer joined #nim |
18:18:58 | phytolizer | hey guys -- i'm trying to make a fully static executable with nim, and have almost succeeded. however, my code uses std/db_sqlite, and is attempting to load the lib dynamically. how can i make it not call dlopen? |
18:19:19 | FromDiscord | <Elegantbeef> `--dynLibOverride` explained on the nimc manual |
18:19:31 | * | kevinsjoberg left #nim (#nim) |
18:19:45 | FromDiscord | <dachian> Is it possible to incorporate Nim's compiled C code into a foreign language's cffi? |
18:21:22 | FromDiscord | <Elegantbeef> What do you mean? |
18:21:32 | FromDiscord | <Elegantbeef> Can you make libraries using Nim? |
18:22:49 | FromDiscord | <dachian> So for example Dart and python have cffis which allow you to call c functions and wrap them with a dart or python interface |
18:23:06 | FromDiscord | <Elegantbeef> Yes you can expose Nim code as a system library |
18:23:14 | FromDiscord | <Elegantbeef> `--app:lib` and `exportC` |
18:23:41 | FromDiscord | <dachian> oh cool thx let me try that real quick and get back |
18:24:13 | FromDiscord | <Elegantbeef> Pixie for instance is accessible from python and C using genny |
18:24:23 | phytolizer | thanks @Elegantbeef |
18:24:25 | * | phytolizer quit (Quit: Client closed) |
18:25:59 | FromDiscord | <dachian> In reply to @Elegantbeef "Pixie for instance is": so is it better practice to use genny or --app:lib exportC |
18:26:15 | FromDiscord | <dachian> or do u use genny in combination with the above |
18:26:36 | FromDiscord | <Elegantbeef> Well without genny you have to manually make type definitions |
18:26:50 | FromDiscord | <auxym> genny basically automates the exportC process / makes it easier to use |
18:27:01 | FromDiscord | <auxym> so your choice if you want to do it manually or let genny do it for you |
18:27:14 | FromDiscord | <Elegantbeef> You still need `--app:lib` or `--app:staticlib` depending on what you're after |
18:29:26 | termer | ORC GC seems to cause so many problems |
18:29:34 | termer | httpbeast is broken with it |
18:29:51 | termer | and I've been having issues with db_sqlite with it |
18:30:11 | termer | it looks like my database instance is getting GC'd even though it's top level and never goes away |
18:30:22 | termer | this happens when working with async code |
18:30:44 | FromDiscord | <Elegantbeef> Do you have any threading? |
18:30:55 | termer | in my sqlite test, no |
18:31:05 | termer | httpbeast has threading |
18:31:15 | termer | are there best practices for threading with orc |
18:31:37 | termer | I've had some memory-leaking code possibly related to either sqlite or the way I'm doing threading in another project |
18:32:01 | FromDiscord | <Elegantbeef> I cant really say more than i did yesterday, i dont use threading or async |
18:32:18 | termer | guess my memory is poor |
18:32:59 | FromDiscord | <Elegantbeef> When using global heap allocated memory you will likely need to use `{.cast(gcSafe).}:` and `let myVar {.cursor.} = myCollection[ind]` |
18:33:21 | termer | what is the behavior of gcSafe and cursor |
18:33:24 | termer | I've seen gcSafe before |
18:33:26 | termer | not cursor though |
18:33:35 | FromDiscord | <Elegantbeef> Or using the `threading` module |
18:34:00 | FromDiscord | <Elegantbeef> cursor creates an unowned reference, which means the ref counter isnt touched when destroyed |
18:34:21 | FromDiscord | <Elegantbeef> https://github.com/nim-lang/threading is likely the best threading experience for orc |
18:34:33 | termer | just pulled that up when searching |
18:34:41 | termer | does it have pre-generated docs or do I need to run nimdoc |
18:35:00 | FromDiscord | <Elegantbeef> There are 3 modules |
18:35:26 | termer | I'll take a look at it then |
18:35:30 | FromDiscord | <Elegantbeef> It's like \< 1000 loc with doc comments |
18:35:55 | termer | the memory leaks and crashes under orc have been driving me crazy so hopefully this helps |
18:36:21 | termer | the alternative to threading is just running single-threaded, and at that point I'd just use nodejs |
18:36:26 | FromDiscord | <Elegantbeef> It's likely just you're accidently sharing ownership of resources which causes deallocation |
18:36:41 | FromDiscord | <Elegantbeef> The segfaults come from orc's procedures eh? |
18:36:54 | termer | usually a use a pointer to a channel which was made with createShared |
18:37:04 | termer | that's how I do cross-thread communication |
18:37:08 | termer | or queue |
18:37:11 | termer | not channel |
18:37:20 | termer | same concept though |
18:38:48 | FromDiscord | <Elegantbeef> Yea channels are nice |
18:38:48 | FromDiscord | <Elegantbeef> Will be nicer soon with isolated |
18:39:10 | FromDiscord | <Elegantbeef> Well one has a lock 😛 |
18:39:24 | termer | I need to look through the code and see which I used |
18:39:30 | termer | I'm pretty sure I used a channel |
18:39:47 | termer | there's a project I was working on but stopped because of severe threading and memory issues |
18:40:01 | termer | so I'm trying to resolve those issues before returning to it |
18:40:29 | * | PMunch quit (Ping timeout: 260 seconds) |
18:40:39 | FromDiscord | <Horizon [She/Her]> How do i access a private field of an object? Iirc that was doable but can't remember how |
18:41:03 | FromDiscord | <Elegantbeef> I slap you and say `std/importutils` |
18:41:58 | FromDiscord | <Horizon [She/Her]> Aah, i was googling `Nim access hidden field in object` and `Nim access hidden field` but searching in any Nim documents for the word `private` gave nothing |
18:42:08 | FromDiscord | <Horizon [She/Her]> Thanks beef aha |
18:42:13 | FromDiscord | <Elegantbeef> Why google |
18:42:20 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/theindex.html exists |
18:42:46 | * | pro joined #nim |
18:42:57 | FromDiscord | <Horizon [She/Her]> God the loading times are abyssmal on chrome |
18:43:04 | termer | https://github.com/nim-lang/threading/blob/master/tests/tchannels_simple.nim |
18:43:12 | termer | No allocShared0/createShared |
18:43:16 | termer | Interesting |
18:43:17 | FromDiscord | <Horizon [She/Her]> But thanks! |
18:43:43 | FromDiscord | <Elegantbeef> The channels are global and dont have any heap allocated portion |
18:43:55 | termer | now that's sweet |
18:44:08 | FromDiscord | <Elegantbeef> Well Nim managed heap allocation |
18:44:23 | FromDiscord | <Elegantbeef> You can do the same with the present channels |
18:44:55 | FromDiscord | <Elegantbeef> You only need to pass a `ptr Channel` if you want each thread to have it's own channel |
18:45:14 | termer | usually I just use channels for passing work to/from a worker thread |
18:45:18 | termer | like in the case of sqlite |
18:45:27 | termer | I need to perform queries without blocking an HTTP thread |
18:45:32 | FromDiscord | <Elegantbeef> So then a global channel could work |
18:45:40 | termer | it should |
18:46:10 | termer | when you have a single thread to do a type of work then it would work perfectly I'd imagine |
18:46:39 | termer | and assuming locks are working right, there should be no problem expanding the number of workers |
18:50:10 | FromDiscord | <auxym> I really hope this whole threading/channels situation gets way better in 2.0. Sounds like sort of a mess atm |
18:50:19 | termer | it's terrible |
18:50:26 | termer | if you throw async into the mix it becomes a nightmare |
18:50:47 | FromDiscord | <Elegantbeef> I honestly dont know what's wrong with channels 😄 |
18:50:55 | FromDiscord | <Elegantbeef> I've used them before and it worked just fine |
18:51:03 | termer | nothing's wrong except there are magical things that make memory do funny things in orc |
18:51:08 | termer | and cause crashes if you're not careful |
18:51:17 | FromDiscord | <Elegantbeef> isolated should make channels 0 cost even in orc |
18:51:33 | termer | I'll have to check things out and make sure they're working right |
18:52:12 | FromDiscord | <auxym> never really needed/used them. But as I understand we have two channels implementations? The stdlib and threading? And threading isn't documented? And sometimes you have to use ptr Channel, for reasons? And all of this is poorly documented? |
18:52:38 | FromDiscord | <Elegantbeef> It's not for reasons |
18:53:11 | FromDiscord | <Elegantbeef> You need `ptr Channel` if you want to pass a specific channel to a thread, it's that simple |
18:53:32 | FromDiscord | <Elegantbeef> Threading is the future of Nim's threading and is still under development, it is documented though |
18:53:40 | * | PMunch joined #nim |
18:53:42 | FromDiscord | <auxym> In what other case would you ever want a channel, other than passing it to a thread? |
18:53:58 | FromDiscord | <Elegantbeef> When you have a global channel that's used as a queue for worker threads |
18:54:24 | FromDiscord | <Elegantbeef> You dont need to pass a channel anywhere, you just access the channel directly in that case |
18:54:35 | FromDiscord | <auxym> don't you still have to pass a ref/ptr to the channel to each thread though? |
18:54:36 | FromDiscord | <auxym> Oh |
18:55:07 | FromDiscord | <Elegantbeef> Channels are stack allocated types(well the data is heap allocated but it's managed by the thread) |
18:55:18 | termer | PMunch I watched your talks on running Nim on microcontrollers |
18:55:26 | FromDiscord | <auxym> Still, in general the idiomatic nim way is to never use ptr, so having to use ptr for channels as the standard use case feels sort of weird |
18:55:35 | termer | those were very eye-opening, since I was convinced nim wasn't suitable for devices like that |
18:55:39 | FromDiscord | <Elegantbeef> managed by the channel\ |
18:55:58 | FromDiscord | <Elegantbeef> I mean we're talking about threading |
18:55:59 | FromDiscord | <Elegantbeef> If you get stuck on pointers while you're attempting to thread i'm a bit scared of your generated threaded code |
18:56:07 | FromDiscord | <auxym> Anyways, ty for the info. I should try out threading sometime. Good news if threading is under active development and gets better in the future |
18:56:46 | FromDiscord | <Elegantbeef> With orc/arc you might(I dont know if this is true) be able to pass `ref Channel` |
18:57:11 | FromDiscord | <Elegantbeef> Eh that seems unlikely though |
18:57:17 | FromDiscord | <auxym> In reply to @Elegantbeef "If you get stuck": my only experience with threads TBH is python, and you don't need to know anyhting about pointers. A thread-safe Queue is provided as a high-level sync primitive which takes care of most things without fuss |
18:57:50 | FromDiscord | <Elegantbeef> Something about python's evaluator being single threaded here |
18:58:01 | FromDiscord | <auxym> yes, yes, GIL, etc 🙂 |
18:58:20 | FromDiscord | <Elegantbeef> When you dont have code running at the same time it's a bit easier to manage |
18:59:01 | FromDiscord | <Elegantbeef> Nim threading has you dealing with code running at the same time so it requires some thought into what you're doing, mainly with regard to memory management |
18:59:04 | FromDiscord | <auxym> from my understanding, python Queues would still be thread-safe in the absence of the GIL. They are synchronized by OS-level locks/condition vars, under the hood |
18:59:08 | FromDiscord | <Elegantbeef> It's extremely easy to have race conditions with memory management |
18:59:19 | FromDiscord | <Elegantbeef> Sure and channels are threadsafe |
18:59:21 | * | jkl quit (Quit: Gone.) |
18:59:34 | termer | any of my threading experience before nim was Java, which handles it all for you |
18:59:41 | FromDiscord | <auxym> yes but pointers 😠|
18:59:48 | termer | you only really have to use the proper thread-safe List implementations and the `synchronized` keyword |
19:00:02 | FromDiscord | <auxym> In reply to @termer "any of my threading": yeah. exactly. |
19:00:54 | * | jkl joined #nim |
19:01:26 | FromDiscord | <Elegantbeef> Meh pointers arent that scary |
19:01:45 | FromDiscord | <auxym> I know, just doesn't feel like very idiomatic Nim |
19:02:20 | FromDiscord | <auxym> Nowhere else in the stdlib is the "normal" way to things requires ptr (other than c ffi obviously) |
19:02:21 | FromDiscord | <haywireSSC> how would I iterate through file names in a directory in compile time? would I need to use staticExec and ls command? |
19:02:30 | termer | pointers aren't scary |
19:02:34 | termer | GC with pointers is scary |
19:02:44 | Amun-Ra | haywireSSC: that, tbh, makes little sense |
19:02:54 | Amun-Ra | haywireSSC: unless directory contents are fixed |
19:03:36 | FromDiscord | <Elegantbeef> You can do `import std/os` and `walkFiles` assuming your target OS supports `std/os` |
19:03:57 | FromDiscord | <haywireSSC> In reply to @Elegantbeef "You can do `import": do most things like that also work in compile time? |
19:04:25 | Amun-Ra | yes |
19:04:26 | FromDiscord | <auxym> @haywireSSC see listDirs and listFiles in https://nim-lang.org/docs/nimscript.html#listDirs%2Cstring |
19:04:35 | FromDiscord | <haywireSSC> ty |
19:05:33 | FromDiscord | <ezquerra> sent a code paste, see https://play.nim-lang.org/#ix=4feX |
19:07:14 | FromDiscord | <auxym> you could pass topolist/visited as `var` arguments to buildTopoList. But your current impl looks good to me, too. |
19:07:57 | termer | a surprising amount of things work at compile time |
19:08:30 | FromDiscord | <ezquerra> Would it be as (or perhaps more) efficient one way or the other?? |
19:09:12 | FromDiscord | <auxym> benchmark it if you want a real answer. OTOH I wouldn't expect a significant difference |
19:09:54 | * | ttkap joined #nim |
19:12:11 | FromDiscord | <ezquerra> Thanks! |
19:20:09 | FromDiscord | <Elegantbeef> A lot do if your target os supports them↵(@haywireSSC) |
19:20:24 | FromDiscord | <Elegantbeef> It's a bit of a chore if you're targetting embedded |
19:21:25 | * | deadmarshal quit (Ping timeout: 246 seconds) |
19:24:40 | FromDiscord | <auxym> yeah. shouldn't CT stuff use hostOS rather than targetOS though, for any cross compilation stuff? |
19:31:02 | * | deadmarshal joined #nim |
19:36:17 | FromDiscord | <haywireSSC> In reply to @Elegantbeef "A lot do if": it says cannot importc variable at compile time |
19:37:06 | * | pro quit (Quit: pro) |
19:39:01 | FromDiscord | <haywireSSC> for glob |
19:40:28 | FromDiscord | <haywireSSC> In reply to @auxym "<@536164435136479232> see listDirs and": how would I use these? |
19:41:32 | FromDiscord | <dlesnoff> I have a question about nim v2. If strictDefs requires initialization of variables and becomes the default, does that mean that each field of our objects must be initialized too ? |
19:41:46 | FromDiscord | <ShalokShalom> sent a long message, see http://ix.io/4ff4 |
19:42:05 | FromDiscord | <auxym> In reply to @haywireSSC "how would I use": IIRC, the nimscript module is always available (like system) for anything running in the VM |
19:42:29 | FromDiscord | <ShalokShalom> Does this mean, I can just load Lua libraries, or write Lua code and load that like I load Nim code?↵↵Treat Lua code as native code? |
19:42:59 | FromDiscord | <ShalokShalom> Similar to Nimpy?/ |
20:25:58 | FromDiscord | <tangonov> What a beauty, color syntax examples, too https://media.discordapp.net/attachments/371759389889003532/1039274533594615828/IMG_20221107_122220639_HDR.jpg |
20:26:45 | * | xet7 quit (Remote host closed the connection) |
20:35:48 | * | krux02 joined #nim |
20:43:42 | * | krux02 quit (Remote host closed the connection) |
20:44:19 | * | krux02 joined #nim |
20:44:28 | * | LuxuryMode quit (Quit: Connection closed for inactivity) |
20:52:09 | FromDiscord | <albassort> Should I buy that book for my bookshelves |
20:52:20 | FromDiscord | <albassort> I don't really think it has much information for me at this point but I still want it |
20:52:34 | FromDiscord | <albassort> Maybe I can destroy it at someone when they tell me that they never heard of him and it's not a real system language |
20:52:42 | FromDiscord | <albassort> (edit) "destroy" => "throw" |
20:54:47 | FromDiscord | <Phil> Mastering nim is an eternal pain for me. On if I'm too lazy to cancel my patreon contributions for 2 months to get the book or not |
20:55:05 | FromDiscord | <Phil> So far the lazyness has won |
20:56:04 | FromDiscord | <ShalokShalom> See it as a contribution |
20:56:22 | FromDiscord | <Elegantbeef> Yea not all of them↵(@haywireSSC) |
20:56:35 | FromDiscord | <Elegantbeef> It's not for `static` evaluated code↵(@auxym) |
20:56:54 | FromDiscord | <ShalokShalom> Its doesnt really matter, if you buy the book or contribute the money ↵↵The book costs are minimal, the income for Andreas/the project will be similar |
20:57:10 | FromDiscord | <ShalokShalom> @Phil |
20:57:19 | FromDiscord | <Elegantbeef> Book probably gives more than patreon |
20:57:38 | FromDiscord | <Elegantbeef> Patreon takes a larger cut than publishers/printers likely but idk |
20:58:18 | FromDiscord | <Phil> Something in my brain refuses the double dip |
20:58:35 | FromDiscord | <Phil> So its a matter of lazyness |
21:00:38 | FromDiscord | <ShalokShalom> In reply to @Elegantbeef "Patreon takes a larger": Ah, yeah true. Forgot that Patreon even takes something. |
21:00:58 | FromDiscord | <ShalokShalom> And with buying the book, you show interest in the language too |
21:01:11 | FromDiscord | <ShalokShalom> Andreas can then say, xx people bought my book. |
21:05:03 | FromDiscord | <haywireSSC> In reply to @Elegantbeef "Yea not all of": do you think I would need to run commands to list files and iterate over their output insted? |
21:05:33 | FromDiscord | <Elegantbeef> `walkFiles` works |
21:05:43 | FromDiscord | <Elegantbeef> Sorry `walkDir` |
21:06:52 | FromDiscord | <haywireSSC> oke |
21:07:01 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4ffm |
21:07:34 | FromDiscord | <haywireSSC> thanks!! |
21:08:21 | FromDiscord | <Slazaa> sent a code paste, see https://play.nim-lang.org/#ix=4ffn |
21:08:33 | FromDiscord | <Slazaa> Here I'd like the first echo to get me Derived basically |
21:08:37 | FromDiscord | <Elegantbeef> `Derived(ob)` |
21:08:52 | FromDiscord | <Elegantbeef> `proc showType[T: Base](obj: T)` |
21:09:07 | FromDiscord | <Slazaa> Oh ok :o |
21:09:22 | FromDiscord | <Elegantbeef> Nim's `type`(really you should be using `typeof`) is static and does not know about runtime |
21:09:27 | FromDiscord | <Slazaa> Yeah it works thank you :3 |
21:09:58 | FromDiscord | <Elegantbeef> the above makes the procedure generic and constrains to all subtypes of `Base`, so when you call it with a subtype it generates a new procedure specifically for that |
21:10:32 | FromDiscord | <Slazaa> And why does the condition is true though ? |
21:10:33 | FromDiscord | <ShalokShalom> Why typeof instead type? |
21:10:38 | FromDiscord | <Slazaa> (edit) "does" => "is" | removed "is" |
21:10:48 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/ogN |
21:10:49 | FromDiscord | <Elegantbeef> cause `of` is runtime |
21:10:54 | FromDiscord | <Slazaa> :o |
21:11:18 | FromDiscord | <ShalokShalom> Runtime, as in dynamic typing? |
21:11:21 | FromDiscord | <Elegantbeef> Cause `typeof` is supposed to be used in typing expressions as it's more clear and doesnt overload a existing word, and it can take parameters |
21:11:34 | FromDiscord | <Slazaa> sent a code paste, see https://play.nim-lang.org/#ix=4ffp |
21:11:43 | FromDiscord | <ShalokShalom> Ah |
21:11:45 | FromDiscord | <Elegantbeef> The 'correct' solution is to make a method to do what you want |
21:13:14 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4ffq |
21:13:34 | FromDiscord | <Elegantbeef> Nim does not really have mechanisms to get the name of a type at runtime, without bodging around |
21:13:51 | FromDiscord | <Elegantbeef> It's "Possible" but it's a bit of a bodge |
21:14:23 | * | derpydoo quit (Quit: derpydoo) |
21:18:41 | NimEventer | New thread by mantielero: C++ binding - error: use of deleted function, see https://forum.nim-lang.org/t/9588 |
21:30:12 | FromDiscord | <geekrelief> sent a code paste, see https://play.nim-lang.org/#ix=4ffu |
21:31:05 | FromDiscord | <Elegantbeef> Is this perhaps a call from inside a generic procedure? |
21:31:17 | FromDiscord | <Elegantbeef> Your provided example works fine |
21:31:21 | * | jjido joined #nim |
21:31:34 | FromDiscord | <geekrelief> yeah the provided examples should work and has worked fine |
21:31:51 | FromDiscord | <geekrelief> @jmgomez and I came across this issue while working on NimForUE |
21:32:06 | FromDiscord | <Elegantbeef> What's the procedure calling the stringification that is bugging? |
21:32:07 | FromDiscord | <Elegantbeef> Is it a generic? |
21:32:07 | FromDiscord | <geekrelief> there's been a bunch of commits between when it was working to where it's now broken |
21:32:43 | FromDiscord | <geekrelief> we're just calling `$` directly on a type |
21:33:07 | FromDiscord | <geekrelief> let me get a code sample for context |
21:33:14 | FromDiscord | <Elegantbeef> Not inside any procedure, just at top level? |
21:33:22 | FromDiscord | <geekrelief> it's inside a procedure |
21:33:33 | FromDiscord | <Elegantbeef> Are you sure the `$` is in scope of the calling procedure? |
21:34:02 | FromDiscord | <geekrelief> yeah, I can call the `$` on the type directly, but if the type is in a `seq` it doesn't call it |
21:34:17 | FromDiscord | <geekrelief> I have no idea what's causing it to break |
21:34:41 | FromDiscord | <geekrelief> https://github.com/jmgomez/NimForUE/blob/d8c307e94be4bdf3beda0edec7287be9ab92c0e7/src/nimforue/examples/examplescodegen.nim#L225 |
21:35:19 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4ffw |
21:35:24 | FromDiscord | <geekrelief> we're just calling it here and writing the output to a file, if I drill into `ueProject`... |
21:35:39 | FromDiscord | <geekrelief> sent a code paste, see https://play.nim-lang.org/#ix=4ffx |
21:36:02 | FromDiscord | <Elegantbeef> Oh that's not a generic so that mixin wont do |
21:36:34 | FromDiscord | <geekrelief> I have a macro generating the `$` procs |
21:36:55 | FromDiscord | <geekrelief> https://github.com/jmgomez/NimForUE/blob/master/src/nimforue/macros/makestrproc.nim this was working fine before |
21:37:08 | FromDiscord | <geekrelief> something else around it changed and broke it |
21:37:14 | * | jmdaemon joined #nim |
21:37:38 | FromDiscord | <Elegantbeef> What's wrong with Nim's `$` you dont like that it lacks type name? |
21:37:52 | FromDiscord | <Elegantbeef> or you dislike that it does `"..."` for pointers? |
21:37:54 | FromDiscord | <geekrelief> sent a code paste, see https://play.nim-lang.org/#ix=4ffy |
21:38:05 | FromDiscord | <geekrelief> yeah we need the type name because we're writing the output to a nim file |
21:38:17 | FromDiscord | <geekrelief> it gets processed to produce C++ bindings |
21:38:43 | FromDiscord | <Elegantbeef> So why not just do `strformat` `{typeof(V)}{$v}` ? |
21:39:20 | FromDiscord | <geekrelief> does that work recursively? |
21:39:29 | FromDiscord | <geekrelief> I guess I can try it |
21:39:32 | FromDiscord | <Elegantbeef> As long as there isnt a pointer |
21:39:34 | FromDiscord | <geekrelief> yeah I didn't think of it |
21:40:04 | FromDiscord | <geekrelief> but the question still is why would the type in a seq break? |
21:40:29 | FromDiscord | <Elegantbeef> Can only imagine the issue is generic binding |
21:40:59 | FromDiscord | <Elegantbeef> Inside your `makeStrProc` perhaps a `mixin` would resolve this |
21:41:06 | FromDiscord | <geekrelief> can you elaborate on what is generic binding? |
21:41:30 | FromDiscord | <Elegantbeef> Generic procedures bind symbols open or closed depending on overloads in context |
21:42:07 | FromDiscord | <Elegantbeef> Your `ueProject`'s `$` is likely calling `$` for `seq[T]` and cause it doesnt mixin `$` it's only searching for procedures in it's original scope |
21:42:10 | FromDiscord | <Elegantbeef> So your overloads are not found |
21:42:28 | FromDiscord | <Elegantbeef> A forward declaration may also help |
21:42:40 | FromDiscord | <Elegantbeef> It's quite hard to say with your macros |
21:42:55 | FromDiscord | <geekrelief> ok, I'll look into mixin, thanks for the suggestions! |
21:43:29 | FromDiscord | <Elegantbeef> You may want to just look into templates and disruptek's assume for easing headaches |
21:43:50 | FromDiscord | <Elegantbeef> He has a `typeit` macro that allows iterating fields of a type regardless if it's a object variant |
21:44:22 | FromDiscord | <geekrelief> In reply to @Elegantbeef "You may want to": thanks I'll take a look if `mixin` fails to do the trick |
21:46:38 | FromDiscord | <geekrelief> sent a code paste, see https://play.nim-lang.org/#ix=4ffA |
21:47:04 | FromDiscord | <Elegantbeef> Sounds like a nice fun program |
21:47:48 | FromDiscord | <geekrelief> lol |
21:50:39 | FromDiscord | <Elegantbeef> Looking at what your `$` does i'm fairly certain you can replace it with much simpler macro-less operators |
21:51:13 | FromDiscord | <Elegantbeef> The objects you use `makeStrProc` for are not complex types(well one has an object variant, but nim works with `$` on object variants) |
21:58:14 | FromDiscord | <geekrelief> In reply to @Elegantbeef "The objects you use": yeah, right I'm trying this: |
21:58:45 | FromDiscord | <geekrelief> sent a code paste, see https://play.nim-lang.org/#ix=4ffG |
21:58:55 | FromDiscord | <geekrelief> but getting an ambiguous `$` error for object or T |
21:59:36 | FromDiscord | <geekrelief> do you know how I could call the object version of `$` on T or is there a better way? |
22:00:01 | FromDiscord | <Elegantbeef> Damn it |
22:00:05 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4ffH |
22:00:12 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4ffI |
22:00:19 | FromDiscord | <Elegantbeef> I give up |
22:00:39 | FromDiscord | <Elegantbeef> Someone take my keyboard from me |
22:01:06 | FromDiscord | <Elegantbeef> `object` and the generic constraint might be comparably specific so you might need multiple `$`s |
22:01:16 | FromDiscord | <geekrelief> sent a code paste, see https://play.nim-lang.org/#ix=4ffJ |
22:02:08 | FromDiscord | <geekrelief> sent a code paste, see https://play.nim-lang.org/#ix=4ffK |
22:02:12 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4ffL |
22:02:18 | FromDiscord | <Elegantbeef> Yea like i said they're both generics so equally specific |
22:02:40 | FromDiscord | <Elegantbeef> `makeStrProc(T: typedesc)` is proper 😄 |
22:03:27 | FromDiscord | <Elegantbeef> Even though the type is named specifically it's the same specificity as `object or tuple` it seems |
22:03:48 | FromDiscord | <Elegantbeef> Possible RFC or PR there, but typechecker changes are scary |
22:04:51 | FromDiscord | <geekrelief> darn getting a "undeclared identifier `system`" |
22:05:01 | FromDiscord | <geekrelief> (edit) "`system`"" => "'`system`'"" |
22:05:20 | FromDiscord | <Elegantbeef> did you leave out the `.` like i did? |
22:05:42 | FromDiscord | <Elegantbeef> `system.\`$\`\` |
22:05:45 | FromDiscord | <geekrelief> oh .. yeah add the dot |
22:05:47 | FromDiscord | <Elegantbeef> God damn it 😄 |
22:05:48 | FromDiscord | <geekrelief> that worked |
22:06:01 | FromDiscord | <Elegantbeef> Mark down is not being kind to me today |
22:06:27 | FromDiscord | <geekrelief> ahh no luck, it compiles but produces the same output |
22:07:00 | FromDiscord | <geekrelief> I truncated the output |
22:07:02 | FromDiscord | <geekrelief> sent a code paste, see https://play.nim-lang.org/#ix=4ffN |
22:07:24 | FromDiscord | <geekrelief> f.signature should be `@[UEField(name: "VertexID"...` |
22:07:25 | FromDiscord | <Elegantbeef> Are we sure the place that calls `$` imported the module with `$`? |
22:08:02 | FromDiscord | <geekrelief> yeah the makestrproc is being imported |
22:09:32 | FromDiscord | <geekrelief> it was working before, and after a bunch of commits it broke. I've been staring at the between the commits, and I don't have a clue what could have broken it. I'm considering just giving the string proc a different name just to work around this, but I want to figure out what's going wrong. |
22:09:47 | FromDiscord | <geekrelief> missed a word.. staring at the diff |
22:10:30 | FromDiscord | <Elegantbeef> https://wandbox.org/permlink/IbD4hN2Ag3w4rANY i dont know what to say |
22:10:46 | FromDiscord | <geekrelief> not to throw any shade, but I didn't write the following commits that led to the breakage 😄 |
22:10:49 | FromDiscord | <Elegantbeef> It seems you have somewhere where the system `$` is being considered above the one provided |
22:10:57 | FromDiscord | <geekrelief> I'm just trying to fix it |
22:11:01 | FromDiscord | <Elegantbeef> Well i'll blame whoever used `astGenRepr` |
22:11:13 | FromDiscord | <geekrelief> ha |
22:13:55 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4ffO |
22:14:38 | FromDiscord | <Elegantbeef> It shouldnt be needed but it really seems like system's `$` is being preferred |
22:17:08 | FromDiscord | <geekrelief> right, for some reason system's `$` is being called |
22:17:45 | FromDiscord | <geekrelief> if I call `$` on the type directly it works |
22:18:10 | FromDiscord | <geekrelief> but for seq[T] where T is my custom type it doesn't call my `$` |
22:19:15 | FromDiscord | <Elegantbeef> Wait dollars procs do not mixin `$`... |
22:20:09 | FromDiscord | <geekrelief> Well it was working before, but now it's not working. |
22:20:28 | FromDiscord | <Elegantbeef> Have you updated your Nim compiler? |
22:20:29 | FromDiscord | <geekrelief> I'm defining `$` for seqs |
22:20:38 | FromDiscord | <geekrelief> I'm on v1.6.8 |
22:21:02 | FromDiscord | <geekrelief> I ran into an issue on devel. |
22:21:23 | FromDiscord | <Elegantbeef> Where do you define `$`? |
22:21:43 | FromDiscord | <geekrelief> in a module called `makeStrProc.nim` |
22:22:29 | FromDiscord | <geekrelief> it's being imported before it's used in https://github.com/jmgomez/NimForUE/blob/d8c307e94be4bdf3beda0edec7287be9ab92c0e7/src/nimforue/examples/examplescodegen.nim#L5 |
22:22:46 | FromDiscord | <Elegantbeef> I dont see you defining `$` for seqs in there |
22:22:58 | FromDiscord | <geekrelief> right, I'm not |
22:23:11 | FromDiscord | <geekrelief> I didn't before and it was working for seqs |
22:23:16 | FromDiscord | <Elegantbeef> Well where are you defining it for seqs |
22:24:03 | FromDiscord | <geekrelief> I'm not defining it for seqs, it was working before. Just like your wandbox example. |
22:24:24 | FromDiscord | <Elegantbeef> Ok well you said twice you were so 😄 |
22:24:25 | FromDiscord | <geekrelief> But something is breaking it now. |
22:24:35 | FromDiscord | <geekrelief> oh I didn't sorry.. |
22:24:38 | FromDiscord | <geekrelief> (edit) "didn't" => "did" |
22:24:46 | FromDiscord | <geekrelief> I probably need to get some sleep. |
22:26:02 | FromDiscord | <geekrelief> anyway, I'm going to step away for a bit. Thanks for trying to help out. |
22:26:41 | FromDiscord | <Elegantbeef> No problem |
22:26:57 | FromDiscord | <Elegantbeef> I'm like 99% certain this is a generic bug but i dont see any signs of it |
22:53:20 | * | phytolizer joined #nim |
23:02:15 | * | phytolizer quit (Quit: Client closed) |
23:04:24 | * | PMunch quit (Quit: leaving) |
23:05:57 | * | jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…) |
23:29:26 | * | xet7 joined #nim |
23:40:18 | * | jmd_ joined #nim |
23:40:54 | * | jmdaemon quit (Ping timeout: 260 seconds) |
23:59:50 | arkanoid | How can I write stack only code? What should I avoid doing, apart from using seqs, tables, and other dynamic collections? |