<< 29-04-2021 >>

00:00:11*teal joined #nim
00:02:34*teal quit (Client Quit)
00:03:56*Figworm quit (Quit: Figworm)
00:10:59*teal joined #nim
00:12:39*Figworm joined #nim
00:14:25lainso I'm looking at "view types"... can these be used in multithreading? ( https://nim-lang.github.io/Nim/manual_experimental.html#view-types )
00:22:36leorize[m]not now, they are very unstable at the moment
00:23:19*teal quit (Quit: WeeChat 3.1)
00:24:18lainso like, in what situation would you use view types?
00:26:11leorize[m]when you want a (mutable) view to your array, seq, string, you name it
00:26:31*vicfred quit (Quit: Leaving)
00:27:03leorize[m]it's a very useful feature, just incomplete right now
00:27:36FromDiscord<ElegantBeef> It's also pretty good for noncopying procedures like `strutils` but without allocating new strings
00:28:17FromDiscord<exelotl> It's still my most anticipated feature of the language haha
00:28:45lainaha, ok I can see it now, thanks :3
00:30:08FromDiscord<ElegantBeef> https://github.com/beef331/strviewutils if you want to see the usage of it in a "real" library šŸ˜›
00:31:29lainnice
00:32:08ForumUpdaterBotNew thread by Jrenner: Is it possible to have an embedded Nimscript interpreter when compiling with --app:lib ?, see https://forum.nim-lang.org/t/7881
00:52:48*njoseph quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
00:53:07*njoseph joined #nim
01:23:05FromDiscord<JSONBash> @ElegantBeef I was wondering if you could give me some guidance with an error I am having?
01:23:13*leorize joined #nim
01:23:25FromDiscord<ElegantBeef> Lol acting like you didnt just dm me that question šŸ˜›
01:23:39FromDiscord<ElegantBeef> Pitter patter let's get at 'er
01:23:41FromDiscord<JSONBash> cats outta the bag lol
01:25:05FromDiscord<JSONBash> sent a code paste, see https://paste.rs/pGa
01:25:44FromDiscord<JSONBash> sent a code paste, see https://play.nim-lang.org/#ix=3kII
01:26:13FromDiscord<JSONBash> sent a code paste, see https://paste.rs/GOh
01:26:52FromDiscord<JSONBash> sent a code paste, see https://paste.rs/fQV
01:27:46FromDiscord<JSONBash> but if i remove the line accessing affWords in the doAnalysisOnText I don't get the error. I'm thinking it's becuase that fn is inside a thread and cannot access the var outside it? im not sure though
01:29:03FromDiscord<ElegantBeef> If you're certain it's threadsafe you can override the thread analysis with `{.cast(gcSafe).}:` and put the code that's causing it inside
01:29:29FromDiscord<ElegantBeef> I dont know about using async + threading much
01:30:03FromDiscord<JSONBash> how might I be certain? make sure it doesnt mutate anything outside of it?
01:30:10FromDiscord<JSONBash> (thank you for that help)
01:30:37FromDiscord<ElegantBeef> Well knowing what you're doing and the implications of such
01:30:49FromDiscord<JSONBash> haha fair enough
01:32:32FromDiscord<JSONBash> ill give it a go thanks!
02:02:23FromDiscord<reilly> sent a code paste, see https://paste.rs/1xH
02:02:40FromDiscord<reilly> No matter how much I work with async, it always manages to give me trouble.
02:03:52FromDiscord<ElegantBeef> Cause async is done using macros so issues that pop up appear in the macro impl
02:04:36FromDiscord<reilly> I just realized, I'm dumb as usual and forgot the `{.async.}`. At least asking for help makes me figure it out myself.
02:08:36*johnnynitwits quit (Quit: Bridge terminating on SIGTERM)
02:09:04*johnnynitwits joined #nim
02:24:34ForumUpdaterBotNew thread by Masiarek2: Echo isAlphaAscii("ą") - expecting false (instead of error), see https://forum.nim-lang.org/t/7882
02:31:33*leorize quit (Ping timeout: 240 seconds)
02:37:54*leorize joined #nim
02:47:06*thomasross quit (Ping timeout: 260 seconds)
02:47:18*Tlangir joined #nim
02:49:52*merlin_the_beard quit (Ping timeout: 252 seconds)
04:03:17*Tlanger joined #nim
04:05:45*Tlangir quit (Ping timeout: 252 seconds)
04:22:32*rockcavera quit (Ping timeout: 240 seconds)
04:40:36*letto quit (Quit: Konversation terminated!)
05:03:43*narimiran joined #nim
05:05:24*mindhunter0x joined #nim
05:07:17*xet7 quit (Quit: Leaving)
06:23:03*teal joined #nim
06:25:37saemBeef: 3000 tests, and they run faster than they take to compile. :D
06:26:31*xet7 joined #nim
06:28:47FromDiscord<ElegantBeef> Lol
06:29:22FromDiscord<ElegantBeef> There is a glaring flaw with my macro and the current way arbitraries are made, so will have to resolve that šŸ˜„
06:30:47FromDiscord<ElegantBeef> But hey i might have resolved the CI failing, though i dont remove the flag, so that's awful
06:31:13*Vladar joined #nim
06:37:20*teal quit (Quit: WeeChat 3.1)
06:40:52saemDoheth
06:41:35saemI didn't notice the flaw. It's late so I'm extra slow.
06:44:41FromDiscord<ElegantBeef> Really it's my bad šŸ˜›
06:45:19FromDiscord<ElegantBeef> I was trying to resolve it but i couldnt think of the best way, so was going to mention it, but got lost in trying to get the compiler to build with this inference
06:52:36saemI see the value being uint32, but that seems to never get used. Not sure what else the issue might be.
06:56:29FromDiscord<ElegantBeef> it's cause i'm using the `initArbitrary` procedure
06:57:34FromDiscord<ElegantBeef> My idea is mostly we use `Arbitrary[tuple]` for it, but the generators arent really accessible to make a `Shrinkable[tuple]
06:59:24saemAh, yeah so the input shrinking can't happen on the whole tuple, it needs to happen on the shrinkable inputs.
07:00:09saemI know, that's weird, but the tuple is a borderline hack.
07:00:32FromDiscord<ElegantBeef> No i understand the main issue, is just you need the generics for things like report and stuff
07:00:53FromDiscord<ElegantBeef> So tuple seemed to be the most sensible, but painted myself in a corner
07:02:15saemYeah, wish there was a better way to deal with that, maybe if I allocate memory a bit differently and hold onto failed result sets as packed bytes somehow.
07:03:21saemThat way the report doesn't really need to know directly, could refer to something that can hide the generic bits.
07:07:06FromDiscord<ElegantBeef> Well the report is just for showing fails right?
07:09:02FromDiscord<ElegantBeef> If that's the case we could just stringify the results and store them in a string or seq of themthere
07:09:02saemOther stats too, but the generic part is definitely the counter example
07:09:35*letto joined #nim
07:09:48saemYeah, that's true, precluded some options but not the end of the world for now.
07:11:39saemMaybe getImpl or a relative might allow fetching the type info for the tuple fields? Then generating vars/shrinkable shouldn't be an issue.
07:12:44saemI remember bits and pieces of that from CPS, I need to look again.
07:13:13FromDiscord<ElegantBeef> Yea it could work, gotta reason about shrinkables a bit more
07:14:32saemOK, I should get some sleep, maybe I'll figure something out tomorrow.
07:14:50FromDiscord<ElegantBeef> Buh bye
07:29:01*PMunch joined #nim
07:32:47*NimBot joined #nim
07:40:53*aeverr quit (Ping timeout: 268 seconds)
07:57:51*hyiltiz quit (Ping timeout: 252 seconds)
07:58:25*hyiltiz joined #nim
07:58:25*hyiltiz quit (Changing host)
07:58:25*hyiltiz joined #nim
08:19:18*mindhunter0x quit (Quit: leaving)
08:25:30*mindhunter0x joined #nim
08:55:22*teasea quit (Quit: teasea)
08:57:27*teasea joined #nim
09:15:53ForumUpdaterBotNew thread by Dabod: Question about package level object, see https://forum.nim-lang.org/t/7884
09:17:52*xet7 quit (Remote host closed the connection)
09:52:01ForumUpdaterBotNew thread by Dbl007: Trojan:Win32/Wacatac.B!ml, see https://forum.nim-lang.org/t/7885
10:20:14*natrys joined #nim
10:26:41*aeverr joined #nim
10:38:40PMunchHave people found any good topics for NimConf 2?
10:50:33*kuon quit (Remote host closed the connection)
10:50:54*kuon joined #nim
11:19:02FromDiscord<exelotl> maybe I'll do another GBA talk... no promises though, I was barely able to finish the last one šŸ˜…
11:26:52PMunchWould be cool, and a good opportunity to show off the amazing trailer once more :D
11:27:21FromDiscord<exelotl> hahaha yeah
11:28:20PMunchI was thinking on doing something more on the microcontroller stuff
11:28:41FromDiscord<exelotl> at least I know what approach works best for me now (don't try to follow a script or use a webcam, just record each slide 1 by 1 with as many attempts as it takes)
11:28:59FromDiscord<exelotl> oh yeah that would be nice
11:29:20narimiran...and change clothes/hairstyle between the slides, to keep audience entertained!
11:29:42FromDiscord<hamidb80> hey every one
11:29:43FromDiscord<exelotl> hehehe
11:29:56FromDiscord<Rika> or change bg locations between slides (while maintaining fg positions)
11:30:07FromDiscord<Rika> would be funny
11:30:29narimiranok, we basically figured it out for you. now you must do it
11:30:40PMunchMoving stuff around in the background like a stop-motion movie :P
11:31:32FromDiscord<exelotl> each slide is like a tom scott video: "I'm at the large hadron collider!"
11:32:55FromDiscord<hamidb80> i get diffrent error in windows and nim playground
11:33:03FromDiscord<Rika> "I'm currently inside your house"
11:33:06FromDiscord<hamidb80> https://play.nim-lang.org/#ix=3lix
11:33:34FromDiscord<hamidb80> can anyone tell me why `swap` proc doesn't work here?
11:33:47FromDiscord<hamidb80> but `replace` template works
11:34:41FromDiscord<hamidb80> i use nim 1.4.4
11:34:48FromDiscord<hamidb80> (edit) "i use nim 1.4.4 ... " added "in windows"
11:36:58FromDiscord<hamidb80> PMunch your talks and articles about was very helpful, thank u
11:37:06FromDiscord<hamidb80> (edit) "PMunch your talks and articles about ... was" added "metaprogramming"
11:37:50PMunchGlad they could be of help :)
11:39:28FromDiscord<hamidb80> In reply to @hamidb80 "https://play.nim-lang.org/#ix=3lix": any idea?
11:40:39FromDiscord<hamidb80> nim playground doesn't know `copy`
11:40:45FromDiscord<hamidb80> strange
11:40:48FromDiscord<Rika> import macros
11:41:32FromDiscord<demotomohiro> NimNode doesn't have operator`[]` that returns var NimNode.
11:41:58FromDiscord<hamidb80> In reply to @Rika "import macros": updated. https://play.nim-lang.org/#ix=3liy
11:43:04PMunchThis seems like what you're trying to do: https://play.nim-lang.org/#ix=3liz
11:43:18PMunchBut I get another very weird error when I try to run it
11:44:26FromDiscord<hamidb80> how does `swap` works then? i thought it was just like the `replace` template that i wrote
11:44:37FromDiscord<hamidb80> (edit) removed "the"
11:44:55PMunchDunno, don't think I've used it
11:45:47*blitzworksD1337d joined #nim
11:47:08*xet7 joined #nim
11:47:12FromDiscord<hamidb80> In reply to @PMunch "But I get another": https://play.nim-lang.org/#ix=3liA this works fine!
11:47:31PMunchIt does? On the playground I get an error..
11:48:33FromDiscord<hamidb80> In reply to @PMunch "It does? On the": i got nothing ( it should print generated AST right? )
11:48:51*blitzworks quit (Ping timeout: 252 seconds)
11:49:00PMunchYeah, but when it tries to call the two variants the second one fails..
11:49:36FromDiscord<hamidb80> https://media.discordapp.net/attachments/371759389889003532/837294542217674812/unknown.png
11:50:19FromDiscord<hamidb80> https://play.nim-lang.org/#ix=3liD
11:51:39FromDiscord<demotomohiro> It seems calling `[]=` proc is an only way to directly set chid node of NimNode and you cannot use proc with var parameter to change it.
11:51:49PMunchhttp://ix.io/3liE
11:52:28FromDiscord<hamidb80> In reply to @PMunch "http://ix.io/3liE": https://media.discordapp.net/attachments/371759389889003532/837295262611406848/unknown.png
11:53:03PMunchOh well, all is good then :P
11:53:37FromDiscord<hamidb80> In reply to @hamidb80 "": seems like nim playground hide the compile time `echos`
11:53:48FromDiscord<hamidb80> (edit) "`echos`" => "`echo`s"
11:53:54FromDiscord<hamidb80> (edit) "hide" => "hides"
11:54:42FromDiscord<Rika> no, theyre shown when you click on the button beside "run"
11:55:20FromDiscord<hamidb80> In reply to @Rika "no, theyre shown when": oh - showing : debug
11:58:57FromDiscord<hamidb80> programming was a pain before https://media.discordapp.net/attachments/371759389889003532/837296897407713300/unknown.png
11:59:05FromDiscord<hamidb80> (edit) "programming was a pain before ... https://media.discordapp.net/attachments/371759389889003532/837296897407713300/unknown.png" added "macros"
11:59:35FromDiscord<hamidb80> imagine 500 lines of code like this
11:59:40FromDiscord<hamidb80> (edit)
12:00:24FromDiscord<hamidb80> (edit) removed "just"
12:07:19FromDiscord<šŸphylumšŸ> When I try to set a compiler using the --cc flag it gives me a list of legal names
12:08:43FromDiscord<šŸphylumšŸ> I'm trying to set it to a gcc build for a special gcc build targeting a mips R5900 cpu
12:08:52FromDiscord<šŸphylumšŸ> by convention the binary isn't called gcc
12:08:54FromDiscord<Rika> you use --gcc.exe: for that instead i believe
12:09:13FromDiscord<Rika> and gcc.exe.linker or something i forget (check compiler docs)
12:09:20FromDiscord<Rika> oh, gcc.linker.exe
12:09:33FromDiscord<šŸphylumšŸ> perfect šŸ‘
12:13:44FromDiscord<šŸphylumšŸ> sent a code paste, see https://paste.rs/1Uk
12:13:51FromDiscord<šŸphylumšŸ> I think perhaps not :D
12:13:56FromDiscord<šŸphylumšŸ> not tonight at least
12:29:03reversem3How to cross compile for windows:nim c -d:mingw --cpu:amd64 --threads:on (only if threads are needed) <file.nim>
12:32:29ForumUpdaterBotNew thread by FabienPRI: SetControlCHook , see https://forum.nim-lang.org/t/7886
12:34:28FromDiscord<demotomohiro> @reversem3↵https://forum.nim-lang.org/t/7803
12:42:38reversem3I haven't cross compiled for a UI yet only CLI and it works great
12:43:32reversem3I cross compile from Mac OSX to windows 7 and 10
12:53:54reversem3hmm so I haven't tried using wine but it does have the same compiler installed and it probably would be better especially dealing with any kind of UI
12:54:13reversem3I know nigui uses SDL and openGL right
12:55:10reversem3You would need to setup all the niGUI dependences in nim.cfg.
12:58:06*blitzworksD1337d quit (Quit: Gateway shutdown)
12:58:41*blitzworksD1337d joined #nim
13:41:04*rockcavera joined #nim
13:56:31*PMunch quit (Quit: leaving)
14:29:33Benjamin[m]1Is it possible to make a seq of proc with varying pragmas? E.g., closures and non-closures in the same seq.
14:43:43giacoIf fut.failed is true, what is the return value of withTimeout? https://github.com/nim-lang/Nim/blob/version-1-4/lib/pure/asyncdispatch.nim#L1845
14:44:11*natrys quit (Ping timeout: 240 seconds)
14:44:38*natrys joined #nim
14:59:31FromDiscord<haxscramper> sent a code paste, see https://paste.rs/yfz
15:00:36FromDiscord<haxscramper> I need this pragma to be `typed` in order to get the object definition symbol
15:18:25*xet7 quit (Remote host closed the connection)
15:20:04*rockcavera quit (Read error: Connection reset by peer)
15:20:33*rockcavera joined #nim
15:20:41*natrys quit (Ping timeout: 240 seconds)
15:21:05FromDiscord<exelotl> is there a way to set the arm.none.gcc.exe configuration key on the command line rather than in a config file?
15:21:32FromDiscord<exelotl> particularly for using Nim with compiler explorer
15:29:40leorize[m]prepend a `--` to that
15:36:25*natrys joined #nim
15:37:35FromDiscord<exelotl> ahh thanks
15:39:22giacogot my asnwer, and it "it raises exception"
15:45:03Amun_RaI've encountered weird error, perhaps it's the way templates word I'm not aware of: https://play.nim-lang.org/#ix=3lk0
15:45:11Amun_Ras/word/work/
15:50:46giacohttps://nim-lang.org/docs/asyncdispatch.html#asynchronous-procedures-handling-exceptions does anybody knows more than "Unfortunately the semantics of the try statement may not always be correct"?
15:51:32FromGitter<iffy> Is FutureStream threadsafe?
16:07:45*xet7 joined #nim
16:12:33*arecaceae quit (Remote host closed the connection)
16:12:53*arecaceae joined #nim
16:19:33leorize[m]giaco: @dom96 should know about this stuff
16:24:03*letto_ joined #nim
16:24:18*letto quit (Ping timeout: 260 seconds)
16:41:09*leorize quit (Ping timeout: 240 seconds)
16:44:04*letto_ quit (Remote host closed the connection)
16:44:27*letto_ joined #nim
16:52:30FromDiscord<dom96> wow, that's outdated. We need to update the docs, this isn't the case anymore since Nim's closure iterators support try
17:08:44giacodom96: I've just refactored all my code from try/except to yield future; future.failed
17:08:57giacoare you saying that was not necessary?
17:09:14ForumUpdaterBotNew thread by GamzWithJamz: Nim Standard Library - How expansive should it be?, see https://forum.nim-lang.org/t/7887
17:15:20FromDiscord<dom96> giaco: yes
17:15:59FromDiscord<d4rckh> sent a code paste, see https://play.nim-lang.org/#ix=3lky
17:16:07FromDiscord<d4rckh> (edit) "https://play.nim-lang.org/#ix=3lky" => "https://play.nim-lang.org/#ix=3lkz"
17:17:29FromDiscord<d4rckh> sent a code paste, see https://play.nim-lang.org/#ix=3lkA
17:20:06giacodom96: but I am quite sure it is not working as expected, as I was struggling with a "catch all" try/except block at the root of my async tree, but my program was quitting anyway on error. By replacing that with yield it was working as expected
17:20:50*leorize joined #nim
17:24:48FromDiscord<d4rckh> or is there anyway i can do it to pass the post data as a string?
17:27:23FromDiscord<dom96> giaco: hm, that's odd, are you using `asyncCheck`? That will bubble up any errors to the dispatcher
17:29:28giacodom96, at main I run 3 asyncCheck + runForever, then inside each of the three async proc I have a try/execept catch-all block
17:30:50giacoinside each of these try/catch block I do many "await future" thay may raise exceptions
17:31:16FromDiscord<dom96> hm, that should catch everything. Would be brilliant if you could come up with a short repro for this, maybe there is a bug hiding there with the exception handling
17:33:06giacoI will surely want to revert back to try/catch pattern as the yield smells bad
17:33:21giacoif I will be able to reproduce I will narrow it down to minimal example
17:33:34giacoone short question while I am here
17:36:23giacowhile I tend to do "try: await myfuture() except: echo foo" I wonder what does "try: asyncdispatch myfuture() except: echo foo" actually do
17:37:43giacoI mean, if try/except wraps a call tree, where is asyncdispatch attached? Does it branch from the root of the dispatcher?
17:54:00reversem3I propose we setup a "kitty" or "pool" for funding documentation for nim
17:54:28reversem3I also propose dom96 to write all the documentation lol
18:01:51*vicfred joined #nim
18:02:55*kuon quit (Remote host closed the connection)
18:17:32FromDiscord<zetashift> I think docs are doing great compared to a few years ago tbh, they have improved a lot. I don't know what the status is of docgen and it's problems outlined here: https://github.com/mratsim/Arraymancer/issues/488#issuecomment-754616990 but there are solutions coming up(haxdoc/nimib) for that too. I feel like a current issue is discoverability of Nim. People still not knowing about `-d:danger` and minor stuff like that
18:19:07FromDiscord<zetashift> F# has an Advent Calender filled with blogposts about all sorts of things F#, Rust had it too, I think that could be a way to have a more easier onboarding to the Nim world, without burdening the maintainers
18:27:30FromDiscord<haxscramper> `nim doc` was not really designed to generate project-wide documentation to begin with. nim compiler documentation pages are manually stiched together using `koch` https://github.com/nim-lang/Nim/blob/16405083485967a395b8d677833bc26040881b21/tools/kochdocs.nim#L247
18:28:52FromDiscord<haxscramper> And as a result some packages don't have compiled documentation and rely instead on "look in the tests" and "look in the documentation comments"
18:34:21*leorize quit (Ping timeout: 240 seconds)
18:51:48*leorize joined #nim
19:11:38FromDiscord<haxscramper> The fact nim RST parser sometimes directly interprets things like `.. include` for example does not help in writing custom tooling on top of it
19:29:21FromDiscord<exelotl> I tried to generate docs for my GBA library the other day and the compiler just crashed lol
19:30:16FromDiscord<exelotl> I managed to get docs I'm fairly happy with for my asset conversion lib: https://exelotl.github.io/trick/trick.html
19:30:59FromDiscord<exelotl> but it required a lot of messing around to fill in for things that nim doc is missing
19:31:38FromDiscord<exelotl> like this CSS hack šŸ˜… https://media.discordapp.net/attachments/371759389889003532/837410815028101141/unknown.png
19:31:57FromDiscord<haxscramper> first and foremost it is missing adequate IR that can be used by others. For haxdoc I"m not really concerned about producing high-quality documentation etc,
19:32:13FromDiscord<haxscramper> instead I want to make documentation generator Library
19:32:26FromDiscord<haxscramper> And some default generator too of course
19:34:09FromDiscord<Avatarfighter> @exelotl those docs look good
19:34:10FromDiscord<haxscramper> And it is not possible to even query `nim doc` for a list of classes defined in a project or something, you have to compile each file on its own and manually combine this info
19:35:38FromDiscord<exelotl> In reply to @Avatarfighter "<@!90614688374624256> those docs look": thanks :)
19:36:09FromDiscord<exelotl> I just realised the anchor format changed so now none of the links in the tables take you to the right part of the page 🤦
19:36:33FromDiscord<exelotl> or at least some of them don't
19:36:37FromDiscord<exelotl> maybe they were always wrong
19:37:09FromDiscord<exelotl> or I just broke them myself
19:53:23FromDiscord<treeform> In reply to @ElegantBeef "Especially in treeforms case": Yep fidget left, pixie left, typography left, css left, html cavas left, svg left etc... so many variations left right top bottom center middle... enums!
19:53:49FromDiscord<ElegantBeef> Yea, i really like the implications of the tests, but CI issues galore
19:54:06*reversem3 quit (Ping timeout: 245 seconds)
19:54:31*Clonkk[m] quit (Ping timeout: 245 seconds)
19:54:56*FlammableDuck[m] quit (Ping timeout: 245 seconds)
19:54:56*jaens[m] quit (Ping timeout: 245 seconds)
19:55:40*Clonkk[m] joined #nim
19:55:46*lnxw37d4 quit (Ping timeout: 245 seconds)
19:55:47*FlammableDuck[m] joined #nim
19:55:54*jaens[m] joined #nim
19:56:18*reversem3 joined #nim
19:56:20FromDiscord<ElegantBeef> If interested in what it currently enables https://github.com/beef331/Nim/blob/sillyinfercase/tests/inference/tinference.nim
19:57:00*lnxw37d4 joined #nim
19:59:41*natrys quit (Ping timeout: 240 seconds)
20:01:35FromDiscord<treeform> In reply to @ElegantBeef "If interested in what": This is exactly what I need.
20:02:20FromDiscord<ElegantBeef> And i need my sanity to get it to pass the CI šŸ˜›
20:03:47FromDiscord<jtiai> Is there some size limit for `seq`?
20:04:13*narimiran quit (Ping timeout: 252 seconds)
20:04:34FromDiscord<jtiai> Since I'm trying to do:↵`var data: seq[uint8] = newSeq[uint8](65536)`
20:04:48FromDiscord<jtiai> But data ends up begin just `[]`
20:06:23FromDiscord<ElegantBeef> Are you sure? https://play.nim-lang.org/#ix=3ll5
20:07:25FromDiscord<jtiai> Yep...
20:07:36FromDiscord<jtiai> Wonder why it doesn't work in my code.
20:08:54FromDiscord<jtiai> Hmm...
20:08:59FromDiscord<jtiai> Okay...
20:12:18FromDiscord<jtiai> 0-65535 0 where s=0, e=65535 but why e - s + 1 is 0 ? Does nim do some magic and assumes all are 16 bit unsigned numbers and rolls over?
20:12:50*natrys joined #nim
20:13:17FromDiscord<ElegantBeef> is e a u16?
20:13:27FromDiscord<jtiai> both e and s.
20:13:54FromDiscord<ElegantBeef> Well there you go, uints overflow
20:14:53FromDiscord<ElegantBeef> !eval echo 255u8 + 1u8
20:14:56NimBot0
20:15:30FromDiscord<jtiai> Is there shortuct to say (e - s + 1) should be evaluated all as u32?
20:15:51FromDiscord<ElegantBeef> `(e.uint32 - s.uint32 + 1)`
20:18:06FromDiscord<dain> sent a code paste, see https://play.nim-lang.org/#ix=3ll8
20:18:16FromDiscord<dain> (edit) "https://play.nim-lang.org/#ix=3ll8" => "https://play.nim-lang.org/#ix=3ll9"
20:18:37FromDiscord<dain> from the book: https://media.discordapp.net/attachments/371759389889003532/837422639931981854/unknown.png
20:18:46FromDiscord<dain> https://media.discordapp.net/attachments/371759389889003532/837422679102455888/unknown.png
20:19:27FromDiscord<Solitude> `echo client[]`
20:19:38FromDiscord<Solitude> you have to dereference reference types before echoing
20:20:24FromDiscord<ElegantBeef> This isnt addressed here but if you havent seen this already https://deepakg.github.io/nim/2019/09/28/nim-in-action-errata.html
20:21:11*natrys quit (Ping timeout: 240 seconds)
20:24:39FromDiscord<dain> In reply to @Solitude "`echo client[]`": ah thank you :)
20:24:40FromDiscord<dain> that worked
20:26:21*vicfred quit (Quit: Leaving)
20:26:42FromDiscord<dain> so was that added to the language after the book came out?
20:28:39FromDiscord<ElegantBeef> Probably removed after yes
20:28:47FromDiscord<Solitude> no, something was probably removed, this could work only if there was default `$` for reference types, but i dont remember that
20:29:28FromDiscord<ElegantBeef> when you pass a type to `echo` it invokes that types `$` procedure, which the system doesnt define for reference types since it can end badly if you have recursive types
20:30:09FromDiscord<ElegantBeef> Atleast i imagine that's the reason why, plus you generally want your own `$` to give a specific output
20:31:36FromDiscord<dain> oh I see, just after that part it says that it will fail compilation because we havent defined a `$` method
20:31:45FromDiscord<dain> and then proceeds to do so
20:31:52FromDiscord<ElegantBeef> Lol
20:32:07FromDiscord<ElegantBeef> Well there you go that's why it failed
20:32:37FromDiscord<dain> ya
20:32:38FromDiscord<dain> thankyou
20:36:52*natrys joined #nim
20:46:47*natrys quit (Quit: natrys)
20:59:36FromDiscord<dom96> lol
21:00:06FromDiscord<dom96> You should use this in case you run into similar situations: https://github.com/dom96/nim-in-action-code
21:00:34FromDiscord<dom96> https://github.com/dom96/nim-in-action-code/blob/master/Chapter3/ChatApp/src/server.nim#L18
21:22:07*thomasross joined #nim
22:13:57*Vladar quit (Quit: Leaving)
22:29:14*wasted_youth2 quit (Read error: Connection reset by peer)
22:29:37*wasted_youth2 joined #nim
22:50:01*ubq323 joined #nim
22:56:23*ubq323 quit (Quit: WeeChat 2.3)
23:08:07*Gustavo6046 quit (Ping timeout: 252 seconds)
23:14:53*Gustavo6046 joined #nim
23:16:37FromDiscord<mattrb> sent a long message, see http://ix.io/3llO
23:19:22FromDiscord<ElegantBeef> if instead of bindsym you did `dotexpr(ident"thumb", nnkCall(ident"softwareInterrupt")` it'd override that
23:19:54FromDiscord<ElegantBeef> the bind sym is a bit odd since you dont use it as a sym
23:21:28FromDiscord<mattrb> Does nnkCall allow for generic args?
23:22:31FromDiscord<ElegantBeef> Well yea it's nim ast afterall https://play.nim-lang.org/#ix=3llR
23:23:36FromDiscord<ElegantBeef> Unless you're using the sym as a sym there isnt any reason to bind it
23:24:18FromDiscord<mattrb> Ah interesting, good to know
23:24:25FromDiscord<mattrb> I'm definitely still a noob with nim macros
23:24:55FromDiscord<ElegantBeef> sym's are semantically checked identifiers, so you can see their impls and get data from it
23:25:06FromDiscord<mattrb> Also interesting, _just_ changing `bindSym` with `ident` seems to solve this in this case haha. Guess I just don't actually understand what bindSym does
23:25:08FromDiscord<ElegantBeef> As you're just making proc calls it's pretty much not needed
23:25:32FromDiscord<ElegantBeef> Bindsym forces lookup of a string or identifier to get all valid symbols
23:25:59FromDiscord<mattrb> Does it do that with modules that aren't in scope?
23:26:08FromDiscord<ElegantBeef> It shouldnt
23:26:51FromDiscord<mattrb> Since `macros.nim` doesn't import `thumb.nim` or `arm.nim`, and neither of those import eachother, I'm confused why it was getting the wrong `softwareInterrupt` anyway..
23:27:24FromDiscord<ElegantBeef> It probably was resolving in the call scope
23:28:48FromDiscord<mattrb> But if thumb.nim imports macros.nim (where `call` lives), and macros.nim doesn't import anything, how would the bind in thumb.nim be resolving to the `softwareInterrupt` in arm.nim?
23:29:12FromDiscord<ElegantBeef> No clue
23:29:25FromDiscord<ElegantBeef> I'm just going to say it makes sense if you dont think about it
23:37:04FromDiscord<mattrb> Works for me lol
23:37:05FromDiscord<mattrb> Thanks for the help
23:40:25leorizebindSym bound all symbols present at the scope of the macro
23:40:48leorizethere is a flag that makes it bind that plus symbols at the scope of the macro expansion
23:50:19*vicfred joined #nim