00:00:14 | disruptek | cast it from your mind, never to return. |
00:01:12 | FromDiscord | <Clyybber> not yet, saem was interested too |
00:02:14 | FromDiscord | <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:47 | FromDiscord | <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:57 | saem | Clyybber, 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:01 | saem | "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:03 | disruptek | clyybber: 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:39 | disruptek | it'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:27 | disruptek | how long is this rune? ⚫ |
02:35:44 | disruptek | how 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:08 | saem | First two are big characters, and the last one is a simple bullet point... ? |
03:07:32 | * | muffindrake joined #nim |
03:09:57 | disruptek | ie. two characters wide? |
03:10:42 | * | leorize joined #nim |
03:15:58 | * | lritter joined #nim |
03:25:22 | saem | Yeah |
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:52 | saem | yay, I got a 32 bit nimsuggest built |
05:27:24 | * | saem pats himself on the back |
05:27:42 | disruptek | isn't it built in the nightlies? |
05:28:08 | saem | mebbe |
05:28:24 | saem | But I need the one in my branch for testing |
05:29:42 | * | Gustavo6046 joined #nim |
05:29:59 | disruptek | was it really that tricky? |
05:30:20 | saem | It was awkward to figure out what was wrong. |
05:30:44 | saem | Unfamiliar, misunderstood the error messages, all that jazz |
05:30:55 | disruptek | sounds like my first time with a shemale. |
05:31:16 | saem | I don't think they have error messages. |
05:31:25 | disruptek | you'd be surprised. |
05:31:32 | saem | I probably would be |
05:32:08 | disruptek | i just replaced an entire library with 40 lines of code. |
05:32:50 | disruptek | eh 50. |
05:33:27 | saem | How's it feel? |
05:34:11 | disruptek | marginal. |
05:35:09 | disruptek | looks cool though. |
05:36:35 | disruptek | https://github.com/disruptek/balls/runs/1774567768#step:4:853 |
05:37:12 | saem | that does look cool |
05:37:20 | disruptek | the lib was only a couple hundred lines. 😁 |
05:37:50 | saem | The 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:45 | disruptek | what the hell are those? |
05:38:59 | disruptek | oh, just shortcuts. |
05:39:13 | disruptek | that makes sense. |
05:39:56 | saem | not 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:32 | saem | huh, i wonder if I'm running into some weird limitation with 32 bits, strings or regex or something. |
05:42:52 | saem | I know I can disable the test, but I'm kinda curious. |
05:42:54 | leorize | you can also sum it up as 32-bit nim being untested |
05:42:58 | disruptek | it fails in ci, right? |
05:44:01 | saem | Yeah, it does |
05:44:08 | saem | Fails locally too |
05:44:15 | * | William[m]1 joined #nim |
05:44:19 | disruptek | i can't find the ci on 'hub. |
05:44:36 | saem | https://dev.azure.com/nim-lang/255dfe86-e590-40bb-a8a2-3c0295ebdeb1/_apis/build/builds/12503/logs/118 |
05:44:45 | disruptek | thanks. |
05:44:50 | saem | `2021-01-26T05:17:35.1283906Z Test /home/vsts/work/1/s/nimsuggest/tests/tsug_regression.nim` <--- that line |
05:45:30 | leorize | the expected line looks very weird |
05:45:52 | * | lnxw37d4 joined #nim |
05:46:20 | saem | Oh the `*` does a swap with a `(.*)` basically. |
05:47:09 | saem | https://github.com/nim-lang/Nim/blob/devel/nimsuggest/tester.nim#L145 |
05:47:29 | saem | That line shows the smartCompare which does the whole regex bit |
05:48:16 | leorize | 32bit libpcre can be kinda weird |
05:48:21 | leorize | maybe swap it with pegs? |
05:48:33 | saem | Ah! I was wondering |
05:48:39 | disruptek | that sounds like a pita. |
05:48:50 | disruptek | but also the right move long-term. |
05:49:57 | saem | are the two surface level compatible? AFAIK, the regex usage is pretty basic. |
05:50:28 | leorize | the test system uses ubuntu, which should compile their libpcre the same way for the 32bit and 64bit versions... |
05:50:31 | saem | oh wait... |
05:50:32 | saem | damn |
05:50:48 | * | lytedev[m] joined #nim |
05:50:52 | saem | I started reading pegs, it's a whole _thing_ |
05:50:56 | * | Avahe[m] joined #nim |
05:51:41 | disruptek | yes, and unfortunately, npeg isn't in the stdlib. |
05:51:52 | saem | what about jpeg? |
05:51:57 | leorize | testament uses pegs for parsing compiler output if you wanna look at it |
05:51:57 | disruptek | that might work. |
05:52:20 | saem | mpeg, we got any mpeg? |
05:52:35 | disruptek | hell, there's even mjpeg. |
05:52:38 | saem | Yeah, that might be doable. |
05:52:43 | disruptek | opengl here? |
05:53:02 | saem | mopengl |
05:53:18 | saem | ok, I'll take a quick peak at testament |
05:53:33 | disruptek | ...4hrs later... |
05:53:43 | saem | spoilers! |
05:54:00 | disruptek | it's not that bad, actually. |
05:55:43 | saem | actually, pegs might be pretty easy? |
05:55:56 | saem | it'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:06 | saem | nope, not easy |
06:25:39 | disruptek | i want a service where i give you a 32/64-bit value and you give me an ai-generated face. |
06:25:49 | disruptek | ie. the same one given the same value. |
06:25:58 | saem | no |
06:26:04 | disruptek | no? |
06:26:07 | saem | yes, no |
06:26:15 | disruptek | no, yes. |
06:26:19 | disruptek | i do want that thing. |
06:26:22 | saem | no |
06:26:26 | disruptek | no? |
06:26:33 | saem | yes, no |
06:26:35 | disruptek | Zevv: right? |
06:27:01 | disruptek | well, i guess i can settle for robots or whatever. |
06:28:31 | disruptek | https://robohash.org/ |
06:28:42 | saem | that's pretty great |
06:29:04 | disruptek | yeah, i will use this for my tierra organisms. |
06:30:22 | saem | TMI |
06:30:38 | disruptek | but i'd prefer humans. |
06:32:41 | saem | I'm glad you don't discriminate. |
06:32:49 | disruptek | humans are tastier. |
06:32:54 | disruptek | more memorable. |
06:32:59 | disruptek | that's what i meant. |
06:43:49 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
06:52:36 | saem | hmm, y no wrk? https://play.nim-lang.org/#ix=2NrN |
06:53:27 | saem | It's because it's hex isn't it and it wants digits. |
06:59:46 | * | krux02 joined #nim |
07:00:12 | Zevv | what he says |
07:12:09 | ForumUpdaterBot | New 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:11 | saem | oh 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:24 | saem | "very subtle" |
07:54:21 | * | PMunch joined #nim |
08:04:38 | saem | Well that should be working for now, PR updated. |
08:05:09 | saem | I'll go back to checking on debugging that nimsuggest crash tomorrow -- hopefully. |
08:19:46 | PMunch | @treeform, you around? |
08:26:10 | * | habamax left #nim (#nim) |
08:59:38 | PMunch | Hmm, is `now()` from the times module broken on 32-bit systems? http://ix.io/2Nsc |
09:01:45 | PMunch | It 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:41 | ForumUpdaterBot | New thread by Drkameleon: Performance impact of unused ref-object fields?, see https://forum.nim-lang.org/t/7440 |
10:55:38 | PMunch | Is there a blocking version of `recv` for channels that has a timeout? |
11:02:10 | PMunch | I 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:42 | PMunch | Hmm, maybe with ARC I could have two separate threads doing this |
11:04:56 | FromGitter | <Araq> you can use os.sleep inside your tryRecv busy loop |
11:05:59 | PMunch | That's what I'm doing now, but I'm anxious that it blocks my thread for too long |
11:06:12 | PMunch | We have some performance issue with this code |
11:06:24 | FromGitter | <Araq> the usual logic is an expontential back-off |
11:06:36 | FromGitter | <Araq> like you sleep for 1ms, then for 2, 4, 8 etc |
11:07:04 | FromGitter | <Araq> so in the worst case you sleep for twice as long as you needed to, on average. Or something like that... |
11:08:43 | PMunch | I guess that would be better at least |
11:23:32 | * | wasted_youth joined #nim |
12:24:52 | FromGitter | <dom96> looks like Discord bridge is down |
12:25:32 | PMunch | That explains why it's been so quiet today :P |
12:26:45 | FromGitter | <dom96> btw what you can do PMunch is use AsyncEvents to signal that your channel has data |
12:27:41 | PMunch | Hmm, how would that work? |
12:28:54 | FromGitter | <dom96> on send signal the AsyncEvent |
12:29:01 | * | FromDiscord joined #nim |
12:29:18 | FromDiscord | <Yardanico> should be up now |
12:29:21 | FromGitter | <dom96> depending on what you're doing you could also just use sockets :D |
12:29:56 | FromDiscord | <dom96> Yeah. Systemd can also restart it if it crashes |
12:40:40 | FromDiscord | <Meowz> Is there a nim equivalent to python's `setattr`? So I could manually set keys to an object? |
12:41:34 | FromDiscord | <haxscramper> you can write a macro that accepts `static[string]`, or iterate over all fields using `fieldPairs()` |
12:41:34 | FromDiscord | <konsumlamm> umm |
12:41:49 | FromDiscord | <konsumlamm> why exactly do you feel something like `setattr` is necessary? |
12:42:07 | FromDiscord | <haxscramper> But you need to either have type erasure or make sure all fields have identical types |
12:42:09 | FromDiscord | <konsumlamm> objects in nim aren't represented as hashmaps, unlike in python |
12:42:40 | FromDiscord | <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:51 | FromDiscord | <Meowz> (edit) removed "be able to" |
12:42:59 | FromDiscord | <mratsim> @Meowz https://github.com/status-im/nim-cookbook/blob/master/dynamic_approximating_dynamic_types.nim |
12:43:00 | FromDiscord | <Meowz> (edit) removed "don't" |
12:43:06 | FromDiscord | <lqdev> https://nim-lang.org/docs/manual_experimental.html#special-operators-dot-operators |
12:43:51 | FromDiscord | <konsumlamm> or make a template or something that generates a `key` proc that you can then use with the MCS? |
12:47:53 | PMunch | Or 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:12 | FromDiscord | <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:37 | FromDiscord | <Meowz> Sorry, wrong keys in that code |
13:24:38 | FromDiscord | <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:07 | PMunch | Well that would require you JSON to be known on compile-time |
13:25:11 | FromDiscord | <haxscramper> https://nim-lang.org/docs/marshal.html |
13:25:12 | PMunch | But it's certainly possible |
13:33:37 | FromDiscord | <exelotl> @Meowz there's also https://github.com/treeform/jsony |
13:40:46 | * | dddddd_ is now known as dddddd |
13:42:49 | FromDiscord | <lqdev> @Meowz there's `json.to` and the `jsonutils` module |
13:47:57 | FromDiscord | <mratsim> There is an ongoing competition to create more json serializers |
13:51:58 | FromDiscord | <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:31 | FromDiscord | <Meowz> I need to call `getInt` instead for every key |
13:52:51 | * | cheatfate left #nim ("Leaving") |
13:53:15 | FromDiscord | <lqdev> make a converter |
13:53:29 | FromDiscord | <lqdev> the problem is that it's not returning JInt |
13:53:31 | FromDiscord | <lqdev> rather JsonNode |
13:53:34 | FromDiscord | <lqdev> with the kind JInt |
13:53:47 | FromDiscord | <lqdev> so uh, even a converter won't help you in that case |
13:58:21 | FromDiscord | <hamidb80> Is there anyway to catch an error with its details? |
13:59:51 | FromDiscord | <hamidb80> raise newException(ValueEror, `file name is wrong`) |
14:01:00 | FromDiscord | <hamidb80> For example in cpp we use e.what() in order to get the error message |
14:01:11 | FromDiscord | <hamidb80> (edit) Is there anyway to catch an error with its message? |
14:01:22 | FromDiscord | <Meowz> `getCurrentExceptionMsg()` ? |
14:02:04 | FromDiscord | <haxscramper> `except Error as err: echo err.msg` |
14:02:19 | FromDiscord | <Meowz> oh thats even better |
14:02:40 | FromDiscord | <haxscramper> (edit) "Error" => "ValueError" |
14:03:25 | FromDiscord | <Meowz> would `except Exception as err` catch all exceptions btw? |
14:03:38 | FromDiscord | <hamidb80> I didnt see these examples on documentations |
14:03:55 | FromDiscord | <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:24 | FromDiscord | <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:40 | FromDiscord | <sealmove> can iterators be closures? |
14:34:45 | FromDiscord | <Rika> yes |
14:34:50 | FromDiscord | <Rika> to sealmove |
14:34:55 | FromDiscord | <sealmove> I get "current routine cannot return an expression" |
14:35:12 | FromDiscord | <Rika> well are you yielding or returning because i believe it cant return? |
14:35:28 | FromDiscord | <sealmove> yield |
14:35:46 | FromDiscord | <Rika> uhh i think this is the point i ask if i can see the code |
14:37:30 | FromDiscord | <sealmove> also I wonder if there is a simpler way for this |
14:37:32 | FromDiscord | <sealmove> sent a code paste, see https://play.nim-lang.org/#ix=2Ntt |
14:38:08 | FromDiscord | <sealmove> essentially I just want a shuffled range |
14:38:49 | FromDiscord | <Meowz> random has shuffle - if thats what you need |
14:39:50 | FromDiscord | <konsumlamm> @sealmove you forgot the yield type, the first line needs to be `iterator nextNum(): int =` |
14:40:01 | FromDiscord | <sealmove> ohhh thanks |
14:40:17 | FromDiscord | <konsumlamm> (if you dont specify a yield type, `void` is assumed, that's why the compiler says "cannot return an expression") |
14:40:23 | FromDiscord | <sealmove> haven't written nim for some weeks and I'm already forgetting basics :| |
14:42:12 | PMunch | @sealmove, did you see that I pinged you on GitHub? |
14:42:15 | FromDiscord | <Rika> itll come back over time |
14:42:28 | FromDiscord | <sealmove> PMunch no, hold on, I'll check now |
14:43:10 | FromDiscord | <konsumlamm> reposting in case someone knows now: |
14:43:21 | FromDiscord | <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:54 | FromDiscord | <haxscramper> IIRC `bindir` for build artifacts, just pass `-d:release` for nim run |
14:45:00 | FromDiscord | <haxscramper> Or put this in `nim.cfg` |
14:45:54 | FromDiscord | <Rika> note: not in project cfg |
14:46:07 | FromDiscord | <konsumlamm> just passing the compiler options doesnt seem to work for `nimble run` (but appears to work for `nimble build`...) |
14:46:53 | FromDiscord | <konsumlamm> wdym with `bindir`? add that to the `.nimble` file? |
14:49:16 | FromDiscord | <lqdev> i think they meant --bindir |
14:49:33 | FromDiscord | <haxscramper> https://github.com/nim-lang/nimble/blob/master/readme.markdown#optional |
14:49:50 | FromDiscord | <haxscramper> I meant RTFM on `bindir = "your/directory"` |
14:50:18 | FromDiscord | <sealmove> @PMunch when `l` is specified I use `readDataLE`/`writeDataLE`, but I didn't write or audit those procs. |
14:51:11 | FromDiscord | <konsumlamm> thx |
14:51:28 | FromDiscord | <sealmove> https://github.com/PMunch/binaryparse/blob/master/binaryparse.nim#L322↵https://github.com/PMunch/binaryparse/blob/master/binaryparse.nim#L415 |
14:56:12 | PMunch | Hmm, so you're saying it's my fault then.. |
14:56:19 | PMunch | I was afraid of that |
14:56:59 | FromDiscord | <sealmove> Maybe you made an assumption about system's endianness in those procs? |
14:58:06 | PMunch | They look pretty sane: https://github.com/PMunch/binaryparse/blob/master/binaryparse.nim#L117-L139 |
14:59:49 | FromDiscord | <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:36 | FromDiscord | <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:07 | PMunch | Those are the lower level ones that take a pointer and a count of bytes |
15:02:39 | PMunch | And those loops loop over the bytes of the data in the right order |
15:03:04 | FromDiscord | <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:16 | PMunch | Ooh, that's a good point |
15:03:46 | PMunch | But that still shouldn't fail on the same machine though.. |
15:07:15 | * | PMunch quit (Quit: leaving) |
15:08:06 | FromDiscord | <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:26 | FromDiscord | <sealmove> writeData sorry |
15:10:56 | FromDiscord | <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:22 | FromDiscord | <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:23 | FromDiscord | <haxscramper> I finally got callgraph (somewhat) working for sourcetrail - https://media.discordapp.net/attachments/371759389889003532/804010422595223593/unknown.png |
15:32:41 | FromDiscord | <haxscramper> At least it doesn't die when parsing whole compiler at once |
15:34:08 | FromDiscord | <sealmove> hmm, every time I run my program shuffle uses the same seed |
15:34:52 | FromDiscord | <konsumlamm> thats the intended behaviour |
15:35:16 | FromDiscord | <sealmove> yeah, just read in docs... though it's kind of surprising |
15:35:46 | FromDiscord | <lqdev> it's not really surprising considering that the random state is initialized with zeroes `i think` like all globals really |
15:36:41 | saem | Morning |
15:36:46 | FromDiscord | <konsumlamm> anyone wanna review a short PR of mine? https://github.com/nim-lang/Nim/pull/16824 |
15:36:47 | disbot | ➥ Improve documentation for the mersenne module |
15:37:35 | FromDiscord | <carpal> cool |
15:37:42 | saem | Bum, CI still had an issue... But looks like maybe it's fidget. |
15:51:00 | saem | Everytime I see the Mersenne module come up I think to myself one day I'll write a property based testing framework. |
16:01:00 | leorize[m] | or just use disruptek's balls :p |
16:05:09 | saem | leorize[m]: those run tests mostly, I need reporting on an asserted property and generators. |
16:05:55 | leorize[m] | so you mean you wanna test the randomness |
16:06:15 | FromDiscord | <konsumlamm> property testing is pretty cool |
16:07:03 | saem | It's very 😎 |
16:07:05 | FromDiscord | <konsumlamm> you specify a property and then that property is tested for a bunch of different imports |
16:07:54 | FromDiscord | <mratsim> property testing is life |
16:08:24 | saem | Yup, 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:51 | saem | The generators and moreover the commission of them and some quality of life gets are where it's at. |
16:09:18 | FromDiscord | <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:22 | saem | Ugh, damn phone |
16:09:41 | saem | Composition of them and quality of life features |
16:09:55 | FromDiscord | <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:16 | FromDiscord | <mratsim> so naive property-based testing (or fuzzing) doesn't find those. |
16:10:39 | saem | One day I'll get around to writing something inspirited by fast check (typescript) and kotest (kotlin). |
16:11:50 | saem | Oh man, mratsim I was curious to know if you'd seen the extensions to property based testing that result in model testing? |
16:13:22 | saem | I thought it'd be a neat companion to synthesis, one day when I get some more time. |
16:13:48 | FromDiscord | <konsumlamm> seems like those are based on Haskell's QuickCheck |
16:13:55 | saem | I actually would love to use PBT to generate Nim programs for compiler testing. |
16:14:09 | saem | Yeah, that's the lineage |
16:15:01 | saem | Python folks might be more familiar with hypothesis, which isn't _that_ different |
16:15:31 | saem | Kotest's fixed examples woven into generators is really nice quality of life stuff |
16:15:45 | * | narimiran quit (Ping timeout: 240 seconds) |
16:16:35 | saem | And FC model testing is really interesting for testing some of the trickier concurrency and parallelism state machines, like schedulers, etc... |
16:17:04 | saem | Anyways, inspiration |
16:18:16 | saem | PBT is also pretty brutal way to bring about more algebraic thinking at design time. |
16:18:40 | saem | Sorry, I get excited about this stuff. |
16:19:06 | FromDiscord | <konsumlamm> xd |
16:20:59 | saem | I 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:35 | FromDiscord | <konsumlamm> btw, does anyone know how stable the pattern matching in fusion is? |
16:21:47 | * | xet7 joined #nim |
16:22:28 | saem | I personally haven't used it, sorry. |
16:24:05 | FromDiscord | <haxscramper> It is relatively stable |
16:24:21 | FromDiscord | <haxscramper> Well, I tested all possible combinations that I managed to come up with |
16:25:21 | FromDiscord | <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:33 | FromDiscord | <haxscramper> Except for use of view types when they become non-experimental |
16:26:15 | FromDiscord | <konsumlamm> nice, gotta try it |
16:26:52 | FromDiscord | <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:20 | FromDiscord | <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:39 | ForumUpdaterBot | New 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:18 | FromDiscord | <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:45 | ForumUpdaterBot | New thread by HJarausch: Conversion int -> float : what's the rule?, see https://forum.nim-lang.org/t/7441 |
17:28:22 | leorize | fwsgonzo: you use load-plugin in gdb iirc |
17:30:34 | FromDiscord | <mratsim> @fwsgonzo never tried nim-gdb. I just compiler with "--debugger:native" and then "gdb myprogram" and then "b foo.nim:53" |
17:31:03 | FromDiscord | <fwsgonzo> sent a code paste, see https://play.nim-lang.org/#ix=2Nul |
17:31:12 | FromDiscord | <mratsim> compile with --debugger:native |
17:32:09 | FromDiscord | <fwsgonzo> magic! |
17:32:59 | FromDiscord | <fwsgonzo> sent a code paste, see https://play.nim-lang.org/#ix=2Num |
17:48:39 | saem | I 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:47 | FromDiscord | <fwsgonzo> so what does the --debugger:native option actually do to add pretty printers to the executable? |
18:11:30 | FromDiscord | <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:49 | FromDiscord | <mratsim> it puts the Nim code in the C file for the debugger |
18:16:30 | FromDiscord | <Zachary Carter> sent a code paste, see https://play.nim-lang.org/#ix=2Nuw |
18:16:47 | FromDiscord | <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:54 | FromDiscord | <mratsim> "newer"? when was this written |
18:17:03 | FromDiscord | <Zachary Carter> prior to 2017 |
18:17:07 | FromDiscord | <mratsim> 😄 |
18:17:28 | FromDiscord | <fwsgonzo> im live-debugging a game engine that uses Nim as a scripting language |
18:17:35 | FromDiscord | <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:43 | FromDiscord | <fwsgonzo> just homebrew |
18:17:49 | FromDiscord | <Zachary Carter> 2d or 3d? |
18:18:21 | FromDiscord | <mratsim> <insert xzibit meme> |
18:18:32 | FromDiscord | <fwsgonzo> 2D, so that we will be able to finish in our lifetimes 🙂 |
18:18:40 | * | notchris joined #nim |
18:18:46 | FromDiscord | <Zachary Carter> psh plenty of FOSS 3d games out there 🙂 |
18:18:58 | * | r4vi joined #nim |
18:19:00 | * | sirn joined #nim |
18:19:01 | FromDiscord | <Zachary Carter> I find 2d way too limiting - but I'm not a game designer either so |
18:19:06 | FromDiscord | <fwsgonzo> > `https://media.discordapp.net/attachments/710281407917850685/798325218992324608/unknown.png?width=1233&height=663`↵maybe youve seen us on reddit |
18:19:13 | FromDiscord | <Zachary Carter> also I can't draw and I find 3d art easier to find / produce than 2d |
18:19:14 | FromDiscord | <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:20 | FromDiscord | <Zachary Carter> I don't use reddit so probably not but let me lok |
18:19:20 | * | d10n-work joined #nim |
18:19:23 | FromDiscord | <Zachary Carter> (edit) "lok" => "look" |
18:19:45 | * | hoek joined #nim |
18:19:52 | * | sz0 joined #nim |
18:19:52 | FromDiscord | <Zachary Carter> cool, looks nice! |
18:20:36 | FromDiscord | <fwsgonzo> its definitely a challenge to draw good pixelart, for sure |
18:21:22 | FromDiscord | <Zachary Carter> good any art |
18:21:42 | FromDiscord | <fwsgonzo> $ART |
18:22:00 | FromDiscord | <Zachary Carter> all art drawn on a monitor is pixel art at the end of the day anyway |
18:22:20 | FromDiscord | <Zachary Carter> unless you physically draw on the monitor with crayon or marker or something |
18:24:10 | FromDiscord | <Zachary Carter> I just realized I'm actually going to be able to work on my game this weekend 😄 |
18:24:33 | FromDiscord | <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:54 | FromDiscord | <mratsim> aren't you susposed to attend to her |
18:26:07 | FromDiscord | <mratsim> bring flowers? |
18:26:43 | FromDiscord | <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:13 | planetis[m] | i just dont get how riscv relates to all of this? |
18:27:33 | * | sz0 quit (Ping timeout: 260 seconds) |
18:27:37 | FromDiscord | <Zachary Carter> you haven't studied hard enough |
18:27:38 | * | d10n-work quit (Ping timeout: 264 seconds) |
18:28:50 | FromDiscord | <Zachary Carter> skipped over the opcode for setting your fiancee to mute |
18:29:40 | FromDiscord | <fwsgonzo> im maintaining a RISC-V emulator with remote GDB support |
18:29:52 | FromDiscord | <fwsgonzo> so i can use systems languages for scripting |
18:30:20 | FromDiscord | <Zachary Carter> why don't you just write the engine in Nim? |
18:30:29 | FromDiscord | <Zachary Carter> or use Nimscript? |
18:30:50 | FromDiscord | <haxscramper> Is emulator open-source/written in nim? |
18:31:04 | FromDiscord | <fwsgonzo> one of the strength of systems languages are optimized executables, regardless of them being executed instruction by instruction |
18:31:16 | FromDiscord | <fwsgonzo> the emulator is C++ so its a drop-in in most game project |
18:31:16 | FromDiscord | <fwsgonzo> (edit) "project" => "projects" |
18:31:55 | * | r4vi joined #nim |
18:31:55 | * | sirn joined #nim |
18:31:59 | * | notchris joined #nim |
18:32:10 | FromDiscord | <fwsgonzo> https://gist.github.com/fwsGonzo/c77befe81c5957b87b96726e98466946 |
18:33:42 | * | d10n-work joined #nim |
18:33:51 | FromDiscord | <Zachary Carter> pretty impressive |
18:33:59 | * | hoek joined #nim |
18:34:29 | * | sz0 joined #nim |
18:34:29 | FromGitter | <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:18 | FromGitter | <Araq> "ok, what about multipication and signed integers?" -- RISC-V "la la la, we're simple instead" |
18:35:35 | FromDiscord | <fwsgonzo> theres multiple instructions for multiplication? |
18:35:48 | FromDiscord | <fwsgonzo> if you want to complain, complain about sign-extension |
18:36:06 | FromDiscord | <fwsgonzo> or the compressed instructions, both of which add emulation overhead |
18:36:09 | FromDiscord | <mratsim> multiplication on x86: I'll just use RAX and RDX, get out of my lawn. |
18:36:19 | FromDiscord | <fwsgonzo> its certainly not the perfect architecture for emulation, but it does get the job done |
18:36:22 | FromDiscord | <mratsim> oh and 2 more registers as well |
18:36:24 | FromGitter | <Araq> when I looked at it, these instructions were in some unspecified "extension" |
18:36:42 | FromGitter | <Araq> everything useful in some bullshit "extension" |
18:37:05 | FromDiscord | <fwsgonzo> yea the M-extension. very simple micro-controllers would only support the base ISA which has just the basic instructions |
18:37:08 | federico3 | huh? |
18:37:34 | federico3 | the modular design makes a lot of sense to scale down to tiny microcontrollers |
18:37:40 | FromDiscord | <fwsgonzo> indeed |
18:38:12 | federico3 | you are not expected to target only the core ISA |
18:38:49 | FromGitter | <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:17 | FromDiscord | <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:40 | FromDiscord | <mratsim> no idea |
18:39:55 | FromDiscord | <mratsim> sometimes it's genuine, and sometimes it's wrong. |
18:40:15 | FromDiscord | <mratsim> because symbol bound in macros or something are not seen by the unused import check. |
18:41:00 | FromDiscord | <mratsim> there are a couple of warnings that are annoying because they are wrong: UnusedImport, ObservableStores and the Proveinit. |
18:41:21 | FromDiscord | <mratsim> I don't think I have the last 2 in weave though |
18:42:28 | FromGitter | <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:26 | FromGitter | <Araq> @haxscramper you need to use --define:nimcore on the command line when compiling or put it to your config |
18:43:42 | FromGitter | <dom96> @Araq can you check your PMs? |
18:44:11 | FromGitter | <haxscramper> I'm writing compiler-based tooling, and explicitly creating configuration/module graph etc. Is `--define:nimcore` still applicable in this situation? |
18:44:31 | FromDiscord | <konsumlamm> kk, also, i noticed that it segfaults, if i don't call `init` and `exit`, i assume that's a bug? |
18:45:00 | FromGitter | <haxscramper> . |
18:46:23 | FromDiscord | <konsumlamm> also, i'm curious, what does a `type Weave` parameter mean? |
18:46:49 | * | tane joined #nim |
18:47:18 | federico3 | Araq: what matter for Nim's implementation is that the rv64 target can be safely assumed to be rv64gc |
18:47:30 | FromDiscord | <Rika> Takes in the actual type Weave and not a parameter of type Weave |
18:47:39 | FromDiscord | <Rika> So you pass the type name |
18:48:12 | FromDiscord | <Rika> What its purpose is for weave is to force (quasi)qualification |
18:48:13 | FromGitter | <haxscramper> Yes, it works, so I guess I had misunderstanding on where the symbol needs to be defined |
18:53:57 | FromDiscord | <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:06 | FromDiscord | <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:36 | FromDiscord | <mratsim> no exceptions in Weave |
18:58:56 | FromDiscord | <konsumlamm> hmm, k |
18:59:03 | FromDiscord | <mratsim> maybe an assert but that stuff would be called on every spawn. |
18:59:28 | FromDiscord | <konsumlamm> ye, i thought so, but assertions can be disabled |
18:59:50 | FromDiscord | <konsumlamm> auto-initializing would also solve the issue ig |
19:00:24 | FromDiscord | <mratsim> yeah but I don't want to impose my overhead and leave control to people |
19:00:33 | FromDiscord | <mratsim> It's a library not a framework |
19:00:46 | FromDiscord | <mratsim> but I guess once I have user threadpools |
19:00:55 | FromDiscord | <mratsim> I can have those for those who want control |
19:01:03 | FromDiscord | <mratsim> and the global one be autoinitialized |
19:01:38 | FromDiscord | <konsumlamm> ye, fair |
19:02:32 | * | notchris joined #nim |
19:04:22 | FromDiscord | <Clyybber> Araq: Does it make sense to use intset/packedset for a set of PNodes? |
19:05:24 | * | narimiran joined #nim |
19:06:08 | FromGitter | <Araq> no. |
19:06:46 | FromDiscord | <Clyybber> so should I use normal HashSets instead? (I just need ref equality here) |
19:12:12 | FromGitter | <Araq> why do you need it? |
19:12:28 | FromGitter | <Araq> we discussed new node flags so that you can avoid the lookup table altogether |
19:14:48 | FromDiscord | <Clyybber> Araq: Yeah, but I need to store some things internally during the analysis |
19:14:54 | FromDiscord | <Clyybber> I'm using node flags |
19:15:38 | * | hoek joined #nim |
19:15:53 | FromDiscord | <Clyybber> And theres a lot of `for pla in potLastReadsA: if pla notin oldPotLastReads: potLastReads.add pla` |
19:16:02 | FromGitter | <Araq> thankfully we don't overload == for PNode so a HashSet will be fine |
19:16:20 | * | sz0 joined #nim |
19:16:22 | FromDiscord | <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:17 | hmmm | nimions! <3 |
19:58:27 | hmmm | how do I check the type of an object? |
19:58:37 | hmmm | I knew it but I forgot :| |
19:58:41 | FromDiscord | <lqdev> `x is MyType` |
19:58:54 | hmmm | wasn't something like typeof? |
19:59:04 | FromDiscord | <lqdev> there's typeof also |
19:59:13 | hmmm | I'll try |
19:59:15 | hmmm | <33 |
19:59:31 | FromDiscord | <lqdev> you said "check" so i assumed you want to see if an expression is of some type :p |
19:59:31 | FromDiscord | <konsumlamm> get != check :p |
20:01:18 | * | kwilczynski joined #nim |
20:03:41 | hmmm | what was nim version of python "with thisfile open: do stuff" and close the thing without me doing any work |
20:03:54 | FromDiscord | <Clyybber> defer |
20:04:03 | hmmm | hmm |
20:04:06 | hmmm | it rings a bell |
20:04:08 | FromDiscord | <Clyybber> defer: file.close() |
20:04:10 | hmmm | I'll go check |
20:10:49 | hmmm | defer is comfy |
20:10:52 | hmmm | ty clybby |
20:15:18 | FromDiscord | <exelotl> Again, looking forward to destructors for files 😅 |
20:15:38 | hmmm | why can't I create a variable inside a proc? I'm getting undeclared identifier error :? |
20:15:52 | FromDiscord | <lqdev> hmmm: show us the code. |
20:15:55 | hmmm | very suspect |
20:17:51 | FromDiscord | <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:24 | FromDiscord | <haxscramper> E.g. I need location of field use, but `.info` for symbol stores location of field definition |
20:18:33 | hmmm | https://play.nim-lang.org/#ix=2Nv8 |
20:19:24 | FromDiscord | <Clyybber> hmmm: Replace the : on the second line with = |
20:19:30 | hmmm | oh shi |
20:19:41 | hmmm | :DDD |
20:20:04 | hmmm | clibby <3 |
20:21:11 | FromDiscord | <Clyybber> <3 |
20:23:41 | FromDiscord | <Clyybber> @haxscramper Are you sure you are using the .info of the PNode not the PSym? |
20:26:28 | FromDiscord | <haxscramper> Yes, `node is PNode`, but `echo .info` returns the same line/column for all nodes in module |
20:27:19 | FromDiscord | <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:39 | FromDiscord | <haxscramper> (edit) "`TSym`" => "`TNode`" |
20:29:41 | FromDiscord | <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:48 | FromDiscord | <Clyybber> hmm |
20:30:21 | * | def- quit (Quit: -) |
20:30:26 | FromDiscord | <Clyybber> and the .info of the nkDotExpr points to what you want? |
20:30:32 | * | def- joined #nim |
20:36:01 | FromDiscord | <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:25 | hmmm | hey can I do something like this: var x : File and then later check if it's empty or not with "if x" |
20:36:43 | FromDiscord | <andeee> sent a code paste, see https://play.nim-lang.org/#ix=2Nvj |
20:37:16 | FromDiscord | <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:24 | FromDiscord | <haxscramper> Though lattern one is just a guess |
20:37:57 | hmmm | very interesting |
20:38:07 | hmmm | I'll try to fiddle withi this isNil stuff |
20:38:24 | FromDiscord | <haxscramper> Or you can do `Option[File]` if you want to be more explicit |
20:38:53 | FromDiscord | <haxscramper> Like `if someCondition(): # set file to something` and `if file.isSome(): # write to it` |
20:41:04 | FromDiscord | <haxscramper> IIRC you can just do `var nimString = newStringOfCap(<size>)`, then pass it using `nimString.cstring`, `nimString.len` to C API |
20:41:06 | FromDiscord | <haxscramper> And return it |
20:43:40 | hmmm | 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:41 | FromDiscord | <andeee> oh that's nice, maybe the way i'm doing it fucks something up |
20:43:49 | FromDiscord | <andeee> (edit) "oh that's nice, maybe the way i'm doing it fucks something up ... " added "with the string representatin" |
20:43:51 | FromDiscord | <andeee> (edit) "representatin" => "representation" |
20:45:05 | FromDiscord | <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:20 | FromDiscord | <haxscramper> But I'm not sure if that is the case, but I've had some issues with `defer` and whatever |
20:47:54 | FromDiscord | <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:25 | FromDiscord | <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:53 | FromDiscord | <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:15 | FromDiscord | <CodeHz> does --gc:arc affect compile-time evaluation? |
21:37:01 | Zevv | no |
21:37:21 | FromDiscord | <CodeHz> https://github.com/nim-lang/Nim/issues/16847 ↵but in my case, I got nil in macro |
21:37:27 | disbot | ➥ ARC/nimSeqsV2 breaks compile-time evaluation (macro) ; snippet at 12https://play.nim-lang.org/#ix=2NvD |
21:38:25 | Zevv | well, if you hadn't filed this as a github issue, I would have told you to file a github issue |
21:39:27 | Zevv | binpak? |
21:39:46 | FromDiscord | <CodeHz> (just a experiment project( |
21:40:00 | FromDiscord | <CodeHz> (edit) "a" => "an" |
21:40:12 | Zevv | like this it's not reproducable for others |
21:40:51 | FromDiscord | <CodeHz> at least reproduce in my WSL and windows native environment |
21:41:09 | Zevv | yeah but how can we reproduce with your code? |
21:42:40 | FromDiscord | <CodeHz> sent a code paste, see https://play.nim-lang.org/#ix=2NvE |
21:42:55 | FromDiscord | <CodeHz> (I think I've already paste the permlink to this file in that issue |
21:49:57 | FromDiscord | <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:33 | FromDiscord | <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:19 | FromDiscord | <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:33 | FromDiscord | <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:45 | FromDiscord | <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:11 | FromDiscord | <haxscramper> You can have custom unpacker |
21:54:19 | FromDiscord | <konsumlamm> oh, i can? nice |
21:54:33 | FromDiscord | <haxscramper> Overload [] operator for static FieldIndex |
21:54:49 | FromDiscord | <haxscramper> IIRC there is a test with this example |
21:55:14 | FromDiscord | <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:35 | FromDiscord | <haxscramper> No, it doesn't work because I haven't thought about it |
21:56:51 | FromDiscord | <haxscramper> But it should - I need to fix that |
21:57:08 | FromDiscord | <konsumlamm> in general, the only patterns supported for Option seem to be `None` and `Some(@var)` |
21:57:13 | FromDiscord | <haxscramper> Though in form of `Some(Some(@a))` |
21:57:21 | FromDiscord | <konsumlamm> ye, that would be nice |
21:57:37 | FromDiscord | <haxscramper> Yes, that is correct, Option is edge-cased explicitly |
21:58:03 | FromDiscord | <haxscramper> For only those two patterns at this moment, and they are not recursive |
21:58:54 | FromDiscord | <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:01 | FromDiscord | <haxscramper> Well |
21:59:05 | FromDiscord | <haxscramper> I don't like it too |
21:59:26 | FromDiscord | <haxscramper> But there was some extremely compelling reason why it is this way |
22:01:16 | FromDiscord | <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:36 | FromDiscord | <haxscramper> Sometimes in the future |
22:03:54 | FromDiscord | <lqdev> maybe the reason was that @ has higher precedence than other prefix operators? |
22:04:24 | FromDiscord | <konsumlamm> i'm not talking about why @ specifically, but why an operator prefix in the first place |
22:07:43 | FromDiscord | <haxscramper> To indicate variable injection and because all other pattern matching libraries used it |
22:08:49 | FromDiscord | <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:52 | FromDiscord | <konsumlamm> patty doesnt as far as i can tell |
22:10:15 | FromDiscord | <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:47 | FromDiscord | <haxscramper> But I guess it just sort of happened at some point, because I used this in nimtrs |
22:11:06 | FromDiscord | <haxscramper> And notable portion of the syntax was influenced by it |
22:16:50 | FromDiscord | <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:19 | FromDiscord | <konsumlamm> ahh, now i now what ypu meant with `let`; using `let a` instead of `@a`, i like that |
22:20:40 | FromDiscord | <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:47 | FromDiscord | <konsumlamm> but the rest is pretty cool, nice job |
22:21:54 | FromDiscord | <haxscramper> Trailing if expressions would be really clunky and need to be wrapped in layers of parentheses to get correct AST |
22:23:09 | FromDiscord | <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:36 | FromDiscord | <haxscramper> Operators in patters are mostly for `in setOfSomething` but it made no sense to restrict them to particular set of operators |
22:25:08 | FromDiscord | <haxscramper> (edit) "`in" => "`field: in" |
22:27:25 | FromDiscord | <konsumlamm> ye, i can agree on that at least |
22:28:07 | FromDiscord | <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:15 | FromDiscord | <haxscramper> Maybe I misunderstood what particular syntax do you have in mind |
22:32:35 | FromDiscord | <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:14 | FromDiscord | <konsumlamm> something like `of [@a, .._] if a == 1:` |
22:56:35 | FromDiscord | <konsumlamm> so `<pattern> if <expression>` |
22:57:54 | FromDiscord | <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) |