00:02:21 | FromDiscord | <Hourglass [She/Her]> Random math question: Why do people wanna know the exact value of pi? |
00:03:02 | FromDiscord | <Rika> because why the fuck not |
00:03:02 | FromDiscord | <Hourglass [She/Her]> Isn't there a point we've reached that we just don't have the precision to draw a 'perfect circle' (via mechanical needs or otherwise)? |
00:03:07 | FromDiscord | <Rika> yes |
00:03:25 | FromDiscord | <Hourglass [She/Her]> Like, 100 digits |
00:03:39 | FromDiscord | <Hourglass [She/Her]> We aren't using that in math |
00:03:42 | FromDiscord | <Rika> not even, a few digits is already enough for practical purposes |
00:03:55 | FromDiscord | <Hourglass [She/Her]> Yeah, 3.14 is what everyone is taught |
00:04:14 | FromDiscord | <Rika> not what i mean but sure close enough |
00:04:43 | FromDiscord | <Hourglass [She/Her]> What do you mean then? |
00:05:03 | FromDiscord | <Rika> a few digits like 3.141592 etc etc |
00:06:03 | FromDiscord | <Rika> side note i seem to remember the digits of pi better in japanese |
00:06:52 | FromDiscord | <Hourglass [She/Her]> Weird lmao, unless Japanese is your native language or a language you know better than English ig? |
00:07:22 | FromDiscord | <Rika> neither |
00:11:51 | FromDiscord | <Hourglass [She/Her]> Weird |
00:21:48 | FromDiscord | <Elegantbeef> I know quite a few digits, due to my insistence on seeing how long it'd take me to memorise a new digit 😄 |
00:21:49 | FromDiscord | <Elegantbeef> 3.1415926535897932384626327951969 the last bit might be off, but alas |
00:22:20 | FromDiscord | <Elegantbeef> I think it's way off now 😄 |
00:23:39 | FromDiscord | <Elegantbeef> Yea i missed 4338 and then went to hell |
00:25:27 | FromDiscord | <slime> cool, i only remember 3.1415926535😂🤣 |
00:25:53 | FromDiscord | <[[ Array ]]> bruh i can only remember up to 3.14159 |
00:26:07 | FromDiscord | <[[ Array ]]> must be an engineering thing |
00:26:16 | FromDiscord | <Elegantbeef> Nah engineers know it's 4 |
00:27:05 | FromDiscord | <Yepoleb> how can i write a quote do macro for a property setter? when i try to do `quote("@")` with `\`@varName=\`\` it does not expand my variable |
00:27:22 | FromDiscord | <Yepoleb> dammit i tried to hard to not fuck up the formatting |
00:28:04 | FromDiscord | <Elegantbeef> Just use genast like it's 20223 |
00:28:07 | FromDiscord | <Elegantbeef> 2023 even |
00:28:37 | FromDiscord | <Yepoleb> genast will solve all my problems? |
00:28:49 | FromDiscord | <Elegantbeef> It does not use backtick escaping |
00:28:54 | FromDiscord | <Elegantbeef> So it should |
00:29:28 | * | lumo_e quit (Quit: Quit) |
00:31:36 | FromDiscord | <Yepoleb> i followed this tutorial from a guy called beef331 and it did not mention genast ☹️ |
00:32:43 | FromDiscord | <Elegantbeef> I can counter that argument by saying i linked to a bunch of my repos |
00:32:49 | FromDiscord | <Elegantbeef> I only use genast now, so.... checkmate |
00:33:32 | FromDiscord | <Yepoleb> sorry this is not a debate club actually |
00:34:46 | FromDiscord | <Yepoleb> you cannot checkmate me for failure |
00:35:03 | FromDiscord | <Elegantbeef> Oh shit if that's the case why do i have this debate team shirt on |
00:36:54 | FromDiscord | <Yepoleb> genast is 2 hard 4 me |
00:37:24 | FromDiscord | <Elegantbeef> It's so much better |
00:37:57 | FromDiscord | <Rika> git gud |
00:38:17 | FromDiscord | <Rika> <-- hasnt used nim in a very long while |
00:38:28 | FromDiscord | <Yepoleb> but it gives me dumb errors |
00:38:38 | FromDiscord | <[[ Array ]]> sent a long message, see http://ix.io/4qL9 |
00:39:05 | FromDiscord | <Elegantbeef> Perhaps provide the code and the errors and someone that knows how to use the tools will tell you you're using the tool end as a handle |
00:39:21 | FromDiscord | <Rika> oof |
00:39:44 | FromDiscord | <Yepoleb> no let me struggly by myself for a while |
00:40:08 | FromDiscord | <Elegantbeef> Okay dokey |
00:40:08 | FromDiscord | <Yepoleb> it builds character |
00:40:14 | FromDiscord | <Yepoleb> and it makes me feel things |
00:40:20 | FromDiscord | <Elegantbeef> Well i've got generics sorta working with my ADT schtuffs |
00:40:39 | FromDiscord | <Rika> In reply to @Yepoleb "and it makes me": like suffering |
00:40:39 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4qLb |
00:40:54 | FromDiscord | <Elegantbeef> At some point that's all you're capable of feeling |
00:43:04 | FromDiscord | <Yepoleb> if i use `genAst(varName)` will varName automatically become the ident inside the block or do i need to do something else? |
00:44:07 | FromDiscord | <Elegantbeef> You just use it |
00:50:10 | FromDiscord | <Yepoleb> sent a code paste, see https://play.nim-lang.org/#ix=4qLd |
00:50:17 | FromDiscord | <Yepoleb> i'm doing something like this |
00:50:37 | FromDiscord | <Yepoleb> and i get `Error: identifier expected, but found 'a'` |
00:56:32 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#ix=4qLe |
00:56:40 | FromDiscord | <Elegantbeef> you had a `stmtList` |
00:56:46 | FromDiscord | <Elegantbeef> also properties do not work at top level |
00:56:57 | FromDiscord | <Elegantbeef> you need something on the left of a `.` |
00:57:26 | NimEventer | New Nimble package! minicoro - Lua-like asymmetric coroutine. Nim wrapper of minicoro in C, see https://git.envs.net/iacore/minicoro |
01:03:14 | FromDiscord | <Yepoleb> i tried to make a minimal example and added more errors |
01:03:44 | FromDiscord | <Elegantbeef> Well hopefully my code helps atleast 😄 |
01:07:21 | FromDiscord | <Yepoleb> the error was something completely different, sorry |
01:07:31 | FromDiscord | <Yepoleb> but genAst is working now |
01:07:52 | FromDiscord | <Yepoleb> i tried to use it inside result.add() |
01:08:20 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4qLh |
01:09:04 | FromDiscord | <Yepoleb> thank you ❤️ |
01:57:56 | hernan | hi |
01:58:53 | FromDiscord | <huantian> hi |
02:37:02 | * | arkurious quit (Quit: Leaving) |
02:47:50 | NimEventer | New thread by jasonfi: Advanced Compilers: Self-Guided Online Course, see https://forum.nim-lang.org/t/9993 |
03:02:53 | * | Goodbye_Vincent6 joined #nim |
03:04:55 | * | Goodbye_Vincent quit (Ping timeout: 276 seconds) |
03:04:55 | * | Goodbye_Vincent6 is now known as Goodbye_Vincent |
03:18:46 | * | ltriant joined #nim |
03:25:20 | * | sagax joined #nim |
03:25:20 | * | sagax quit (Changing host) |
03:25:20 | * | sagax joined #nim |
03:57:05 | * | pbsds quit (Quit: The Lounge - https://thelounge.chat) |
03:59:03 | * | pbsds joined #nim |
04:33:11 | * | azimut quit (Ping timeout: 255 seconds) |
04:46:32 | * | azimut joined #nim |
05:57:29 | * | ltriant quit (Ping timeout: 268 seconds) |
07:13:03 | * | derpydoo quit (Quit: derpydoo) |
07:15:47 | * | derpydoo joined #nim |
07:17:20 | * | rockcavera quit (Remote host closed the connection) |
08:27:56 | * | jmdaemon joined #nim |
08:35:01 | FromDiscord | <I have 50GB of nothing on my PC> is it just me or is nimsaem breaking my vscode |
08:35:35 | FromDiscord | <Rika> @Saem I can’t believe you’ve been hacking into his IDE smh |
08:35:54 | FromDiscord | <Rika> In reply to @I have 50GB of nothing on my PC "is it just me": In seriousness what do you mean by breaking? |
08:48:13 | * | Notxor joined #nim |
08:51:08 | FromDiscord | <I have 50GB of nothing on my PC> vs seems to be crashing due to an extension (it doesn't want to tell me which one!), but the logs suggest it's that extension |
08:51:21 | FromDiscord | <I have 50GB of nothing on my PC> which is weird because it hasn't been updated in a while |
08:51:37 | FromDiscord | <I have 50GB of nothing on my PC> so I suspect some weird interaction between existing code and an update |
08:51:43 | FromDiscord | <I have 50GB of nothing on my PC> vscode update |
09:01:41 | FromDiscord | <Phil> Could it be nimsuggest burning through memory? |
09:06:53 | * | rmt joined #nim |
09:08:18 | * | jmdaemon quit (Quit: ZNC 1.8.2 - https://znc.in) |
09:09:35 | * | jmdaemon joined #nim |
09:14:28 | FromDiscord | <jmgomez> In reply to @I have 50GB of nothing on my PC "vs seems to be": are you on win? Something similar happened to me in one project (the others work fine though). My workaround was to update to the vscode nightly/insiders build |
09:15:26 | FromDiscord | <I have 50GB of nothing on my PC> @jmgomez no, but that sounds like it could help |
09:19:51 | * | ltriant joined #nim |
09:29:32 | FromDiscord | <4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4qMg |
09:29:38 | * | jmdaemon quit (Quit: ZNC 1.8.2 - https://znc.in) |
09:29:44 | FromDiscord | <Elegantbeef> Hell no |
09:29:50 | FromDiscord | <4zv4l> why not ? |
09:29:54 | FromDiscord | <4zv4l> I think that's a great feature |
09:29:55 | FromDiscord | <Elegantbeef> A language is not a package manager or retriever |
09:30:04 | FromDiscord | <I have 50GB of nothing on my PC> id like that too |
09:30:11 | FromDiscord | <4zv4l> In reply to @I have 50GB of nothing on my PC "id like that too": yay ! |
09:30:15 | FromDiscord | <4zv4l> In reply to @Elegantbeef "A language is not": well |
09:30:20 | FromDiscord | <4zv4l> that's arguable |
09:30:26 | FromDiscord | <Elegantbeef> It's really not |
09:30:38 | FromDiscord | <4zv4l> it helps when you wanna compile a program↵it can fetch the dependencies directly |
09:30:43 | FromDiscord | <Elegantbeef> Why does Nim need to have package resolution features built into it |
09:30:45 | * | jmdaemon joined #nim |
09:31:11 | FromDiscord | <4zv4l> you can have multiple libraries with the same name↵so being able to give the url↵and in the source code↵would be simple and easy |
09:31:19 | FromDiscord | <Elegantbeef> You can use installed nimble packages without having to have git embedded into the compiler |
09:31:20 | FromDiscord | <4zv4l> and when you compile it would automatically fetch the dependencies |
09:31:42 | FromDiscord | <Elegantbeef> What problem does this really solve? |
09:31:43 | FromDiscord | <4zv4l> is there a tool that create a dependencies files from nim source code ? |
09:31:48 | FromDiscord | <Elegantbeef> It's easy as to use and add packages to a Nim project |
09:31:49 | FromDiscord | <4zv4l> or you have to manually add them ? |
09:32:28 | FromDiscord | <Elegantbeef> Nimble does not have a feature to auto add imports 'PR's welcome' |
09:32:45 | FromDiscord | <Elegantbeef> If you're using a library you ostensibly want a specific version and pin to it |
09:32:48 | FromDiscord | <Elegantbeef> Explicitly |
09:33:24 | FromDiscord | <4zv4l> well could have an idea but again |
09:33:38 | FromDiscord | <4zv4l> imagine the best case scenario |
09:34:11 | FromDiscord | <I have 50GB of nothing on my PC> I would like the feature simply because I always have to write the library name both in .nimble an in my prelude.nim that I include |
09:34:24 | FromDiscord | <4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4qMi |
09:34:25 | FromDiscord | <I have 50GB of nothing on my PC> would be cool to have just one place for both |
09:34:28 | FromDiscord | <4zv4l> maybe there are mutliple github repo with the same name |
09:34:33 | FromDiscord | <4zv4l> (edit) "mutliple" => "multiple" |
09:34:44 | FromDiscord | <dlesnoff> Which VSCode extension is the best ? nimsaem's or Konstantin Zaitsev's ? |
09:34:45 | FromDiscord | <I have 50GB of nothing on my PC> @4zv4l you can import `as` though |
09:34:49 | FromDiscord | <Elegantbeef> You do realise Nimble does allow git urls right? |
09:34:58 | FromDiscord | <I have 50GB of nothing on my PC> @dlesnoff nimsaem's is the only semi-updated one |
09:35:04 | FromDiscord | <4zv4l> you have to put them in the file yeah |
09:35:11 | FromDiscord | <4zv4l> in go you simply put the url and that's it |
09:35:14 | FromDiscord | <4zv4l> not external file to edit |
09:35:29 | FromDiscord | <Elegantbeef> How is that worse than your suggestion |
09:35:35 | FromDiscord | <4zv4l> In reply to @I have 50GB of nothing on my PC "would be cool to": yeah exactly |
09:35:40 | FromDiscord | <Elegantbeef> You now have to copy a git url to every module that uses a file |
09:35:41 | FromDiscord | <4zv4l> in Go you can have all in the source file |
09:35:49 | FromDiscord | <Elegantbeef> What's the benefit? |
09:36:18 | FromDiscord | <dlesnoff> It is much better to have a list of packages in an external file at the top of your module |
09:36:18 | FromDiscord | <4zv4l> well I personally find it annoying to edit a file an external file↵while I could simply precise in my code from where the lib comes from |
09:36:27 | FromDiscord | <Elegantbeef> The compiler now needs to support git, version management and be a package manager |
09:36:36 | FromDiscord | <4zv4l> like in Rust↵it is so annoying I have to add entries to `Cargo.tml` to be able to use a lib |
09:36:45 | FromDiscord | <4zv4l> In reply to @Elegantbeef "The compiler now needs": can use nimble for it |
09:36:48 | FromDiscord | <Elegantbeef> I do not follow how it's annoying |
09:36:59 | FromDiscord | <4zv4l> that's more work to do |
09:37:11 | FromDiscord | <Elegantbeef> It's literally the exact same amount of work |
09:37:18 | FromDiscord | <dlesnoff> That's the bread and butter of programming |
09:37:20 | FromDiscord | <Elegantbeef> `requires "myGitUrl"` hmph |
09:37:22 | FromDiscord | <4zv4l> that means at one moment you have to think↵> ok now let's write my config file instead on focusing on my code |
09:37:30 | FromDiscord | <dlesnoff> I always switch between config files and my code |
09:37:38 | FromDiscord | <Elegantbeef> It's the exact same amount of writing |
09:37:41 | * | jmdaemon quit (Quit: ZNC 1.8.2 - https://znc.in) |
09:37:44 | FromDiscord | <Elegantbeef> Like.... what? |
09:37:57 | FromDiscord | <Elegantbeef> And actually your way is even more writing |
09:38:04 | FromDiscord | <Elegantbeef> Cause now every module needs the giturl |
09:38:04 | FromDiscord | <4zv4l> actually I got an example |
09:38:16 | FromDiscord | <4zv4l> in go you can use `go mod`↵and it will automatically fetch the dependencies |
09:38:50 | * | jmdaemon joined #nim |
09:38:51 | FromDiscord | <4zv4l> would be great that from an existing code you can do↵`nimble whatever`↵and it creates the config with the dependencies etc. ready to ship |
09:39:01 | * | jmdaemon quit (Remote host closed the connection) |
09:39:20 | FromDiscord | <Elegantbeef> To quote the Nim core 'PRs welcome' |
09:39:23 | FromDiscord | <Elegantbeef> But i'm still absolutely confused how you think that'd work |
09:39:32 | FromDiscord | <Elegantbeef> Which version should it fetch |
09:39:44 | FromDiscord | <Elegantbeef> I can understand if you have local version from nimble already installed |
09:40:09 | FromDiscord | <Rika> I don’t understand which problem this solves |
09:40:10 | * | jmdaemon joined #nim |
09:40:29 | FromDiscord | <4zv4l> basically having to write a config file↵and manually adds the url |
09:40:54 | FromDiscord | <Rika> And what difference is there to having to write the URL on each module file now? |
09:41:05 | FromDiscord | <jmgomez> you can always write a macro that does it for you |
09:41:26 | FromDiscord | <Elegantbeef> But with remotes, you just fetch the most recent? |
09:41:36 | FromDiscord | <4zv4l> In reply to @Elegantbeef "But with remotes, you": yeah like nimble |
09:41:36 | FromDiscord | <4zv4l> the head |
09:43:03 | FromDiscord | <4zv4l> ok really simple↵I'm gonna try making a simple library on my github and see how it works↵then I can actually say if that's really that annoying to do |
09:43:05 | FromDiscord | <ringabout> https://github.com/nim-lang/nimble/issues/80↵Anyway there are already discussions here |
09:43:20 | FromDiscord | <ElegantBeef> Matrix are dieded |
09:44:01 | FromDiscord | <ElegantBeef> The peak thing about go's package management is they ddos git hosts |
09:45:53 | FromDiscord | <jmgomez> @ringabout any idea of what's going on here? https://github.com/nim-lang/Nim/issues/21512 It seemed to work in the past |
09:45:54 | FromDiscord | <4zv4l> is it possible to install dependencies of a projet at the project location instead of ~/.nimble ? |
09:45:57 | FromDiscord | <4zv4l> (edit) "projet" => "project" |
09:46:11 | FromDiscord | <Rika> In reply to @4zv4l "is it possible to": Discussion mentioned by ring about |
09:47:56 | FromDiscord | <ringabout> In reply to @jmgomez "<@658563905425244160> any idea of": Do you mean it worked with 1.6.x? |
09:47:56 | FromDiscord | <ElegantBeef> Does this mean everytime you compiler a go program it makes a HTTP request to a giturl to see if the commit changed? |
09:48:42 | FromDiscord | <Elegantbeef> Generating a dependency list only makes sense if you're working locally with installed nimble files |
09:48:42 | FromDiscord | <Elegantbeef> So if a package has a sudden change in versioning whilst you're working it fails? |
09:48:42 | FromDiscord | <Elegantbeef> And i mean you technically can make a `importgit` macro if you really wanted to, but why would you want to |
09:48:43 | FromDiscord | <Elegantbeef> That i can get behind, but using git urls inside of Nim is awful, just make a proper package so everyone can easily see what you depend upon and have somewhat reproducible builds |
09:48:53 | FromDiscord | <ElegantBeef> Oh there is matrix |
09:49:32 | FromDiscord | <jmgomez> In reply to @ringabout "Do you mean it": No, but I think when pmunch wrote the articles on his web about them VM it worked because he was doing from/to json inside the vm |
09:49:53 | FromDiscord | <ringabout> I see, it does work with 1.6.10. |
09:50:40 | FromDiscord | <jmgomez> (edit) "them" => "the" |
09:52:26 | FromDiscord | <ElegantBeef> It works with nimscripter |
09:52:41 | FromDiscord | <jmgomez> In reply to @ElegantBeef "It works with nimscripter": really? so it's a config issue? |
09:53:00 | FromDiscord | <jmgomez> I mean, nimscripter builds on top of it, right? |
09:53:12 | FromDiscord | <ElegantBeef> sent a code paste, see https://play.nim-lang.org/#ix=4qMn |
09:53:20 | FromDiscord | <ElegantBeef> Yea nimscripter is ontop the compiler api |
09:53:36 | FromDiscord | <ElegantBeef> It's amazing how simple a single file is to load |
09:54:00 | FromDiscord | <ElegantBeef> Are you passing `--path:'$nim'`? |
09:54:14 | FromDiscord | <ElegantBeef> I know i had plenty of issues when i just did `requires "compiler"` in a nimble file |
09:54:45 | FromDiscord | <jmgomez> I think I am, but maybe not in the repro case, let me check (its in another computer) |
09:57:00 | FromDiscord | <ringabout> Isn't the problem is `onInterpreterError`? |
09:57:08 | FromDiscord | <ringabout> (edit) "Isn't ... the" added "that" |
09:57:24 | FromDiscord | <ElegantBeef> It is |
09:57:32 | FromDiscord | <ElegantBeef> It's raising an exception on every error type including hints |
09:57:55 | FromDiscord | <ringabout> yeah |
09:57:58 | FromDiscord | <ElegantBeef> https://github.com/beef331/nimscripter/blob/master/src/nimscripter.nim#L31 likely will solve the problem |
09:58:21 | FromDiscord | <ElegantBeef> I didnt even look at the error stack, i just tested the example with Nimscripter cause why not 😄 |
09:59:01 | FromDiscord | <jmgomez> wow |
09:59:15 | FromDiscord | <jmgomez> that was it.. I saw that in the compiler example too |
09:59:34 | FromDiscord | <jmgomez> so it's elevating hints or what? |
09:59:40 | FromDiscord | <ElegantBeef> Be honest you just wanted to make yourself work for it |
09:59:44 | FromDiscord | <jmgomez> I mean, hints triggers the hook |
09:59:56 | FromDiscord | <ElegantBeef> I believe anything that uses the error path triggers it |
10:00:08 | FromDiscord | <ElegantBeef> Hints and Warnings both follow the error path |
10:00:33 | FromDiscord | <ElegantBeef> And with that it's late so i'm away |
10:00:34 | FromDiscord | <jmgomez> okay, I guess it makes sense |
10:00:53 | FromDiscord | <ringabout> In reply to @ElegantBeef "And with that it's": bye |
10:00:57 | FromDiscord | <ringabout> Yeah, there is a `severity : Severity` |
10:01:14 | FromDiscord | <jmgomez> bye and thanks! 😄 |
10:01:40 | FromDiscord | <ringabout> sent a code paste, see https://play.nim-lang.org/#ix=4qMr |
10:01:43 | FromDiscord | <jmgomez> thanks, will close the issue with a comment about it in case someone else encounters it |
10:01:58 | FromDiscord | <ringabout> Seems that there is a type mismatch, that's weird. |
10:05:38 | FromDiscord | <ringabout> sent a code paste, see https://play.nim-lang.org/#ix=4qMs |
10:11:38 | * | derpydoo quit (Quit: derpydoo) |
10:13:53 | * | derpydoo joined #nim |
10:22:40 | FromDiscord | <sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4qMC |
10:40:36 | FromDiscord | <sOkam!> oh it actually works when its not run on nimscript 🤔 |
10:41:20 | FromDiscord | <sOkam!> (edit) "🤔" => "🤔↵note to self. test things compiled first ✍️" |
10:43:46 | NimEventer | New thread by inv2004: Trying to understand: is it better if IndexDefect is CatchableError or not, see https://forum.nim-lang.org/t/9994 |
10:50:13 | FromDiscord | <4zv4l> if I wanna make an addon to nimble that can scrap used dependencies↵how can I make the difference between `std/strutils` and a random guy making a lib named `strutils` ? |
10:50:33 | FromDiscord | <4zv4l> or it would only scrap them from nimble repo N |
10:50:35 | FromDiscord | <4zv4l> (edit) "N" => "?" |
10:51:06 | FromDiscord | <4zv4l> from here nimble.directory |
10:52:02 | FromDiscord | <ringabout> You can use `pkg/strutils ` to distinguish it from stdlibs. |
11:03:18 | * | jmdaemon quit (Quit: ZNC 1.8.2 - https://znc.in) |
11:04:25 | * | jmdaemon joined #nim |
11:40:44 | * | PMunch joined #nim |
11:43:36 | PMunch | Hmm, is there a good way to parse a JSON object from a stream and _not_ throw an exception if the stream has more data? |
11:49:23 | * | jmdaemon quit (Ping timeout: 264 seconds) |
11:51:49 | FromDiscord | <jtv> No, I had to write my own JSON parser specifically because even if you give yourself private access, it cannot be done. |
11:51:59 | PMunch | Well that's dumb.. |
11:52:26 | FromDiscord | <jtv> 100%. But JSON parsing itself is easy enough that 🤷 |
11:53:35 | FromDiscord | <jtv> But yeah, it's one of those little nicks where the basic libraries need to be more universal. I know why it's done; the JSON spec is explicit in saying "extraneous input is rejected". But JSON also isn't telling you how many bytes are in the JSON blob, it's done when it's done. |
11:54:09 | PMunch | Exactly |
11:54:26 | PMunch | What I wanted to use it for was parsing Markdown with a JSON frontmatter, similar to Huga |
11:54:27 | PMunch | Hugo* |
11:54:50 | PMunch | Basically if it starts with a valid JSON object then that's the frontmatter |
11:55:13 | FromDiscord | <inv> About it https://forum.nim-lang.org/t/9994↵I think that all my happiness from Nim was only because panics:off by default and I did not know about it |
11:55:16 | * | derpydoo quit (Ping timeout: 246 seconds) |
11:55:19 | PMunch | For TOML and YAML frontmatters it uses delimiting +++ and --- respectively |
11:55:34 | PMunch | Which of course makes it much easier |
11:56:11 | PMunch | I guess I will run parseJson over and over with subsequent find("}") calls to determine the end of the object.. |
11:57:19 | PMunch | @inv, the thing with IndexError being a defect is that if you run with -d:danger then they are removed |
11:57:42 | PMunch | So if you had code with a try/except around that then it wouldn't catch an error any longer |
11:58:15 | PMunch | I guess there is an argument to be made for making IndexError either inherit from Defects or from CatchableError depending on which mode you compile in |
11:58:39 | PMunch | That way Nim would tell you when you enabled danger that IndexError wasn't catchable |
11:58:50 | PMunch | But you could catch it with -d:release or -d:debug |
11:59:51 | * | derpydoo joined #nim |
12:05:02 | PMunch | @jtv, I tried to use parseJsonFragments and then just break after the first element. But lexbase buffers input.. |
12:05:23 | PMunch | I was able to get the element, but I have no way of knowing how far into the data it ended |
12:08:26 | FromDiscord | <inv> @PMunch I know, but please some some benches - it is even slower with panics:on |
12:09:19 | FromDiscord | <inv> Even without it - I expect a lot of problems with danger, but I suppose that the problem affects too much code with the IndexDefect |
12:10:21 | FromDiscord | <jtv> I can give you my parsing code if you want, but I don't go to the same objects 🤷 |
12:10:29 | FromDiscord | <inv> After I know that about the IndexDefect with panics:on I have a feeling that I write go-like code, not python-like like it was before |
12:10:49 | FromDiscord | <inv> (edit) "After I know that about the IndexDefect with panics:on I have a feeling that I write go-like code, not python-like like it was before ... " added "=> pretty annoying" |
12:12:32 | FromDiscord | <inv> I would say that at the moment I think that golang is more safe - I can try to catch the panic at least |
12:13:40 | FromDiscord | <inv> and I remember I did it in rust too |
12:14:55 | PMunch | @jtv, this "works": http://ix.io/4qMW |
12:15:34 | PMunch | I tried looking into how the JSON parser is implemented, and I think it would be very tricky to to this with the current implementation |
12:15:47 | PMunch | I was hoping there was a quickfix I could make |
12:17:19 | PMunch | @inv, the problem is that the panics:on switch doesn't create anything for you to catch any longer. The sole purpose of this flag is basically, if you do something which is a programmer error, abort immediately! |
12:17:57 | PMunch | Index errors are seen as programmer errors, the exception they create are merely to give you better stack traces while debugging |
12:19:05 | PMunch | So the correct way to write Nim is to check that indexes are within the ranges you expect them to be before trying to index something with them. |
12:23:30 | FromDiscord | <inv> @PMunch I undestand how panic work and that they can be disables, what is why I think IndexDefect is too dangerous, I met the problem about everywhere: asciigraph lib and many other. Also, I am not 100% sure in my code too - but to fail the app is much worse |
12:24:21 | PMunch | Sorry, I'm having a bit of a hard time understanding you |
12:24:28 | PMunch | And I need to run to a meeting |
12:29:34 | FromDiscord | <inv> I am trying to undestand myself why I do not like it so a lot 🙂 |
12:29:47 | FromDiscord | <inv> (edit) "a lot" => "much" |
12:31:08 | FromDiscord | <inv> `[](idx)` is so usual error, but it does not mean that program should always fail with it. I do not believe who says: my code always work and correct |
12:32:44 | FromDiscord | <inv> and it needs a lot of effort to work, for example with file-parsing: You have to check amount of lines, amount of words and etc. It is pretty complicates, split() returns at least @[""] which is safe, but splitWhitespaces can return @[] |
12:33:22 | NimEventer | New Nimble package! nclip - A simple wrapper around the winapi to control the clipboard, see https://github.com/4zv4l/nclip |
12:36:24 | * | PMunch quit (Quit: leaving) |
12:41:39 | * | Notxor quit (Remote host closed the connection) |
12:46:39 | FromDiscord | <jtv> @PMunch Yeah, I'd once looked at doing a simple PR, and it can almost be done, but, not quite. It would be far less work to build something new than massage what's there. |
12:50:48 | FromDiscord | <4zv4l> In reply to @NimEventer "New Nimble package! nclip": oh jeez, why does it have to spread it like this xD |
12:52:07 | FromDiscord | <4zv4l> In reply to @ringabout "You can use `pkg/strutils": I mean I can but what about users ?↵they will do↵`import winim, strutils, tables, regex`↵can't know which one is from stdlib or not |
13:06:21 | FromDiscord | <dlesnoff> sent a code paste, see https://play.nim-lang.org/#ix=4qNc |
13:23:14 | FromDiscord | <4zv4l> `(0..<numPartitions).Natural` |
13:23:15 | FromDiscord | <4zv4l> I thinj |
13:23:16 | FromDiscord | <4zv4l> (edit) "thinj" => "think" |
13:24:21 | FromDiscord | <etra> In reply to @4zv4l "oh jeez, why does": nice! I was working on a lib to handle the clipboard as well but more focused on multiplatform, and heavily depending on arboard (<https://github.com/1Password/arboard>) |
13:24:52 | FromDiscord | <etra> mostly because arboard supports image handling on the three platforms |
13:25:58 | FromDiscord | <4zv4l> oh well mine is mostly something I had to do for work and I simply wanted to test posting it on my github to import it and test nimble↵↵I didn't mean to post it like that xD |
13:26:42 | FromDiscord | <4zv4l> mine isn't really to totally wrap the clipboard api↵I made it to help myself making a dll that monitor the clipboard content allowing only the data matching a specific regex |
13:27:13 | FromDiscord | <4zv4l> so it doesn't handle specific data type↵only text and file |
13:43:13 | FromDiscord | <etra> In reply to @4zv4l "oh well mine is": oh, nice, you're doing Nim at work? |
13:43:19 | FromDiscord | <etra> how is it working for you? |
13:45:26 | FromDiscord | <4zv4l> yeah I was working on a cyber security project and I proposed Nim and they accepted |
13:45:39 | FromDiscord | <4zv4l> going very well↵the code is super clean, easy to add new features |
13:46:06 | FromDiscord | <4zv4l> > the code is super clean↵I was more referring to the language rather than my way to code xD |
13:47:00 | FromDiscord | <sOkam!> nim tends towards clean, even in messy codebases, ime |
13:47:31 | FromDiscord | <sOkam!> C tends towards confusing no matter if you are clean, for example 😭 |
13:47:45 | FromDiscord | <sOkam!> (edit) "C tends towards confusing ... no" added "mess" |
14:06:33 | FromDiscord | <Rika> Lol |
14:15:43 | FromDiscord | <Ayy Lmao> What's a good way to idiomatically represent something like `float outputs` in nim? `outputs` in this case is a two dimensional array of known length where you can edit the values. |
14:16:14 | FromDiscord | <Ayy Lmao> Like I can use UncheckedArray but I am wondering if there is a nicer way. |
14:16:31 | FromDiscord | <Ayy Lmao> (edit) "way." => "way since the length is known." |
14:18:37 | * | Notxor joined #nim |
14:19:15 | FromDiscord | <planetis> its `ptr UncheckedArray[ptr UncheckedArray[float32]]` for sure, but you can do an extra trick with distinct types and get bounds checking on the indices. |
14:21:14 | FromDiscord | <Ayy Lmao> In reply to @planetis "its `ptr UncheckedArray[ptr UncheckedArray[float32]": Can you go into more detail about that? |
14:21:22 | FromDiscord | <planetis> @Ayy Lmao see: https://github.com/planetis-m/naylib/blob/main/src/raylib.nim#L2498 |
14:21:35 | * | PMunch joined #nim |
14:22:47 | FromDiscord | <planetis> you declare a `MyTypeOutput = distinct MyType` then a template that converts to it with the field name: `template outputs(x: Mytype): MyTypeOutputs` then have `[]` `[]=` procs for `MyTypeOutputs` |
14:23:50 | FromDiscord | <Ayy Lmao> Sounds very complicated but I will look into it. |
14:24:19 | FromDiscord | <Ayy Lmao> sent a code paste, see https://play.nim-lang.org/#ix=4qNH |
14:24:28 | FromDiscord | <planetis> you're interfacing with a C library right? |
14:24:32 | FromDiscord | <Ayy Lmao> Yeah |
14:25:11 | FromDiscord | <Ayy Lmao> or something like that |
14:25:11 | FromDiscord | <Ayy Lmao> sent a code paste, see https://play.nim-lang.org/#ix=4qNI |
14:25:32 | FromDiscord | <Ayy Lmao> with hopefully no overhead |
14:25:47 | FromDiscord | <planetis> it's not complicated, other languages would have to do `proc outputs(x: MyType; i. j: Natural)` and have an ugly api on it |
14:27:09 | FromDiscord | <planetis> wait you don't want to expose the values of output? |
14:28:31 | FromDiscord | <Ayy Lmao> I want to expose it in such a way that you can do something like `outputs[0][0] = 1.0` and it will edit it with bounds checking. |
14:29:06 | FromDiscord | <Ayy Lmao> And you can iterate over the channels and samples |
14:29:24 | FromDiscord | <planetis> right, so it's not even part of a structure right? |
14:29:35 | FromDiscord | <planetis> (edit) "right, so it's" => "So `outputs`" |
14:30:05 | FromDiscord | <Ayy Lmao> Yeah on the c side of things you are given `float ` and then separately given the lengths of each |
14:30:38 | FromDiscord | <planetis> then have a `AudioBuffer = distinct ptr UncheckedArray[ptr UncheckedArray[float32]]` and `[]`, `[]=` that operate on `AudioBuffer` |
14:31:04 | FromDiscord | <planetis> sorry my first solution is unnecessary, this is simpler |
14:31:10 | FromDiscord | <Rika> You’re gonna have to store the sizes somewhere though |
14:31:11 | FromDiscord | <Ayy Lmao> Is there a way to bake in the length of it though? |
14:31:27 | FromDiscord | <Ayy Lmao> I'd like to tie the length in with the object |
14:31:41 | FromDiscord | <Rika> Well make an object that stores the buffer and the sizes |
14:31:47 | FromDiscord | <planetis> In reply to @Ayy Lmao "Is there a way": good point! |
14:32:30 | FromDiscord | <planetis> so make `AudioBuffer` an object, with a data pointer and sizes fields |
14:33:06 | FromDiscord | <Ayy Lmao> I guess maybe I am being silly and thinking that approach has overhead. |
14:33:33 | FromDiscord | <Ayy Lmao> For some reason I was trying to avoid it |
14:33:41 | * | estiquelapice_ quit () |
14:33:51 | FromDiscord | <planetis> what else can you do unless you know the sizes on compile time |
14:34:04 | FromDiscord | <Rika> Prolly just as much overhead as storing the lengths separately in some variable |
14:34:22 | FromDiscord | <planetis> (edit) "on" => "at" |
14:34:38 | FromDiscord | <Rika> Unless you’re trying for pretty high performance you’re not gonna hit any limitations with it |
14:34:48 | FromDiscord | <Ayy Lmao> In reply to @planetis "what else can you": Not sure but I was wondering if there was some voodoo magic templatized thing that could pass it to a function without making a separate object. |
14:35:04 | FromDiscord | <Ayy Lmao> So to the user it looks like an object but in the backend it isn't doing anything extra. |
14:35:14 | FromDiscord | <Rika> Sounds cursed |
14:35:19 | FromDiscord | <Ayy Lmao> Probably haha |
14:35:46 | FromDiscord | <Rika> And the backend is doing extra, if you need the size to be runtime then it’s going to be runtime no escaping that |
14:37:36 | FromDiscord | <Ayy Lmao> I didn't mean like I wanted to somehow escape the size being runtime. I meant like I didn't want to copy the pointers and sizes to a new object. But I guess they would probably get passed by value anyways right? I have a nasty habit of prematurely optimizing when I have no idea what I am doing. |
14:38:45 | FromDiscord | <Ayy Lmao> I guess I was thinking that passing pointers and sizes to a function directly is faster than making a new struct and then passing that struct. |
14:40:14 | FromDiscord | <Rika> Sounds premature yes |
14:41:57 | FromDiscord | <Ayy Lmao> Ok I will try to stop thinking about it then haha |
14:44:04 | FromDiscord | <4zv4l> sent a code paste, see https://paste.rs/jkU |
14:49:08 | FromDiscord | <4zv4l> what nim version does `nimble.directory` uses ? |
14:49:22 | FromDiscord | <4zv4l> it seems to be older than nim 1.6.12 |
14:59:09 | FromDiscord | <caravaggio> Is it possible to ffi a rust program from nim? |
14:59:26 | FromDiscord | <caravaggio> Without weird builds |
15:08:04 | PMunch | Define weird build |
15:08:27 | PMunch | If you can FFI Rust with C then Nim can FFI with Rust via C |
15:09:07 | FromDiscord | <4zv4l> how to make the `doc build` on nimble.directory to work ? |
15:09:28 | PMunch | Maybe ask @federico3 |
15:33:25 | FromDiscord | <4zv4l> https://nimble.directory/pkg/nclip |
15:33:37 | FromDiscord | <4zv4l> also the test is like running for 10 minutes |
15:33:51 | FromDiscord | <4zv4l> while it was alright on my computer |
15:47:04 | FromDiscord | <ringabout> You can open an issue on its source repo. |
15:47:55 | FromDiscord | <ringabout> https://github.com/FedericoCeratto/nim-package-directory |
15:49:34 | NimEventer | New thread by SerjEpatoff: How to reproduce the release build of Nim?, see https://forum.nim-lang.org/t/9996 |
15:52:23 | NimEventer | New post on r/nim by AlbertShown88: Easly Use Any Web Browser as GUI in Nim, see https://reddit.com/r/nim/comments/11r9u7t/easly_use_any_web_browser_as_gui_in_nim/ |
16:02:20 | * | Notxor quit (Quit: Leaving) |
16:06:38 | * | jmdaemon joined #nim |
16:10:16 | * | arkurious joined #nim |
16:27:13 | * | jmdaemon quit (Ping timeout: 246 seconds) |
16:46:57 | FromDiscord | <firasuke> how do you clean testing artifacts (resulting build files) when using Testament? |
16:58:31 | Amun-Ra | I have a makefile rule for unitest builds |
17:02:01 | * | rockcavera joined #nim |
17:06:42 | * | jmdaemon joined #nim |
17:45:11 | NimEventer | New thread by jj2299: Get equivalent code with expanded templates/macros, see https://forum.nim-lang.org/t/9997 |
18:03:21 | * | rmt quit (Ping timeout: 265 seconds) |
18:55:40 | FromDiscord | <System64 ~ Flandre Scarlet> Hi, do I need to install Nim to use it? (on Windows |
18:57:48 | * | Notxor joined #nim |
19:15:35 | FromDiscord | <Hourglass [She/Her]> To program in Nim? Yeah |
19:15:55 | FromDiscord | <System64 ~ Flandre Scarlet> So I need Admin rights? |
19:16:00 | FromDiscord | <Hourglass [She/Her]> To run existing programs that have EXEs? Then no |
19:16:14 | FromDiscord | <Hourglass [She/Her]> In reply to @System64 "So I need Admin": I'm not sure about that, I'm not a Windows user |
19:17:04 | FromDiscord | <halc> stuff is weird, man, according to https://github.com/nim-lang/Nim/issues/18146, `--tlsEmulation:off` increases performance, but for me it's actually slower than `--tlsEmulation:on`, this is on Windows with minGW. But the funny part is that it works the opposite way if I compile with `--cc:vcc` |
19:20:11 | FromDiscord | <Phil> Compilers↵insert aliens meme image here |
19:20:12 | FromDiscord | <halc> I'll try running the same test as the issue and see what happens |
19:30:18 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @Hourglass, When the Hour Strikes "I'm not sure about": Just tested, seems it doesn't require admin rights |
19:33:29 | FromDiscord | <rakgew> @System64 ~ Flandre Scarlet - nope nim does not need admin rights to install on win.↵the binaries can be downloaded and extracted just like mingw for c-compilation. adding thier paths to user env vars helps with convenience. |
19:35:43 | FromDiscord | <System64 ~ Flandre Scarlet> Oh nice, this is interesting!↵Also, is it possible to download all Nim docs? |
19:45:56 | FromDiscord | <auxym> In reply to @System64 "Oh nice, this is": I'm not sure if they are hosted anywhere, but you can build PDF docs from nim source using `./koch pdf` |
19:47:03 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @auxym "I'm not sure if": What does it do? Does it compile or something? |
19:48:40 | FromDiscord | <auxym> it compiles all official nim docs into PDF files |
19:48:50 | FromDiscord | <System64 ~ Flandre Scarlet> Oh nice |
19:49:13 | FromDiscord | <System64 ~ Flandre Scarlet> and where should I execute this command? |
19:50:26 | FromDiscord | <auxym> clone (or dowload) the Nim repo and run it from the root: https://github.com/nim-lang/Nim |
19:50:55 | FromDiscord | <auxym> actually follow the instructions in the readme to bootstrap nim and build the koch tool |
19:51:38 | FromDiscord | <System64 ~ Flandre Scarlet> Alright, thanks! |
19:54:22 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @auxym "actually follow the instructions": so I need to do build_all.bat? |
19:56:09 | NimEventer | New thread by elcritch: Export C library components when using `--app:lib`, see https://forum.nim-lang.org/t/9998 |
19:57:24 | * | jmdaemon quit (Ping timeout: 268 seconds) |
20:24:56 | * | azimut quit (Ping timeout: 255 seconds) |
20:32:44 | * | kenran joined #nim |
20:37:00 | FromDiscord | <sOkam!> What tools/syntax should I use to guarantee a specific layout for an object when it reaches C land? |
20:37:28 | FromDiscord | <sOkam!> (edit) "What tools/syntax should I use to guarantee a specific ... layout" added "memory" |
20:38:43 | * | PMunch quit (Quit: leaving) |
20:46:17 | FromDiscord | <guttural666> when I type "return result" here, the compiler complains that the template has no type (no return type), is this possibly a compiler bug? I think "return result" is valid is it not? https://media.discordapp.net/attachments/371759389889003532/1085302904417681438/image.png |
20:49:23 | FromDiscord | <guttural666> okay, this gives me a runtime error, even if it compiles |
20:52:52 | FromDiscord | <Elegantbeef> What do you mean a specific layout? |
20:54:01 | FromDiscord | <Elegantbeef> guttural you do realise you do not need the result there? |
20:54:11 | FromDiscord | <Elegantbeef> Remove the return type on the template and it'll work |
20:54:22 | FromDiscord | <Elegantbeef> What's the runtime error |
20:55:16 | FromDiscord | <guttural666> Error: execution of an external program failed: '/home/al/Documents/code/Nim/meddl_test/src/meddl ' |
20:56:30 | FromDiscord | <Elegantbeef> How are you running it? |
20:57:06 | FromDiscord | <guttural666> main is calling database, which is calling this: https://media.discordapp.net/attachments/371759389889003532/1085305625988317294/image.png |
20:57:22 | FromDiscord | <Elegantbeef> No i mean how are you compiling the code |
20:57:49 | FromDiscord | <guttural666> nim c -r -d:ssl |
20:58:00 | FromDiscord | <Elegantbeef> And that's the only error message?? |
20:58:06 | FromDiscord | <Elegantbeef> Is just it failed |
20:58:12 | FromDiscord | <Elegantbeef> No exceptions raised, no defect, just "it dun failed" |
20:58:45 | FromDiscord | <guttural666> just the Error, when I call the proc that calls the proc that uses the template |
20:59:23 | FromDiscord | <guttural666> ohhh |
20:59:27 | FromDiscord | <guttural666> might have another problem here |
20:59:40 | FromDiscord | <guttural666> /home/al/Documents/code/Nim/meddl_test/src/api.nim(21) get_html_label↵/home/al/.choosenim/toolchains/nim-1.6.10/lib/system.nim(2565) []↵Error: execution of an external program failed: '/home/al/Documents/code/Nim/meddl_test/src/meddl ' |
20:59:47 | FromDiscord | <Elegantbeef> Do you somewhere have a config that is making the build a release build? |
20:59:50 | FromDiscord | <guttural666> looks like an index failed |
20:59:57 | FromDiscord | <guttural666> index access maybe? |
21:00:09 | FromDiscord | <Elegantbeef> Yes it's a `[]` error |
21:00:31 | FromDiscord | <Dudugz> >.> And they say the exceptions are clear lol |
21:00:40 | FromDiscord | <Elegantbeef> They are clear |
21:00:56 | * | jmdaemon joined #nim |
21:01:17 | FromDiscord | <guttural666> In reply to @Elegantbeef "They are clear": yess, not a problem of the template it seems, dammit |
21:01:26 | FromDiscord | <Elegantbeef> The entire error log and config needs to be taken into account |
21:01:39 | FromDiscord | <guttural666> yeah, user error sorry 😄 |
21:01:48 | FromDiscord | <Elegantbeef> If you run `-d:danger` or `-d:release` for developing you're going to get shitty error logs |
21:01:55 | FromDiscord | <Dudugz> They are not, they just show the message and the internal file of the language where the error occurred, this stack trace does not detail the error itself or how to get to the cause of it. |
21:01:57 | FromDiscord | <Elegantbeef> Not that i think they're using those flags here |
21:02:13 | FromDiscord | <Elegantbeef> Uhh |
21:02:23 | FromDiscord | <Elegantbeef> A proper defect/exception has a message to explain the error |
21:02:57 | FromDiscord | <Dudugz> ... so if there is an error on a random file all you get is "You did it wrong nice" |
21:03:04 | FromDiscord | <Elegantbeef> What? |
21:03:31 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4qPz |
21:03:45 | FromDiscord | <Elegantbeef> We know that at line 3 we have an ivocation that causes an indexdefect |
21:03:51 | FromDiscord | <Dudugz> The message is not a problem, the problem is the stack trace that doesn't follow the message, you easily get lost where the error occurred and the possible cause |
21:04:07 | FromDiscord | <Elegantbeef> I do not follow |
21:04:24 | FromDiscord | <Dudugz> sent a code paste, see https://play.nim-lang.org/#ix=4qPA |
21:04:29 | FromDiscord | <guttural666> tbh, I still don't know what exactly the problem is, all I wanted to do here is to yeet the parsing out of the more general api call |
21:04:41 | FromDiscord | <Elegantbeef> Well demonstrate the problem error for me |
21:05:03 | FromDiscord | <Dudugz> In reply to @Elegantbeef "Well demonstrate the problem": Not at home now but i'll see if i can retrieve a log here |
21:05:19 | FromDiscord | <Elegantbeef> And no async errors do not count |
21:06:11 | FromDiscord | <Elegantbeef> Guttural i'd personally make an iterator for this |
21:06:41 | FromDiscord | <guttural666> In reply to @Elegantbeef "Guttural i'd personally make": to parse the json response you mean? |
21:07:11 | FromDiscord | <Elegantbeef> Well i'd just parse the json into an object |
21:07:56 | FromDiscord | <guttural666> that is what I ultimately do, I just take a string sequence from the json payload and pass that back to the database, that knows the concrete types |
21:08:22 | FromDiscord | <guttural666> that was my idea, to make the api stupid and simple and handle the details in a database.nim |
21:09:35 | FromDiscord | <Elegantbeef> So why do you not use `std/jsonutils`? |
21:09:48 | FromDiscord | <jmgomez> the generated cpp is platform independent? Seeing a crash on NimMain inside iOS it did work in past attempts so not sure if it's because iOS or something else |
21:10:10 | FromDiscord | <Elegantbeef> It should be, no clue if it is |
21:10:14 | FromDiscord | <Elegantbeef> I do not touch C++ cause i like sanity or something |
21:10:16 | FromDiscord | <guttural666> In reply to @Elegantbeef "So why do you": wasn't aware of that lib, gonna take a look at that |
21:10:35 | FromDiscord | <Elegantbeef> It allows you to define your own hooks for (de)serialisation |
21:11:01 | FromDiscord | <jmgomez> xD |
21:12:33 | FromDiscord | <Dudugz> In reply to @Elegantbeef "And no async errors": 🤔 why? It's a server, async becomes necessary. |
21:13:04 | FromDiscord | <Dudugz> I won't be able to pull the logs out of here anyway, when I get home I'll show you what I have to deal with |
21:13:16 | FromDiscord | <Elegantbeef> Cause async errors are already established to be bad, due to how the errors are generated and bubbled up |
21:13:37 | FromDiscord | <Dudugz> So it makes sense lol, that's why I'm having so much trouble |
21:14:22 | FromDiscord | <Elegantbeef> Normal Nim exceptions are generally helpful due to the fact they do not have to bubble around a dispatcher and the like |
21:15:23 | FromDiscord | <Dudugz> yes, so that confused me, because there were certain errors that really helped a lot but some were just ridiculous, a guessing game. |
21:15:40 | FromDiscord | <Elegantbeef> https://github.com/nim-lang/Nim/pull/21091 |
21:15:44 | FromDiscord | <Elegantbeef> But with devel they're a bit better |
21:16:05 | FromDiscord | <Dudugz> Hm, sure i'll take a look, do they intend to fix this in the future? |
21:16:56 | FromDiscord | <Elegantbeef> Some people have put some time into it |
21:17:00 | FromDiscord | <Elegantbeef> You could do it aswell! 😛 |
21:17:21 | FromDiscord | <Elegantbeef> I personally do not use async, so I'm not overly concerned about it's errors |
21:18:12 | FromDiscord | <Dudugz> Sure, well, personally I need asynchronous functions even more when dealing with servers, god knows hell what callback hell was in javascript. |
21:23:54 | FromDiscord | <guttural666> okay, it was a stupid logic error on my part |
21:41:59 | FromDiscord | <fabricio> sent a code paste, see https://play.nim-lang.org/#ix=4qPJ |
21:42:10 | FromDiscord | <fabricio> (edit) "https://play.nim-lang.org/#ix=4qPJ" => "https://play.nim-lang.org/#ix=4qPK" |
21:42:29 | FromDiscord | <fabricio> (edit) "https://play.nim-lang.org/#ix=4qPK" => "https://play.nim-lang.org/#ix=4qPL" |
21:43:07 | FromDiscord | <fabricio> (edit) "https://play.nim-lang.org/#ix=4qPL" => "https://play.nim-lang.org/#ix=4qPM" |
21:45:35 | FromDiscord | <Elegantbeef> Nope `tbl["foo"]` should be folded into the binary |
21:45:56 | FromDiscord | <Elegantbeef> If you want to check do `nim c -d:danger --nimcache=./somefolder` then look at the generated C |
21:47:05 | FromDiscord | <Maken James> sent a long message, see http://ix.io/4qPN |
21:49:23 | FromDiscord | <Nilts> Does anyone have a good tutorial on how to make a neural network/ai using arraymancer in nim? |
21:55:10 | FromDiscord | <dedraiaken> Is there a means to do pointer arithmetic in Nim for the purpose of interop with a C library? In this case, the underlying library wants a pointer to the beginning and the end of a cstring. |
21:56:23 | FromDiscord | <Elegantbeef> You can use `cast[ptr UncheckedArray[T]]` or use `ptr_math` |
21:56:35 | FromDiscord | <Elegantbeef> Nim doesnt define pointer arithmetic cause it's quite obnoxious |
22:01:28 | * | kenran quit (Remote host closed the connection) |
22:13:41 | FromDiscord | <guttural666> Is there a way to define the value of a variable at compile time by differing function calls, depending on a given type of a generic proc parameter? |
22:16:06 | FromDiscord | <Elegantbeef> The answer is yes but i do not know exactly what you're after |
22:19:18 | FromDiscord | <guttural666> something like:↵let myvar = if typeof(x) == api1: callfunc1() elif typeof(x) == api2: callfunc2() where the proc calls don't have to be compile time executable, I just want to kind of text replace the proc calls themselves at compile time? |
22:20:35 | FromDiscord | <guttural666> meaning the type of x is known at compile time and the proc call itselves are known, but not the values they procude? |
22:20:43 | FromDiscord | <guttural666> (edit) "procude?" => "produce?" |
22:24:20 | FromDiscord | <guttural666> probably just a text replace / template |
22:26:30 | FromDiscord | <guttural666> I solved this previously by just providing a differing proc pointer, depending on my types at the call site |
22:26:47 | FromDiscord | <Elegantbeef> `when` and `elif` |
22:27:31 | FromDiscord | <guttural666> okay, yeah that was one solution chatGPT gave me + it said static if typeof(x) |
22:27:35 | FromDiscord | <guttural666> will try thanks |
22:28:27 | FromDiscord | <Elegantbeef> Sorry i cannot be as useless as a predictive AI model |
22:28:51 | FromDiscord | <guttural666> hahaha |
22:29:02 | FromDiscord | <guttural666> heresy |
22:29:26 | FromDiscord | <guttural666> seems to do what I want, thanks 😛 |
22:33:36 | FromDiscord | <guttural666> to clarify: this whole path here should be replaced at compile time by let url = make_band_url(query), since the type is known at compile time, I think I understood correctly, that when does a runtime type check https://media.discordapp.net/attachments/371759389889003532/1085329912119951481/image.png |
22:33:55 | FromDiscord | <Elegantbeef> `when query is BandQuery` |
22:34:11 | FromDiscord | <guttural666> sorry, yes |
22:34:49 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4qQ2 |
22:35:26 | FromDiscord | <guttural666> yeah, but I have a bigger let block |
22:35:33 | FromDiscord | <Elegantbeef> So what |
22:35:43 | FromDiscord | <guttural666> maybe nl the when yeah |
22:36:16 | FromDiscord | <guttural666> this https://media.discordapp.net/attachments/371759389889003532/1085330583133110345/image.png |
22:36:43 | FromDiscord | <Elegantbeef> I do not do single line expressions, so that's between you and your god |
22:36:44 | FromDiscord | <guttural666> nice |
22:37:34 | FromDiscord | <guttural666> if they're < 80 width it's all good, thus spoketh the lord |
22:43:58 | FromDiscord | <Elegantbeef> Your lord is the wrong lord |
22:44:21 | FromDiscord | <Takemichi Hanagaki> sent a code paste, see https://play.nim-lang.org/#ix=4qQ4 |
22:46:51 | FromDiscord | <Takemichi Hanagaki> (Yes, I know, Case/Of), but I'm talking about match its internal values. |
23:06:06 | * | cyraxjoe quit (Ping timeout: 268 seconds) |
23:08:06 | FromDiscord | <demotomohiro> @Takemichi Hanagaki I think you need to write a macro to do such a pattern matching. |
23:08:23 | * | cyraxjoe joined #nim |
23:09:19 | FromDiscord | <Takemichi Hanagaki> In reply to @demotomohiro "<@890300313729400832> I think you": Alright! Thanks! |
23:11:51 | * | Notxor quit (Quit: Leaving) |
23:20:54 | * | jmdaemon quit (Ping timeout: 268 seconds) |
23:32:12 | * | jmdaemon joined #nim |
23:40:30 | * | lumo_e joined #nim |
23:52:11 | * | derpydoo quit (Quit: derpydoo) |
23:54:50 | FromDiscord | <Takemichi Hanagaki> In reply to @demotomohiro "<@890300313729400832> I think you": Btw, I found what I was looking for: https://nim-lang.github.io/fusion/src/fusion/matching.html |
23:56:15 | FromDiscord | <auxym> see also patty |
23:58:54 | FromDiscord | <Takemichi Hanagaki> In reply to @auxym "see also patty": Alright! Thanks for the suggestion! 🙂 |
23:59:45 | FromDiscord | <Elegantbeef> Patty is for object variants though |