<< 05-01-2022 >>

00:05:01*noeontheend quit (Ping timeout: 240 seconds)
00:12:05FromDiscord<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:49noeontheendI'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:09FromDiscord<Elegantbeef> Code?
00:48:21noeontheendI'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:49FromDiscord<Elegantbeef> Is it pure Nim or are you using libraries?
00:51:32noeontheendMy stuff is all pure Nim, and in scanning the dependencies it looks like they're also all Nim.
00:52:47FromDiscord<Elegantbeef> What's the line?
00:54:38noeontheendIt's actually just from passing the `ref object` to a proc that uses it.
00:54:59FromDiscord<Elegantbeef> Do you have the code somewhere i can read it?
00:55:07noeontheend(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:19noeontheendI'll put it up if you're interested, one second.
01:02:02noeontheendSpecifically: https://git.sr.ht/~reesmichael1/roman/tree/sigsegv/item/src/romanpkg/main.nim#L81
01:04:14noeontheendThe `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:38FromDiscord<Elegantbeef> Where is Feed defined?
01:05:09noeontheendhttps://git.sr.ht/~reesmichael1/roman/tree/sigsegv/item/src/romanpkg/types.nim#L33
01:07:32FromDiscord<Elegantbeef> Wont change anything but `displayFeed` taking a `var Feed` is suspect
01:08:22noeontheendYou're right, I changed it earlier to just take a `Feed` and it still happens.
01:08:33FromDiscord<Elegantbeef> What GC are you using?
01:09:38FromDiscord<Elegantbeef> If not try with `--gc:orc` or `--gc:arc`
01:11:16noeontheendInteresting! I hadn't tried it without the default `--gc:refc`. `--gc:boehm` also crashes, but `--gc:refAndSweep` works as expected.
01:12:02noeontheend(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:11noeontheendWhoops...`--gc:markAndSweep`, obviously.
01:12:20FromDiscord<Elegantbeef> Yea
01:12:34FromDiscord<Elegantbeef> Sounds like it could be an issue with the GC
01:12:56noeontheendNeat, thanks for the suggestion/your time!
01:13:12FromDiscord<Elegantbeef> I dont know about a min repo
01:13:50noeontheendI'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:34FromDiscord<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:40FromDiscord<Elegantbeef> Might cause the GC to behave differently
01:17:02noeontheendUnfortunately not, still crashes with `gc:refc` and works with `gc:markAndSweep`.
01:17:37FromDiscord<Elegantbeef> I suppose i can always clone this 😀
01:18:47FromDiscord<Elegantbeef> What nim version are you using?
01:19:49*arkurious quit (Quit: Leaving)
01:20:18noeontheendI 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:48FromDiscord<noeontheend> In reply to @Elegantbeef "I suppose i can": Please feel free! 😀
01:21:24noeontheendNim Compiler Version 1.6.0 [Linux: amd64]
01:21:24noeontheendCompiled at 2021-10-19
01:21:25noeontheendCopyright (c) 2006-2021 by Andreas Rumpf
01:21:25noeontheend
01:21:25noeontheendgit hash: 727c6378d2464090564dbcd9bc8b9ac648467e38
01:21:25noeontheendactive boot switches: -d:release
01:23:07FromDiscord<Elegantbeef> Hmm i'm not getting a seg issue
01:23:12FromDiscord<Elegantbeef> > error rendering HTML to text\: \<class 'ModuleNotFoundError'\>\: No module named 'html2text'
01:23:29noeontheendTry building it with `-d:internalRenderer`
01:24:14FromDiscord<Elegantbeef> > error\: while accessing https://os.phil-opp.com/rss.xml: could not create read-posts file
01:24:54noeontheendAck, sorry, my bad: https://todo.sr.ht/~reesmichael1/roman/23
01:25:33noeontheendIf you're on Linux, create `~/.local/share/roman/`.
01:25:42FromDiscord<Elegantbeef> I can read!
01:27:10FromDiscord<Elegantbeef> After running subscribe on that link i get `error: Invalid enum value: rss`
01:28:13noeontheendFascinating...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:17FromDiscord<Elegantbeef> Where should the crash be?
01:30:41noeontheendFor me, it's on startup, before showing the feed:
01:30:41noeontheend> michael at pepper in ~/programs/roman on sigsegv [!]
01:30:41noeontheend> ↪ ./bin/roman
01:30:41noeontheend> SIGSEGV: Illegal storage access. (Attempt to read from nil?)
01:30:41noeontheend> fish: Job 1, './bin/roman' terminated by signal SIGSEGV (Address boundary error)
01:31:15FromDiscord<Elegantbeef> Ah got it aswell
01:31:32noeontheendPhew :)
01:35:08noeontheendHmmm, disabling the parallel loading on line 218 of feeds.nim fixes the crash as well.
01:35:33FromDiscord<Rika> Lol hmmm got pinged
01:36:23noeontheendOops, sorry!
01:38:27FromDiscord<Elegantbeef> If that's the case it sounds like it's GC + heap issue
01:39:48FromDiscord<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:20noeontheendThat makes sense to me.
01:43:14noeontheendElegantbeef: 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:48FromDiscord<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:12NimEventerNew thread by Sdmcallister: Column value extraction, see https://forum.nim-lang.org/t/8773
01:59:18FromDiscord<michaelb> sent a long message, see http://ix.io/3L3d
01:59:40FromDiscord<Rika> when statement + const?
01:59:53FromDiscord<michaelb> (edit) "http://ix.io/3L3d" => "http://ix.io/3L3e"
02:00:11FromDiscord<Elegantbeef> Yep https://nim-lang.org/docs/manual.html#foreign-function-interface-dynlib-pragma-for-import
02:00:19FromDiscord<Elegantbeef> That's dynlib, whoops
02:00:44FromDiscord<Rika> oh yeah they have patterns too huh'
02:01:03FromDiscord<Elegantbeef> Dynlib does, passL probably doesnt
02:01:35FromDiscord<michaelb> passL also seems to be passing the flags to gcc and not ld... which is not what I expected
02:01:41FromDiscord<michaelb> but that's another issue
02:03:48FromDiscord<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:20FromDiscord<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:48FromDiscord<Elegantbeef> Yea i've never dealt with system libraries so cant say much
02:07:30FromDiscord<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:34FromDiscord<michaelb> (edit) ""libfoo.so.3"}`" => ""libfoo.so.3".}`" | "-lfoo-core"}`," => "-lfoo-core".}`,"
02:13:24FromDiscord<Elegantbeef> Correct me if i'm wrong but isnt the static library vendored by you
02:13:34FromDiscord<Elegantbeef> So it'll always be the "right" version
02:14:53FromDiscord<michaelb> it's shared, not static
02:15:03FromDiscord<michaelb> when it's `.so` I mean
02:15:25FromDiscord<Elegantbeef> Sure but the one you're doing `-lfoo` for is static isnt it?
02:15:59FromDiscord<michaelb> In reply to @Elegantbeef "Sure but the one": no
02:16:03FromDiscord<Elegantbeef> Like i said i've never used libraries so i just thing those are static, i'm probably way wrong
02:16:10FromDiscord<michaelb> okay, found what works: https://stackoverflow.com/a/3840318
02:16:41FromDiscord<michaelb> `{.passL: "-l:libfoo.so.3 -llibfoo-core.so.3".}`
02:16:50FromDiscord<michaelb> (edit) "-llibfoo-core.so.3".}`" => "-l:libfoo-core.so.3".}`"
02:17:13FromDiscord<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:08FromDiscord<ajusa> Is there a way to set a value for an option type without using `some`? Like `var a: Option[int] = 5`?
03:43:13FromDiscord<Elegantbeef> Converters
03:45:13FromDiscord<Elegantbeef> Or make an operator
03:47:29FromDiscord<ajusa> Didn't think about converters, good idea.
03:47:47FromDiscord<ajusa> I also found https://github.com/nim-lang/Nim/issues/6246
03:50:24FromDiscord<Elegantbeef> The operator is cleaner
03:50:29FromDiscord<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:23FromDiscord<sOkam!> Is there an easy way to alias `func` into another word, without making a big mess?
05:11:42FromDiscord<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:59FromDiscord<sOkam!> (edit) removed "just"
05:16:08FromDiscord<Elegantbeef> `template`
05:18:30FromDiscord<Rika> You can’t without making a big mess
05:18:47FromDiscord<Rika> Using a template would probably need custom syntax
05:20:33FromDiscord<Elegantbeef> Oh the keyword
05:20:38FromDiscord<Elegantbeef> No the keyword is static you cannot change it
05:21:32FromDiscord<sOkam!> just wanted to alias it, so a different word is solved as the proper word when compiling
05:21:48FromDiscord<sOkam!> without touching the functionality
05:21:59FromDiscord<Elegantbeef> Could use a source code filter but it's silly
05:22:48FromDiscord<sOkam!> wdym?
05:23:07FromDiscord<Elegantbeef> https://nim-lang.org/docs/filters.html
05:24:58FromDiscord<Rika> It will change everything
05:25:12FromDiscord<sOkam!> ah i see
05:25:14FromDiscord<Rika> Including the word “func” in a string
05:25:20FromDiscord<sOkam!> yeah, it would change the whole file
05:55:03FromDiscord<gogolxdong (liuxiaodong)> Is there a way to construct XMLNode from string literals?
05:58:43FromDiscord<Elegantbeef> `parseXml`?
06:00:19FromDiscord<gogolxdong (liuxiaodong)> yes, that's what I'm looking for.
06:01:07FromDiscord<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:39FromDiscord<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:53FromDiscord<Elegantbeef> Converters dont work to generics
08:24:07FromDiscord<Elegantbeef> Rather for generics
08:24:18FromDiscord<Michal Maršálek> Hmm, that's a shame
08:24:23FromDiscord<Michal Maršálek> Is there a workaround?
08:24:42FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3L4u
08:25:30PMunchDon't they?
08:25:50FromDiscord<Michal Maršálek> In reply to @PMunch "Don't they?": they do but not if the type needs to be inferred
08:26:34FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3L4v
08:26:45FromDiscord<Elegantbeef> Imo it's easier just to use an operator or keyword
08:27:01PMunchAh right, I was about to say that the error was simply that it couldn't infer S
08:27:42PMunchIf you always want to emit types where T = S though it's easy
08:27:59FromDiscord<Michal Maršálek> In reply to @PMunch "If you always want": no T != S
08:28:12PMunchBut what is S?
08:28:28PMunchYou never use it in your example
08:28:40FromDiscord<Michal Maršálek> it is a static in my usecase
08:28:53PMunchStatic what?
08:28:56FromDiscord<Michal Maršálek> should have kept it static in my example ig
08:29:19FromDiscord<Michal Maršálek> static string but i don't think that matters?
08:30:07PMunchWell if it's always a static string then it does
08:30:55FromDiscord<Michal Maršálek> How?
08:31:49*arkanoid quit (Ping timeout: 256 seconds)
08:32:20*arkanoid joined #nim
08:32:46PMunchHmm, maybe not
08:32:51PMunchI'm trying something out
08:33:00FromDiscord<Michal Maršálek> THis doesn't work either: https://play.nim-lang.org/#ix=3L4A
08:33:04FromDiscord<Michal Maršálek> Still cannot infer S
08:33:20PMunchYeah, that's normal
08:33:29PMunchBecause calling that with 0 won't give you S
08:33:56FromDiscord<Michal Maršálek> I understand that now
08:36:03PMunchHmm, this is close: https://play.nim-lang.org/#ix=3L4B
08:36:21PMunchBut it complains that it can't instantiate `result:type`
08:37:04PMunchThis works though: https://play.nim-lang.org/#ix=3L4C
08:37:14PMunchBut you have to replicate your static string everywhere
08:37:42FromDiscord<Michal Maršálek> @ElegantBeef how can I achieve this with statics? this doesn't work: https://play.nim-lang.org/#ix=3L4D
08:38:13FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3L4E
08:39:58FromDiscord<Michal Maršálek> sent a code paste, see https://play.nim-lang.org/#ix=3L4F
08:40:03FromDiscord<Michal Maršálek> putting constants in place of geenric arguments 😄
08:40:12FromDiscord<Michal Maršálek> thanks
08:40:32FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3L4G
08:41:06PMunch@Michal_Maršálek, did you see my last paste?
08:41:31FromDiscord<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:49FromDiscord<Michal Maršálek> Also it is not really a solution as it is not generic
08:42:10PMunchOh, you can remove the noInit
08:42:13PMunchAnd it is generic
08:42:27PMunchJust not for the S parameter, which you can't infer anyways
08:42:28FromDiscord<Michal Maršálek> it is only for "a"
08:42:45FromDiscord<Michal Maršálek> Yes, but that is the original question
08:43:03PMunchThen the answer is, it's not possible with converters
08:43:42*Vladar joined #nim
08:44:13FromDiscord<Michal Maršálek> Thank you guys very much. ❤️
08:44:43FromDiscord<Michal Maršálek> I will probably just emit a new converter for every instantiation of S for now.
08:45:05FromDiscord<Elegantbeef> Have fun!
08:48:44FromDiscord<Michal Maršálek> no
08:48:49FromDiscord<Michal Maršálek> it leads to ambiguous calls
08:50:03FromDiscord<Michal Maršálek> wait
08:50:25FromDiscord<Michal Maršálek> only if the converters have the same name
08:50:31FromDiscord<Michal Maršálek> that's quite annoying
08:51:02FromDiscord<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:55FromDiscord<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:32FromDiscord<Michal Maršálek> What is the best way to debug "Error: generic instantiation too nested"?
09:41:57FromDiscord<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:25FromDiscord<haxscramper> You might hit this on a perfectly valid code as well, compiler has a hardcoded limit of 50 instantiations
09:42:46FromDiscord<Michal Maršálek> hmm
09:43:43*badsektor joined #nim
09:44:01*badsektor quit (Remote host closed the connection)
09:44:06FromDiscord<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:51FromDiscord<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:04FromDiscord<Michal Maršálek> In reply to @haxscramper "You might hit this": no flag to change that?
09:51:28FromDiscord<haxscramper> no https://github.com/nim-lang/Nim/blob/devel/compiler/seminst.nim#L342
10:01:57*Vladar quit (Quit: Leaving)
10:04:06FromDiscord<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:17FromDiscord<Rika> No
10:05:31FromDiscord<Rika> Because it “clobbers” generic type syntax
10:05:50FromDiscord<Rika> You can probably use {}
10:07:17FromDiscord<Michal Maršálek> Ha I didn't know `{}` operator! Is it used in stdlib?
10:09:27FromDiscord<Michal Maršálek> Thanks, that is a good tip
10:09:55FromDiscord<Rika> No it’s a set of characters that can be used for an operator
10:10:04FromDiscord<Rika> There’s one that uses it, in json
10:10:47FromDiscord<Michal Maršálek> In reply to @Rika "There’s one that uses": Ah true, I've seen that
10:11:29FromDiscord<Michal Maršálek> In reply to @Rika "No it’s a set": wdym?
10:11:44FromDiscord<Rika> Nothing, I misread again
10:15:41FromDiscord<Michal Maršálek> how do I say a macro argument should be an untyped ident?
10:17:28FromDiscord<Michal Maršálek> (edit) "how do I say a macro ... argumentis" added "should only match if the" | "should be" => "is" | removed "untyped"
10:20:00FromDiscord<Solitude> In reply to @Michal58 "how do I say": `arg: untyped{ident}`
10:20:20FromDiscord<Michal Maršálek> In reply to @Solitude "`arg: untyped{ident}`": Thank you
10:22:18FromDiscord<Michal Maršálek> sent a code paste, see https://play.nim-lang.org/#ix=3L5a
10:23:04FromDiscord<Solitude> in this exact form, you cant
10:24:17*nrds quit (Ping timeout: 268 seconds)
10:24:37FromDiscord<Michal Maršálek> I'd have to probably use termrewriting macros and process it all together including the `let a =`?
10:25:35FromDiscord<Solitude> In reply to @Michal58 "I'd have to probably": does this work for you? https://play.nim-lang.org/#ix=3L5b
10:28:18FromDiscord<Michal Maršálek> Hmm, I thought about that, but unfortunately I need te order
10:30:13FromDiscord<Michal Maršálek> In reply to @Michal58 "Hmm, I thought about": or maybe I don't
10:41:06FromDiscord<Michal Maršálek> @Rika or anyone, why does this not work? https://play.nim-lang.org/#ix=3L5f
10:52:42FromDiscord<inv> sent a code paste, see https://play.nim-lang.org/#ix=3L5k
10:53:22FromDiscord<inv> (edit) "https://play.nim-lang.org/#ix=3L5k" => "https://play.nim-lang.org/#ix=3L5l"
11:05:39FromDiscord<SirOlaf> In reply to @SirOlaf "Is it possible to": I'll just assume it's not possible
11:06:15FromDiscord<SirOlaf> Nightly has style issues too btw
11:06:25FromDiscord<SirOlaf> But that's more expected
11:06:42FromDiscord<SirOlaf> (edit) "has" => "has(had?)"
11:25:47FromDiscord<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:43FromDiscord<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:20FromDiscord<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:36FromDiscord<retkid> i did some python stuf
11:40:38FromDiscord<retkid> (edit) "stuf" => "stuff"
11:40:45FromDiscord<retkid> I realized i hate pytho
11:40:48FromDiscord<retkid> (edit) "pytho" => "python"
11:41:06FromDiscord<retkid> I think its the least expressive language I know
11:42:32FromDiscord<retkid> Its weird tat people compare Nim and Python because they look alike
11:42:40FromDiscord<Rika> Wait until you’re made to learn Go
11:43:04FromDiscord<retkid> I've almost learned GO
11:43:09FromDiscord<retkid> but
11:43:28FromDiscord<retkid> the project i was working on got suddenly closed forever
11:43:33FromDiscord<retkid> dodged a bullet
11:44:58FromDiscord<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:08FromDiscord<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:48FromDiscord<retkid> everything was python3
11:46:54FromDiscord<retkid> like 3.10 currently
11:47:04FromDiscord<retkid> not my cup of tea
11:48:59PMunch@demotomohiro, that's why I prefer compiled languages
11:49:23FromDiscord<retkid> i too prefer compiled langs
11:49:33FromDiscord<retkid> java's compiler can suck it tho
11:50:04PMunch@congusbongus, Python is okay, but I was surprised to discover how clunky it felt after having used Nim for a while
11:50:26FromDiscord<retkid> maybe its that
11:50:27PMunch@retkid, I mean Java and C# are basically dynamic languages disguised as a compiled language
11:50:42FromDiscord<retkid> I just dont enjoy it
11:51:05FromDiscord<retkid> I prefer static typings
11:51:36*jjido joined #nim
11:51:37PMunchI'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:54FromDiscord<retkid> i missed let/val, var, and const.
11:52:24PMunchHmm, are there pre-built Nim installs for raspbian?
11:52:35PMunch@federico3 ^
11:52:50FromDiscord<retkid> there are for arm so why not?
11:52:56PMunchI tried to apt install it but that tried to install 0.19.4 or something
11:53:13PMunchWhere can I get those? Choosenim just told me it wasn't supported..
11:55:37FromDiscord<Rika> Probably an old Pi?
11:55:46PMunch2B
11:55:52PMunchSo yeah, pretty old
11:58:08FromDiscord<demotomohiro> sent a code paste, see https://play.nim-lang.org/#ix=3L5K
11:59:38FromDiscord<krisppurg> In reply to @krisppurg "Hi, I have a": @treeform?
12:00:32FromDiscord<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:49FromDiscord<Michal Maršálek> In reply to @demotomohiro "It seems you cannot": Hmm, that is a shame
12:03:06FromDiscord<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:08PMunch@demotomohiro, I know how Nim and NimScript works, that's why I like it :)
12:06:43FromDiscord<demotomohiro> I use archlinux on my raspberry PI and it provides latest Nim:↵https://archlinuxarm.org
12:06:54PMunch@demotomohiro, oh nice, according to uname it's a armv7l chip
12:07:28PMunchThis is an OpenHAB install, hence why it's running a rasbian-esque distro
12:08:15FromDiscord<demotomohiro> In reply to @konsumlamm "because it still is": So compiled language != language that produce a executable file.
12:08:45NimEventerNew thread by Kobi: Is computer online?, see https://forum.nim-lang.org/t/8774
12:12:08FromDiscord<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:26FromDiscord<konsumlamm> the more useful distinction is probably statically typed vs dynamically typed
12:14:00FromDiscord<demotomohiro> In reply to @konsumlamm "ye, it doesn't necessarily": That makes sense.
12:16:37PMunchYes I guess this case is more about statically typed vs. dynamically typed
12:16:59PMunchAlthough I would prefer a dynamically typed compiled language to a dynamically typed interpreted language
12:17:27PMunchI 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:45PMunchHad that happen to me back when I was using Python..
12:18:55PMunchCrawled 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:46NimEventerNew thread by Kobi: A thought about error messages, see https://forum.nim-lang.org/t/8775
12:21:59FromDiscord<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:55FromDiscord<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:05FromDiscord<hmmm> hey what was the compact definition to initialize an array of 100 len
12:23:29PMuncharray[100, int]
12:23:33PMunchBoom!
12:23:37FromDiscord<Rika> In reply to @demotomohiro "So compiled language !=": TypeScript is a compiled language
12:23:37FromDiscord<hmmm> boom!
12:23:43FromDiscord<hmmm> ty 😃
12:23:57PMunchWait, that was a joke :P
12:24:02FromDiscord<hmmm> what
12:24:10FromDiscord<hmmm> 🧐
12:24:12PMunchThat's just how you define an array of size 100
12:24:21PMunchWhat have you been doing?
12:25:37FromDiscord<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:17FromDiscord<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:37FromDiscord<Rika> In reply to @demotomohiro "I don't know much": Pretty much from what I recall
12:28:03FromDiscord<demotomohiro> In reply to @Rika "Pretty much from what": ty!
12:28:48NimEventerNew thread by Kobi: A thought about faster iteration, see https://forum.nim-lang.org/t/8776
12:34:41FromDiscord<hmmm> sent a code paste, see https://play.nim-lang.org/#ix=3L5V
12:34:45FromDiscord<hmmm> I'm almost sure there is a one liner to do that
12:35:02FromDiscord<hmmm> I've read it in some tutorials billions of years ago
12:40:38FromDiscord<evoalg> was it about seq's instead of array's?
12:42:02FromDiscord<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:05FromDiscord<demotomohiro> sent a code paste, see https://play.nim-lang.org/#ix=3L5Y
12:43:42FromDiscord<hmmm> ty demo! are we sure we don't have an import arrayutils somewhere? 🤔
12:44:24FromDiscord<Rika> No we don’t
12:44:39FromDiscord<Rika> Why one line? Make a proc if you want “one line”
12:44:46FromDiscord<Rika> Call it fill or something
12:45:00FromDiscord<evoalg> one liner: `var a: array[100, string]; for i in 0 .. 99: a[i] = $i`
12:45:35FromDiscord<hmmm> I'll do that, I was convinced we had it but probably I was thinking about toseq() from demo
12:47:03PMunchYou also have collect
12:47:14PMunchBut I'm not sure if it can make an array
12:47:21FromDiscord<hmmm> hmm
12:50:07FromDiscord<Michal Maršálek> In reply to @PMunch "But I'm not sure": I don't think it can
12:50:37FromDiscord<SirOlaf> sent a code paste, see https://play.nim-lang.org/#ix=3L60
12:51:31FromDiscord<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:17FromDiscord<SirOlaf> So there is nothing
12:52:30FromDiscord<SirOlaf> (edit) "So there is nothing ... " added "equivalent"
12:52:45FromDiscord<Solitude> stdlib doesnt use concepts
12:52:46FromDiscord<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:29FromDiscord<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:33FromDiscord<SirOlaf> (edit) "haven't" => "have"
12:53:48FromDiscord<hmmm> I see! well it's not really necessary so we do it the old way
12:54:01FromDiscord<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:33FromDiscord<SirOlaf> Rika already said, but I use this concept in procs
12:55:03FromDiscord<SirOlaf> And wanted to see if there was a replacement because compiling spams my console with the T unused warning
12:56:47FromDiscord<Rika> Well try it, it might work, but I believe it won’t work if you use inline iterators of course
12:57:00FromDiscord<SirOlaf> I tried it, gave me an error
12:57:03FromDiscord<demotomohiro> You can pass closure iterator to procedure:↵https://nim-lang.org/docs/manual.html#iterators-and-the-for-statement-firstminusclass-iterators
13:00:39FromDiscord<SirOlaf> Can I also get the iterator for say a deque?
13:00:58FromDiscord<SirOlaf> To pass to a proc that takes an iterator
13:01:30FromDiscord<Solitude> sent a code paste, see https://play.nim-lang.org/#ix=3L63
13:02:48FromDiscord<hmmm> sent a code paste, see https://play.nim-lang.org/#ix=3L64
13:04:17FromDiscord<Rika> In reply to @hmmm "that would be impressive": What don’t you get
13:04:31FromDiscord<hmmm> template and static
13:04:39FromDiscord<hmmm> also untyped
13:04:50FromDiscord<Rika> Static just means a compile time value
13:05:07FromDiscord<Rika> Untyped means “dunno the type yet you figure it out” kinda
13:05:14FromDiscord<Rika> Template is… template
13:06:03FromDiscord<hmmm> so with toArray static toseq you are telling that toArray toseq must be done at compiletime?
13:07:08FromDiscord<Rika> Oh that part
13:07:17FromDiscord<Rika> The second static means “to seq is done in compile time”
13:07:31FromDiscord<Rika> Not the array one since it’s “before”
13:07:36FromDiscord<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:55FromDiscord<hmmm> uh
14:02:03FromDiscord<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:33FromDiscord<hmmm> that is not what I expected 🤨
14:03:49FromDiscord<Solitude> export whatever symbol you need from module B
14:04:59FromDiscord<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:17FromDiscord<hmmm> oh can I import only the symbol I need?
14:05:28FromDiscord<hmmm> what was the syntax from y import thingy?
14:05:34FromDiscord<Solitude> from y import thingy
14:06:07FromDiscord<demotomohiro> Here is how to do what @Solitude said: https://nim-lang.org/docs/manual.html#modules-export-statement
14:06:51FromDiscord<hmmm> is there a reason nim doesn't work as I expected it would work? 🤔
14:07:05FromDiscord<Solitude> yes, the way you expected it to work is bad
14:07:06FromDiscord<hmmm> I mean a techincal reason the exports arent' transitive
14:10:20FromDiscord<hmmm> hmm I couldn't add another e so I added a 3 🤔
14:10:31FromDiscord<hmmm> lol
14:10:33FromDiscord<hmmm> right
14:13:56FromDiscord<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:04NimEventerNew thread by Pietroppeter: Made in Nim 2021 - your favorites?, see https://forum.nim-lang.org/t/8777
14:17:13FromDiscord<hmmm> demo you are good at explaining things 😊
14:19:46FromDiscord<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:04FromDiscord<Michal Maršálek> Can someone help me understand converters? https://play.nim-lang.org/#ix=3L7f
15:45:55FromDiscord<SirOlaf> Hope that's a bug
15:46:02*xiamx[m] joined #nim
15:46:46FromDiscord<Solitude> In reply to @Michal58 "Can someone help me": math.^ is generic too, not clear which one should have the priority
15:46:46FromDiscord<SirOlaf> Because that would be bad design
15:47:29FromDiscord<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:13FromDiscord<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:08FromDiscord<Solitude> true, you probably could submit an issue
15:50:47FromDiscord<Solitude> or ask on forum, where araq could maybe see your question
15:54:33FromDiscord<haxscramper> sent a code paste, see https://paste.rs/4UR
15:55:10FromDiscord<haxscramper> in first case it calls the conveter implicitly even when it is called explicitly
15:55:29FromDiscord<haxscramper> I don't think converter is able to properly infer it's argument values
15:58:44FromDiscord<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:10FromDiscord<haxscramper> this way it actually calls whatever you defined instead of defaulting to things with higher precedence
15:59:45FromDiscord<haxscramper> any call match that uses converter has the lowest precedence of all calls, so even `SomeInteger SomeFloat` etc. would fit better
16:06:44FromDiscord<Michal Maršálek> In reply to @haxscramper "any call match that": I dont't understand this
16:08:56FromDiscord<haxscramper> https://nim-lang.org/docs/manual.html#overload-resolution generics are considered first, then compiler looks for possible calls using converters
16:09:19FromDiscord<haxscramper> so you can't make converter call win over generic one
16:11:59FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3L7w
16:12:11FromDiscord<haxscramper> not ambiguous, it calls integer one because calling float would require converter
16:12:32FromDiscord<Michal Maršálek> That is the exact opossite of what I'm complaining about is happening
16:14:49FromDiscord<Michal Maršálek> In my paste, the converter call wins
16:18:57FromDiscord<SirOlaf> sent a code paste, see https://play.nim-lang.org/#ix=3L7B
16:18:59FromDiscord<SirOlaf> With rest of code the same
16:19:22FromDiscord<SirOlaf> Or wait, that's me doing nonsense
16:20:36FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3L7D
16:20:44FromDiscord<haxscramper> I just got lost in all the unnecessary generics in the original example
16:20:50FromDiscord<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:15FromDiscord<SirOlaf> Is it because of generics?
16:23:01FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3L7E
16:23:32FromDiscord<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:46FromDiscord<haxscramper> Actually wait, that's me being stupid
16:24:10FromDiscord<haxscramper> `(Generic, Generic)` supposedly is weaker than `(Converter, Literal)`, since literal match has the `#1` precendence
16:24:13FromDiscord<SirOlaf> Generics seem kinda strange
16:24:55FromDiscord<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:15FromDiscord<SirOlaf> sent a code paste, see https://play.nim-lang.org/#ix=3L7H
16:25:35FromDiscord<SirOlaf> (edit) "https://play.nim-lang.org/#ix=3L7H" => "https://play.nim-lang.org/#ix=3L7I"
16:25:50FromDiscord<SirOlaf> But only errors when it's used
16:27:06FromDiscord<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:58FromDiscord<SirOlaf> sent a code paste, see https://play.nim-lang.org/#ix=3L7O
16:36:08FromDiscord<Rika> rust has a different type system that is incompatible with what nim does
16:36:55FromDiscord<SirOlaf> I assume nim emits new procs/types/whatever for generics when instantiated and skips checks for the base construct
16:37:20FromDiscord<SirOlaf> Don't see why the base construct can't be checked
16:39:05FromDiscord<SirOlaf> It's also not like nim skips checks for all unused functions
16:39:07FromDiscord<el__maco> its not clear why should it though
16:39:41FromDiscord<SirOlaf> Just seems inconsistent as it clearly produces errors for concrete functions that are unused
16:39:49FromDiscord<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:55FromDiscord<Rika> DCE too aggressive i guess?
16:40:17FromDiscord<SirOlaf> sent a code paste, see https://play.nim-lang.org/#ix=3L7V
16:40:19FromDiscord<SirOlaf> But not the generic variant
16:40:22FromDiscord<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:37FromDiscord<SirOlaf> Problem is that the non-generic version actually is checked
16:41:16FromDiscord<el__maco> its not obvious to me why that matters 🤷‍♂️
16:41:40FromDiscord<SirOlaf> It's not some compiler-breaking issue or anything, just inconsistent
16:45:15FromDiscord<SirOlaf> sent a code paste, see https://play.nim-lang.org/#ix=3L80
16:45:32FromDiscord<SirOlaf> Is that different from generics or are empty generics just allowed for some reason
16:46:15FromDiscord<SirOlaf> (edit) "https://play.nim-lang.org/#ix=3L80" => "https://play.nim-lang.org/#ix=3L81"
16:46:59FromDiscord<SirOlaf> Because it does compile and can be used
16:53:08FromDiscord<SirOlaf> Guess it is wanted according to grammar
16:56:57FromDiscord<Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3L85
16:57:29FromDiscord<Patitotective> (edit) "https://play.nim-lang.org/#ix=3L85" => "https://play.nim-lang.org/#ix=3L86"
16:57:51FromDiscord<Patitotective> Should I create my own procedure to achieve it?
16:58:11FromDiscord<Patitotective> (edit) "Should" => "Or should"
16:59:57FromDiscord<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:06FromDiscord<Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3L8k
17:27:43FromDiscord<Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3L8o
17:27:52FromDiscord<Patitotective> (edit) "https://play.nim-lang.org/#ix=3L8o" => "https://play.nim-lang.org/#ix=3L8p"
17:28:02FromDiscord<Michal Maršálek> defined
17:28:12FromDiscord<Michal Maršálek> (edit) "defined" => "`defined`"
17:28:17FromDiscord<Rika> !eval let a = 0; echo defined a; echo defined b
17:28:19NimBotfalse↵false
17:28:24FromDiscord<Rika> ??
17:29:11FromDiscord<Patitotective> Thanks
17:29:12FromDiscord<Patitotective> 🙃
17:31:04FromDiscord<demotomohiro> !eval let a = 0; echo declared a; echo declared bbbb
17:31:06NimBottrue↵false
17:32:18FromDiscord<demotomohiro> https://nim-lang.org/docs/system.html#declared%2Cuntyped
17:36:25FromDiscord<demotomohiro> `defined` is not for checking existance of variables.↵https://nim-lang.org/docs/system.html#defined,untyped
17:37:52FromDiscord<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:07FromDiscord<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:32FromDiscord<DMI-1407> have a question related to nim and mt
19:27:36FromDiscord<DMI-1407> https://media.discordapp.net/attachments/371759389889003532/928369158293438524/asd.png
19:28:04FromDiscord<DMI-1407> does this mean i can not use multithreaded code in dlls ?
19:30:28FromDiscord<planetis> does anyone knows what this error means\: https://pastebin.com/kRytQG8n
19:33:32FromDiscord<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:14FromDiscord<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:10FromDiscord<Rosen> I bet you can just put air at the end and it'll work
20:28:17FromDiscord<Rosen> Since the error refers to order
20:32:26FromDiscord<SoicBR> It worked
20:33:02FromDiscord<SoicBR> thanks
20:42:39FromDiscord<Schelz> Any idea how to i could create a browser app in nim
20:43:20FromDiscord<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:23FromDiscord<Yardanico> In reply to @Schelz "like an exe that": https://github.com/marcomq/nimview
20:51:06FromDiscord<Yardanico> and if you just want a _web app_, use any http server
20:51:33FromDiscord<Yardanico> from stdlib's https://nim-lang.org/docs/asynchttpserver.html to jester and prologue
20:51:38FromDiscord<Yardanico> since a "browser app" is just a web page
20:53:24FromDiscord<Schelz> <3
20:55:43FromDiscord<planetis> also https://nim-lang.github.io/Nim/browsers.html
20:56:10FromDiscord<Yardanico> this is quite different though
20:56:16FromDiscord<Yardanico> its just for opening a browser :)
21:00:12FromDiscord<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:18FromDiscord<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:57NimEventerNew thread by Niminem: Am I allowed to add this feature to stdlib module?, see https://forum.nim-lang.org/t/8778
21:48:59FromDiscord<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:12FromDiscord<SirOlaf> sent a code paste, see https://play.nim-lang.org/#ix=3L9T
22:03:41FromDiscord<Elegantbeef> Why wouldnt it be allowed
22:05:01FromDiscord<SirOlaf> Just looks weird. It also behaves differently when you only give it one parameter vs more
22:06:30FromDiscord<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:31FromDiscord<SirOlaf> sent a code paste, see https://play.nim-lang.org/#ix=3L9U
22:08:17FromDiscord<SirOlaf> sent a code paste, see https://play.nim-lang.org/#ix=3L9V
22:08:37FromDiscord<SirOlaf> It tries to coerce them into each other
22:08:45FromDiscord<SirOlaf> And it succeeds in a strange way
22:09:27FromDiscord<Elegantbeef> really you're better doing `b: openArray[int] = []`
22:09:59FromDiscord<SirOlaf> Not using this for anything, am trying to wrap my head around the compiler code and stumbled upon weird varargs features
22:10:22FromDiscord<SirOlaf> https://play.nim-lang.org/#ix=3L9X
22:10:58FromDiscord<Elegantbeef> Ah nice they're broken
22:11:16FromDiscord<SirOlaf> Very unexpected output, isn't it
22:12:13FromDiscord<kevin> Is it possible to get a file's owner with Nim?
22:12:42FromDiscord<kevin> I thought there would be an entry in `os`'s FileInfo type : https://nim-lang.org/docs/os.html#FileInfo
22:12:47FromDiscord<Elegantbeef> It is but i dont think there is a cross platform api
22:12:56FromDiscord<kevin> booooo 😦
22:14:48FromDiscord<SirOlaf> You can even cause sigsegv with those varargs
22:15:29FromDiscord<SirOlaf> If the 0 is changed to a 1 it tries to interpret it as a string pointer
22:15:46FromDiscord<Elegantbeef> Yea seems the fight over parameters
22:16:54FromDiscord<SirOlaf> Actually, it crashes with a single vararg too
22:17:27FromDiscord<SirOlaf> I think varargs just break type safety in addition to competing over params
22:18:03FromDiscord<SirOlaf> Nevermind, ignore that
22:18:07FromDiscord<SirOlaf> Only breaks with more than one
22:18:09FromDiscord<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:14FromDiscord<Elegantbeef> Shit doublt paste
22:19:02FromDiscord<SirOlaf> It seems to just perform a cast[T]
22:19:10FromDiscord<SirOlaf> Somehow
22:19:45FromDiscord<Elegantbeef> They fight over parameters, without proper logic over which gets which
22:20:06FromDiscord<SirOlaf> Does this deserve another issue?
22:20:13FromDiscord<Elegantbeef> Probably
22:21:43FromDiscord<Elegantbeef> It'd never be accepted but i'd probably say any usage of varargs without a convert should be removed 😀
22:21:53FromDiscord<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:26FromDiscord<SirOlaf> Opened an issue. Wonder if there's more strange stuff like that in the cracks of the compiler
22:27:54FromDiscord<Elegantbeef> Probably
22:28:53FromDiscord<Elegantbeef> Many issues in the nim compiler are due to someone forgetting X ability exists
22:29:28FromDiscord<SirOlaf> Fair, the thing is massive
22:33:57FromDiscord<Elegantbeef> Time to get those PRs out to fix varargs you have 3 hours 😛
22:39:08FromDiscord<SirOlaf> I wish, but can barely comprehend half of this. Almost every variable is like a single letter 👺
22:40:02FromDiscord<Elegantbeef> You arent supposed to comprehend it you just throw echo statements until you get what's happening
22:41:17FromDiscord<SirOlaf> Yep, time to randomly place echoes into one of the big semcheck functions
22:41:55FromDiscord<SirOlaf> Hope you like echoes, because you'll be placing a lot of them
22:42:11FromDiscord<Elegantbeef> Eh it's not that bad
22:42:20FromDiscord<Elegantbeef> Go to vararg processing and see what it does
22:44:03FromDiscord<SirOlaf> I'm sure you know which file to look in?
22:44:23FromDiscord<Elegantbeef> Perhaps semtypes 191
22:44:40FromDiscord<Elegantbeef> Though probably more likely is semoverloadedcall
22:45:11FromDiscord<Elegantbeef> which is semcall line585
22:45:22FromDiscord<Elegantbeef> There is also the chance this is just a generation issue
22:46:24FromDiscord<SirOlaf> Probably? Issue is that they share a memory location or something
22:46:39FromDiscord<Elegantbeef> Indeed
22:47:09FromDiscord<Elegantbeef> I'd say try it in JS to see if it behaves teh same
22:47:49FromDiscord<SirOlaf> In fact, they are the same address
22:48:15FromDiscord<SirOlaf> sent a code paste, see https://play.nim-lang.org/#ix=3La3
22:48:19FromDiscord<SirOlaf> Gives same thing twice
22:48:48FromDiscord<SirOlaf> https://play.nim-lang.org/#ix=3La4
22:49:19FromDiscord<SirOlaf> So my guess is that it's a assignment issue
22:49:30FromDiscord<SirOlaf> Where the compiler assumes there is only one vararg param
22:51:19FromDiscord<Elegantbeef> Yep behaves the same on JS
22:51:28FromDiscord<Elegantbeef> well "same"
22:52:22FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3La6
22:52:44FromDiscord<SirOlaf> Why are both int
22:52:45FromDiscord<Elegantbeef> The generation of the varargs is wrong
22:52:59FromDiscord<Elegantbeef> JS isnt C
22:59:01FromDiscord<SirOlaf> Do you also know where it is generated? I am very lost
22:59:58FromDiscord<Elegantbeef> I'm trying to find it
23:00:36FromDiscord<SirOlaf> Thought you had all of nim memorized with how quickly you got those two functions before 😛
23:00:38FromDiscord<Elegantbeef> transf gets `["a", 0]` for both parameters
23:01:11FromDiscord<SirOlaf> Nice, a file I haven't even considered looking at for anything until now
23:01:27FromDiscord<Elegantbeef> Well transf is the last file before generation
23:01:31FromDiscord<Elegantbeef> So i was seeing what it got
23:01:58FromDiscord<SirOlaf> Well yeah, but I don't know that. Am a little compiler baby
23:02:08FromDiscord<Elegantbeef> Join the club
23:04:12*Gustavo6046 quit (Remote host closed the connection)
23:05:20FromDiscord<Elegantbeef> Presently checking if `semOverloadedCall` has the same
23:07:14FromDiscord<Elegantbeef> Ahah line 596 in semcalls is the path to getting two bad arrays
23:07:15FromDiscord<Elegantbeef> So `semResolvedCall` is creating two arrays
23:07:17FromDiscord<Elegantbeef> but not doing an offset
23:09:39FromDiscord<Elegantbeef> Ok so `x.call` in `semResolvedCall` is what's causing the array to get created incorrectly
23:10:09FromDiscord<Elegantbeef> Now we get to find where
23:10:09FromDiscord<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:08FromDiscord<SirOlaf> Or is this stage too early for that
23:11:15FromDiscord<SirOlaf> (edit) "Or is this ... stage" added "compiler"
23:11:17FromDiscord<Elegantbeef> Ah that's the candidate from `resolveOverloads`
23:11:17FromDiscord<Elegantbeef> 😀
23:11:22FromDiscord<Elegantbeef> Compiler is fun!
23:11:45FromDiscord<Elegantbeef> It creates 2 arrays with the parameters
23:12:19FromDiscord<Elegantbeef> So for some reason the candidate created inside `semOverloadedCall` is creating 1 array and assigning it twice
23:12:36FromDiscord<SirOlaf> Nice
23:12:41FromDiscord<Elegantbeef> Finding where the array is created is key to resolving this issue
23:13:25*Guest1783 quit (Ping timeout: 240 seconds)
23:16:58FromDiscord<SirOlaf> This does happen to be the exact path I was looking at
23:17:29FromDiscord<SirOlaf> When I was exploring before
23:20:15FromDiscord<SirOlaf> matchesAux is probably the evil one
23:20:40FromDiscord<SirOlaf> But I'm biased because that's the only function I kinda understand
23:21:37FromDiscord<Elegantbeef> the issue branch starts line 2489 in sigmatch
23:21:38FromDiscord<Elegantbeef> That atleast points you to where it needs fixed, how to fix it is another question
23:21:54FromDiscord<SirOlaf> Yeah, that's matchesAux
23:21:56FromDiscord<Elegantbeef> That loop iterates over every passed in argument and assigns it to parameter
23:22:48FromDiscord<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:17FromDiscord<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:28FromDiscord<SirOlaf> That sounds a lot more complicated than it initially seemed
23:42:28FromDiscord<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:49FromDiscord<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:30FromDiscord<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)