00:00:37 | FromDiscord | <Elegantbeef> I know I do |
01:11:21 | * | alexdaguy joined #nim |
02:42:16 | FromDiscord | <.tokyovigilante> sent a code paste, see https://play.nim-lang.org/#pasty=gEVXlLTo |
02:43:13 | FromDiscord | <.tokyovigilante> (edit) "https://play.nim-lang.org/#pasty=QRxHYHiR" => "https://play.nim-lang.org/#pasty=vXSiJAvu" |
02:44:19 | FromDiscord | <.tokyovigilante> sent a long message, see https://pasty.ee/qeHdjlbE |
02:45:47 | FromDiscord | <.tokyovigilante> (sorry about the partial pastes) |
02:46:31 | FromDiscord | <.tokyovigilante> sent a code paste, see https://play.nim-lang.org/#pasty=vFNTeEWH |
02:47:02 | FromDiscord | <.tokyovigilante> But it turns out if I just skip the `include` indirection then this code will compile, which seems like it may actually be a compiler bug? |
02:47:45 | FromDiscord | <.tokyovigilante> ie if I delete `wayland_impl.nim` and just `import wayland_client_generated.nim` then it does compile. |
02:48:53 | FromDiscord | <.tokyovigilante> sent a code paste, see https://play.nim-lang.org/#pasty=sPsnxvwd |
02:49:34 | FromDiscord | <Elegantbeef> This is a Nim type bug you've found |
02:49:35 | FromDiscord | <Elegantbeef> How are you doing the include indirectin? |
02:49:35 | FromDiscord | <Elegantbeef> Why are you even including |
02:50:02 | FromDiscord | <Elegantbeef> change that to an import and be normal cheers π |
02:52:41 | FromDiscord | <Elegantbeef> I have very little faith in that `include` is what you want, no clue whether it fixes the bug though |
02:52:55 | FromDiscord | <Elegantbeef> I know for me I've used import over include for futhark generated code |
02:53:07 | FromDiscord | <Elegantbeef> But I also pretend `include` doesn't exist |
02:54:44 | FromDiscord | <.tokyovigilante> Fair, it does not fix the bug, but feels good to be normal π |
02:56:42 | FromDiscord | <.tokyovigilante> There is extra stuff in `wayland_impl` (mainly inline code which Futhark doesn't automatically bring in) which I omitted for brevity and I can reproduce the above without it |
02:56:55 | FromDiscord | <Elegantbeef> Do you have this in a repo? |
03:00:32 | FromDiscord | <.tokyovigilante> https://git.sr.ht/~tokyovigilante/Tsunami/ |
03:00:48 | FromDiscord | <.tokyovigilante> Please don't laugh at my amateur coding skills |
03:00:51 | FromDiscord | <Elegantbeef> Thanks saves me making files |
03:01:04 | FromDiscord | <.tokyovigilante> That's the full app not the reproducible example |
03:01:16 | FromDiscord | <.tokyovigilante> I can share the test case alternatively |
03:01:26 | FromDiscord | <Elegantbeef> Too late |
03:01:51 | FromDiscord | <Elegantbeef> I'm already running your malware locally |
03:02:05 | FromDiscord | <.tokyovigilante> Isn't all Nim code malware? |
03:02:14 | FromDiscord | <Elegantbeef> Only the way you write it |
03:03:12 | FromDiscord | <Elegantbeef> `tsunami` is the entry file? |
03:03:24 | FromDiscord | <.tokyovigilante> yup |
03:03:35 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=TMEuqKTd |
03:04:48 | FromDiscord | <.tokyovigilante> Yup, that's my issue, can't see how `ptr struct_wl_surface` and `ptr struct_wl_surface` are mismatched |
03:06:02 | FromDiscord | <Elegantbeef> Why are you importing using strings |
03:06:02 | FromDiscord | <Elegantbeef> Right different procedure as prior so thought I was not on the scent |
03:07:06 | FromDiscord | <Elegantbeef> Oh you're using code reorder aswell |
03:07:20 | FromDiscord | <Elegantbeef> Really throwing everything at the fun hell of diagnosing issues |
03:07:48 | FromDiscord | <.tokyovigilante> I thought we agreed you wouldn't make fun... maybe I do need to buy that book after all |
03:07:59 | FromDiscord | <.tokyovigilante> (furiously taking notes) |
03:08:01 | FromDiscord | <Elegantbeef> I mean I'm not making fun I'm trying to solve the issue π |
03:08:17 | FromDiscord | <Elegantbeef> code reordering is a compiler feature which could cause issues |
03:08:55 | FromDiscord | <.tokyovigilante> importing with strings for my local modules, unquote for system modules, sure I saw that somewhere... |
03:09:25 | FromDiscord | <Elegantbeef> Might be a status style guide, but i'm suspect of it myself |
03:09:56 | FromDiscord | <.tokyovigilante> Ah right. I could put my declarations first, LIKE AN ANIMAL. I did that before I got the codegen working for the Wayland stuff, while I was willy-nilly implementing functions to get a build going |
03:10:26 | FromDiscord | <Elegantbeef> Like a normal person that likes seeing what they're working with before other code |
03:10:37 | FromDiscord | <Elegantbeef> Even in a language with reordering I prefer declaration before usage so I know what's what. YMMV |
03:14:06 | FromDiscord | <Elegantbeef> Wait a minute `xdg_shell` uses `wayland_client_generated` even with `--d:useFuthark`? |
03:15:32 | FromDiscord | <.tokyovigilante> well... no. That's another temporary-ism, all the protocol extensions will need `wayland_client_generated` for some of the base protocol types so I just run a build with `--d:useFuthark` to generate that module, and then run a normal build which will include it where required. |
03:15:47 | FromDiscord | <.tokyovigilante> There is probably a better way to structure it |
03:15:50 | FromDiscord | <Elegantbeef> Well `include` would throw a wrench into that |
03:16:00 | FromDiscord | <Elegantbeef> So yea good thing you don't use include π |
03:16:14 | FromDiscord | <.tokyovigilante> In theory it should work with import in multiple places once generated though right? |
03:21:43 | FromDiscord | <ElegantBeef> sent a code paste, see https://play.nim-lang.org/#pasty=KIYosWQd |
03:21:52 | FromDiscord | <ElegantBeef> Surely that slower me will catch up |
03:22:09 | FromDiscord | <ElegantBeef> in the mean time https://media.discordapp.net/attachments/371759389889003532/1349583282140086272/image.png?ex=67d3a0e0&is=67d24f60&hm=2db9b760037fbbf6e9712308ae296e83e3d2f257e1dd6c0878b8f2c29805fa5d& |
03:22:51 | FromDiscord | <ElegantBeef> It's looking a lot like you're getting two `struct _wl_display`s for one proc |
03:23:11 | FromDiscord | <Elegantbeef> Wait |
03:23:12 | FromDiscord | <Elegantbeef> bad copy |
03:23:12 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=CikfLpPA |
03:24:05 | FromDiscord | <.tokyovigilante> I mean, my infrastructure is a leaning tower of issues... I'm using a packaged Nim and Nimble from the Alpine repo and I haven't quite figured out how to make that play nicely with nimple dependencies |
03:24:20 | FromDiscord | <ElegantBeef> Heh |
03:24:50 | FromDiscord | <.tokyovigilante> But yeah, presumably under the hood somewhere those two pointer types are different despite looking the same |
03:25:08 | FromDiscord | <ElegantBeef> You `import wayland_impl` and `wayland_client_generated` |
03:25:59 | FromDiscord | <ElegantBeef> When using futhark atleast this means the types are not compatible |
03:26:16 | FromDiscord | <ElegantBeef> Since one comes from `wayland_impl` and another from `wayland_client_generated` |
03:27:03 | FromDiscord | <ElegantBeef> https://status-im.github.io/nim-style-guide/language.import.html ah also status doesn't use strings in their style guide |
03:27:10 | FromDiscord | <ElegantBeef> So no clue where you got that from π |
03:27:27 | FromDiscord | <.tokyovigilante> ok, will consider myself told π |
03:39:28 | FromDiscord | <ElegantBeef> @.tokyovigilante you've trolled me `xdg_shell` defines the type so does `wayland_client_generated` |
03:39:58 | FromDiscord | <ElegantBeef> Remove the def from `xdg_shell` and it suddenly works |
03:41:30 | FromDiscord | <Elegantbeef> I could've sworn that there was a time when types would print the module in output |
03:43:58 | FromDiscord | <.tokyovigilante> Ah I am an idiot. I think that was in before I realised I just needed to pull in the whole generated module. Then I even spent time not exporting those symbols thinking they would fix it, but of course they all still end up in the symbol table |
03:44:06 | FromDiscord | <.tokyovigilante> Thanks for the help, and the free code review! |
03:45:12 | FromDiscord | <.tokyovigilante> I will not quit my day job |
03:45:47 | * | rockcavera quit (Remote host closed the connection) |
03:55:50 | * | beholders_eye quit (Ping timeout: 260 seconds) |
04:58:20 | * | ensyde joined #nim |
05:02:09 | * | andreas quit (Quit: Konversation terminated!) |
05:02:20 | * | andreas joined #nim |
05:36:35 | * | ensyde quit (Quit: WeeChat 4.5.2) |
06:18:35 | * | ntat joined #nim |
08:41:41 | FromDiscord | <Zoom> @fromiselectq0 you were just unlucky and bumped into https://github.com/nim-lang/choosenim/issues/64β΅β΅Usually it works fine, but this bug is annoying and all the maintainers are busy with nimony. It's a bit annoying that nobody told you what's happening right away. GCC from 99 was funny, though. |
08:45:07 | FromDiscord | <fromiselectq0> In reply to @Zoom "<@552170338100969474> you were just": Ikr πππ |
08:45:26 | FromDiscord | <fromiselectq0> It caught me off guard |
10:14:52 | * | ntat quit (Quit: Leaving) |
10:18:01 | * | beholders_eye joined #nim |
10:30:35 | FromDiscord | <aintea> sent a code paste, see https://play.nim-lang.org/#pasty=MqbwMCEc |
10:31:18 | FromDiscord | <aintea> (edit) "https://play.nim-lang.org/#pasty=MptZhBBz" => "https://play.nim-lang.org/#pasty=eXjLyxnf" |
10:31:23 | FromDiscord | <aintea> Where `newParser` is the macro |
10:49:01 | FromDiscord | <demotomohiro> In reply to @aintea "I have no idea": There are tutorials for learning macros: https://internet-of-tomohiro.pages.dev/nim/faq.en#macro-is-there-any-tutorial-or-documents-to-learn-about-macroqmark |
10:49:58 | * | ntat joined #nim |
11:12:43 | FromDiscord | <solitudesf> In reply to @aintea "I have no idea": slap both of those into dumpTree and looks what you need to transform |
11:19:22 | ehmry | dumpTree is great. when I write a code generator I write an example of what I want by hand, put it thru dumpTree and then try to recreate it in code |
11:21:44 | FromDiscord | <aintea> In reply to @solitudesf "slap both of those": I've took a look at it but I have no idea how to start to write the parsing |
11:21:57 | FromDiscord | <aintea> In reply to @demotomohiro "There are tutorials for": Thanks |
11:24:45 | ehmry | .tokyovigilante: are you doing code generation? |
11:26:14 | * | ntat quit (Read error: Connection reset by peer) |
11:32:30 | * | ntat joined #nim |
11:57:04 | FromDiscord | <pmunch> In reply to @Zoom "<@552170338100969474> you were just": Not sure what the fix for this would be. I guess finding arch from the system and maybe trigger an error if GCC arch doesn't match? |
11:57:25 | FromDiscord | <pmunch> And you can create your own PRs to choosenim, be the change you want to see in the world π |
12:18:36 | * | ntat quit (Read error: Connection reset by peer) |
12:26:20 | * | ntat joined #nim |
13:10:31 | FromDiscord | <enthus1ast.> do we have a build in "getOrDefault" for openarray index access? |
13:11:23 | FromDiscord | <enthus1ast.> sent a code paste, see https://play.nim-lang.org/#pasty=wkVQqdJt |
13:15:06 | FromDiscord | <enthus1ast.> or, how would you write code that access an seq index where you do not know if the index is there? |
13:24:50 | FromDiscord | <Robyn [She/Her]> sent a code paste, see https://play.nim-lang.org/#pasty=qHzYRTHs |
13:25:09 | FromDiscord | <Robyn [She/Her]> that code should just work, no? |
13:28:42 | FromDiscord | <enthus1ast.> yes, but before i use it in my project i thought maybe i overlooked a build in |
13:29:30 | Amun-Ra | ss.len <= idx looks unorthodox |
13:31:33 | FromDiscord | <enthus1ast.> ? |
13:32:16 | Amun-Ra | I mean it's just a yoda notation; btw you can use .high here instead |
13:32:35 | Amun-Ra | if idx > ss.high: return default |
13:33:09 | FromDiscord | <enthus1ast.> yes high is better, i always forget that we have that |
13:34:32 | Amun-Ra | and if that's inside a hot path of some kind, I'd thow "unlikely" in, too |
13:34:55 | FromDiscord | <enthus1ast.> not hot but why not |
13:38:28 | FromDiscord | <enthus1ast.> so just for the protocol, you're also not aware of a build in? π |
13:47:02 | FromDiscord | <Robyn [She/Her]> In reply to @Amun-Ra "and if that's inside": i don't think you should do that unless you actually profile your code tbh |
13:47:21 | FromDiscord | <Robyn [She/Her]> wouldn't just throw that around, compilers generally are pretty good at optimising |
13:48:14 | * | ntat quit (Quit: leaving) |
13:52:46 | FromDiscord | <enthus1ast.> since (plan) to use this code in js it will not matter |
13:53:06 | FromDiscord | <enthus1ast.> but i would benchmark it out of curiosity |
14:25:46 | * | ntat joined #nim |
14:30:33 | FromDiscord | <leorize> benchmarking JIT-able code is just a PITA |
14:31:35 | FromDiscord | <leorize> I'd recommend getting the whole program together then profile it to find bottlenecks instead of spending time on microbench |
14:31:44 | Amun-Ra | Robyn: that depends on which occurance is more frequent, you can do that w/o the profiler |
14:33:10 | FromDiscord | <enthus1ast.> @leorize0713 i'm waaay before i care about benchmarks π β΅I have thousands of lines in a big frontend.nim (karax) what works, does the job. But i now refactor and cleanup and modularize. |
14:34:34 | FromDiscord | <enthus1ast.> BUT if i would not have just "hack the stuff together" i would not have a "produkt" but would still think about the best/most elegant way of doing stuff |
15:51:07 | * | alexdaguy quit (Quit: ded) |
15:57:48 | * | ntat_ joined #nim |
16:08:31 | FromDiscord | <Robyn [She/Her]> In reply to @Amun-Ra "Robyn: that depends on": Why wouldn't you structure the branching code in that way then? |
16:16:59 | * | ntat_ quit (Quit: leaving) |
16:38:02 | Amun-Ra | Robyn: let's say you read a file and you're just past the magic value and the next field according to the specs should be less than X; we can discuss whether it's a part of hot path; we don't have to profile the 99.9% of the files are according to the spec |
16:44:04 | FromDiscord | <Robyn [She/Her]> that doesn't really answer my question |
16:44:21 | FromDiscord | <Robyn [She/Her]> i'm saying why wouldn't you put the hot path/branch, first |
16:47:55 | Amun-Ra | that wasn't the part of the question before |
16:48:52 | Amun-Ra | what I only mean was you don't have to use profiler to predict the branch |
16:50:00 | FromDiscord | <Robyn [She/Her]> In reply to @battery.acid.bubblegum "Why wouldn't you structure": ^^^ |
16:50:39 | FromDiscord | <Robyn [She/Her]> In reply to @Amun-Ra "what I only mean": that's fair enough ig, but honestly I think restructuring code would be better than just slapping a `likely` or `unlikely` somewhere |
16:56:51 | * | pmp-p quit (Ping timeout: 252 seconds) |
17:00:53 | * | pmp-p joined #nim |
17:38:30 | tokyovigilante | ehmry: yup, Iβll share my wayland-scanner changes presently, will probably refactor it to be standalone ultimately though, itβs a bit clunky. |
18:04:29 | FromDiscord | <user2m> can I use -g directly like `nim c -g app.nim` ? |
18:14:09 | FromDiscord | <lainlaylie> seems undocumented but yes |
18:27:16 | FromDiscord | <nervecenter> what does it do? |
18:39:43 | FromDiscord | <user2m> > Use the nim c command to compile your Nim code, but include the -g flag to enable the inclusion of debug information |
18:40:10 | FromDiscord | <user2m> I have a memory leak and using valgrind and I think I need to pass -g |
18:47:00 | FromDiscord | <Elegantbeef> `--debugger:native` |
19:15:45 | * | beholders_eye quit (Ping timeout: 260 seconds) |
19:31:09 | FromDiscord | <leorize> I'd recommend LeakSanitizer/AddressSanitizer over valgrind |
19:31:12 | FromDiscord | <leorize> valgrind is just too slow for complex programs |
19:31:13 | FromDiscord | <Elegantbeef> I love trying to use valgrind with SDL games, it takes like 30 seconds to open a window |
19:40:11 | Amun-Ra | asan/ubsan/etc. |
19:40:40 | Amun-Ra | ah, I missed the line mentioned those already |
19:53:56 | FromDiscord | <Elegantbeef> Slooooooow |
20:24:46 | Amun-Ra | ;) |
21:00:53 | FromDiscord | <user2m> how can I update all my installed nim packages with nimble? |
21:04:53 | FromDiscord | <Elegantbeef> update your .nimble |
21:06:24 | FromDiscord | <user2m> In reply to @Elegantbeef "update your .nimble": Im not sure what you mean? I see the .nimble dir - how do I update this? |
21:06:48 | FromDiscord | <Elegantbeef> manually go to each dependency and copy the newest version |
21:07:04 | FromDiscord | <user2m> In reply to @Elegantbeef "manually go to each": ...theres no automatic way? |
21:07:17 | FromDiscord | <Elegantbeef> Not that I know of |
21:07:43 | FromDiscord | <Elegantbeef> A shell script could do it quickly |
21:08:23 | FromDiscord | <user2m> I found this https://forum.nim-lang.org/t/4648 just weird that it's not built in |
21:08:47 | FromDiscord | <Elegantbeef> "PRs welcome" |
21:09:48 | * | xet7 quit (Remote host closed the connection) |
21:11:02 | FromDiscord | <Elegantbeef> I don't think that works for packages not in your registry |
21:11:40 | * | xet7 joined #nim |
21:13:46 | FromDiscord | <user2m> yeah I only want to update the packages i've installed |
21:14:17 | FromDiscord | <Elegantbeef> Right but if you installed a package by giturl instead of by name it will fail to update it |
21:18:07 | FromDiscord | <user2m> yup I see that now lol |
21:20:06 | FromDiscord | <Elegantbeef> could use `nimble dump` and iterate the `requires` |
22:05:54 | * | ntat quit (Quit: Leaving) |
22:23:59 | * | rockcavera joined #nim |
22:57:35 | * | beholders_eye joined #nim |
23:14:09 | * | beholders_eye quit (Ping timeout: 260 seconds) |
23:46:18 | * | beholders_eye joined #nim |