<< 27-01-2021 >>

00:00:14disruptekcast it from your mind, never to return.
00:01:12FromDiscord<Clyybber> not yet, saem was interested too
00:02:14FromDiscord<Clyybber> saem do you have a concrete usecase? It seems nice in general, but I have to confess that I never encountered a situation where Id need it
00:02:47FromDiscord<Clyybber> and eventually TM it should be really easy to walk up the AST once we switch to PackedAST
00:10:41*asdflkj joined #nim
00:12:57saemClyybber, the two things was thinking of immediately: 1. IDE injecting macros that use that information for inspections and hints above and beyond the compiler, 2. Programmers or teams that wish to add project development/engineering rules as macros.
00:15:01saem"X is only used here, but you declare it in a wider scope, shrink the lifetime by moving it." That type of inspection, assume for the sake of the argument that's something the compiler doesn't want to do globally.
00:15:51*Q-Master quit (Read error: Connection reset by peer)
00:15:57*Q-Master joined #nim
00:21:08*oddp joined #nim
00:37:13*Guest62103 quit (Quit: Guest62103)
00:37:45*Guest62103 joined #nim
01:12:04*Tanger joined #nim
01:24:51*a_chou joined #nim
01:31:15*leorize quit (Ping timeout: 268 seconds)
01:37:29*Guest62103 quit (Quit: Guest62103)
01:40:18*krux02 quit (Remote host closed the connection)
01:53:02*oddp quit (Quit: quit)
02:10:03disruptekclyybber: what's the point of talking about package management with people who don't use packages? with no practical experience, such a person has to weigh complaints against indifferent acceptance of the status quo. of course i look like a lunatic; i'm the passionate outlier.
02:10:39disruptekit's same when talking about compiler quality. yeah, no thanks. do what you want. i will stick to my own code where i can cast blame without looking like a prick.
02:13:25*oddp joined #nim
02:16:42*asdflkj quit (Ping timeout: 272 seconds)
02:19:31*abm quit (Quit: Leaving)
02:26:11*a_chou quit (Ping timeout: 272 seconds)
02:28:08*NimBot joined #nim
02:35:27disruptekhow long is this rune? ⚫
02:35:44disruptekhow about this one? ⏺ or ●?
02:37:14*oddp quit (Quit: quit)
02:37:16*wasted_youth quit (Quit: Leaving)
03:06:02*muffindrake quit (Ping timeout: 264 seconds)
03:07:08saemFirst two are big characters, and the last one is a simple bullet point... ?
03:07:32*muffindrake joined #nim
03:09:57disruptekie. two characters wide?
03:10:42*leorize joined #nim
03:15:58*lritter joined #nim
03:25:22saemYeah
03:59:04*rockcavera quit (Remote host closed the connection)
04:07:54*spiderstew_ joined #nim
04:08:31*ee7[m] quit (*.net *.split)
04:08:45*koltrast quit (*.net *.split)
04:08:45*k0mpjut0r quit (*.net *.split)
04:08:45*silvernode[m] quit (*.net *.split)
04:08:48*planetis[m] quit (*.net *.split)
04:08:48*Avahe[m] quit (*.net *.split)
04:08:53*spiderstew quit (Ping timeout: 272 seconds)
04:15:02*koltrast joined #nim
04:15:02*k0mpjut0r joined #nim
04:15:02*silvernode[m] joined #nim
04:15:02*planetis[m] joined #nim
04:15:02*Avahe[m] joined #nim
04:20:24*Zoom[m] quit (Ping timeout: 246 seconds)
04:20:24*BauxnaMatrix[m] quit (Ping timeout: 246 seconds)
04:20:24*Clonkk[m] quit (Ping timeout: 246 seconds)
04:20:24*himup[m] quit (Ping timeout: 246 seconds)
04:20:24*Avatarfighter[m] quit (Ping timeout: 246 seconds)
04:20:25*reversem3 quit (Ping timeout: 246 seconds)
04:20:25*stisa[m] quit (Ping timeout: 246 seconds)
04:20:26*GitterIntegratio quit (Ping timeout: 246 seconds)
04:20:26*cadmium[m] quit (Ping timeout: 240 seconds)
04:20:27*William[m]1 quit (Ping timeout: 240 seconds)
04:20:29*jaens[m] quit (Ping timeout: 240 seconds)
04:20:33*cmc[m] quit (Ping timeout: 248 seconds)
04:20:33*Juno[m] quit (Ping timeout: 248 seconds)
04:20:35*lytedev[m] quit (Ping timeout: 248 seconds)
04:20:36*matthias[m] quit (Ping timeout: 248 seconds)
04:20:45*MTRNord quit (Ping timeout: 246 seconds)
04:20:48*dilawar_uchiha[m quit (Ping timeout: 265 seconds)
04:20:48*awici[m] quit (Ping timeout: 265 seconds)
04:20:50*j-james[m] quit (Ping timeout: 265 seconds)
04:20:50*Kurre[m] quit (Ping timeout: 265 seconds)
04:20:50*BitPuffin quit (Ping timeout: 265 seconds)
04:20:50*leorize[m] quit (Ping timeout: 265 seconds)
04:20:54*k0mpjut0r quit (Ping timeout: 258 seconds)
04:20:54*silvernode[m] quit (Ping timeout: 258 seconds)
04:20:56*codic quit (Ping timeout: 260 seconds)
04:20:56*vindaar[m] quit (Ping timeout: 260 seconds)
04:20:57*planetis[m] quit (Ping timeout: 258 seconds)
04:20:57*Avahe[m] quit (Ping timeout: 258 seconds)
04:20:59*unclechu quit (Ping timeout: 260 seconds)
04:21:20*lnxw37d4 quit (Ping timeout: 268 seconds)
04:21:21*VijayMarupudi[m] quit (Ping timeout: 272 seconds)
04:45:10*reversem3 joined #nim
04:46:01*ee7[m] joined #nim
04:46:42*Zoom[m] joined #nim
04:46:42*himup[m] joined #nim
04:46:42*Avatarfighter[m] joined #nim
04:46:54*Clonkk[m] joined #nim
04:48:34*jaens[m] joined #nim
04:48:37*cadmium[m] joined #nim
04:49:49*stisa[m] joined #nim
04:49:52*BauxnaMatrix[m] joined #nim
04:50:30*cmc[m] joined #nim
04:51:13*codic joined #nim
04:51:13*vindaar[m] joined #nim
04:54:23*cmc[m] quit (*.net *.split)
04:54:23*BauxnaMatrix[m] quit (*.net *.split)
04:54:23*Avatarfighter[m] quit (*.net *.split)
04:55:00*dilawar_uchiha[m joined #nim
04:55:01*awici[m] joined #nim
04:55:02*j-james[m] joined #nim
04:55:28*matthias[m] joined #nim
04:57:06*cmc[m] joined #nim
04:57:06*BauxnaMatrix[m] joined #nim
04:57:06*Avatarfighter[m] joined #nim
04:57:13*Avatarfighter[m] quit (Changing host)
04:57:13*Avatarfighter[m] joined #nim
04:57:14*BauxnaMatrix[m] quit (Changing host)
04:57:14*BauxnaMatrix[m] joined #nim
04:57:14*cmc[m] quit (Changing host)
04:57:15*cmc[m] joined #nim
05:00:38*matthias[m] quit (Ping timeout: 246 seconds)
05:00:42*cmc[m] quit (Ping timeout: 244 seconds)
05:00:47*reversem3 quit (Ping timeout: 258 seconds)
05:00:55*codic quit (Ping timeout: 265 seconds)
05:00:56*Clonkk[m] quit (Ping timeout: 240 seconds)
05:01:00*Zoom[m] quit (Ping timeout: 246 seconds)
05:01:00*himup[m] quit (Ping timeout: 246 seconds)
05:01:04*jaens[m] quit (Ping timeout: 260 seconds)
05:01:04*j-james[m] quit (Ping timeout: 240 seconds)
05:01:09*stisa[m] quit (Ping timeout: 258 seconds)
05:01:13*BauxnaMatrix[m] quit (Ping timeout: 244 seconds)
05:01:13*Avatarfighter[m] quit (Ping timeout: 244 seconds)
05:01:21*ee7[m] quit (Ping timeout: 246 seconds)
05:01:32*awici[m] quit (Ping timeout: 260 seconds)
05:01:32*dilawar_uchiha[m quit (Ping timeout: 258 seconds)
05:03:51*vindaar[m] quit (Ping timeout: 268 seconds)
05:03:51*cadmium[m] quit (Ping timeout: 268 seconds)
05:07:10*a_chou joined #nim
05:07:56*a_chou quit (Remote host closed the connection)
05:24:09*vicfred quit (Quit: Leaving)
05:24:16*Gustavo6046 quit (Ping timeout: 240 seconds)
05:26:52saemyay, I got a 32 bit nimsuggest built
05:27:24*saem pats himself on the back
05:27:42disruptekisn't it built in the nightlies?
05:28:08saemmebbe
05:28:24saemBut I need the one in my branch for testing
05:29:42*Gustavo6046 joined #nim
05:29:59disruptekwas it really that tricky?
05:30:20saemIt was awkward to figure out what was wrong.
05:30:44saemUnfamiliar, misunderstood the error messages, all that jazz
05:30:55disrupteksounds like my first time with a shemale.
05:31:16saemI don't think they have error messages.
05:31:25disruptekyou'd be surprised.
05:31:32saemI probably would be
05:32:08disrupteki just replaced an entire library with 40 lines of code.
05:32:50disruptekeh 50.
05:33:27saemHow's it feel?
05:34:11disruptekmarginal.
05:35:09disrupteklooks cool though.
05:36:35disruptekhttps://github.com/disruptek/balls/runs/1774567768#step:4:853
05:37:12saemthat does look cool
05:37:20disruptekthe lib was only a couple hundred lines. 😁
05:37:50saemThe thing I was missing was this: https://forum.nim-lang.org/t/2519 for the cross-compiling. Didn't know about -t and -l with -m32
05:38:45disruptekwhat the hell are those?
05:38:59disruptekoh, just shortcuts.
05:39:13disruptekthat makes sense.
05:39:56saemnot to me at the time
05:40:26*Juno[m] joined #nim
05:41:05*MTRNord joined #nim
05:41:14*VijayMarupudi[m] joined #nim
05:41:20*Kurre[m] joined #nim
05:41:24*leorize[m] joined #nim
05:42:32saemhuh, i wonder if I'm running into some weird limitation with 32 bits, strings or regex or something.
05:42:52saemI know I can disable the test, but I'm kinda curious.
05:42:54leorizeyou can also sum it up as 32-bit nim being untested
05:42:58disruptekit fails in ci, right?
05:44:01saemYeah, it does
05:44:08saemFails locally too
05:44:15*William[m]1 joined #nim
05:44:19disrupteki can't find the ci on 'hub.
05:44:36saemhttps://dev.azure.com/nim-lang/255dfe86-e590-40bb-a8a2-3c0295ebdeb1/_apis/build/builds/12503/logs/118
05:44:45disruptekthanks.
05:44:50saem`2021-01-26T05:17:35.1283906Z Test /home/vsts/work/1/s/nimsuggest/tests/tsug_regression.nim` <--- that line
05:45:30leorizethe expected line looks very weird
05:45:52*lnxw37d4 joined #nim
05:46:20saemOh the `*` does a swap with a `(.*)` basically.
05:47:09saemhttps://github.com/nim-lang/Nim/blob/devel/nimsuggest/tester.nim#L145
05:47:29saemThat line shows the smartCompare which does the whole regex bit
05:48:16leorize32bit libpcre can be kinda weird
05:48:21leorizemaybe swap it with pegs?
05:48:33saemAh! I was wondering
05:48:39disruptekthat sounds like a pita.
05:48:50disruptekbut also the right move long-term.
05:49:57saemare the two surface level compatible? AFAIK, the regex usage is pretty basic.
05:50:28leorizethe test system uses ubuntu, which should compile their libpcre the same way for the 32bit and 64bit versions...
05:50:31saemoh wait...
05:50:32saemdamn
05:50:48*lytedev[m] joined #nim
05:50:52saemI started reading pegs, it's a whole _thing_
05:50:56*Avahe[m] joined #nim
05:51:41disruptekyes, and unfortunately, npeg isn't in the stdlib.
05:51:52saemwhat about jpeg?
05:51:57leorizetestament uses pegs for parsing compiler output if you wanna look at it
05:51:57disruptekthat might work.
05:52:20saemmpeg, we got any mpeg?
05:52:35disruptekhell, there's even mjpeg.
05:52:38saemYeah, that might be doable.
05:52:43disruptekopengl here?
05:53:02saemmopengl
05:53:18saemok, I'll take a quick peak at testament
05:53:33disruptek...4hrs later...
05:53:43saemspoilers!
05:54:00disruptekit's not that bad, actually.
05:55:43saemactually, pegs might be pretty easy?
05:55:56saemit's all in the smartcompare proc
05:58:10*lritter quit (Quit: Leaving)
05:59:02*planetis[m] joined #nim
05:59:03*vicfred joined #nim
05:59:07*BitPuffin joined #nim
05:59:24*lritter joined #nim
06:00:43*k0mpjut0r joined #nim
06:00:43*silvernode[m] joined #nim
06:04:50*unclechu joined #nim
06:04:53*BauxnaMatrix[m] joined #nim
06:04:53*cmc[m] joined #nim
06:04:54*Avatarfighter[m] joined #nim
06:05:03*himup[m] joined #nim
06:05:04*ee7[m] joined #nim
06:05:06*matthias[m] joined #nim
06:08:02*jaens[m] joined #nim
06:08:20*awici[m] joined #nim
06:11:05*dilawar_uchiha[m joined #nim
06:11:07*stisa[m] joined #nim
06:11:23*reversem3 joined #nim
06:14:50*Zoom[m] joined #nim
06:15:28*habamax joined #nim
06:16:25*codic joined #nim
06:17:11*Clonkk[m] joined #nim
06:17:55*vindaar[m] joined #nim
06:17:57*cadmium[m] joined #nim
06:19:09*j-james[m] joined #nim
06:25:06saemnope, not easy
06:25:39disrupteki want a service where i give you a 32/64-bit value and you give me an ai-generated face.
06:25:49disruptekie. the same one given the same value.
06:25:58saemno
06:26:04disruptekno?
06:26:07saemyes, no
06:26:15disruptekno, yes.
06:26:19disrupteki do want that thing.
06:26:22saemno
06:26:26disruptekno?
06:26:33saemyes, no
06:26:35disruptekZevv: right?
06:27:01disruptekwell, i guess i can settle for robots or whatever.
06:28:31disruptekhttps://robohash.org/
06:28:42saemthat's pretty great
06:29:04disruptekyeah, i will use this for my tierra organisms.
06:30:22saemTMI
06:30:38disruptekbut i'd prefer humans.
06:32:41saemI'm glad you don't discriminate.
06:32:49disruptekhumans are tastier.
06:32:54disruptekmore memorable.
06:32:59disruptekthat's what i meant.
06:43:49*waleee-cl quit (Quit: Connection closed for inactivity)
06:52:36saemhmm, y no wrk? https://play.nim-lang.org/#ix=2NrN
06:53:27saemIt's because it's hex isn't it and it wants digits.
06:59:46*krux02 joined #nim
07:00:12Zevvwhat he says
07:12:09ForumUpdaterBotNew post on r/nim by imdadadani: Nimgram, An MTProto client in Nim, see https://www.reddit.com/r/nim/comments/l5yu1g/nimgram_an_mtproto_client_in_nim/
07:14:01*narimiran joined #nim
07:47:11saemoh wow, I didn't expect that, so the failure is because there is in fact a very subtle difference in the returned suggestions.
07:47:24saem"very subtle"
07:54:21*PMunch joined #nim
08:04:38saemWell that should be working for now, PR updated.
08:05:09saemI'll go back to checking on debugging that nimsuggest crash tomorrow -- hopefully.
08:19:46PMunch@treeform, you around?
08:26:10*habamax left #nim (#nim)
08:59:38PMunchHmm, is `now()` from the times module broken on 32-bit systems? http://ix.io/2Nsc
09:01:45PMunchIt works sometimes, but sometimes it fails like that
09:03:45*MyMind quit (Ping timeout: 240 seconds)
09:11:14*Tanger quit (Quit: Leaving)
09:29:11*MyMind joined #nim
09:34:19*MyMind quit (Ping timeout: 272 seconds)
09:49:12*abm joined #nim
10:23:41*Vladar joined #nim
10:39:41ForumUpdaterBotNew thread by Drkameleon: Performance impact of unused ref-object fields?, see https://forum.nim-lang.org/t/7440
10:55:38PMunchIs there a blocking version of `recv` for channels that has a timeout?
11:02:10PMunchI don't want to peg my thread at 100% by doing tryRecv in a loop but I also don't want to lock it completely with recv
11:02:42PMunchHmm, maybe with ARC I could have two separate threads doing this
11:04:56FromGitter<Araq> you can use os.sleep inside your tryRecv busy loop
11:05:59PMunchThat's what I'm doing now, but I'm anxious that it blocks my thread for too long
11:06:12PMunchWe have some performance issue with this code
11:06:24FromGitter<Araq> the usual logic is an expontential back-off
11:06:36FromGitter<Araq> like you sleep for 1ms, then for 2, 4, 8 etc
11:07:04FromGitter<Araq> so in the worst case you sleep for twice as long as you needed to, on average. Or something like that...
11:08:43PMunchI guess that would be better at least
11:23:32*wasted_youth joined #nim
12:24:52FromGitter<dom96> looks like Discord bridge is down
12:25:32PMunchThat explains why it's been so quiet today :P
12:26:45FromGitter<dom96> btw what you can do PMunch is use AsyncEvents to signal that your channel has data
12:27:41PMunchHmm, how would that work?
12:28:54FromGitter<dom96> on send signal the AsyncEvent
12:29:01*FromDiscord joined #nim
12:29:18FromDiscord<Yardanico> should be up now
12:29:21FromGitter<dom96> depending on what you're doing you could also just use sockets :D
12:29:56FromDiscord<dom96> Yeah. Systemd can also restart it if it crashes
12:40:40FromDiscord<Meowz> Is there a nim equivalent to python's `setattr`? So I could manually set keys to an object?
12:41:34FromDiscord<haxscramper> you can write a macro that accepts `static[string]`, or iterate over all fields using `fieldPairs()`
12:41:34FromDiscord<konsumlamm> umm
12:41:49FromDiscord<konsumlamm> why exactly do you feel something like `setattr` is necessary?
12:42:07FromDiscord<haxscramper> But you need to either have type erasure or make sure all fields have identical types
12:42:09FromDiscord<konsumlamm> objects in nim aren't represented as hashmaps, unlike in python
12:42:40FromDiscord<Meowz> I'm parsing a json file and I don't want to be able to use the `json.key` syntax instead of `json["key"]`
12:42:51FromDiscord<Meowz> (edit) removed "be able to"
12:42:59FromDiscord<mratsim> @Meowz https://github.com/status-im/nim-cookbook/blob/master/dynamic_approximating_dynamic_types.nim
12:43:00FromDiscord<Meowz> (edit) removed "don't"
12:43:06FromDiscord<lqdev> https://nim-lang.org/docs/manual_experimental.html#special-operators-dot-operators
12:43:51FromDiscord<konsumlamm> or make a template or something that generates a `key` proc that you can then use with the MCS?
12:47:53PMunchOr use jsonschema
12:49:48*sagax quit (Remote host closed the connection)
12:52:48*lritter quit (Quit: Leaving)
13:04:07*sagax joined #nim
13:14:56*rockcavera joined #nim
13:18:27*oddp joined #nim
13:22:12FromDiscord<Meowz> Thanks `{.experimental: "dotOperators".}` did it. Isn't there a template in `json` which automatically parses `JsonNode` into Nim types? I could check the `JsonKind` in the dot template and return the correct type but that would break nested usage. https://play.nim-lang.org/#ix=2Nt5
13:23:37FromDiscord<Meowz> Sorry, wrong keys in that code
13:24:38FromDiscord<Meowz> (edit) Thanks `{.experimental: "dotOperators".}` did it. Isn't there a template in `json` which automatically parses `JsonNode` into Nim types? I could check the `JsonNodeKind` in the dot template and return the correct type but that would break nested usage. https://play.nim-lang.org/#ix=2Nt5
13:25:07PMunchWell that would require you JSON to be known on compile-time
13:25:11FromDiscord<haxscramper> https://nim-lang.org/docs/marshal.html
13:25:12PMunchBut it's certainly possible
13:33:37FromDiscord<exelotl> @Meowz there's also https://github.com/treeform/jsony
13:40:46*dddddd_ is now known as dddddd
13:42:49FromDiscord<lqdev> @Meowz there's `json.to` and the `jsonutils` module
13:47:57FromDiscord<mratsim> There is an ongoing competition to create more json serializers
13:51:58FromDiscord<Meowz> Unmarshalling into a object is weird imo because it's a big json response. I would need a object with 500 lines. I'm just wondering since `js.signatures.foo.kind` is returning `JInt` why they aren't parsed directly into `int`
13:52:26*cheatfate joined #nim
13:52:31FromDiscord<Meowz> I need to call `getInt` instead for every key
13:52:51*cheatfate left #nim ("Leaving")
13:53:15FromDiscord<lqdev> make a converter
13:53:29FromDiscord<lqdev> the problem is that it's not returning JInt
13:53:31FromDiscord<lqdev> rather JsonNode
13:53:34FromDiscord<lqdev> with the kind JInt
13:53:47FromDiscord<lqdev> so uh, even a converter won't help you in that case
13:58:21FromDiscord<hamidb80> Is there anyway to catch an error with its details?
13:59:51FromDiscord<hamidb80> raise newException(ValueEror, `file name is wrong`)
14:01:00FromDiscord<hamidb80> For example in cpp we use e.what() in order to get the error message
14:01:11FromDiscord<hamidb80> (edit) Is there anyway to catch an error with its message?
14:01:22FromDiscord<Meowz> `getCurrentExceptionMsg()` ?
14:02:04FromDiscord<haxscramper> `except Error as err: echo err.msg`
14:02:19FromDiscord<Meowz> oh thats even better
14:02:40FromDiscord<haxscramper> (edit) "Error" => "ValueError"
14:03:25FromDiscord<Meowz> would `except Exception as err` catch all exceptions btw?
14:03:38FromDiscord<hamidb80> I didnt see these examples on documentations
14:03:55FromDiscord<haxscramper> IIRC you need to use `CatchableError` to get all non-defect exceptions
14:30:32*evbo quit (Remote host closed the connection)
14:31:51*evbo joined #nim
14:32:24FromDiscord<konsumlamm> two questions about nimble: can i set a directory for the build artifacts? and how can i pass compiler options (like `-d:release`) to `nimble run`?
14:34:40FromDiscord<sealmove> can iterators be closures?
14:34:45FromDiscord<Rika> yes
14:34:50FromDiscord<Rika> to sealmove
14:34:55FromDiscord<sealmove> I get "current routine cannot return an expression"
14:35:12FromDiscord<Rika> well are you yielding or returning because i believe it cant return?
14:35:28FromDiscord<sealmove> yield
14:35:46FromDiscord<Rika> uhh i think this is the point i ask if i can see the code
14:37:30FromDiscord<sealmove> also I wonder if there is a simpler way for this
14:37:32FromDiscord<sealmove> sent a code paste, see https://play.nim-lang.org/#ix=2Ntt
14:38:08FromDiscord<sealmove> essentially I just want a shuffled range
14:38:49FromDiscord<Meowz> random has shuffle - if thats what you need
14:39:50FromDiscord<konsumlamm> @sealmove you forgot the yield type, the first line needs to be `iterator nextNum(): int =`
14:40:01FromDiscord<sealmove> ohhh thanks
14:40:17FromDiscord<konsumlamm> (if you dont specify a yield type, `void` is assumed, that's why the compiler says "cannot return an expression")
14:40:23FromDiscord<sealmove> haven't written nim for some weeks and I'm already forgetting basics :|
14:42:12PMunch@sealmove, did you see that I pinged you on GitHub?
14:42:15FromDiscord<Rika> itll come back over time
14:42:28FromDiscord<sealmove> PMunch no, hold on, I'll check now
14:43:10FromDiscord<konsumlamm> reposting in case someone knows now:
14:43:21FromDiscord<konsumlamm> two questions about nimble: can i set a directory for the build artifacts? and how can i pass compiler options (like `-d:release`) to `nimble run`?
14:44:54FromDiscord<haxscramper> IIRC `bindir` for build artifacts, just pass `-d:release` for nim run
14:45:00FromDiscord<haxscramper> Or put this in `nim.cfg`
14:45:54FromDiscord<Rika> note: not in project cfg
14:46:07FromDiscord<konsumlamm> just passing the compiler options doesnt seem to work for `nimble run` (but appears to work for `nimble build`...)
14:46:53FromDiscord<konsumlamm> wdym with `bindir`? add that to the `.nimble` file?
14:49:16FromDiscord<lqdev> i think they meant --bindir
14:49:33FromDiscord<haxscramper> https://github.com/nim-lang/nimble/blob/master/readme.markdown#optional
14:49:50FromDiscord<haxscramper> I meant RTFM on `bindir = "your/directory"`
14:50:18FromDiscord<sealmove> @PMunch when `l` is specified I use `readDataLE`/`writeDataLE`, but I didn't write or audit those procs.
14:51:11FromDiscord<konsumlamm> thx
14:51:28FromDiscord<sealmove> https://github.com/PMunch/binaryparse/blob/master/binaryparse.nim#L322↵https://github.com/PMunch/binaryparse/blob/master/binaryparse.nim#L415
14:56:12PMunchHmm, so you're saying it's my fault then..
14:56:19PMunchI was afraid of that
14:56:59FromDiscord<sealmove> Maybe you made an assumption about system's endianness in those procs?
14:58:06PMunchThey look pretty sane: https://github.com/PMunch/binaryparse/blob/master/binaryparse.nim#L117-L139
14:59:49FromDiscord<konsumlamm> hmm, i suppose `nimble run` "ignores" options because t passes everything to the executable... would be nice to be able to do `nimble run <compiler options> -- <executable options>`
15:00:36FromDiscord<sealmove> But `readData`/`writeData` use system's endianness, which can be either LE or BE. You are not checking whether you need to reverse order or not.
15:01:07PMunchThose are the lower level ones that take a pointer and a count of bytes
15:02:39PMunchAnd those loops loop over the bytes of the data in the right order
15:03:04FromDiscord<sealmove> I mean, for example in `readDataBE` you are reversing the order of bytes, while if the system is BE you shouldn't
15:03:16PMunchOoh, that's a good point
15:03:46PMunchBut that still shouldn't fail on the same machine though..
15:07:15*PMunch quit (Quit: leaving)
15:08:06FromDiscord<sealmove> stdlib's `WriteData` might reverse the order relative to binaryparse's perspective or not, depending on system's endianness, so maybe it can fail on same machine because of it? not 100%, a bit confused :S
15:08:26FromDiscord<sealmove> writeData sorry
15:10:56FromDiscord<sealmove> hmm, you are probably right, if it wrongly reverses bytes while reading, it will re-reverse them while writing, so it should not fail the read-write test.
15:11:22FromDiscord<sealmove> it is still wrong though because the value read will be wrong
15:19:17*waleee-cl joined #nim
15:19:28*ryanhowe quit (Quit: ZNC 1.8.2 - https://znc.in)
15:30:23FromDiscord<haxscramper> I finally got callgraph (somewhat) working for sourcetrail - https://media.discordapp.net/attachments/371759389889003532/804010422595223593/unknown.png
15:32:41FromDiscord<haxscramper> At least it doesn't die when parsing whole compiler at once
15:34:08FromDiscord<sealmove> hmm, every time I run my program shuffle uses the same seed
15:34:52FromDiscord<konsumlamm> thats the intended behaviour
15:35:16FromDiscord<sealmove> yeah, just read in docs... though it's kind of surprising
15:35:46FromDiscord<lqdev> it's not really surprising considering that the random state is initialized with zeroes `i think` like all globals really
15:36:41saemMorning
15:36:46FromDiscord<konsumlamm> anyone wanna review a short PR of mine? https://github.com/nim-lang/Nim/pull/16824
15:36:47disbotImprove documentation for the mersenne module
15:37:35FromDiscord<carpal> cool
15:37:42saemBum, CI still had an issue... But looks like maybe it's fidget.
15:51:00saemEverytime I see the Mersenne module come up I think to myself one day I'll write a property based testing framework.
16:01:00leorize[m]or just use disruptek's balls :p
16:05:09saemleorize[m]: those run tests mostly, I need reporting on an asserted property and generators.
16:05:55leorize[m]so you mean you wanna test the randomness
16:06:15FromDiscord<konsumlamm> property testing is pretty cool
16:07:03saemIt's very 😎
16:07:05FromDiscord<konsumlamm> you specify a property and then that property is tested for a bunch of different imports
16:07:54FromDiscord<mratsim> property testing is life
16:08:24saemYup, needs some tweaks to test runner to report on that properly, as a single invocation of a function or whatever isn't a single test anymore. That's rather minor.
16:08:51saemThe generators and moreover the commission of them and some quality of life gets are where it's at.
16:09:18FromDiscord<mratsim> I have found many bugs with property testing and skewed RNG https://github.com/mratsim/constantine/blob/master/tests/t_fp_tower_template.nim#L267-L457
16:09:22saemUgh, damn phone
16:09:41saemComposition of them and quality of life features
16:09:55FromDiscord<mratsim> the issue in bigint is that most of the interesting bugs occur in the carry code which has 2^-64 chance of being triggered
16:10:16FromDiscord<mratsim> so naive property-based testing (or fuzzing) doesn't find those.
16:10:39saemOne day I'll get around to writing something inspirited by fast check (typescript) and kotest (kotlin).
16:11:50saemOh man, mratsim I was curious to know if you'd seen the extensions to property based testing that result in model testing?
16:13:22saemI thought it'd be a neat companion to synthesis, one day when I get some more time.
16:13:48FromDiscord<konsumlamm> seems like those are based on Haskell's QuickCheck
16:13:55saemI actually would love to use PBT to generate Nim programs for compiler testing.
16:14:09saemYeah, that's the lineage
16:15:01saemPython folks might be more familiar with hypothesis, which isn't _that_ different
16:15:31saemKotest's fixed examples woven into generators is really nice quality of life stuff
16:15:45*narimiran quit (Ping timeout: 240 seconds)
16:16:35saemAnd FC model testing is really interesting for testing some of the trickier concurrency and parallelism state machines, like schedulers, etc...
16:17:04saemAnyways, inspiration
16:18:16saemPBT is also pretty brutal way to bring about more algebraic thinking at design time.
16:18:40saemSorry, I get excited about this stuff.
16:19:06FromDiscord<konsumlamm> xd
16:20:59saemI mean, if I'm the only one then I'm spamming after a while. But if others are genuinely interested then that's a worthwhile discussion.
16:21:35FromDiscord<konsumlamm> btw, does anyone know how stable the pattern matching in fusion is?
16:21:47*xet7 joined #nim
16:22:28saemI personally haven't used it, sorry.
16:24:05FromDiscord<haxscramper> It is relatively stable
16:24:21FromDiscord<haxscramper> Well, I tested all possible combinations that I managed to come up with
16:25:21FromDiscord<haxscramper> There is a follow-up PR with some additional fixes, but those are not particularly important - mostly related to documentation/ergonomics. There won't be any API changes
16:25:33FromDiscord<haxscramper> Except for use of view types when they become non-experimental
16:26:15FromDiscord<konsumlamm> nice, gotta try it
16:26:52FromDiscord<haxscramper> I will be finalizing it next week and merging to fusion, so if you have any ideas/suggestions/bugs feel free to ask, or comment on PR - I will try to address it if possible
16:27:20FromDiscord<konsumlamm> will do
16:37:48*kinkinkijkin quit (Read error: Connection reset by peer)
16:37:50*sirn quit (Ping timeout: 264 seconds)
16:37:54*euantorano quit (Ping timeout: 260 seconds)
16:37:54*r4vi quit (Ping timeout: 260 seconds)
16:37:55*fowl quit (Ping timeout: 265 seconds)
16:37:59*mids quit (Read error: Connection reset by peer)
16:38:05*nikki93 quit (Read error: Connection reset by peer)
16:38:05*rayman22201 quit (Read error: Connection reset by peer)
16:38:07*zielmicha__ quit (Read error: Connection reset by peer)
16:38:13*saem quit (Read error: Connection reset by peer)
16:38:14*npgm quit (Read error: Connection reset by peer)
16:38:16*d10n-work quit (Write error: Connection reset by peer)
16:38:17*jholland__ quit (Read error: Connection reset by peer)
16:38:19*Evolver quit (Read error: Connection reset by peer)
16:38:21*sz0 quit (Read error: Connection reset by peer)
16:38:21*waleee-cl quit (Read error: Connection reset by peer)
16:38:21*kwilczynski quit (Read error: Connection reset by peer)
16:38:21*notchris quit (Read error: Connection reset by peer)
16:38:24*jjido quit (Read error: Connection reset by peer)
16:38:25*hoek quit (Write error: Connection reset by peer)
16:39:30*mids joined #nim
16:39:56*npgm joined #nim
16:40:39*hoek joined #nim
16:40:39ForumUpdaterBotNew question by arctic_clerk: Nim use a input in arrays cannot evaluate at compile time, see https://stackoverflow.com/questions/65923453/nim-use-a-input-in-arrays-cannot-evaluate-at-compile-time
16:40:48*euantorano joined #nim
16:40:52*saem joined #nim
16:40:55*nikki93 joined #nim
16:41:08*jjido joined #nim
16:41:43*Adeon quit (Ping timeout: 272 seconds)
16:41:52*sz0 joined #nim
16:42:05*kinkinkijkin joined #nim
16:42:11*rayman22201 joined #nim
16:42:37*notchris joined #nim
16:42:38*jholland__ joined #nim
16:42:58*kwilczynski joined #nim
16:43:51*zielmicha__ joined #nim
16:45:31*fowl joined #nim
16:45:39*euantorano quit (Ping timeout: 264 seconds)
16:47:19*waleee-cl joined #nim
16:50:32*Evolver joined #nim
16:50:44*Adeon joined #nim
16:50:52*r4vi joined #nim
16:55:50*Adeon quit (Ping timeout: 264 seconds)
16:56:07*sirn joined #nim
16:56:45*d10n-work joined #nim
16:57:46*Adeon joined #nim
16:58:35*euantorano joined #nim
17:04:05*natrys joined #nim
17:17:03*oculux quit (Ping timeout: 256 seconds)
17:17:39*r4vi quit (Read error: Connection reset by peer)
17:17:59*Evolver quit (Read error: Connection reset by peer)
17:18:01*d10n-work quit (Read error: Connection reset by peer)
17:18:02*Adeon quit (Read error: Connection reset by peer)
17:18:03*euantorano quit (Read error: Connection reset by peer)
17:19:15*r4vi joined #nim
17:19:36*euantorano joined #nim
17:19:39*Evolver joined #nim
17:19:52*Adeon joined #nim
17:20:16*abm quit (Quit: Leaving)
17:20:18FromDiscord<fwsgonzo> hey guys, I am currently trying to remotely debug a Nim program built for a RISC-V architecture - how can I use the nim-gdb.py script?
17:21:13*d10n-work joined #nim
17:21:30*sz0 quit (Ping timeout: 256 seconds)
17:21:39*fowl quit (Ping timeout: 264 seconds)
17:21:43*sirn quit (Read error: Connection reset by peer)
17:21:49*kwilczynski quit (Write error: Connection reset by peer)
17:26:33*fowl joined #nim
17:26:45ForumUpdaterBotNew thread by HJarausch: Conversion int -> float : what's the rule?, see https://forum.nim-lang.org/t/7441
17:28:22leorizefwsgonzo: you use load-plugin in gdb iirc
17:30:34FromDiscord<mratsim> @fwsgonzo never tried nim-gdb. I just compiler with "--debugger:native" and then "gdb myprogram" and then "b foo.nim:53"
17:31:03FromDiscord<fwsgonzo> sent a code paste, see https://play.nim-lang.org/#ix=2Nul
17:31:12FromDiscord<mratsim> compile with --debugger:native
17:32:09FromDiscord<fwsgonzo> magic!
17:32:59FromDiscord<fwsgonzo> sent a code paste, see https://play.nim-lang.org/#ix=2Num
17:48:39saemI use nim-gdb.py a lot, it's all with vs code and cpp debug extension
17:56:28*kwilczynski joined #nim
17:58:48*sz0 joined #nim
17:59:42*sirn joined #nim
18:00:16*r4vi quit (Read error: Connection reset by peer)
18:00:35*r4vi joined #nim
18:04:49*MyMind joined #nim
18:04:53*notchris quit (Read error: Connection reset by peer)
18:05:10*notchris joined #nim
18:10:47FromDiscord<fwsgonzo> so what does the --debugger:native option actually do to add pretty printers to the executable?
18:11:30FromDiscord<fwsgonzo> (edit) "so what does the --debugger:native option actually do to add pretty printers to the executable? ... " added "looks like it outputs .ndi files"
18:13:50*notchris quit (Ping timeout: 264 seconds)
18:14:10*r4vi quit (Read error: Connection reset by peer)
18:14:11*sz0 quit (Ping timeout: 272 seconds)
18:14:18*sirn quit (Read error: Connection reset by peer)
18:14:49FromDiscord<mratsim> it puts the Nim code in the C file for the debugger
18:16:30FromDiscord<Zachary Carter> sent a code paste, see https://play.nim-lang.org/#ix=2Nuw
18:16:47FromDiscord<Zachary Carter> @fwsgonzo not sure if you've seen this or not, but it might be useful: https://nim-lang.org/blog/2017/10/02/documenting-profiling-and-debugging-nim-code.html
18:16:54FromDiscord<mratsim> "newer"? when was this written
18:17:03FromDiscord<Zachary Carter> prior to 2017
18:17:07FromDiscord<mratsim> 😄
18:17:28FromDiscord<fwsgonzo> im live-debugging a game engine that uses Nim as a scripting language
18:17:35FromDiscord<Zachary Carter> what game engine?
18:17:41*hoek quit (Read error: Connection reset by peer)
18:17:42*d10n-work quit (Read error: Connection reset by peer)
18:17:43FromDiscord<fwsgonzo> just homebrew
18:17:49FromDiscord<Zachary Carter> 2d or 3d?
18:18:21FromDiscord<mratsim> <insert xzibit meme>
18:18:32FromDiscord<fwsgonzo> 2D, so that we will be able to finish in our lifetimes 🙂
18:18:40*notchris joined #nim
18:18:46FromDiscord<Zachary Carter> psh plenty of FOSS 3d games out there 🙂
18:18:58*r4vi joined #nim
18:19:00*sirn joined #nim
18:19:01FromDiscord<Zachary Carter> I find 2d way too limiting - but I'm not a game designer either so
18:19:06FromDiscord<fwsgonzo> > `https://media.discordapp.net/attachments/710281407917850685/798325218992324608/unknown.png?width=1233&height=663`↵maybe youve seen us on reddit
18:19:13FromDiscord<Zachary Carter> also I can't draw and I find 3d art easier to find / produce than 2d
18:19:14FromDiscord<fwsgonzo> (edit) "> `https://media.discordapp.net/attachments/710281407917850685/798325218992324608/unknown.png?width=1233&height=663`↵maybe youve seen us on reddit ... " added "- i double hid it to avoid expansion"
18:19:20FromDiscord<Zachary Carter> I don't use reddit so probably not but let me lok
18:19:20*d10n-work joined #nim
18:19:23FromDiscord<Zachary Carter> (edit) "lok" => "look"
18:19:45*hoek joined #nim
18:19:52*sz0 joined #nim
18:19:52FromDiscord<Zachary Carter> cool, looks nice!
18:20:36FromDiscord<fwsgonzo> its definitely a challenge to draw good pixelart, for sure
18:21:22FromDiscord<Zachary Carter> good any art
18:21:42FromDiscord<fwsgonzo> $ART
18:22:00FromDiscord<Zachary Carter> all art drawn on a monitor is pixel art at the end of the day anyway
18:22:20FromDiscord<Zachary Carter> unless you physically draw on the monitor with crayon or marker or something
18:24:10FromDiscord<Zachary Carter> I just realized I'm actually going to be able to work on my game this weekend 😄
18:24:33FromDiscord<Zachary Carter> Finacee is having surgery tomorrow, and will not be able to complain about me being on the PC all weekend
18:25:12*r4vi quit (Ping timeout: 260 seconds)
18:25:28*sirn quit (Read error: Connection reset by peer)
18:25:32*notchris quit (Read error: Connection reset by peer)
18:25:54FromDiscord<mratsim> aren't you susposed to attend to her
18:26:07FromDiscord<mratsim> bring flowers?
18:26:43FromDiscord<Zachary Carter> Nah, she's going to be sprawled out on the couch, sleeping and high on pain killers I imagine
18:26:57*hoek quit (Ping timeout: 260 seconds)
18:27:13planetis[m]i just dont get how riscv relates to all of this?
18:27:33*sz0 quit (Ping timeout: 260 seconds)
18:27:37FromDiscord<Zachary Carter> you haven't studied hard enough
18:27:38*d10n-work quit (Ping timeout: 264 seconds)
18:28:50FromDiscord<Zachary Carter> skipped over the opcode for setting your fiancee to mute
18:29:40FromDiscord<fwsgonzo> im maintaining a RISC-V emulator with remote GDB support
18:29:52FromDiscord<fwsgonzo> so i can use systems languages for scripting
18:30:20FromDiscord<Zachary Carter> why don't you just write the engine in Nim?
18:30:29FromDiscord<Zachary Carter> or use Nimscript?
18:30:50FromDiscord<haxscramper> Is emulator open-source/written in nim?
18:31:04FromDiscord<fwsgonzo> one of the strength of systems languages are optimized executables, regardless of them being executed instruction by instruction
18:31:16FromDiscord<fwsgonzo> the emulator is C++ so its a drop-in in most game project
18:31:16FromDiscord<fwsgonzo> (edit) "project" => "projects"
18:31:55*r4vi joined #nim
18:31:55*sirn joined #nim
18:31:59*notchris joined #nim
18:32:10FromDiscord<fwsgonzo> https://gist.github.com/fwsGonzo/c77befe81c5957b87b96726e98466946
18:33:42*d10n-work joined #nim
18:33:51FromDiscord<Zachary Carter> pretty impressive
18:33:59*hoek joined #nim
18:34:29*sz0 joined #nim
18:34:29FromGitter<Araq> it's 2021. Most programming languages care about integer overflows in one way (JS) or the other (Nim, Swift). RISC-V: "here is how to handle overflows for uint add with just a single additional instruction after the addition"
18:35:18FromGitter<Araq> "ok, what about multipication and signed integers?" -- RISC-V "la la la, we're simple instead"
18:35:35FromDiscord<fwsgonzo> theres multiple instructions for multiplication?
18:35:48FromDiscord<fwsgonzo> if you want to complain, complain about sign-extension
18:36:06FromDiscord<fwsgonzo> or the compressed instructions, both of which add emulation overhead
18:36:09FromDiscord<mratsim> multiplication on x86: I'll just use RAX and RDX, get out of my lawn.
18:36:19FromDiscord<fwsgonzo> its certainly not the perfect architecture for emulation, but it does get the job done
18:36:22FromDiscord<mratsim> oh and 2 more registers as well
18:36:24FromGitter<Araq> when I looked at it, these instructions were in some unspecified "extension"
18:36:42FromGitter<Araq> everything useful in some bullshit "extension"
18:37:05FromDiscord<fwsgonzo> yea the M-extension. very simple micro-controllers would only support the base ISA which has just the basic instructions
18:37:08federico3huh?
18:37:34federico3the modular design makes a lot of sense to scale down to tiny microcontrollers
18:37:40FromDiscord<fwsgonzo> indeed
18:38:12federico3you are not expected to target only the core ISA
18:38:49FromGitter<haxscramper> @Araq how to define `nimcore` symbol when using compiler API I need to `defineSymbol(config.symbols, "nimcore")` - correct? I'm having troubles with `when defined(nimcore)` - it is still not activated
18:39:17FromDiscord<konsumlamm> @mratsim i'm currently trying out weave and i'm getting an UnusedImport warning using your exact fib example, do you happen to know the reason for that?
18:39:40FromDiscord<mratsim> no idea
18:39:55FromDiscord<mratsim> sometimes it's genuine, and sometimes it's wrong.
18:40:15FromDiscord<mratsim> because symbol bound in macros or something are not seen by the unused import check.
18:41:00FromDiscord<mratsim> there are a couple of warnings that are annoying because they are wrong: UnusedImport, ObservableStores and the Proveinit.
18:41:21FromDiscord<mratsim> I don't think I have the last 2 in weave though
18:42:28FromGitter<Araq> federico: well an instruction is 32 bits. too large for "tiny microcontrollers" but ymmv and it's offtopic so I'll shut up
18:43:26FromGitter<Araq> @haxscramper you need to use --define:nimcore on the command line when compiling or put it to your config
18:43:42FromGitter<dom96> @Araq can you check your PMs?
18:44:11FromGitter<haxscramper> I'm writing compiler-based tooling, and explicitly creating configuration/module graph etc. Is `--define:nimcore` still applicable in this situation?
18:44:31FromDiscord<konsumlamm> kk, also, i noticed that it segfaults, if i don't call `init` and `exit`, i assume that's a bug?
18:45:00FromGitter<haxscramper> .
18:46:23FromDiscord<konsumlamm> also, i'm curious, what does a `type Weave` parameter mean?
18:46:49*tane joined #nim
18:47:18federico3Araq: what matter for Nim's implementation is that the rv64 target can be safely assumed to be rv64gc
18:47:30FromDiscord<Rika> Takes in the actual type Weave and not a parameter of type Weave
18:47:39FromDiscord<Rika> So you pass the type name
18:48:12FromDiscord<Rika> What its purpose is for weave is to force (quasi)qualification
18:48:13FromGitter<haxscramper> Yes, it works, so I guess I had misunderstanding on where the symbol needs to be defined
18:53:57FromDiscord<konsumlamm> i see, thx
18:54:41*sirn quit (Read error: Connection reset by peer)
18:54:41*r4vi quit (Read error: Connection reset by peer)
18:55:04*d10n-work quit (Write error: Connection reset by peer)
18:55:05*hoek quit (Read error: Connection reset by peer)
18:55:05*notchris quit (Read error: Connection reset by peer)
18:55:06*sz0 quit (Read error: Connection reset by peer)
18:56:18*sirn joined #nim
18:56:24*VijayMarupudi[m] quit (Ping timeout: 260 seconds)
18:56:25*Prestige quit (Ping timeout: 260 seconds)
18:56:52*cmc[m] quit (Ping timeout: 260 seconds)
18:57:48*cmc[m] joined #nim
18:58:06FromDiscord<konsumlamm> @mratsim i noticed that weave segfaults if i don't call `Weave.init`, i assume that's a bug? i think it should rather throw an exception or at least have an assertion
18:58:16*Prestige joined #nim
18:58:18*VijayMarupudi[m] joined #nim
18:58:36FromDiscord<mratsim> no exceptions in Weave
18:58:56FromDiscord<konsumlamm> hmm, k
18:59:03FromDiscord<mratsim> maybe an assert but that stuff would be called on every spawn.
18:59:28FromDiscord<konsumlamm> ye, i thought so, but assertions can be disabled
18:59:50FromDiscord<konsumlamm> auto-initializing would also solve the issue ig
19:00:24FromDiscord<mratsim> yeah but I don't want to impose my overhead and leave control to people
19:00:33FromDiscord<mratsim> It's a library not a framework
19:00:46FromDiscord<mratsim> but I guess once I have user threadpools
19:00:55FromDiscord<mratsim> I can have those for those who want control
19:01:03FromDiscord<mratsim> and the global one be autoinitialized
19:01:38FromDiscord<konsumlamm> ye, fair
19:02:32*notchris joined #nim
19:04:22FromDiscord<Clyybber> Araq: Does it make sense to use intset/packedset for a set of PNodes?
19:05:24*narimiran joined #nim
19:06:08FromGitter<Araq> no.
19:06:46FromDiscord<Clyybber> so should I use normal HashSets instead? (I just need ref equality here)
19:12:12FromGitter<Araq> why do you need it?
19:12:28FromGitter<Araq> we discussed new node flags so that you can avoid the lookup table altogether
19:14:48FromDiscord<Clyybber> Araq: Yeah, but I need to store some things internally during the analysis
19:14:54FromDiscord<Clyybber> I'm using node flags
19:15:38*hoek joined #nim
19:15:53FromDiscord<Clyybber> And theres a lot of `for pla in potLastReadsA: if pla notin oldPotLastReads: potLastReads.add pla`
19:16:02FromGitter<Araq> thankfully we don't overload == for PNode so a HashSet will be fine
19:16:20*sz0 joined #nim
19:16:22FromDiscord<Clyybber> cool, just want to get rid of the nm complexity here
19:20:22*r4vi joined #nim
19:21:34*d10n-work joined #nim
19:40:15*r4vi quit (Ping timeout: 260 seconds)
19:40:39*kwilczynski quit ()
19:40:50*d10n-work quit (Read error: Connection reset by peer)
19:42:24*r4vi joined #nim
19:45:34*d10n-work joined #nim
19:58:07*hmmm joined #nim
19:58:17hmmmnimions! <3
19:58:27hmmmhow do I check the type of an object?
19:58:37hmmmI knew it but I forgot :|
19:58:41FromDiscord<lqdev> `x is MyType`
19:58:54hmmmwasn't something like typeof?
19:59:04FromDiscord<lqdev> there's typeof also
19:59:13hmmmI'll try
19:59:15hmmm<33
19:59:31FromDiscord<lqdev> you said "check" so i assumed you want to see if an expression is of some type :p
19:59:31FromDiscord<konsumlamm> get != check :p
20:01:18*kwilczynski joined #nim
20:03:41hmmmwhat was nim version of python "with thisfile open: do stuff" and close the thing without me doing any work
20:03:54FromDiscord<Clyybber> defer
20:04:03hmmmhmm
20:04:06hmmmit rings a bell
20:04:08FromDiscord<Clyybber> defer: file.close()
20:04:10hmmmI'll go check
20:10:49hmmmdefer is comfy
20:10:52hmmmty clybby
20:15:18FromDiscord<exelotl> Again, looking forward to destructors for files 😅
20:15:38hmmmwhy can't I create a variable inside a proc? I'm getting undeclared identifier error :?
20:15:52FromDiscord<lqdev> hmmm: show us the code.
20:15:55hmmmvery suspect
20:17:51FromDiscord<haxscramper> @Clyybber If I have `nkSym` node (resolved after semcheck) - how do I get its position in source code (`node.info` points to symbol location)? I want to track all field uses, in code, but I can't get correct positional information
20:18:24FromDiscord<haxscramper> E.g. I need location of field use, but `.info` for symbol stores location of field definition
20:18:33hmmmhttps://play.nim-lang.org/#ix=2Nv8
20:19:24FromDiscord<Clyybber> hmmm: Replace the : on the second line with =
20:19:30hmmmoh shi
20:19:41hmmm:DDD
20:20:04hmmmclibby <3
20:21:11FromDiscord<Clyybber> <3
20:23:41FromDiscord<Clyybber> @haxscramper Are you sure you are using the .info of the PNode not the PSym?
20:26:28FromDiscord<haxscramper> Yes, `node is PNode`, but `echo .info` returns the same line/column for all nodes in module
20:27:19FromDiscord<haxscramper> I'm scanning `compiler/ast.nim`, and `.sons` for `TSym` is always reported with position `line: 730` regardless of actual use location
20:27:39FromDiscord<haxscramper> (edit) "`TSym`" => "`TNode`"
20:29:41FromDiscord<haxscramper> (edit) I'm scanning `compiler/ast.nim`, and `.sons` for `TNode` is always reported with position `line: 742` regardless of actual use location
20:29:48FromDiscord<Clyybber> hmm
20:30:21*def- quit (Quit: -)
20:30:26FromDiscord<Clyybber> and the .info of the nkDotExpr points to what you want?
20:30:32*def- joined #nim
20:36:01FromDiscord<haxscramper> More or less, though now I need to dump additional layer of heuristics to get it correctly aligned https://media.discordapp.net/attachments/371759389889003532/804087333846122566/unknown.png
20:36:25hmmmhey can I do something like this: var x : File and then later check if it's empty or not with "if x"
20:36:43FromDiscord<andeee> sent a code paste, see https://play.nim-lang.org/#ix=2Nvj
20:37:16FromDiscord<haxscramper> hmmm: there is no implicit boolean conversions, but for nilable types you can use `isNil()`. For file handles it might be `== 0` for file descriptor
20:37:24FromDiscord<haxscramper> Though lattern one is just a guess
20:37:57hmmmvery interesting
20:38:07hmmmI'll try to fiddle withi this isNil stuff
20:38:24FromDiscord<haxscramper> Or you can do `Option[File]` if you want to be more explicit
20:38:53FromDiscord<haxscramper> Like `if someCondition(): # set file to something` and `if file.isSome(): # write to it`
20:41:04FromDiscord<haxscramper> IIRC you can just do `var nimString = newStringOfCap(<size>)`, then pass it using `nimString.cstring`, `nimString.len` to C API
20:41:06FromDiscord<haxscramper> And return it
20:43:40hmmm option kind of seems like overkill for the simple stuff I need, I just want to check at a later moment if the file was opened on the variable x or not
20:43:41FromDiscord<andeee> oh that's nice, maybe the way i'm doing it fucks something up
20:43:49FromDiscord<andeee> (edit) "oh that's nice, maybe the way i'm doing it fucks something up ... " added "with the string representatin"
20:43:51FromDiscord<andeee> (edit) "representatin" => "representation"
20:45:05FromDiscord<haxscramper> @andeee as a side not - I don't see anything particularly wrong with this code, though it might have something to do with `defer: dealloc` or something. You can use `result = $buf` and then dealloc
20:46:20FromDiscord<haxscramper> But I'm not sure if that is the case, but I've had some issues with `defer` and whatever
20:47:54FromDiscord<haxscramper> (edit) @andeee As a side note - I don't see anything particularly wrong with this code, though it might have something to do with `defer: dealloc` or something. You can use `result = $buf` and then `dealloc`
20:48:25FromDiscord<andeee> thanks, but it doesn't seem like that's the problem, the newStringOfCap way also throws the same error
20:55:03*narimiran quit (Ping timeout: 272 seconds)
21:24:01*natrys quit (Quit: natrys)
21:33:53FromDiscord<konsumlamm> @haxscramper what's your reasoning for not allowing pattern matching by position? i tried to test the module by creating a custom Result (Either) type and got bitten by it, i think it would be especially useful for such "container types"↵for Option, this is allowed as well, so i don't really see the point
21:36:15FromDiscord<CodeHz> does --gc:arc affect compile-time evaluation?
21:37:01Zevvno
21:37:21FromDiscord<CodeHz> https://github.com/nim-lang/Nim/issues/16847 ↵but in my case, I got nil in macro
21:37:27disbotARC/nimSeqsV2 breaks compile-time evaluation (macro) ; snippet at 12https://play.nim-lang.org/#ix=2NvD
21:38:25Zevvwell, if you hadn't filed this as a github issue, I would have told you to file a github issue
21:39:27Zevvbinpak?
21:39:46FromDiscord<CodeHz> (just a experiment project(
21:40:00FromDiscord<CodeHz> (edit) "a" => "an"
21:40:12Zevvlike this it's not reproducable for others
21:40:51FromDiscord<CodeHz> at least reproduce in my WSL and windows native environment
21:41:09Zevvyeah but how can we reproduce with your code?
21:42:40FromDiscord<CodeHz> sent a code paste, see https://play.nim-lang.org/#ix=2NvE
21:42:55FromDiscord<CodeHz> (I think I've already paste the permlink to this file in that issue
21:49:57FromDiscord<haxscramper> 1) It is possible to match based on position if you use tuple pattern - `(@x, @y) := expr` corresponds to `expr[0]` etc.↵2) for sequence matching I had to choose between using items by default, vs indexing, and I decided that `items` is more commonly used↵3) it should possible to match slices of sequences using `[0 .. 3 is @elems]`, and I'm adding support for `[6 is @PragmaExpr()]` in the follow-up PR as well
21:50:24*vindaar[m] quit (Ping timeout: 246 seconds)
21:50:25*leorize[m] quit (Ping timeout: 246 seconds)
21:50:26*VijayMarupudi[m] quit (Ping timeout: 240 seconds)
21:50:26*Clonkk[m] quit (Ping timeout: 240 seconds)
21:50:26*reversem3 quit (Ping timeout: 240 seconds)
21:50:27*ee7[m] quit (Ping timeout: 240 seconds)
21:50:27*BauxnaMatrix[m] quit (Ping timeout: 240 seconds)
21:50:27*planetis[m] quit (Ping timeout: 240 seconds)
21:50:28*Kurre[m] quit (Ping timeout: 240 seconds)
21:50:29*silvernode[m] quit (Ping timeout: 260 seconds)
21:50:29*Avahe[m] quit (Ping timeout: 258 seconds)
21:50:30*Juno[m] quit (Ping timeout: 258 seconds)
21:50:33FromDiscord<haxscramper> To allow for explicit specification of position
21:50:37*jaens[m] quit (Ping timeout: 240 seconds)
21:50:47*j-james[m] quit (Ping timeout: 244 seconds)
21:50:47*codic quit (Ping timeout: 244 seconds)
21:50:49*lytedev[m] quit (Ping timeout: 244 seconds)
21:50:49*lnxw37d4 quit (Ping timeout: 244 seconds)
21:50:49*MTRNord quit (Ping timeout: 244 seconds)
21:50:52*BitPuffin quit (Ping timeout: 258 seconds)
21:50:53*Zoom[m] quit (Ping timeout: 268 seconds)
21:50:53*himup[m] quit (Ping timeout: 268 seconds)
21:50:53*matthias[m] quit (Ping timeout: 268 seconds)
21:50:53*unclechu quit (Ping timeout: 268 seconds)
21:50:56*stisa[m] quit (Ping timeout: 260 seconds)
21:51:05*cadmium[m] quit (Ping timeout: 265 seconds)
21:51:05*dilawar_uchiha[m quit (Ping timeout: 265 seconds)
21:51:06*William[m]1 quit (Ping timeout: 265 seconds)
21:51:14*Avatarfighter[m] quit (Ping timeout: 258 seconds)
21:51:19FromDiscord<haxscramper> Also `[_, @firsr, @second]` supports positional matching as well, though uses `items` internally.
21:51:29*awici[m] quit (Ping timeout: 268 seconds)
21:51:30*k0mpjut0r quit (Ping timeout: 268 seconds)
21:51:30*Northstrider[m] quit (Ping timeout: 268 seconds)
21:51:33*cmc[m] quit (Ping timeout: 265 seconds)
21:51:47*mahlon quit (Ping timeout: 246 seconds)
21:52:58*disbot quit (Remote host closed the connection)
21:53:27*kinkinkijkin quit (Ping timeout: 264 seconds)
21:53:33FromDiscord<haxscramper> Though think I don't have tests for things like `[any @elems is Some()]` and `[any is Some(@elem)]`, need to add those
21:53:45FromDiscord<konsumlamm> that's cool, but what about positional matching for variant objects?
21:53:52*disbot joined #nim
21:54:09*r4vi quit (Ping timeout: 246 seconds)
21:54:11FromDiscord<haxscramper> You can have custom unpacker
21:54:19FromDiscord<konsumlamm> oh, i can? nice
21:54:33FromDiscord<haxscramper> Overload [] operator for static FieldIndex
21:54:49FromDiscord<haxscramper> IIRC there is a test with this example
21:55:14FromDiscord<konsumlamm> also, speaking of Option, it appears nested matching for Option types doesn't work (at least i couldn't fin out how it would work)? (i tried `Some(is Some(@x))`)
21:55:35*kinkinkijkin joined #nim
21:56:06*mahlon joined #nim
21:56:10*r4vi joined #nim
21:56:35FromDiscord<haxscramper> No, it doesn't work because I haven't thought about it
21:56:51FromDiscord<haxscramper> But it should - I need to fix that
21:57:08FromDiscord<konsumlamm> in general, the only patterns supported for Option seem to be `None` and `Some(@var)`
21:57:13FromDiscord<haxscramper> Though in form of `Some(Some(@a))`
21:57:21FromDiscord<konsumlamm> ye, that would be nice
21:57:37FromDiscord<haxscramper> Yes, that is correct, Option is edge-cased explicitly
21:58:03FromDiscord<haxscramper> For only those two patterns at this moment, and they are not recursive
21:58:54FromDiscord<konsumlamm> btw, i don't really like that you have to prefix binding variables with @, but ig i can live with that (it's too late to change it now anyway)
21:59:01FromDiscord<haxscramper> Well
21:59:05FromDiscord<haxscramper> I don't like it too
21:59:26FromDiscord<haxscramper> But there was some extremely compelling reason why it is this way
22:01:16FromDiscord<haxscramper> But araq mentioned this when merging first PR into fusion that having var/let as keywords that can be freely used is a possibility
22:01:36FromDiscord<haxscramper> Sometimes in the future
22:03:54FromDiscord<lqdev> maybe the reason was that @ has higher precedence than other prefix operators?
22:04:24FromDiscord<konsumlamm> i'm not talking about why @ specifically, but why an operator prefix in the first place
22:07:43FromDiscord<haxscramper> To indicate variable injection and because all other pattern matching libraries used it
22:08:49FromDiscord<haxscramper> I think that was the reason - AST precedence has little to do with this, though @ binds very closely, and it might've influenced original decision by some of the authors for Patty/Gara
22:08:52FromDiscord<konsumlamm> patty doesnt as far as i can tell
22:10:15FromDiscord<haxscramper> Also you can use variable for patterns like `let a = 12; (@firsr, a) := expr` and it is not possible to differentiate between external variables and newly declared one
22:10:47FromDiscord<haxscramper> But I guess it just sort of happened at some point, because I used this in nimtrs
22:11:06FromDiscord<haxscramper> And notable portion of the syntax was influenced by it
22:16:50FromDiscord<konsumlamm> ye, i rather would have done it the other way around, that you have to prefix captured variables
22:18:33*hmmm quit (Quit: WeeChat 3.0)
22:20:19FromDiscord<konsumlamm> ahh, now i now what ypu meant with `let`; using `let a` instead of `@a`, i like that
22:20:40FromDiscord<konsumlamm> i don't like some of the special cases, honestly, like the matching predicates or (it < 10) stuff or operators in patterns, i would have rather added something like trailing if expressions
22:20:47FromDiscord<konsumlamm> but the rest is pretty cool, nice job
22:21:54FromDiscord<haxscramper> Trailing if expressions would be really clunky and need to be wrapped in layers of parentheses to get correct AST
22:23:09FromDiscord<haxscramper> Possible, but at this point it would be easier to just write code by hand anyway then figuring how to use matching
22:24:36FromDiscord<haxscramper> Operators in patters are mostly for `in setOfSomething` but it made no sense to restrict them to particular set of operators
22:25:08FromDiscord<haxscramper> (edit) "`in" => "`field: in"
22:27:25FromDiscord<konsumlamm> ye, i can agree on that at least
22:28:07FromDiscord<konsumlamm> wdym?
22:29:30*a_chou joined #nim
22:29:52*koltrast quit (*.net *.split)
22:30:15*koltrast joined #nim
22:31:25*tane quit (Quit: Leaving)
22:32:15FromDiscord<haxscramper> Maybe I misunderstood what particular syntax do you have in mind
22:32:35FromDiscord<haxscramper> Can you provide example of how you would like trailing if expressions to be implemented
22:54:47*a_chou quit (Ping timeout: 246 seconds)
22:56:14FromDiscord<konsumlamm> something like `of [@a, .._] if a == 1:`
22:56:35FromDiscord<konsumlamm> so `<pattern> if <expression>`
22:57:54FromDiscord<konsumlamm> i still don't know what you meant by this though
23:01:25*rockcavera quit (Read error: Connection reset by peer)
23:01:54*rockcavera joined #nim
23:12:50*leorize[m] joined #nim
23:14:45*audiophile joined #nim
23:15:15*vindaar[m] joined #nim
23:16:14*Vladar quit (Remote host closed the connection)
23:22:09*jaens[m] joined #nim
23:22:28*dilawar_uchiha[m joined #nim
23:22:29*reversem3 joined #nim
23:23:21*cadmium[m] joined #nim
23:23:32*Kurre[m] joined #nim
23:23:50*leorize[m] quit (Quit: Bridge terminating on SIGTERM)
23:23:53*jaens[m] quit (Client Quit)
23:23:53*reversem3 quit (Client Quit)
23:23:53*dilawar_uchiha[m quit (Client Quit)
23:23:53*vindaar[m] quit (Quit: Bridge terminating on SIGTERM)
23:23:53*cadmium[m] quit (Client Quit)
23:23:54*Kurre[m] quit (Client Quit)
23:24:39*William[m]1 joined #nim
23:25:20*William[m]1 quit (Remote host closed the connection)
23:27:36*Northstrider[m] joined #nim
23:37:48*BitPuffin joined #nim
23:52:05*abm joined #nim
23:59:08*oddp quit (Quit: quit)