| 00:17:33 | * | rockcavera quit (Remote host closed the connection) |
| 00:41:07 | * | KawaiiSelbst quit (Read error: Connection reset by peer) |
| 00:42:07 | * | rockcavera joined #nim |
| 00:42:13 | * | KawaiiSelbst joined #nim |
| 02:46:46 | FromDiscord | <zkopt_> In reply to @litlighilit "just use \`const\` or": you can't use table for const |
| 02:48:08 | FromDiscord | <zkopt_> var with {.compileTime.} paragma is right answer↵↵I solve that problem with var and {.compileTime.} paragma |
| 02:49:02 | * | rockcavera quit (Remote host closed the connection) |
| 04:16:45 | * | SchweinDeBurg quit (Quit: WeeChat 4.8.0-dev) |
| 04:28:51 | * | deavmi quit (Read error: Connection reset by peer) |
| 04:37:21 | * | deavmi joined #nim |
| 05:01:17 | * | SchweinDeBurg joined #nim |
| 05:03:10 | FromDiscord | <Tóth Alfréd> I think it's more like a mix of Pascal and Rust with the syntax being very similar to Python↵(@xenthial) |
| 05:48:19 | FromDiscord | <amun0666> In reply to @zkopt_ "var with {.compileTime.} paragma": You can use table for const |
| 05:48:20 | FromDiscord | <amun0666> . |
| 05:51:34 | FromDiscord | <amun0666> sent a code paste, see https://paste.rs/yoeDR |
| 06:13:28 | * | sdothum quit (Ping timeout: 259 seconds) |
| 06:26:31 | * | sdothum joined #nim |
| 06:41:39 | FromDiscord | <Laylie> no code, no error message, no description of what they're trying to do, very difficult to help |
| 06:43:27 | FromDiscord | <b0rsuk> In reply to @Amun-Ra "in what sense?": `Nim = 1/2 C`, therefore `2 Nim = C`.↵People talk a lot about C in this server. Long ago I finished C exercises bundled with my copy of `C Programming Language` (K&R), but I don't think it's enough to make me a better Nim programmer. |
| 06:45:21 | FromDiscord | <amun0666> And `2 == C / Nim` |
| 07:45:31 | * | hygo joined #nim |
| 07:57:17 | FromDiscord | <b0rsuk> This message confused me for several minutes.↵It says `for split`, but it's actually getting the correct type (a string) for the split function. What it really means is the function should return a string. And if I put a dollar in front of the line, I get no error (function logic is incomplete though). https://media.discordapp.net/attachments/371759389889003532/1547878685707866153/but_expected.png?ex=6aa505dc&is=6aa3b45c&hm=1b00568470b |
| 07:58:09 | FromDiscord | <b0rsuk> No, it's getting `seq[string]` from `split`. |
| 09:41:04 | * | Jhonny2x4 quit (Quit: Jhonny2x4) |
| 09:41:17 | * | Jhonny2x4 joined #nim |
| 10:30:00 | FromDiscord | <amun0666> In reply to @b0rsuk "`Nim = 1/2 C`,": You can program in Nim like you did in C. I usually try to use as many low level functions as possible. |
| 10:41:40 | FromDiscord | <b0rsuk> In reply to @amun0666 "You can program in": Is there anything in the stdlib for benchmarking? We both know you can't program C style without benchmarking. |
| 10:43:17 | FromDiscord | <b0rsuk> It surprises me the "Nim for C programmers" document doesn't mention benchmarking 🙂 |
| 10:48:10 | FromDiscord | <amun0666> Hmm, I almost never benchmarked any of my C programs… 😉 |
| 11:01:27 | * | beholders_eye joined #nim |
| 12:58:19 | FromDiscord | <ghazalialshafi> In reply to @b0rsuk "It surprises me the": There is a famous lib in nim to do it : https://github.com/treeform/benchy |
| 13:52:10 | FromDiscord | <b0rsuk> In reply to @ghazalialshafi "There is a famous": It's third party, so you can't use it on exercism.org for example |
| 13:52:41 | FromDiscord | <b0rsuk> And it would be tempting to do so because it encourages you to try at least a couple of programming languages. |
| 13:53:22 | FromDiscord | <b0rsuk> The attitude I sense from C and Rust programmers is Benchmark Driven Development. |
| 14:15:52 | FromDiscord | <_timurski> In reply to @b0rsuk "Is there anything in": there is `cpu time` and `get mono time` but I actually don't know if Nim has proper micro benchmarking libraries like the equivalent of Google Bench ? |
| 14:16:23 | FromDiscord | <_timurski> https://youtu.be/EU_nQh8wg5A |
| 14:16:43 | FromDiscord | <_timurski> this video by Matt is great at explaining why benchmarking is actually quite complicated |
| 14:31:16 | FromDiscord | <b0rsuk> I'm not saying it's easy.↵Python currently has a good stdlib module `timeit`. The Linux commandline utility `time` doesn't cut it with Python, and I couldn't measure any difference with different implementations of "difference of squares" and "sublist" (Exercism exercises). `timeit` even suspends the garbage collector. |
| 14:33:07 | FromDiscord | <b0rsuk> Without benchmarking, its hard to convince someone to write "C style Nim". |
| 14:36:53 | FromDiscord | <DetermiedNim1> whenever i need to go "how long is this executable taking?" I just use Nu 😅 |
| 14:39:24 | FromDiscord | <DetermiedNim1> sent a code paste, see https://paste.rs/c0R4U |
| 14:39:59 | FromDiscord | <DetermiedNim1> (edit) "https://paste.rs/iVZnz" => "https://paste.rs/BqKPV" |
| 14:40:05 | FromDiscord | <DetermiedNim1> (edit) "https://paste.rs/yb7hX" => "https://paste.rs/FSKrq" |
| 14:44:46 | FromDiscord | <_timurski> In reply to @b0rsuk "Without benchmarking, its hard": I don't think people are talking about benchmarking when talking about c style Nim (I don't see that term much though) |
| 14:45:03 | FromDiscord | <_timurski> benchmarking is important in specific situations regardless of style or whatever |
| 14:45:50 | FromDiscord | <_timurski> c style Nim id imagine just focuses on avoiding ref objects and probably closures |
| 14:46:21 | FromDiscord | <_timurski> just keeping the code obviously translatable to C |
| 15:17:43 | FromDiscord | <ghazalialshafi> In reply to @b0rsuk "It's third party, so": Sorry I was not knowing that you are asking about exercism : std/monotimes is exactly what you want then |
| 15:19:18 | FromDiscord | <_timurski> In reply to @b0rsuk "The attitude I sense": I just saw this, BDD sounds stupid as hell 😭 |
| 15:20:26 | FromDiscord | <_timurski> except in select cases, performance is not nearly as important as code correctness and maintainability |
| 15:22:43 | FromDiscord | <ghazalialshafi> sent a code paste, see https://paste.rs/oKN4Y |
| 15:25:03 | FromDiscord | <_timurski> remember that this won't give you good results for actual microbenchmarks |
| 15:25:26 | FromDiscord | <_timurski> watching godbolt's talk is a really great explanation of why and what to do about it |
| 15:25:33 | FromDiscord | <_timurski> (edit) "remember that this ... won't" added "(probablyh)" |
| 15:25:37 | FromDiscord | <_timurski> (edit) "(probablyh)" => "(probably)" |
| 15:30:34 | * | hygo quit (Ping timeout: 247 seconds) |
| 15:31:54 | * | beholders_eye quit (Ping timeout: 244 seconds) |
| 15:33:28 | FromDiscord | <ghazalialshafi> In reply to @_timurski "remember that this (probably)": that's true but microbenchmarks is rare i think, and if stuck inside a basic stdlib setup and want to stop the compiler from disturbing our microbenchmark, you have to inject optimization barriers. like in C asm volatile("" : "+g"(var)) ? |
| 15:34:12 | * | beholders_eye joined #nim |
| 15:38:51 | * | beholders_eye quit (Ping timeout: 247 seconds) |
| 16:58:41 | FromDiscord | <b0rsuk> sent a code paste, see https://paste.rs/PqGU9 |
| 17:00:47 | FromDiscord | <b0rsuk> Ironically, this style of solution is more robust in this case, than relying on split(), filterIt, mapIt, strip/replace. |
| 17:01:20 | FromDiscord | <b0rsuk> (edit) "Ironically, ... thisand" added "in this case" | "in this case," => "and clear" |
| 18:07:35 | * | deavmi quit (Quit: No Ping reply in 180 seconds.) |
| 18:11:31 | * | deavmi joined #nim |
| 18:14:35 | * | deavmi quit (Client Quit) |
| 18:15:47 | * | deavmi joined #nim |
| 19:49:23 | * | cm quit (Quit: Bye.) |
| 19:58:03 | * | cm joined #nim |
| 20:58:57 | FromDiscord | <Nlits (Ping on reply)> I am 80% sure I didn't use choosenim to install my current nim build on my computer. How would I go about installing choosenim now? Idk if it would tear up nimble |
| 20:59:19 | FromDiscord | <Nlits (Ping on reply)> or is it better to just manually install the newest nim version, because i'm on like 1.6.8 rn lol |
| 21:16:11 | * | beholders_eye joined #nim |
| 22:14:49 | FromDiscord | <gemath> I use grabnim. Had some problems with choosenim. |
| 22:26:20 | * | beholders_eye quit (Ping timeout: 256 seconds) |
| 22:42:11 | FromDiscord | <Nlits (Ping on reply)> In reply to @gemath "I use grabnim. Had": I do have a pretty tight restriction in that I don't have access to admin, and would need to install both nim and the installer in a seperate dir, and modify user PATH |
| 22:42:15 | FromDiscord | <Nlits (Ping on reply)> can grabnim do this? |
| 22:42:23 | FromDiscord | <Nlits (Ping on reply)> (edit) "seperate" => "user" |
| 22:43:07 | FromDiscord | <janakali> In reply to @nlits "can grabnim do this?": it sure can |
| 22:48:56 | FromDiscord | <janakali> In reply to @b0rsuk "I'm not saying it's": there's also `perf` that is available for any linux/unix OS: `perf stat` can give you lots of good timing and other performance data |
| 22:49:44 | FromDiscord | <Nlits (Ping on reply)> In reply to @janakali "it sure can": I was wondering why i hadn't heard of it before, turns out it came out during my extended break from devlopment lol |
| 22:49:58 | FromDiscord | <Nlits (Ping on reply)> nice to see, choosenim was clunky at times |
| 22:52:55 | FromDiscord | <_timurski> In reply to @janakali "there's also `perf` that": perf is sampling based though so it's just one type of profiler |
| 22:53:36 | FromDiscord | <_timurski> it's pretty good if you have a whole application you're running though yeah or something with an extended runtime (like a few dozen seconds probably) |
| 22:53:56 | FromDiscord | <_timurski> (edit) "dozen seconds probably)" => "seconds)" |
| 23:06:52 | FromDiscord | <_timurski> mac has Instruments which is amazing |
| 23:07:00 | FromDiscord | <_timurski> i've used it, and have used `perf` on my raspberry pi |
| 23:07:16 | FromDiscord | <_timurski> i didn't want to download instruments for a while on my mac so i would just test my physics engine on my raspberry pi and use `perf` 😭 |
| 23:10:37 | FromDiscord | <Nlits (Ping on reply)> @janakali `%LOCALAPPDATA%\grabnim\current\bin` is in PATH but the nim executable still can't be found |
| 23:11:56 | FromDiscord | <Nlits (Ping on reply)> it installed all the nim resrouces but not the executable itself somehow |
| 23:30:02 | FromDiscord | <Nlits (Ping on reply)> I found the executable, but was it supposed to be linked somehow |
| 23:32:13 | FromDiscord | <Nlits (Ping on reply)> also the grabnim setup command installed many redundant dependencies already in current/bin |
| 23:32:23 | FromDiscord | <Nlits (Ping on reply)> is this a bug or am i missing something |
| 23:36:00 | FromDiscord | <Nlits (Ping on reply)> In reply to @nlits "I found the executable,": ok this was fixed, had to wait 30 min then restart the console. Honestly probs a windows thing |
| 23:52:17 | FromDiscord | <janakali> In reply to @nlits "also the grabnim setup": it's not redundant, `current` is just a link to real directory |
| 23:53:13 | FromDiscord | <janakali> and waiting should not be required, restarting console is |
| 23:54:00 | FromDiscord | <Nlits (Ping on reply)> In reply to @janakali "it's not redundant, `current`": no, it installed in both .nimble/bin and in nim/bin. It also installed libs that already came w/ the installer |
| 23:54:02 | FromDiscord | <janakali> (edit) "required," => "needed," | "needed,restarting console is ... " added "required, though" |
| 23:54:33 | FromDiscord | <Nlits (Ping on reply)> In reply to @janakali "and waiting should not": I restarted the console like 5 times after I installed, but it only ended up working after i waited for like 30 min |
| 23:57:04 | FromDiscord | <janakali> if I remember right, those libs are needed for nightly builds, or for installing from source, that's why they're installed in .nimble/bin |
| 23:57:15 | FromDiscord | <janakali> choosenim does the same |
| 23:57:50 | FromDiscord | <Nlits (Ping on reply)> oh ok |
| 23:58:21 | FromDiscord | <Nlits (Ping on reply)> so they are there in case i want to switch to a nightly version |
| 23:58:30 | FromDiscord | <janakali> yeah |