00:05:01 | * | noeontheend quit (Ping timeout: 240 seconds) |
00:12:05 | FromDiscord | <gogolxdong (liuxiaodong)> Is there any way to tranform xml to json? |
00:28:35 | * | noeontheend joined #nim |
00:38:01 | * | vicfred quit (Quit: Leaving) |
00:44:49 | noeontheend | I'm dealing with a fun memory issue. I'm getting a SIGSEGV that only happens in release builds. I've added enough `echo` statements to track it down to one line, but if I check if that variable is nil before using it, `.isNil` returns false. Further, if I add an `echo` on any of the ref object's fields before trying to use it, the SIGSEGV no longer occurs and the program continues as expected. |
00:46:09 | FromDiscord | <Elegantbeef> Code? |
00:48:21 | noeontheend | I'm trying to make a MWE, but the actual program is well over 1000 LOC, so I haven't been able to replicate it in simple form yet. |
00:48:49 | FromDiscord | <Elegantbeef> Is it pure Nim or are you using libraries? |
00:51:32 | noeontheend | My stuff is all pure Nim, and in scanning the dependencies it looks like they're also all Nim. |
00:52:47 | FromDiscord | <Elegantbeef> What's the line? |
00:54:38 | noeontheend | It's actually just from passing the `ref object` to a proc that uses it. |
00:54:59 | FromDiscord | <Elegantbeef> Do you have the code somewhere i can read it? |
00:55:07 | noeontheend | (Sorry, would love to be more concrete, but I also don't want to ask you to dig through the entire codebase to figure this out) |
00:55:19 | noeontheend | I'll put it up if you're interested, one second. |
01:02:02 | noeontheend | Specifically: https://git.sr.ht/~reesmichael1/roman/tree/sigsegv/item/src/romanpkg/main.nim#L81 |
01:04:14 | noeontheend | The `displayFeed(feed)` on line 87 is what triggers the SIGSEGV. Here's an example feed that triggers it if running it is useful: https://os.phil-opp.com/rss.xml |
01:04:38 | FromDiscord | <Elegantbeef> Where is Feed defined? |
01:05:09 | noeontheend | https://git.sr.ht/~reesmichael1/roman/tree/sigsegv/item/src/romanpkg/types.nim#L33 |
01:07:32 | FromDiscord | <Elegantbeef> Wont change anything but `displayFeed` taking a `var Feed` is suspect |
01:08:22 | noeontheend | You're right, I changed it earlier to just take a `Feed` and it still happens. |
01:08:33 | FromDiscord | <Elegantbeef> What GC are you using? |
01:09:38 | FromDiscord | <Elegantbeef> If not try with `--gc:orc` or `--gc:arc` |
01:11:16 | noeontheend | Interesting! I hadn't tried it without the default `--gc:refc`. `--gc:boehm` also crashes, but `--gc:refAndSweep` works as expected. |
01:12:02 | noeontheend | (It's an older project, I need to update it to compile with `--gc:arc` or `--gc:orc`...as well as to use lots of niceties in modern Nim.) |
01:12:11 | noeontheend | Whoops...`--gc:markAndSweep`, obviously. |
01:12:20 | FromDiscord | <Elegantbeef> Yea |
01:12:34 | FromDiscord | <Elegantbeef> Sounds like it could be an issue with the GC |
01:12:56 | noeontheend | Neat, thanks for the suggestion/your time! |
01:13:12 | FromDiscord | <Elegantbeef> I dont know about a min repo |
01:13:50 | noeontheend | I'll spend some time fixing the older stuff up, that might help it out. Plus I'll see if ARC/ORC works as well once those are usable. |
01:14:34 | FromDiscord | <Elegantbeef> What happens if you remove line 72 and make line 80 `let feed = feeds[0]` and line 89 `let feed = chooseFeed(feeds)`? |
01:14:40 | FromDiscord | <Elegantbeef> Might cause the GC to behave differently |
01:17:02 | noeontheend | Unfortunately not, still crashes with `gc:refc` and works with `gc:markAndSweep`. |
01:17:37 | FromDiscord | <Elegantbeef> I suppose i can always clone this 😀 |
01:18:47 | FromDiscord | <Elegantbeef> What nim version are you using? |
01:19:49 | * | arkurious quit (Quit: Leaving) |
01:20:18 | noeontheend | I don't think it's relevant, but I'm only building it with `-d:internalRenderer` (which uses https://git.sr.ht/~reesmichael1/nim-html2text, which has been my blocker on the main project for a long time). I don't even have the alternate Python renderer installed on this computer. |
01:20:48 | FromDiscord | <noeontheend> In reply to @Elegantbeef "I suppose i can": Please feel free! 😀 |
01:21:24 | noeontheend | Nim Compiler Version 1.6.0 [Linux: amd64] |
01:21:24 | noeontheend | Compiled at 2021-10-19 |
01:21:25 | noeontheend | Copyright (c) 2006-2021 by Andreas Rumpf |
01:21:25 | noeontheend | |
01:21:25 | noeontheend | git hash: 727c6378d2464090564dbcd9bc8b9ac648467e38 |
01:21:25 | noeontheend | active boot switches: -d:release |
01:23:07 | FromDiscord | <Elegantbeef> Hmm i'm not getting a seg issue |
01:23:12 | FromDiscord | <Elegantbeef> > error rendering HTML to text\: \<class 'ModuleNotFoundError'\>\: No module named 'html2text' |
01:23:29 | noeontheend | Try building it with `-d:internalRenderer` |
01:24:14 | FromDiscord | <Elegantbeef> > error\: while accessing https://os.phil-opp.com/rss.xml: could not create read-posts file |
01:24:54 | noeontheend | Ack, sorry, my bad: https://todo.sr.ht/~reesmichael1/roman/23 |
01:25:33 | noeontheend | If you're on Linux, create `~/.local/share/roman/`. |
01:25:42 | FromDiscord | <Elegantbeef> I can read! |
01:27:10 | FromDiscord | <Elegantbeef> After running subscribe on that link i get `error: Invalid enum value: rss` |
01:28:13 | noeontheend | Fascinating...try editing the last field in `~/.config/roman/subscriptions` to "RSS"? I'm guessing it's being written as lowercase, which it obviously shouldn't be.... |
01:29:17 | FromDiscord | <Elegantbeef> Where should the crash be? |
01:30:41 | noeontheend | For me, it's on startup, before showing the feed: |
01:30:41 | noeontheend | > michael at pepper in ~/programs/roman on sigsegv [!] |
01:30:41 | noeontheend | > ↪ ./bin/roman |
01:30:41 | noeontheend | > SIGSEGV: Illegal storage access. (Attempt to read from nil?) |
01:30:41 | noeontheend | > fish: Job 1, './bin/roman' terminated by signal SIGSEGV (Address boundary error) |
01:31:15 | FromDiscord | <Elegantbeef> Ah got it aswell |
01:31:32 | noeontheend | Phew :) |
01:35:08 | noeontheend | Hmmm, disabling the parallel loading on line 218 of feeds.nim fixes the crash as well. |
01:35:33 | FromDiscord | <Rika> Lol hmmm got pinged |
01:36:23 | noeontheend | Oops, sorry! |
01:38:27 | FromDiscord | <Elegantbeef> If that's the case it sounds like it's GC + heap issue |
01:39:48 | FromDiscord | <Elegantbeef> Thread sharing of this complex object doesnt properly give up ownership from the flowvar and is GC'd is my 100% uninformed guess |
01:42:20 | noeontheend | That makes sense to me. |
01:43:14 | noeontheend | Elegantbeef: Thanks a million for pointing me in the right direction! I have to run soon, but I have plenty to work with now. |
01:43:48 | FromDiscord | <Elegantbeef> The blind leading the blind if you ask me, but hopefully it helps and doesnt make you waste time |
01:44:43 | * | def- quit (Quit: -) |
01:45:17 | * | def- joined #nim |
01:56:12 | NimEventer | New thread by Sdmcallister: Column value extraction, see https://forum.nim-lang.org/t/8773 |
01:59:18 | FromDiscord | <michaelb> sent a long message, see http://ix.io/3L3d |
01:59:40 | FromDiscord | <Rika> when statement + const? |
01:59:53 | FromDiscord | <michaelb> (edit) "http://ix.io/3L3d" => "http://ix.io/3L3e" |
02:00:11 | FromDiscord | <Elegantbeef> Yep https://nim-lang.org/docs/manual.html#foreign-function-interface-dynlib-pragma-for-import |
02:00:19 | FromDiscord | <Elegantbeef> That's dynlib, whoops |
02:00:44 | FromDiscord | <Rika> oh yeah they have patterns too huh' |
02:01:03 | FromDiscord | <Elegantbeef> Dynlib does, passL probably doesnt |
02:01:35 | FromDiscord | <michaelb> passL also seems to be passing the flags to gcc and not ld... which is not what I expected |
02:01:41 | FromDiscord | <michaelb> but that's another issue |
02:03:48 | FromDiscord | <michaelb> also, `{.dynlib: "libfoo.so.3".}` is working for me.↵↵it happens that for this library, when I use dynlib (and I am), I also need to use passL, has to do with how the library is built, i.e. it has a libfoo and a libfoo-core and only spec'ing libfoo in dynlib isn't enough, I need to get flags to the linker also |
02:04:20 | FromDiscord | <michaelb> anyway, this is working on macos, where things are usually more weird, so I was surprised when having trouble with it on linux |
02:06:48 | FromDiscord | <Elegantbeef> Yea i've never dealt with system libraries so cant say much |
02:07:30 | FromDiscord | <michaelb> to clarify, what I mean is that I can successfully do `{.dynlib: "libfoo.so.3"}` and `{.passL: "-lfoo -lfoo-core"}`, but I need to make sure that dynlib and ld are going to resolve the same version of libfoo, hence why I'm trying to figure out the version number aspect re: passL |
02:08:34 | FromDiscord | <michaelb> (edit) ""libfoo.so.3"}`" => ""libfoo.so.3".}`" | "-lfoo-core"}`," => "-lfoo-core".}`," |
02:13:24 | FromDiscord | <Elegantbeef> Correct me if i'm wrong but isnt the static library vendored by you |
02:13:34 | FromDiscord | <Elegantbeef> So it'll always be the "right" version |
02:14:53 | FromDiscord | <michaelb> it's shared, not static |
02:15:03 | FromDiscord | <michaelb> when it's `.so` I mean |
02:15:25 | FromDiscord | <Elegantbeef> Sure but the one you're doing `-lfoo` for is static isnt it? |
02:15:59 | FromDiscord | <michaelb> In reply to @Elegantbeef "Sure but the one": no |
02:16:03 | FromDiscord | <Elegantbeef> Like i said i've never used libraries so i just thing those are static, i'm probably way wrong |
02:16:10 | FromDiscord | <michaelb> okay, found what works: https://stackoverflow.com/a/3840318 |
02:16:41 | FromDiscord | <michaelb> `{.passL: "-l:libfoo.so.3 -llibfoo-core.so.3".}` |
02:16:50 | FromDiscord | <michaelb> (edit) "-llibfoo-core.so.3".}`" => "-l:libfoo-core.so.3".}`" |
02:17:13 | FromDiscord | <michaelb> when you use the `-l:` form, you can give the full name and it will look for that |
02:28:17 | * | sagax quit (Ping timeout: 240 seconds) |
02:33:10 | * | neurocyte09 joined #nim |
02:35:01 | * | neurocyte0 quit (Ping timeout: 240 seconds) |
02:35:01 | * | neurocyte09 is now known as neurocyte0 |
03:15:14 | * | xet7 quit (Quit: Leaving) |
03:27:25 | * | noeontheend quit (Ping timeout: 240 seconds) |
03:37:08 | FromDiscord | <ajusa> Is there a way to set a value for an option type without using `some`? Like `var a: Option[int] = 5`? |
03:43:13 | FromDiscord | <Elegantbeef> Converters |
03:45:13 | FromDiscord | <Elegantbeef> Or make an operator |
03:47:29 | FromDiscord | <ajusa> Didn't think about converters, good idea. |
03:47:47 | FromDiscord | <ajusa> I also found https://github.com/nim-lang/Nim/issues/6246 |
03:50:24 | FromDiscord | <Elegantbeef> The operator is cleaner |
03:50:29 | FromDiscord | <Elegantbeef> `? 5` for instance |
03:51:06 | * | xet7 joined #nim |
03:57:38 | * | xet7 quit (Quit: Leaving) |
04:00:05 | * | xet7 joined #nim |
04:09:36 | * | rockcavera quit (Remote host closed the connection) |
04:23:32 | * | ehmry quit (Ping timeout: 268 seconds) |
04:23:48 | * | ehmry joined #nim |
05:11:23 | FromDiscord | <sOkam!> Is there an easy way to alias `func` into another word, without making a big mess? |
05:11:42 | FromDiscord | <sOkam!> Was thinking of making a macro for it, but I don't know how and I also don't know if I could just realias just the word and not all of the rest |
05:12:59 | FromDiscord | <sOkam!> (edit) removed "just" |
05:16:08 | FromDiscord | <Elegantbeef> `template` |
05:18:30 | FromDiscord | <Rika> You can’t without making a big mess |
05:18:47 | FromDiscord | <Rika> Using a template would probably need custom syntax |
05:20:33 | FromDiscord | <Elegantbeef> Oh the keyword |
05:20:38 | FromDiscord | <Elegantbeef> No the keyword is static you cannot change it |
05:21:32 | FromDiscord | <sOkam!> just wanted to alias it, so a different word is solved as the proper word when compiling |
05:21:48 | FromDiscord | <sOkam!> without touching the functionality |
05:21:59 | FromDiscord | <Elegantbeef> Could use a source code filter but it's silly |
05:22:48 | FromDiscord | <sOkam!> wdym? |
05:23:07 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/filters.html |
05:24:58 | FromDiscord | <Rika> It will change everything |
05:25:12 | FromDiscord | <sOkam!> ah i see |
05:25:14 | FromDiscord | <Rika> Including the word “func” in a string |
05:25:20 | FromDiscord | <sOkam!> yeah, it would change the whole file |
05:55:03 | FromDiscord | <gogolxdong (liuxiaodong)> Is there a way to construct XMLNode from string literals? |
05:58:43 | FromDiscord | <Elegantbeef> `parseXml`? |
06:00:19 | FromDiscord | <gogolxdong (liuxiaodong)> yes, that's what I'm looking for. |
06:01:07 | FromDiscord | <gogolxdong (liuxiaodong)> I'm using xmltree, it's hard to use. |
07:07:25 | * | Lord_Nightmare quit (Ping timeout: 240 seconds) |
07:07:38 | * | Lord_Nightmare2 joined #nim |
07:11:24 | * | Lord_Nightmare2 is now known as Lord_Nightmare |
07:13:37 | * | jjido joined #nim |
08:06:50 | * | PMunch joined #nim |
08:22:39 | FromDiscord | <Michal Maršálek> I'm trying to understand converters and don't know why this doesn't work. Can someone please explain? https://play.nim-lang.org/#ix=3L4t |
08:23:53 | FromDiscord | <Elegantbeef> Converters dont work to generics |
08:24:07 | FromDiscord | <Elegantbeef> Rather for generics |
08:24:18 | FromDiscord | <Michal Maršálek> Hmm, that's a shame |
08:24:23 | FromDiscord | <Michal Maršálek> Is there a workaround? |
08:24:42 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3L4u |
08:25:30 | PMunch | Don't they? |
08:25:50 | FromDiscord | <Michal Maršálek> In reply to @PMunch "Don't they?": they do but not if the type needs to be inferred |
08:26:34 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3L4v |
08:26:45 | FromDiscord | <Elegantbeef> Imo it's easier just to use an operator or keyword |
08:27:01 | PMunch | Ah right, I was about to say that the error was simply that it couldn't infer S |
08:27:42 | PMunch | If you always want to emit types where T = S though it's easy |
08:27:59 | FromDiscord | <Michal Maršálek> In reply to @PMunch "If you always want": no T != S |
08:28:12 | PMunch | But what is S? |
08:28:28 | PMunch | You never use it in your example |
08:28:40 | FromDiscord | <Michal Maršálek> it is a static in my usecase |
08:28:53 | PMunch | Static what? |
08:28:56 | FromDiscord | <Michal Maršálek> should have kept it static in my example ig |
08:29:19 | FromDiscord | <Michal Maršálek> static string but i don't think that matters? |
08:30:07 | PMunch | Well if it's always a static string then it does |
08:30:55 | FromDiscord | <Michal Maršálek> How? |
08:31:49 | * | arkanoid quit (Ping timeout: 256 seconds) |
08:32:20 | * | arkanoid joined #nim |
08:32:46 | PMunch | Hmm, maybe not |
08:32:51 | PMunch | I'm trying something out |
08:33:00 | FromDiscord | <Michal Maršálek> THis doesn't work either: https://play.nim-lang.org/#ix=3L4A |
08:33:04 | FromDiscord | <Michal Maršálek> Still cannot infer S |
08:33:20 | PMunch | Yeah, that's normal |
08:33:29 | PMunch | Because calling that with 0 won't give you S |
08:33:56 | FromDiscord | <Michal Maršálek> I understand that now |
08:36:03 | PMunch | Hmm, this is close: https://play.nim-lang.org/#ix=3L4B |
08:36:21 | PMunch | But it complains that it can't instantiate `result:type` |
08:37:04 | PMunch | This works though: https://play.nim-lang.org/#ix=3L4C |
08:37:14 | PMunch | But you have to replicate your static string everywhere |
08:37:42 | FromDiscord | <Michal Maršálek> @ElegantBeef how can I achieve this with statics? this doesn't work: https://play.nim-lang.org/#ix=3L4D |
08:38:13 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3L4E |
08:39:58 | FromDiscord | <Michal Maršálek> sent a code paste, see https://play.nim-lang.org/#ix=3L4F |
08:40:03 | FromDiscord | <Michal Maršálek> putting constants in place of geenric arguments 😄 |
08:40:12 | FromDiscord | <Michal Maršálek> thanks |
08:40:32 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3L4G |
08:41:06 | PMunch | @Michal_Maršálek, did you see my last paste? |
08:41:31 | FromDiscord | <Michal Maršálek> In reply to @PMunch "@Michal_Maršálek, did you see": I did it is similar to what I pasted yes? except the noInit? what does it do? |
08:41:49 | FromDiscord | <Michal Maršálek> Also it is not really a solution as it is not generic |
08:42:10 | PMunch | Oh, you can remove the noInit |
08:42:13 | PMunch | And it is generic |
08:42:27 | PMunch | Just not for the S parameter, which you can't infer anyways |
08:42:28 | FromDiscord | <Michal Maršálek> it is only for "a" |
08:42:45 | FromDiscord | <Michal Maršálek> Yes, but that is the original question |
08:43:03 | PMunch | Then the answer is, it's not possible with converters |
08:43:42 | * | Vladar joined #nim |
08:44:13 | FromDiscord | <Michal Maršálek> Thank you guys very much. ❤️ |
08:44:43 | FromDiscord | <Michal Maršálek> I will probably just emit a new converter for every instantiation of S for now. |
08:45:05 | FromDiscord | <Elegantbeef> Have fun! |
08:48:44 | FromDiscord | <Michal Maršálek> no |
08:48:49 | FromDiscord | <Michal Maršálek> it leads to ambiguous calls |
08:50:03 | FromDiscord | <Michal Maršálek> wait |
08:50:25 | FromDiscord | <Michal Maršálek> only if the converters have the same name |
08:50:31 | FromDiscord | <Michal Maršálek> that's quite annoying |
08:51:02 | FromDiscord | <Elegantbeef> If you never intend on using it directly add `{.genSym.}` to the converter |
08:52:26 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
08:55:55 | FromDiscord | <Michal Maršálek> thank you |
09:02:19 | * | jjido joined #nim |
09:10:28 | * | vicecea quit (Remote host closed the connection) |
09:11:00 | * | vicecea joined #nim |
09:13:40 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
09:38:32 | FromDiscord | <Michal Maršálek> What is the best way to debug "Error: generic instantiation too nested"? |
09:41:57 | FromDiscord | <haxscramper> There is no proper way to debug it right now, except for maybe adding `static: echo` and seeing how things are instantiated |
09:42:25 | FromDiscord | <haxscramper> You might hit this on a perfectly valid code as well, compiler has a hardcoded limit of 50 instantiations |
09:42:46 | FromDiscord | <Michal Maršálek> hmm |
09:43:43 | * | badsektor joined #nim |
09:44:01 | * | badsektor quit (Remote host closed the connection) |
09:44:06 | FromDiscord | <SirOlaf> Is it possible to tell --styleCheck:error to only apply to user-code? asyncdispatch is not accepted with it 1.6.2 |
09:44:51 | FromDiscord | <SirOlaf> (edit) "Is it possible to tell --styleCheck:error to only apply to user-code? asyncdispatch is not accepted with it ... 1.6.2" added "in" |
09:49:04 | FromDiscord | <Michal Maršálek> In reply to @haxscramper "You might hit this": no flag to change that? |
09:51:28 | FromDiscord | <haxscramper> no https://github.com/nim-lang/Nim/blob/devel/compiler/seminst.nim#L342 |
10:01:57 | * | Vladar quit (Quit: Leaving) |
10:04:06 | FromDiscord | <Michal Maršálek> Is it possible to make something like this work (I know it looks cursed)? https://play.nim-lang.org/#ix=3L52 |
10:05:17 | FromDiscord | <Rika> No |
10:05:31 | FromDiscord | <Rika> Because it “clobbers” generic type syntax |
10:05:50 | FromDiscord | <Rika> You can probably use {} |
10:07:17 | FromDiscord | <Michal Maršálek> Ha I didn't know `{}` operator! Is it used in stdlib? |
10:09:27 | FromDiscord | <Michal Maršálek> Thanks, that is a good tip |
10:09:55 | FromDiscord | <Rika> No it’s a set of characters that can be used for an operator |
10:10:04 | FromDiscord | <Rika> There’s one that uses it, in json |
10:10:47 | FromDiscord | <Michal Maršálek> In reply to @Rika "There’s one that uses": Ah true, I've seen that |
10:11:29 | FromDiscord | <Michal Maršálek> In reply to @Rika "No it’s a set": wdym? |
10:11:44 | FromDiscord | <Rika> Nothing, I misread again |
10:15:41 | FromDiscord | <Michal Maršálek> how do I say a macro argument should be an untyped ident? |
10:17:28 | FromDiscord | <Michal Maršálek> (edit) "how do I say a macro ... argumentis" added "should only match if the" | "should be" => "is" | removed "untyped" |
10:20:00 | FromDiscord | <Solitude> In reply to @Michal58 "how do I say": `arg: untyped{ident}` |
10:20:20 | FromDiscord | <Michal Maršálek> In reply to @Solitude "`arg: untyped{ident}`": Thank you |
10:22:18 | FromDiscord | <Michal Maršálek> sent a code paste, see https://play.nim-lang.org/#ix=3L5a |
10:23:04 | FromDiscord | <Solitude> in this exact form, you cant |
10:24:17 | * | nrds quit (Ping timeout: 268 seconds) |
10:24:37 | FromDiscord | <Michal Maršálek> I'd have to probably use termrewriting macros and process it all together including the `let a =`? |
10:25:35 | FromDiscord | <Solitude> In reply to @Michal58 "I'd have to probably": does this work for you? https://play.nim-lang.org/#ix=3L5b |
10:28:18 | FromDiscord | <Michal Maršálek> Hmm, I thought about that, but unfortunately I need te order |
10:30:13 | FromDiscord | <Michal Maršálek> In reply to @Michal58 "Hmm, I thought about": or maybe I don't |
10:41:06 | FromDiscord | <Michal Maršálek> @Rika or anyone, why does this not work? https://play.nim-lang.org/#ix=3L5f |
10:52:42 | FromDiscord | <inv> sent a code paste, see https://play.nim-lang.org/#ix=3L5k |
10:53:22 | FromDiscord | <inv> (edit) "https://play.nim-lang.org/#ix=3L5k" => "https://play.nim-lang.org/#ix=3L5l" |
11:05:39 | FromDiscord | <SirOlaf> In reply to @SirOlaf "Is it possible to": I'll just assume it's not possible |
11:06:15 | FromDiscord | <SirOlaf> Nightly has style issues too btw |
11:06:25 | FromDiscord | <SirOlaf> But that's more expected |
11:06:42 | FromDiscord | <SirOlaf> (edit) "has" => "has(had?)" |
11:25:47 | FromDiscord | <SirOlaf> Either way, the way it's going I'll be back with more issues tomorrow 😛 |
11:29:08 | * | ozzz quit (Read error: Connection reset by peer) |
11:29:43 | FromDiscord | <SirOlaf> Also, is it expected for stylecheck error to produce output while hint produces nothing when the import is unused |
11:36:29 | * | ozzz joined #nim |
11:40:20 | FromDiscord | <demotomohiro> In reply to @Michal58 "<@!259277943275126785> or anyone, why": It seems you cannot use operators in the type section.↵https://play.nim-lang.org/#ix=3L5F |
11:40:36 | FromDiscord | <retkid> i did some python stuf |
11:40:38 | FromDiscord | <retkid> (edit) "stuf" => "stuff" |
11:40:45 | FromDiscord | <retkid> I realized i hate pytho |
11:40:48 | FromDiscord | <retkid> (edit) "pytho" => "python" |
11:41:06 | FromDiscord | <retkid> I think its the least expressive language I know |
11:42:32 | FromDiscord | <retkid> Its weird tat people compare Nim and Python because they look alike |
11:42:40 | FromDiscord | <Rika> Wait until you’re made to learn Go |
11:43:04 | FromDiscord | <retkid> I've almost learned GO |
11:43:09 | FromDiscord | <retkid> but |
11:43:28 | FromDiscord | <retkid> the project i was working on got suddenly closed forever |
11:43:33 | FromDiscord | <retkid> dodged a bullet |
11:44:58 | FromDiscord | <demotomohiro> I hate python when it shows a error like "number of arguments passed to the function is wrong" after running the code for a few minutes. |
11:45:08 | FromDiscord | <congusbongus> did you use python 2 or something; python is fine↵sure it's quite an old language by now and has a lot of cruft, but it has lots of modern features |
11:46:48 | FromDiscord | <retkid> everything was python3 |
11:46:54 | FromDiscord | <retkid> like 3.10 currently |
11:47:04 | FromDiscord | <retkid> not my cup of tea |
11:48:59 | PMunch | @demotomohiro, that's why I prefer compiled languages |
11:49:23 | FromDiscord | <retkid> i too prefer compiled langs |
11:49:33 | FromDiscord | <retkid> java's compiler can suck it tho |
11:50:04 | PMunch | @congusbongus, Python is okay, but I was surprised to discover how clunky it felt after having used Nim for a while |
11:50:26 | FromDiscord | <retkid> maybe its that |
11:50:27 | PMunch | @retkid, I mean Java and C# are basically dynamic languages disguised as a compiled language |
11:50:42 | FromDiscord | <retkid> I just dont enjoy it |
11:51:05 | FromDiscord | <retkid> I prefer static typings |
11:51:36 | * | jjido joined #nim |
11:51:37 | PMunch | I've had errors in my C# program because some of my classes didn't have the correct constructor arguments. It didn't tell me of course, just started up and sat there doing nothing because it couldn't find the correct class to run.. |
11:51:54 | FromDiscord | <retkid> i missed let/val, var, and const. |
11:52:24 | PMunch | Hmm, are there pre-built Nim installs for raspbian? |
11:52:35 | PMunch | @federico3 ^ |
11:52:50 | FromDiscord | <retkid> there are for arm so why not? |
11:52:56 | PMunch | I tried to apt install it but that tried to install 0.19.4 or something |
11:53:13 | PMunch | Where can I get those? Choosenim just told me it wasn't supported.. |
11:55:37 | FromDiscord | <Rika> Probably an old Pi? |
11:55:46 | PMunch | 2B |
11:55:52 | PMunch | So yeah, pretty old |
11:58:08 | FromDiscord | <demotomohiro> sent a code paste, see https://play.nim-lang.org/#ix=3L5K |
11:59:38 | FromDiscord | <krisppurg> In reply to @krisppurg "Hi, I have a": @treeform? |
12:00:32 | FromDiscord | <konsumlamm> In reply to @demotomohiro "Nim script works like": because it still is a compiled language, NimScript is just the subset of Nim that runs in the compile-time VM |
12:02:49 | FromDiscord | <Michal Maršálek> In reply to @demotomohiro "It seems you cannot": Hmm, that is a shame |
12:03:06 | FromDiscord | <demotomohiro> In reply to @PMunch "Hmm, are there pre-built": There are prebuild binaries for armv7l but I don't know whether it works on raspbian:↵https://github.com/nim-lang/nightlies/releases |
12:05:08 | PMunch | @demotomohiro, I know how Nim and NimScript works, that's why I like it :) |
12:06:43 | FromDiscord | <demotomohiro> I use archlinux on my raspberry PI and it provides latest Nim:↵https://archlinuxarm.org |
12:06:54 | PMunch | @demotomohiro, oh nice, according to uname it's a armv7l chip |
12:07:28 | PMunch | This is an OpenHAB install, hence why it's running a rasbian-esque distro |
12:08:15 | FromDiscord | <demotomohiro> In reply to @konsumlamm "because it still is": So compiled language != language that produce a executable file. |
12:08:45 | NimEventer | New thread by Kobi: Is computer online?, see https://forum.nim-lang.org/t/8774 |
12:12:08 | FromDiscord | <konsumlamm> In reply to @demotomohiro "So compiled language !=": ye, it doesn't necessarily have to produce an executable, it can also produce bytecode for a VM (which is what NimScript, Java, C#, etc. do) |
12:12:26 | FromDiscord | <konsumlamm> the more useful distinction is probably statically typed vs dynamically typed |
12:14:00 | FromDiscord | <demotomohiro> In reply to @konsumlamm "ye, it doesn't necessarily": That makes sense. |
12:16:37 | PMunch | Yes I guess this case is more about statically typed vs. dynamically typed |
12:16:59 | PMunch | Although I would prefer a dynamically typed compiled language to a dynamically typed interpreted language |
12:17:27 | PMunch | I want to know if I've messed up a function call before my crawler script has crawled websites for an hour thank-you-very-much |
12:17:45 | PMunch | Had that happen to me back when I was using Python.. |
12:18:55 | PMunch | Crawled information about the local bus system in order to create an app, crawler ran for a couple hours, then failed on writing the result file because I had done the writing part wrong |
12:20:46 | NimEventer | New thread by Kobi: A thought about error messages, see https://forum.nim-lang.org/t/8775 |
12:21:59 | FromDiscord | <el__maco> dynamic typing is magnificently horrible. Nothing like the obscure bugs you get when you accidentally write something to a variable which then polymorphs into a different type that doesn't crash the program but works in subtly different ways |
12:22:55 | FromDiscord | <el__maco> moving most bugs from compile time to runtime is such an amazing idea. Sure makes sense why most popular languages are like that |
12:23:05 | FromDiscord | <hmmm> hey what was the compact definition to initialize an array of 100 len |
12:23:29 | PMunch | array[100, int] |
12:23:33 | PMunch | Boom! |
12:23:37 | FromDiscord | <Rika> In reply to @demotomohiro "So compiled language !=": TypeScript is a compiled language |
12:23:37 | FromDiscord | <hmmm> boom! |
12:23:43 | FromDiscord | <hmmm> ty 😃 |
12:23:57 | PMunch | Wait, that was a joke :P |
12:24:02 | FromDiscord | <hmmm> what |
12:24:10 | FromDiscord | <hmmm> 🧐 |
12:24:12 | PMunch | That's just how you define an array of size 100 |
12:24:21 | PMunch | What have you been doing? |
12:25:37 | FromDiscord | <hmmm> I want something like [1,2,3..] to 100 and didn't want to populate it with loops since I think I've read there is a compact way to do dat |
12:27:17 | FromDiscord | <demotomohiro> In reply to @Rika "TypeScript is a compiled": I don't know much about TypeScript but it generates JavaScript from TypeScript like Nim generates JavaScript from Nim code? |
12:27:37 | FromDiscord | <Rika> In reply to @demotomohiro "I don't know much": Pretty much from what I recall |
12:28:03 | FromDiscord | <demotomohiro> In reply to @Rika "Pretty much from what": ty! |
12:28:48 | NimEventer | New thread by Kobi: A thought about faster iteration, see https://forum.nim-lang.org/t/8776 |
12:34:41 | FromDiscord | <hmmm> sent a code paste, see https://play.nim-lang.org/#ix=3L5V |
12:34:45 | FromDiscord | <hmmm> I'm almost sure there is a one liner to do that |
12:35:02 | FromDiscord | <hmmm> I've read it in some tutorials billions of years ago |
12:40:38 | FromDiscord | <evoalg> was it about seq's instead of array's? |
12:42:02 | FromDiscord | <hmmm> I have a small usecase for a proc called napalmdrop that uses exactly 100 elements so I thought it would be cool to use arrays for that for a change |
12:42:05 | FromDiscord | <demotomohiro> sent a code paste, see https://play.nim-lang.org/#ix=3L5Y |
12:43:42 | FromDiscord | <hmmm> ty demo! are we sure we don't have an import arrayutils somewhere? 🤔 |
12:44:24 | FromDiscord | <Rika> No we don’t |
12:44:39 | FromDiscord | <Rika> Why one line? Make a proc if you want “one line” |
12:44:46 | FromDiscord | <Rika> Call it fill or something |
12:45:00 | FromDiscord | <evoalg> one liner: `var a: array[100, string]; for i in 0 .. 99: a[i] = $i` |
12:45:35 | FromDiscord | <hmmm> I'll do that, I was convinced we had it but probably I was thinking about toseq() from demo |
12:47:03 | PMunch | You also have collect |
12:47:14 | PMunch | But I'm not sure if it can make an array |
12:47:21 | FromDiscord | <hmmm> hmm |
12:50:07 | FromDiscord | <Michal Maršálek> In reply to @PMunch "But I'm not sure": I don't think it can |
12:50:37 | FromDiscord | <SirOlaf> sent a code paste, see https://play.nim-lang.org/#ix=3L60 |
12:51:31 | FromDiscord | <Rika> Yes and it’s the same name in lowercase, but not allowed in procs since it’s a compile time thing or so |
12:52:17 | FromDiscord | <SirOlaf> So there is nothing |
12:52:30 | FromDiscord | <SirOlaf> (edit) "So there is nothing ... " added "equivalent" |
12:52:45 | FromDiscord | <Solitude> stdlib doesnt use concepts |
12:52:46 | FromDiscord | <demotomohiro> Both `toSeq` and `collect` can create a seq from iterator, but how many times given iterator iterates is not determined at compile time.↵So making `toArray` works like `toSeq` might be not so easy. |
12:53:29 | FromDiscord | <SirOlaf> In reply to @Solitude "stdlib doesnt use concepts": Makes sense, concepts haven't been untouched for quite a while as far as I know. My thing also produces lots of hints of T being unused |
12:53:33 | FromDiscord | <SirOlaf> (edit) "haven't" => "have" |
12:53:48 | FromDiscord | <hmmm> I see! well it's not really necessary so we do it the old way |
12:54:01 | FromDiscord | <demotomohiro> In reply to @SirOlaf "Is there something like": There is `iterable[T]` type class: https://nim-lang.org/docs/manual.html#overload-resolution-iterable |
12:54:33 | FromDiscord | <SirOlaf> Rika already said, but I use this concept in procs |
12:55:03 | FromDiscord | <SirOlaf> And wanted to see if there was a replacement because compiling spams my console with the T unused warning |
12:56:47 | FromDiscord | <Rika> Well try it, it might work, but I believe it won’t work if you use inline iterators of course |
12:57:00 | FromDiscord | <SirOlaf> I tried it, gave me an error |
12:57:03 | FromDiscord | <demotomohiro> You can pass closure iterator to procedure:↵https://nim-lang.org/docs/manual.html#iterators-and-the-for-statement-firstminusclass-iterators |
13:00:39 | FromDiscord | <SirOlaf> Can I also get the iterator for say a deque? |
13:00:58 | FromDiscord | <SirOlaf> To pass to a proc that takes an iterator |
13:01:30 | FromDiscord | <Solitude> sent a code paste, see https://play.nim-lang.org/#ix=3L63 |
13:02:48 | FromDiscord | <hmmm> sent a code paste, see https://play.nim-lang.org/#ix=3L64 |
13:04:17 | FromDiscord | <Rika> In reply to @hmmm "that would be impressive": What don’t you get |
13:04:31 | FromDiscord | <hmmm> template and static |
13:04:39 | FromDiscord | <hmmm> also untyped |
13:04:50 | FromDiscord | <Rika> Static just means a compile time value |
13:05:07 | FromDiscord | <Rika> Untyped means “dunno the type yet you figure it out” kinda |
13:05:14 | FromDiscord | <Rika> Template is… template |
13:06:03 | FromDiscord | <hmmm> so with toArray static toseq you are telling that toArray toseq must be done at compiletime? |
13:07:08 | FromDiscord | <Rika> Oh that part |
13:07:17 | FromDiscord | <Rika> The second static means “to seq is done in compile time” |
13:07:31 | FromDiscord | <Rika> Not the array one since it’s “before” |
13:07:36 | FromDiscord | <Rika> Remember command syntax |
13:21:06 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
13:38:08 | * | rockcavera joined #nim |
13:38:08 | * | rockcavera quit (Changing host) |
13:38:08 | * | rockcavera joined #nim |
14:00:42 | * | arkurious joined #nim |
14:00:55 | FromDiscord | <hmmm> uh |
14:02:03 | FromDiscord | <hmmm> apparently if a symbol is exported in module C and module B imports module C. If I have a module A that imports B it will not see that symbol |
14:02:33 | FromDiscord | <hmmm> that is not what I expected 🤨 |
14:03:49 | FromDiscord | <Solitude> export whatever symbol you need from module B |
14:04:59 | FromDiscord | <hmmm> the symbol I need is in module C and I wanted to use it in A. Since A imported B that imported C I assumed the symbol was visible to A |
14:05:17 | FromDiscord | <hmmm> oh can I import only the symbol I need? |
14:05:28 | FromDiscord | <hmmm> what was the syntax from y import thingy? |
14:05:34 | FromDiscord | <Solitude> from y import thingy |
14:06:07 | FromDiscord | <demotomohiro> Here is how to do what @Solitude said: https://nim-lang.org/docs/manual.html#modules-export-statement |
14:06:51 | FromDiscord | <hmmm> is there a reason nim doesn't work as I expected it would work? 🤔 |
14:07:05 | FromDiscord | <Solitude> yes, the way you expected it to work is bad |
14:07:06 | FromDiscord | <hmmm> I mean a techincal reason the exports arent' transitive |
14:10:20 | FromDiscord | <hmmm> hmm I couldn't add another e so I added a 3 🤔 |
14:10:31 | FromDiscord | <hmmm> lol |
14:10:33 | FromDiscord | <hmmm> right |
14:13:56 | FromDiscord | <demotomohiro> Module B imports module C now but it might import module D instead of C in future.↵If modules importing module B also uses symbols from module C, changing importing module in B is breaking change. |
14:15:04 | NimEventer | New thread by Pietroppeter: Made in Nim 2021 - your favorites?, see https://forum.nim-lang.org/t/8777 |
14:17:13 | FromDiscord | <hmmm> demo you are good at explaining things 😊 |
14:19:46 | FromDiscord | <demotomohiro> ty! |
14:35:32 | * | badsektor joined #nim |
15:29:25 | * | badsektor quit (*.net *.split) |
15:29:25 | * | arkanoid quit (*.net *.split) |
15:29:25 | * | def- quit (*.net *.split) |
15:29:25 | * | drewr quit (*.net *.split) |
15:29:25 | * | tinystoat quit (*.net *.split) |
15:29:25 | * | flynn quit (*.net *.split) |
15:29:25 | * | nac quit (*.net *.split) |
15:29:26 | * | PMunch quit (*.net *.split) |
15:29:26 | * | perro_ quit (*.net *.split) |
15:29:26 | * | nisstyre quit (*.net *.split) |
15:29:26 | * | greyrat quit (*.net *.split) |
15:29:27 | * | joast quit (*.net *.split) |
15:29:27 | * | joshbaptiste quit (*.net *.split) |
15:29:27 | * | Jjp137 quit (*.net *.split) |
15:29:27 | * | oz quit (*.net *.split) |
15:29:27 | * | fvs quit (*.net *.split) |
15:29:27 | * | oprypin quit (*.net *.split) |
15:29:27 | * | cornfeedhobo quit (*.net *.split) |
15:29:28 | * | ldlework quit (*.net *.split) |
15:29:28 | * | dv2 quit (*.net *.split) |
15:29:28 | * | oisota quit (*.net *.split) |
15:29:28 | * | LyndsySimon quit (*.net *.split) |
15:29:29 | * | Amun-Ra quit (*.net *.split) |
15:29:29 | * | euantorano quit (*.net *.split) |
15:29:29 | * | Ekho quit (*.net *.split) |
15:29:29 | * | mikko quit (*.net *.split) |
15:29:30 | * | averell quit (*.net *.split) |
15:29:30 | * | meowray quit (*.net *.split) |
15:29:30 | * | dv^_^ quit (*.net *.split) |
15:29:30 | * | pippin quit (*.net *.split) |
15:29:31 | * | vicecea quit (*.net *.split) |
15:29:31 | * | Lord_Nightmare quit (*.net *.split) |
15:29:31 | * | rb quit (*.net *.split) |
15:29:31 | * | beshr quit (*.net *.split) |
15:29:32 | * | jkl1337 quit (*.net *.split) |
15:29:32 | * | Zevv quit (*.net *.split) |
15:29:33 | * | robertmeta quit (*.net *.split) |
15:29:33 | * | cheer[m] quit (*.net *.split) |
15:29:34 | * | toothlessgear quit (*.net *.split) |
15:29:34 | * | blackbeard420 quit (*.net *.split) |
15:29:34 | * | zacts quit (*.net *.split) |
15:29:34 | * | dom96 quit (*.net *.split) |
15:29:34 | * | adium quit (*.net *.split) |
15:29:35 | * | xet7 quit (*.net *.split) |
15:29:35 | * | dtomato quit (*.net *.split) |
15:29:35 | * | nixfreaknim[m] quit (*.net *.split) |
15:29:35 | * | redj quit (*.net *.split) |
15:29:35 | * | GreaseMonkey quit (*.net *.split) |
15:29:35 | * | crem quit (*.net *.split) |
15:29:36 | * | koltrast quit (*.net *.split) |
15:29:36 | * | notchris quit (*.net *.split) |
15:29:36 | * | Schnouki quit (*.net *.split) |
15:29:36 | * | gshumway quit (*.net *.split) |
15:29:36 | * | madprops quit (*.net *.split) |
15:29:36 | * | lain quit (*.net *.split) |
15:29:36 | * | qwr quit (*.net *.split) |
15:29:37 | * | djanatyn quit (*.net *.split) |
15:29:37 | * | xiamx quit (*.net *.split) |
15:29:37 | * | happycorsair[m] quit (*.net *.split) |
15:29:37 | * | FromDiscord quit (*.net *.split) |
15:29:37 | * | mal`` quit (*.net *.split) |
15:29:37 | * | anddam quit (*.net *.split) |
15:29:38 | * | mjsir911 quit (*.net *.split) |
15:29:38 | * | ormiret quit (*.net *.split) |
15:29:38 | * | Yardanico quit (*.net *.split) |
15:29:38 | * | NimEventer quit (*.net *.split) |
15:29:38 | * | xiamx[m] quit (*.net *.split) |
15:29:38 | * | Goodbye_Vincent quit (*.net *.split) |
15:29:38 | * | mahlon_ quit (*.net *.split) |
15:29:39 | * | rp3 quit (*.net *.split) |
15:29:39 | * | GnuYawk quit (*.net *.split) |
15:29:39 | * | ecs quit (*.net *.split) |
15:29:39 | * | [R] quit (*.net *.split) |
15:29:40 | * | anadahz quit (*.net *.split) |
15:31:36 | * | badsektor joined #nim |
15:31:36 | * | arkanoid joined #nim |
15:31:36 | * | PMunch joined #nim |
15:31:36 | * | def- joined #nim |
15:31:36 | * | drewr joined #nim |
15:31:36 | * | fvs joined #nim |
15:31:36 | * | tinystoat joined #nim |
15:31:36 | * | perro_ joined #nim |
15:31:36 | * | oprypin joined #nim |
15:31:36 | * | flynn joined #nim |
15:31:36 | * | nac joined #nim |
15:31:36 | * | nisstyre joined #nim |
15:31:36 | * | greyrat joined #nim |
15:31:36 | * | joast joined #nim |
15:31:36 | * | cornfeedhobo joined #nim |
15:31:36 | * | ldlework joined #nim |
15:31:36 | * | oisota joined #nim |
15:31:36 | * | joshbaptiste joined #nim |
15:31:36 | * | Jjp137 joined #nim |
15:31:36 | * | dv2 joined #nim |
15:31:36 | * | LyndsySimon joined #nim |
15:31:36 | * | Amun-Ra joined #nim |
15:31:36 | * | oz joined #nim |
15:31:36 | * | euantorano joined #nim |
15:31:36 | * | Ekho joined #nim |
15:31:36 | * | mikko joined #nim |
15:31:57 | * | gshumway joined #nim |
15:31:57 | * | notchris joined #nim |
15:31:57 | * | Schnouki joined #nim |
15:31:57 | * | madprops joined #nim |
15:31:57 | * | lain joined #nim |
15:31:57 | * | qwr joined #nim |
15:31:57 | * | djanatyn joined #nim |
15:32:02 | * | dom96 joined #nim |
15:32:02 | * | adium joined #nim |
15:32:06 | * | xet7 joined #nim |
15:32:06 | * | dtomato joined #nim |
15:32:06 | * | nixfreaknim[m] joined #nim |
15:32:06 | * | redj joined #nim |
15:32:06 | * | GreaseMonkey joined #nim |
15:32:06 | * | crem joined #nim |
15:32:06 | * | koltrast joined #nim |
15:32:13 | * | xiamx joined #nim |
15:32:13 | * | happycorsair[m] joined #nim |
15:32:13 | * | FromDiscord joined #nim |
15:32:13 | * | mal`` joined #nim |
15:32:13 | * | anddam joined #nim |
15:32:13 | * | mjsir911 joined #nim |
15:32:13 | * | ormiret joined #nim |
15:32:13 | * | Yardanico joined #nim |
15:32:13 | * | NimEventer joined #nim |
15:32:19 | * | cheer[m] joined #nim |
15:32:19 | * | zacts joined #nim |
15:32:19 | * | toothlessgear joined #nim |
15:32:19 | * | blackbeard420 joined #nim |
15:32:25 | * | averell joined #nim |
15:32:25 | * | pippin joined #nim |
15:32:25 | * | meowray joined #nim |
15:32:25 | * | dv^_^ joined #nim |
15:32:42 | * | anadahz joined #nim |
15:32:48 | * | robertmeta joined #nim |
15:32:57 | * | cheer[m] quit (Ping timeout: 250 seconds) |
15:33:03 | * | xiamx[m] joined #nim |
15:33:03 | * | Goodbye_Vincent joined #nim |
15:33:03 | * | mahlon_ joined #nim |
15:33:03 | * | rp3 joined #nim |
15:33:03 | * | GnuYawk joined #nim |
15:33:03 | * | ecs joined #nim |
15:33:03 | * | [R] joined #nim |
15:33:07 | * | xiamx[m] quit (Ping timeout: 260 seconds) |
15:33:07 | * | vicecea joined #nim |
15:33:07 | * | Lord_Nightmare joined #nim |
15:33:07 | * | rb joined #nim |
15:33:07 | * | beshr joined #nim |
15:33:07 | * | jkl1337 joined #nim |
15:33:07 | * | Zevv joined #nim |
15:33:15 | * | xiamx quit (Ping timeout: 268 seconds) |
15:33:32 | * | nixfreaknim[m] quit (Ping timeout: 240 seconds) |
15:33:52 | * | happycorsair[m] quit (Ping timeout: 268 seconds) |
15:36:15 | * | vicecea quit (Ping timeout: 256 seconds) |
15:38:21 | * | vicecea joined #nim |
15:39:04 | FromDiscord | <Michal Maršálek> Can someone help me understand converters? https://play.nim-lang.org/#ix=3L7f |
15:45:55 | FromDiscord | <SirOlaf> Hope that's a bug |
15:46:02 | * | xiamx[m] joined #nim |
15:46:46 | FromDiscord | <Solitude> In reply to @Michal58 "Can someone help me": math.^ is generic too, not clear which one should have the priority |
15:46:46 | FromDiscord | <SirOlaf> Because that would be bad design |
15:47:29 | FromDiscord | <Solitude> In reply to @SirOlaf "Because that would be": converters are bad design and they lead to bad design |
15:48:08 | * | cheer[m] joined #nim |
15:49:13 | FromDiscord | <Michal Maršálek> In reply to @Solitude "math.^ is generic too,": Seems only natural the one without needing for converter call should have priority? |
15:50:08 | FromDiscord | <Solitude> true, you probably could submit an issue |
15:50:47 | FromDiscord | <Solitude> or ask on forum, where araq could maybe see your question |
15:54:33 | FromDiscord | <haxscramper> sent a code paste, see https://paste.rs/4UR |
15:55:10 | FromDiscord | <haxscramper> in first case it calls the conveter implicitly even when it is called explicitly |
15:55:29 | FromDiscord | <haxscramper> I don't think converter is able to properly infer it's argument values |
15:58:44 | FromDiscord | <haxscramper> In reply to @Michal58 "Can someone help me": and yes, try using operator names that are not already in math, for example `!` and `^!` |
15:59:10 | FromDiscord | <haxscramper> this way it actually calls whatever you defined instead of defaulting to things with higher precedence |
15:59:45 | FromDiscord | <haxscramper> any call match that uses converter has the lowest precedence of all calls, so even `SomeInteger SomeFloat` etc. would fit better |
16:06:44 | FromDiscord | <Michal Maršálek> In reply to @haxscramper "any call match that": I dont't understand this |
16:08:56 | FromDiscord | <haxscramper> https://nim-lang.org/docs/manual.html#overload-resolution generics are considered first, then compiler looks for possible calls using converters |
16:09:19 | FromDiscord | <haxscramper> so you can't make converter call win over generic one |
16:11:59 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3L7w |
16:12:11 | FromDiscord | <haxscramper> not ambiguous, it calls integer one because calling float would require converter |
16:12:32 | FromDiscord | <Michal Maršálek> That is the exact opossite of what I'm complaining about is happening |
16:14:49 | FromDiscord | <Michal Maršálek> In my paste, the converter call wins |
16:18:57 | FromDiscord | <SirOlaf> sent a code paste, see https://play.nim-lang.org/#ix=3L7B |
16:18:59 | FromDiscord | <SirOlaf> With rest of code the same |
16:19:22 | FromDiscord | <SirOlaf> Or wait, that's me doing nonsense |
16:20:36 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3L7D |
16:20:44 | FromDiscord | <haxscramper> I just got lost in all the unnecessary generics in the original example |
16:20:50 | FromDiscord | <SirOlaf> In reply to @SirOlaf "Or wait, that's me": On this incorrect usage, why is it not checked when it's unused |
16:21:15 | FromDiscord | <SirOlaf> Is it because of generics? |
16:23:01 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3L7E |
16:23:32 | FromDiscord | <haxscramper> It must match `^` with `T/Natural` because this call would use two generic matches, which have a higher precedence compared to the converter matches |
16:23:46 | FromDiscord | <haxscramper> Actually wait, that's me being stupid |
16:24:10 | FromDiscord | <haxscramper> `(Generic, Generic)` supposedly is weaker than `(Converter, Literal)`, since literal match has the `#1` precendence |
16:24:13 | FromDiscord | <SirOlaf> Generics seem kinda strange |
16:24:55 | FromDiscord | <haxscramper> In reply to @haxscramper "`(Generic, Generic)` supposedly is": I don't remember sigmatch good enough to say for sure whether this is true, but at least "accoding to spec" it works expectedly |
16:25:15 | FromDiscord | <SirOlaf> sent a code paste, see https://play.nim-lang.org/#ix=3L7H |
16:25:35 | FromDiscord | <SirOlaf> (edit) "https://play.nim-lang.org/#ix=3L7H" => "https://play.nim-lang.org/#ix=3L7I" |
16:25:50 | FromDiscord | <SirOlaf> But only errors when it's used |
16:27:06 | FromDiscord | <haxscramper> there was an RFC for something related, but I"m not sure which one. https://github.com/nim-lang/RFCs/issues/168 and https://github.com/nim-lang/RFCs/issues/416, or rather discussions around them have mentioned this feature from time to time |
16:28:48 | * | happycorsair[m] joined #nim |
16:30:58 | FromDiscord | <SirOlaf> sent a code paste, see https://play.nim-lang.org/#ix=3L7O |
16:36:08 | FromDiscord | <Rika> rust has a different type system that is incompatible with what nim does |
16:36:55 | FromDiscord | <SirOlaf> I assume nim emits new procs/types/whatever for generics when instantiated and skips checks for the base construct |
16:37:20 | FromDiscord | <SirOlaf> Don't see why the base construct can't be checked |
16:39:05 | FromDiscord | <SirOlaf> It's also not like nim skips checks for all unused functions |
16:39:07 | FromDiscord | <el__maco> its not clear why should it though |
16:39:41 | FromDiscord | <SirOlaf> Just seems inconsistent as it clearly produces errors for concrete functions that are unused |
16:39:49 | FromDiscord | <Rika> In reply to @SirOlaf "But only errors when": i believe it just plain doesnt check until its used, its the same for regular procs afaik |
16:39:55 | FromDiscord | <Rika> DCE too aggressive i guess? |
16:40:17 | FromDiscord | <SirOlaf> sent a code paste, see https://play.nim-lang.org/#ix=3L7V |
16:40:19 | FromDiscord | <SirOlaf> But not the generic variant |
16:40:22 | FromDiscord | <el__maco> if you have a proc that you don't use, isn't type checking it just extra work for the compiler that slows things down |
16:40:37 | FromDiscord | <SirOlaf> Problem is that the non-generic version actually is checked |
16:41:16 | FromDiscord | <el__maco> its not obvious to me why that matters 🤷♂️ |
16:41:40 | FromDiscord | <SirOlaf> It's not some compiler-breaking issue or anything, just inconsistent |
16:45:15 | FromDiscord | <SirOlaf> sent a code paste, see https://play.nim-lang.org/#ix=3L80 |
16:45:32 | FromDiscord | <SirOlaf> Is that different from generics or are empty generics just allowed for some reason |
16:46:15 | FromDiscord | <SirOlaf> (edit) "https://play.nim-lang.org/#ix=3L80" => "https://play.nim-lang.org/#ix=3L81" |
16:46:59 | FromDiscord | <SirOlaf> Because it does compile and can be used |
16:53:08 | FromDiscord | <SirOlaf> Guess it is wanted according to grammar |
16:56:57 | FromDiscord | <Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3L85 |
16:57:29 | FromDiscord | <Patitotective> (edit) "https://play.nim-lang.org/#ix=3L85" => "https://play.nim-lang.org/#ix=3L86" |
16:57:51 | FromDiscord | <Patitotective> Should I create my own procedure to achieve it? |
16:58:11 | FromDiscord | <Patitotective> (edit) "Should" => "Or should" |
16:59:57 | FromDiscord | <el__maco> sent a code paste, see https://play.nim-lang.org/#ix=3L89 |
17:00:06 | * | xiamx joined #nim |
17:07:39 | * | nixfreaknim[m] joined #nim |
17:26:06 | FromDiscord | <Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3L8k |
17:27:43 | FromDiscord | <Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3L8o |
17:27:52 | FromDiscord | <Patitotective> (edit) "https://play.nim-lang.org/#ix=3L8o" => "https://play.nim-lang.org/#ix=3L8p" |
17:28:02 | FromDiscord | <Michal Maršálek> defined |
17:28:12 | FromDiscord | <Michal Maršálek> (edit) "defined" => "`defined`" |
17:28:17 | FromDiscord | <Rika> !eval let a = 0; echo defined a; echo defined b |
17:28:19 | NimBot | false↵false |
17:28:24 | FromDiscord | <Rika> ?? |
17:29:11 | FromDiscord | <Patitotective> Thanks |
17:29:12 | FromDiscord | <Patitotective> 🙃 |
17:31:04 | FromDiscord | <demotomohiro> !eval let a = 0; echo declared a; echo declared bbbb |
17:31:06 | NimBot | true↵false |
17:32:18 | FromDiscord | <demotomohiro> https://nim-lang.org/docs/system.html#declared%2Cuntyped |
17:36:25 | FromDiscord | <demotomohiro> `defined` is not for checking existance of variables.↵https://nim-lang.org/docs/system.html#defined,untyped |
17:37:52 | FromDiscord | <Rika> i forgot xd |
17:41:57 | * | Gustavo6046 joined #nim |
17:43:25 | * | meowray quit (Changing host) |
17:43:25 | * | meowray joined #nim |
17:47:07 | FromDiscord | <Michal Maršálek> Lol I used it wrongly today then 😮 |
17:52:15 | * | nrds joined #nim |
18:04:38 | * | noeontheend joined #nim |
18:08:39 | * | Figworm joined #nim |
18:32:40 | * | jjido joined #nim |
19:01:13 | * | vicfred joined #nim |
19:04:19 | * | vicfred_ joined #nim |
19:05:26 | * | Gustavo6046_ joined #nim |
19:06:57 | * | vicfred quit (Ping timeout: 240 seconds) |
19:07:35 | * | Gustavo6046 quit (Ping timeout: 252 seconds) |
19:10:15 | * | Gustavo6046_ quit (Client Quit) |
19:10:29 | * | Gustavo6046 joined #nim |
19:13:35 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
19:26:32 | FromDiscord | <DMI-1407> have a question related to nim and mt |
19:27:36 | FromDiscord | <DMI-1407> https://media.discordapp.net/attachments/371759389889003532/928369158293438524/asd.png |
19:28:04 | FromDiscord | <DMI-1407> does this mean i can not use multithreaded code in dlls ? |
19:30:28 | FromDiscord | <planetis> does anyone knows what this error means\: https://pastebin.com/kRytQG8n |
19:33:32 | FromDiscord | <planetis> not if you use --mm\:arc or orc↵(@DMI-1407) |
19:58:34 | * | badsektor quit (Quit: Leaving) |
20:03:54 | * | vicfred_ quit (Quit: Leaving) |
20:08:39 | * | jjido joined #nim |
20:22:14 | FromDiscord | <SoicBR> sent a code paste, see https://play.nim-lang.org/#ix=3L9t |
20:23:47 | * | krux02 joined #nim |
20:26:58 | * | fvs left #nim (WeeChat 3.4) |
20:28:10 | FromDiscord | <Rosen> I bet you can just put air at the end and it'll work |
20:28:17 | FromDiscord | <Rosen> Since the error refers to order |
20:32:26 | FromDiscord | <SoicBR> It worked |
20:33:02 | FromDiscord | <SoicBR> thanks |
20:42:39 | FromDiscord | <Schelz> Any idea how to i could create a browser app in nim |
20:43:20 | FromDiscord | <Schelz> like an exe that open a new tab in browser with an web page hosted with nim on 127.0.0.1 ( for example) |
20:50:23 | FromDiscord | <Yardanico> In reply to @Schelz "like an exe that": https://github.com/marcomq/nimview |
20:51:06 | FromDiscord | <Yardanico> and if you just want a _web app_, use any http server |
20:51:33 | FromDiscord | <Yardanico> from stdlib's https://nim-lang.org/docs/asynchttpserver.html to jester and prologue |
20:51:38 | FromDiscord | <Yardanico> since a "browser app" is just a web page |
20:53:24 | FromDiscord | <Schelz> <3 |
20:55:43 | FromDiscord | <planetis> also https://nim-lang.github.io/Nim/browsers.html |
20:56:10 | FromDiscord | <Yardanico> this is quite different though |
20:56:16 | FromDiscord | <Yardanico> its just for opening a browser :) |
21:00:12 | FromDiscord | <planetis> i dont really know what he meant 😅 |
21:29:01 | * | neurocyte0 quit (Ping timeout: 240 seconds) |
21:30:42 | * | neurocyte09 joined #nim |
21:47:18 | FromDiscord | <Zonifer> @Yardanico A day or two ago you were helping me with getting the contents of a post form into a variable. `var foo = req.body` do you have any links for `req.`? So I can see what else I can do with it? |
21:48:57 | NimEventer | New thread by Niminem: Am I allowed to add this feature to stdlib module?, see https://forum.nim-lang.org/t/8778 |
21:48:59 | FromDiscord | <Yardanico> https://nim-lang.org/docs/asynchttpserver.html#Request |
21:50:18 | * | Gustavo6046 quit (Remote host closed the connection) |
21:50:26 | * | Gustavo6046_ joined #nim |
21:51:19 | * | Gustavo6046_ is now known as Gustavo6046 |
22:02:12 | FromDiscord | <SirOlaf> sent a code paste, see https://play.nim-lang.org/#ix=3L9T |
22:03:41 | FromDiscord | <Elegantbeef> Why wouldnt it be allowed |
22:05:01 | FromDiscord | <SirOlaf> Just looks weird. It also behaves differently when you only give it one parameter vs more |
22:06:30 | FromDiscord | <Elegantbeef> Indeed, i suppose there is some argument that varargs of the same type shouldnt be next to eachother, but i you write code like this it's your own fault |
22:06:31 | FromDiscord | <SirOlaf> sent a code paste, see https://play.nim-lang.org/#ix=3L9U |
22:08:17 | FromDiscord | <SirOlaf> sent a code paste, see https://play.nim-lang.org/#ix=3L9V |
22:08:37 | FromDiscord | <SirOlaf> It tries to coerce them into each other |
22:08:45 | FromDiscord | <SirOlaf> And it succeeds in a strange way |
22:09:27 | FromDiscord | <Elegantbeef> really you're better doing `b: openArray[int] = []` |
22:09:59 | FromDiscord | <SirOlaf> Not using this for anything, am trying to wrap my head around the compiler code and stumbled upon weird varargs features |
22:10:22 | FromDiscord | <SirOlaf> https://play.nim-lang.org/#ix=3L9X |
22:10:58 | FromDiscord | <Elegantbeef> Ah nice they're broken |
22:11:16 | FromDiscord | <SirOlaf> Very unexpected output, isn't it |
22:12:13 | FromDiscord | <kevin> Is it possible to get a file's owner with Nim? |
22:12:42 | FromDiscord | <kevin> I thought there would be an entry in `os`'s FileInfo type : https://nim-lang.org/docs/os.html#FileInfo |
22:12:47 | FromDiscord | <Elegantbeef> It is but i dont think there is a cross platform api |
22:12:56 | FromDiscord | <kevin> booooo 😦 |
22:14:48 | FromDiscord | <SirOlaf> You can even cause sigsegv with those varargs |
22:15:29 | FromDiscord | <SirOlaf> If the 0 is changed to a 1 it tries to interpret it as a string pointer |
22:15:46 | FromDiscord | <Elegantbeef> Yea seems the fight over parameters |
22:16:54 | FromDiscord | <SirOlaf> Actually, it crashes with a single vararg too |
22:17:27 | FromDiscord | <SirOlaf> I think varargs just break type safety in addition to competing over params |
22:18:03 | FromDiscord | <SirOlaf> Nevermind, ignore that |
22:18:07 | FromDiscord | <SirOlaf> Only breaks with more than one |
22:18:09 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#ix=3L9Z yea it's clearly getting an int on the heap i think https://play.nim-lang.org/#ix=3L9Z |
22:18:14 | FromDiscord | <Elegantbeef> Shit doublt paste |
22:19:02 | FromDiscord | <SirOlaf> It seems to just perform a cast[T] |
22:19:10 | FromDiscord | <SirOlaf> Somehow |
22:19:45 | FromDiscord | <Elegantbeef> They fight over parameters, without proper logic over which gets which |
22:20:06 | FromDiscord | <SirOlaf> Does this deserve another issue? |
22:20:13 | FromDiscord | <Elegantbeef> Probably |
22:21:43 | FromDiscord | <Elegantbeef> It'd never be accepted but i'd probably say any usage of varargs without a convert should be removed 😀 |
22:21:53 | FromDiscord | <Elegantbeef> `openarray[T] = []` is just more sane |
22:22:00 | * | PMunch quit (Quit: leaving) |
22:26:05 | * | noeontheend quit (Ping timeout: 256 seconds) |
22:26:26 | FromDiscord | <SirOlaf> Opened an issue. Wonder if there's more strange stuff like that in the cracks of the compiler |
22:27:54 | FromDiscord | <Elegantbeef> Probably |
22:28:53 | FromDiscord | <Elegantbeef> Many issues in the nim compiler are due to someone forgetting X ability exists |
22:29:28 | FromDiscord | <SirOlaf> Fair, the thing is massive |
22:33:57 | FromDiscord | <Elegantbeef> Time to get those PRs out to fix varargs you have 3 hours 😛 |
22:39:08 | FromDiscord | <SirOlaf> I wish, but can barely comprehend half of this. Almost every variable is like a single letter 👺 |
22:40:02 | FromDiscord | <Elegantbeef> You arent supposed to comprehend it you just throw echo statements until you get what's happening |
22:41:17 | FromDiscord | <SirOlaf> Yep, time to randomly place echoes into one of the big semcheck functions |
22:41:55 | FromDiscord | <SirOlaf> Hope you like echoes, because you'll be placing a lot of them |
22:42:11 | FromDiscord | <Elegantbeef> Eh it's not that bad |
22:42:20 | FromDiscord | <Elegantbeef> Go to vararg processing and see what it does |
22:44:03 | FromDiscord | <SirOlaf> I'm sure you know which file to look in? |
22:44:23 | FromDiscord | <Elegantbeef> Perhaps semtypes 191 |
22:44:40 | FromDiscord | <Elegantbeef> Though probably more likely is semoverloadedcall |
22:45:11 | FromDiscord | <Elegantbeef> which is semcall line585 |
22:45:22 | FromDiscord | <Elegantbeef> There is also the chance this is just a generation issue |
22:46:24 | FromDiscord | <SirOlaf> Probably? Issue is that they share a memory location or something |
22:46:39 | FromDiscord | <Elegantbeef> Indeed |
22:47:09 | FromDiscord | <Elegantbeef> I'd say try it in JS to see if it behaves teh same |
22:47:49 | FromDiscord | <SirOlaf> In fact, they are the same address |
22:48:15 | FromDiscord | <SirOlaf> sent a code paste, see https://play.nim-lang.org/#ix=3La3 |
22:48:19 | FromDiscord | <SirOlaf> Gives same thing twice |
22:48:48 | FromDiscord | <SirOlaf> https://play.nim-lang.org/#ix=3La4 |
22:49:19 | FromDiscord | <SirOlaf> So my guess is that it's a assignment issue |
22:49:30 | FromDiscord | <SirOlaf> Where the compiler assumes there is only one vararg param |
22:51:19 | FromDiscord | <Elegantbeef> Yep behaves the same on JS |
22:51:28 | FromDiscord | <Elegantbeef> well "same" |
22:52:22 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3La6 |
22:52:44 | FromDiscord | <SirOlaf> Why are both int |
22:52:45 | FromDiscord | <Elegantbeef> The generation of the varargs is wrong |
22:52:59 | FromDiscord | <Elegantbeef> JS isnt C |
22:59:01 | FromDiscord | <SirOlaf> Do you also know where it is generated? I am very lost |
22:59:58 | FromDiscord | <Elegantbeef> I'm trying to find it |
23:00:36 | FromDiscord | <SirOlaf> Thought you had all of nim memorized with how quickly you got those two functions before 😛 |
23:00:38 | FromDiscord | <Elegantbeef> transf gets `["a", 0]` for both parameters |
23:01:11 | FromDiscord | <SirOlaf> Nice, a file I haven't even considered looking at for anything until now |
23:01:27 | FromDiscord | <Elegantbeef> Well transf is the last file before generation |
23:01:31 | FromDiscord | <Elegantbeef> So i was seeing what it got |
23:01:58 | FromDiscord | <SirOlaf> Well yeah, but I don't know that. Am a little compiler baby |
23:02:08 | FromDiscord | <Elegantbeef> Join the club |
23:04:12 | * | Gustavo6046 quit (Remote host closed the connection) |
23:05:20 | FromDiscord | <Elegantbeef> Presently checking if `semOverloadedCall` has the same |
23:07:14 | FromDiscord | <Elegantbeef> Ahah line 596 in semcalls is the path to getting two bad arrays |
23:07:15 | FromDiscord | <Elegantbeef> So `semResolvedCall` is creating two arrays |
23:07:17 | FromDiscord | <Elegantbeef> but not doing an offset |
23:09:39 | FromDiscord | <Elegantbeef> Ok so `x.call` in `semResolvedCall` is what's causing the array to get created incorrectly |
23:10:09 | FromDiscord | <Elegantbeef> Now we get to find where |
23:10:09 | FromDiscord | <SirOlaf> Does that leave a dangling array? |
23:10:33 | * | tiorock joined #nim |
23:10:33 | * | tiorock quit (Changing host) |
23:10:33 | * | tiorock joined #nim |
23:10:33 | * | rockcavera is now known as Guest1783 |
23:10:33 | * | tiorock is now known as rockcavera |
23:11:08 | FromDiscord | <SirOlaf> Or is this stage too early for that |
23:11:15 | FromDiscord | <SirOlaf> (edit) "Or is this ... stage" added "compiler" |
23:11:17 | FromDiscord | <Elegantbeef> Ah that's the candidate from `resolveOverloads` |
23:11:17 | FromDiscord | <Elegantbeef> 😀 |
23:11:22 | FromDiscord | <Elegantbeef> Compiler is fun! |
23:11:45 | FromDiscord | <Elegantbeef> It creates 2 arrays with the parameters |
23:12:19 | FromDiscord | <Elegantbeef> So for some reason the candidate created inside `semOverloadedCall` is creating 1 array and assigning it twice |
23:12:36 | FromDiscord | <SirOlaf> Nice |
23:12:41 | FromDiscord | <Elegantbeef> Finding where the array is created is key to resolving this issue |
23:13:25 | * | Guest1783 quit (Ping timeout: 240 seconds) |
23:16:58 | FromDiscord | <SirOlaf> This does happen to be the exact path I was looking at |
23:17:29 | FromDiscord | <SirOlaf> When I was exploring before |
23:20:15 | FromDiscord | <SirOlaf> matchesAux is probably the evil one |
23:20:40 | FromDiscord | <SirOlaf> But I'm biased because that's the only function I kinda understand |
23:21:37 | FromDiscord | <Elegantbeef> the issue branch starts line 2489 in sigmatch |
23:21:38 | FromDiscord | <Elegantbeef> That atleast points you to where it needs fixed, how to fix it is another question |
23:21:54 | FromDiscord | <SirOlaf> Yeah, that's matchesAux |
23:21:56 | FromDiscord | <Elegantbeef> That loop iterates over every passed in argument and assigns it to parameter |
23:22:48 | FromDiscord | <Elegantbeef> Oh is the issue just they iterate over `n` instead of `nOrig` |
23:26:41 | * | acheam joined #nim |
23:27:57 | * | Gustavo6046 joined #nim |
23:32:45 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
23:37:17 | FromDiscord | <Elegantbeef> Well for single parameters i fixed it but adding more it failed, i could be wrong but his may need an iteration over the arguments adding them until a type that doesnt match is hit, unless there is a converter |
23:41:28 | FromDiscord | <SirOlaf> That sounds a lot more complicated than it initially seemed |
23:42:28 | FromDiscord | <Elegantbeef> Well right now what it does is iterate over all parameters and doesnt create a new container when it hits a new variable |
23:42:49 | FromDiscord | <Elegantbeef> So you just need to make the if statement at line 2492 create the container, so i guess i doesnt need iteration |
23:43:30 | FromDiscord | <Elegantbeef> Just a check of "Hey is this the same type, no? Do we have a converter proc, no? Ok drop this and move to next parameter" |
23:50:50 | * | acheam left #nim (Konversation terminated!) |
23:52:23 | * | krux02 quit (Remote host closed the connection) |