<< 18-12-2024 >>

00:17:33*rockcavera quit (Read error: Connection reset by peer)
00:17:55*rockcavera joined #nim
00:23:32FromDiscord<albassort> does IpAddress support subnets?
00:31:16FromDiscord<albassort> no
00:31:18FromDiscord<albassort> it does not btw
00:37:25FromDiscord<bostonboston> What for
00:41:06FromDiscord<albassort> you need subnets for things
00:41:07FromDiscord<albassort> sometimes :3
00:46:19FromDiscord<bostonboston> Yes, but, my understanding was thats the network layers job to worry about so I'm curious what I'm missing
00:48:04FromDiscord<albassort> In reply to @bostonboston "Yes, but, my understanding": Sometimes you need to do things involving your local intranet
00:48:17FromDiscord<albassort> (edit) "intranet" => "intranet/intranets"
00:48:42FromDiscord<albassort> your devices can talk to each other, and sometimes, you need to facilitate that, or prevent that
00:48:47FromDiscord<albassort> so you can block a mask
00:48:58FromDiscord<albassort> (edit) "so you can block a mask ... " added "or send a ping to a mask"
00:49:07FromDiscord<albassort> (edit) "mask" => "mask, etc"
00:54:10FromDiscord<bostonboston> I figured that would all be handled by the router and it's rules that both subnets are connected to
02:11:43*SchweinDeBurg quit (Quit: WeeChat 4.6.0-dev)
02:15:04*SchweinDeBurg joined #nim
03:29:53FromDiscord<Robyn [She/Her]> what is a subnet?
03:30:19FromDiscord<Robyn [She/Her]> I assume it's the /xx at the end of IPs sometimes but what does it mean?
03:39:58FromDiscord<bostonboston> An IP address actually contains two addresses, a network address and a host address, the network address describes what network the host address is on (the subnet), the subnet mask describes what part of the ip address is the network address vs host address
03:58:55FromDiscord<Elegantbeef> 2 address in 32 bytes?! 😛
04:02:33*krux02 quit (Remote host closed the connection)
04:09:39FromDiscord<bostonboston> And nothing bad ever happened with ip, the end
05:10:32*rockcavera quit (Remote host closed the connection)
06:56:44*ntat joined #nim
07:38:19FromDiscord<emmanuel.giveaway> sent a long message, see https://pasty.ee/wfWGxfhm
07:41:24Amun-RaRobyn: the second number denotes the number of bits that form a netmask, /24 - 24 bits of 1, and the rest are 0, so /24 is 255.255.255.0
07:44:06FromDiscord<kreed1415> Question, I have a task in my config.nim to build and run the app. However, how would I copy a dynamic library into my build directory? I tried using copyToDirectory() but it says that proc can't be used from scripts
07:45:04FromDiscord<Elegantbeef> `cpFile`
07:45:15FromDiscord<Elegantbeef> You have to use `nimscript` procs (they're imported by default in Nimble
07:45:22FromDiscord<kreed1415> ah nice
07:46:09FromDiscord<kreed1415> it seems like vscode can't handlenimscript
07:46:48FromDiscord<Elegantbeef> `when defined(nimsuggest): import nimscript`
07:50:04FromDiscord<kreed1415> both worked like a charm
07:50:23FromDiscord<kreed1415> So good news. I have succeeded in creating a wrapper for SDL3
07:51:19FromDiscord<kreed1415> i need to set up wrapping for the other files but you can nimble install SDL3 from here: https://github.com/NitroPlum/sdl3nim
07:53:54FromDiscord<drunkenalcoholic> noob question when did std/os module start adding prefixed forward slash for getHomeDir() is that something newly added?
08:00:07*beholders_eye joined #nim
08:04:01*nils` quit (Ping timeout: 248 seconds)
08:19:56strogon14Seems like a bug to me.
08:21:10strogon14Esp. Since it also does it when the home dir is just "/", returning "//".
08:30:35FromDiscord<spotlightkid> @kreed1415\: nice! so this is the wrapper generated by futhark?↵There is a way to have both the generated wrapper and also a module, which generates the wrapper at compile time using the `outputPath` option for `importc:`.↵Here's an example\: https://github.com/SpotlightKid/nim-libsoundio/blob/master/src/soundio.nim
09:08:05*nils` joined #nim
09:53:03*beholders_eye quit (Quit: WeeChat 4.1.2)
10:23:06FromDiscord<Robyn [She/Her]> In reply to @Amun-Ra "Robyn: the second number": ah okay, thank you
10:55:16*beholders_eye joined #nim
11:08:32FromDiscord<pmunch> Hmm, has anyone tried to rename the object files Nim creates?
11:08:49FromDiscord<pmunch> Talking about the ones in `.cache` with the @ symbols in them
11:09:17FromDiscord<pmunch> I have to move some object files around with a linker script, but the linker script doesn't like those filenames
11:36:38FromDiscord<ambient3332> sent a code paste, see https://play.nim-lang.org/#pasty=ZZrXpGcu
11:40:02FromDiscord<Robyn [She/Her]> In reply to @ambient3332 "Why am I getting": can you share the exact error message?
11:40:13FromDiscord<ambient3332> sent a code paste, see https://play.nim-lang.org/#pasty=AIDHpzsD
11:41:08FromDiscord<Robyn [She/Her]> are you sure bitxor can be used as an op? try using it as a normal function
11:41:40FromDiscord<ambient3332> ok that works but I dont understand why
11:41:54FromDiscord<ambient3332> shouldn't Nim have a.foo b, a foo b and foo(a, b) as equivalent?
11:42:59FromDiscord<ambient3332> it's a macro, I guess shrug
11:43:14FromDiscord<ambient3332> which means I get footgunned
11:43:53FromDiscord<solitudesf> In reply to @ambient3332 "shouldn't Nim have a.foo": not `a foo b`.
11:44:31FromDiscord<Robyn [She/Her]> You can't define arbitrary infix ops in Nim
11:45:31FromDiscord<ambient3332> gotcha
11:46:13FromDiscord<ambient3332> a.foo b works, not a foo b
11:46:21FromDiscord<solitudesf> In reply to @ambient3332 "shouldn't Nim have a.foo": https://nim-lang.org/docs/manual.html#lexical-analysis-operators
11:50:17FromDiscord<ambient3332> sent a code paste, see https://play.nim-lang.org/#pasty=HEaYIghC
11:50:37FromDiscord<ambient3332> UIknow value doesn't get initialized as 0.9
11:51:15FromDiscord<ambient3332> The idea would be to run mouseClick on UIelement and the message being autorouted to the relevant data structure depending on component type
11:52:26FromDiscord<ambient3332> I don't need either hierarchy or overlap tests, just rectangular reqions that get fed messages and react accordingly
11:52:57FromDiscord<System64 ~ Flandre Scarlet> Is there more recent Lua libraries for Nim please?
11:57:44FromDiscord<solitudesf> newest one is for luajit specifically https://github.com/glassesneo/spellua
12:00:25*valms19901 joined #nim
12:04:09FromDiscord<pmunch> ambient, just get rid of the var casting and you're good: https://play.nim-lang.org/#pasty=RGdaqOJh
12:04:34FromDiscord<pmunch> They are already reference objects, so var doesn't do what you think it does
12:05:12FromDiscord<pmunch> Not 100% why exactly casting to `var` doesn't work, but it messes up something
12:05:54FromDiscord<albassort> https://media.discordapp.net/attachments/371759389889003532/1318912118636154950/btcapi.nim?ex=67640c21&is=6762baa1&hm=e6e71518bc9352270aa9ed70d27b2d049b60ff68ffe4ca0ebbd159ac7ab6d634&
12:06:02FromDiscord<albassort> i spent all day making a 1000 line btc wrapper
12:06:42FromDiscord<ambient3332> sent a code paste, see https://play.nim-lang.org/#pasty=MiKCcPWC
12:06:59FromDiscord<ambient3332> How do you add the expand to code paste?
12:08:56FromDiscord<ambient3332> Also I didn't even know the difference between method and proc 😮‍💨
12:11:15FromDiscord<pmunch> @albassort, why didn't you just spend ten minutes doing it in Futhark? 🤔
12:11:32FromDiscord<ambient3332> What's the current situation of Futhark + Windows?
12:12:17FromDiscord<pmunch> Windows? Who's that?
12:12:31FromDiscord<ambient3332> A think you have to use for job
12:12:42FromDiscord<pmunch> Ah yes, proc has to know statically at compile-time, method is dynamic dispatch
12:12:43FromDiscord<ambient3332> (edit) "think" => "thing"
12:13:12FromDiscord<pmunch> @ambient3332, pfft, I recommend my devs to use Linux
12:13:33FromDiscord<pmunch> I don't actually remember what the issue on Windows was, might've been fixed?
12:16:19FromDiscord<albassort> In reply to @pmunch "<@217459674700578816>, why didn't you": Not sure if there is a C api wrapper
12:16:29FromDiscord<albassort> (edit) "In reply to @pmunch "<@217459674700578816>, why didn't you": Not sure if there is a C api wrapper ... " added "for it"
12:16:45FromDiscord<albassort> regardless, it was good because i had to learn each function
12:16:58FromDiscord<albassort> and also mines probably more up to date to the API
12:16:58FromDiscord<pmunch> Ah, that makes it harder to use Futhark
12:17:20FromDiscord<albassort> i mean the implementation is in CPP, so maybe
12:17:28FromDiscord<albassort> its RPC, if you read the code
12:37:19FromDiscord<luteva> sent a long message, see https://pasty.ee/BZVHJSXt
13:09:41FromDiscord<k0ts> have you tried importing `db_connector/db_common`
14:21:10FromDiscord<kreed1415> In reply to @spotlightkid "<@67270681271734272>\: nice! so this": Ah nice. I was just generating it in a repo then another repo is the module. That way you don’t have to pull the SDL source into your project. It’s also a little weird since SDL3 isn’t officially released. It’s just a tag to a preview build that is close to done. This way I can keep the wrapper updated without people having to mess with the submodule
14:21:35FromDiscord<kreed1415> In reply to @ambient3332 "What's the current situation": I got it working
14:21:42FromDiscord<kreed1415> On windows
14:29:01FromDiscord<xtrayambak> god, I love Nim's C++ interop
14:30:34FromDiscord<xtrayambak> I just binded (bound?) some of the Louvre library and now I have a Wayland compositor working in Nim :^)
14:45:33FromDiscord<rakgew> @xtrayambak \: very nice! are you building something like nimdows (nim-x-twm) but for wayland by any chance?
14:46:26FromDiscord<xtrayambak> In reply to @rakgew "<@498088092406644736> \: very nice!": Nope, I'm planning to build something more akin to [Hyprland](https://github.com/hyprwm/hyprland)
14:46:42FromDiscord<xtrayambak> Louvre is a very nice library because it removes 99% of the complexity that comes with writing a Wayland compositor
14:48:43FromDiscord<xtrayambak> here's what it currently looks like https://media.discordapp.net/attachments/371759389889003532/1318953094629031947/i8O0Rg1.png?ex=6764324a&is=6762e0ca&hm=dbe20e84c7dcc8f3dd9340e6e429ccf804efd732b435830794d82844fd3a1531&
14:49:07FromDiscord<xtrayambak> sent a code paste, see https://play.nim-lang.org/#pasty=ayuQsYKl
15:18:47*beholders_eye quit (Ping timeout: 265 seconds)
15:39:15FromDiscord<treeform> In reply to @xtrayambak "Louvre is a very": But writing wayland compositor is not that hard? See: https://github.com/treeform/windy/tree/master/src/windy/platforms/linux
15:39:36FromDiscord<xtrayambak> In reply to @treeform "But writing wayland compositor": I think you're mistaking a Wayland client for a Wayland compositor
15:39:43FromDiscord<treeform> Yes I am, sorry.
15:39:52FromDiscord<xtrayambak> A Wayland compositor is equivalent to an X11 window manager
15:40:02FromDiscord<xtrayambak> (edit) "manager" => "manager, except it's much more lower level"
15:40:05FromDiscord<xtrayambak> In reply to @treeform "Yes I am, sorry.": No worries
15:40:28FromDiscord<xtrayambak> To be fair I got excited for a minute, thinking you started a grassroots project like Smithay but for Nim xD
15:40:35FromDiscord<xtrayambak> given you, it wouldn't be too far fetched
15:41:16FromDiscord<xtrayambak> Maybe we can get a modern Linux desktop environment written in Nim, like Nim's own cosmic one day :^)
15:41:40FromDiscord<xtrayambak> It'd be nice if fidget worked under Wayland natively, that DE wouldn't be too far fetched then
15:41:45FromDiscord<treeform> Why stop there, a 100% Nim OS.
15:42:10FromDiscord<xtrayambak> In reply to @treeform "Why stop there, a": Haha, [khaledh's fusion kernel](https://github.com/khaledh/fusion) comes to mind
15:43:17FromDiscord<treeform> My first open source project was an OS (2004): https://github.com/treeform/Atomic4
15:43:33FromDiscord<treeform> I think I have learned a thing or two in 20 years 🙂
15:43:33FromDiscord<xtrayambak> Ooh, in pure ASM too
15:43:53FromDiscord<xtrayambak> My first one was when I was 9 or something, but it can't really be called a project
15:43:58FromDiscord<xtrayambak> it was just a bunch of BASIC code samples
15:44:08FromDiscord<xtrayambak> I think I deleted the GitHub repository
15:44:24FromDiscord<treeform> I was too poor to have a computer at 9 😦
15:44:32FromDiscord<xtrayambak> In reply to @treeform "I was too poor": Aw, that's sad
15:44:50FromDiscord<xtrayambak> I was using my mom's laptop to write BASIC back then, I learnt Nim on that thing as well
15:45:20FromDiscord<treeform> Thats pretty cool.
15:45:46FromDiscord<treeform> I did not know programming existed at 9.
15:46:09FromDiscord<xtrayambak> I saw my uncle, who's a senior SWE at HP and thought it was pretty cool
15:46:16FromDiscord<xtrayambak> He works on maintaining HP-UX from what I've seen
15:46:24FromDiscord<treeform> yeah that would do it
15:46:50FromDiscord<xtrayambak> I think I'll commit an atrocity and bridge my JavaScript engine and the Louvre bindings so that you can create Wayland compositors in a very limited dialect of JavaScript 😅
15:47:02FromDiscord<xtrayambak> Nah, I think that'd actually be too evil
15:51:06FromDiscord<xtrayambak> I love having to decipher stuff like this https://media.discordapp.net/attachments/371759389889003532/1318968794378670090/SojOu9H.png?ex=676440e9&is=6762ef69&hm=d8e9bddf7b492ef651407a5a0de13b064d9aace68bd4599df76e1e9bf4b9ee0c&
15:52:16FromDiscord<xtrayambak> Ah, I mismatched the `header` and `importcpp` pragmas
15:54:03*beholders_eye joined #nim
16:40:28*nils` quit (Ping timeout: 265 seconds)
17:05:24FromDiscord<saint._._.> What are Louvre bindings?
17:07:45FromDiscord<luteva> In reply to @k0ts "have you tried importing": yes i tried that as well. same problem
17:13:13*krux02 joined #nim
17:35:11FromDiscord<rongcuid> Is it possible to use C procedures without declaring them manually? Like somehow including a C header or something
17:36:13FromDiscord<demotomohiro> In reply to @rongcuid "Is it possible to": Use futhark or c2nim to generate binding automatically.
17:36:51FromDiscord<demotomohiro> https://github.com/PMunch/futhark
17:38:41FromDiscord<anuke> How is state generally handled with async/multithreaded programs?↵↵I have a telegram bot using the telebot library; it requires a .gcsafe. proc to [handle incoming messages](<https://github.com/ba0f3/telebot.nim/blob/master/examples/echo_bot.nim#L30>) - I can't access any global state in this proc, or use any data (e.g. images) I preloaded before registering the handler. Is there a workaround to this that doesn't involve .gcsafe. casts?
17:40:21FromDiscord<anuke> I did try `{.cast(gcsafe).}:` as a temporary workaround, but that caused hard crashes whenever a recoverable exception was raised in a try/catch (could be unrelated?).
17:41:31FromDiscord<rongcuid> In reply to @demotomohiro "Use futhark or c2nim": Ok, thanks
18:04:27*strogon14 quit (Quit: Auf Wiese geh'n!)
18:05:26FromDiscord<kreed1415> Is there a good place to submit issues with vscode? it's getting pretty bad
18:06:05*strogon14 joined #nim
18:06:53FromDiscord<nasuray> In reply to @luteva "yes i tried that": you likely need to fork ormin and update that code to use the `db_connector` and change the import to `db_connector/db_common` , since `db_common` is no longer in the standard library
18:13:02FromDiscord<anuke> In reply to @kreed1415 "Is there a good": I don't think there's a better place than the vscode-nim repository. I saw your issue report there, but sadly it doesn't seem like any of the VSC extensions are being very actively developed/maintained.
18:14:05FromDiscord<bostonboston> https://github.com/nim-lang/vscode-nim↵↵Is actively being developed, be sure that this is the extension you installed
18:14:15FromDiscord<rakgew> cool! looking forward.↵do you plan on posting it on the project show case in the nim forum?↵(@xtrayambak)
18:16:16FromDiscord<kreed1415> In reply to @bostonboston "https://github.com/nim-lang/vscode-nim Is actively": conI think so, im using the official one
18:16:19FromDiscord<kreed1415> https://media.discordapp.net/attachments/371759389889003532/1319005335964352662/image.png?ex=676462f2&is=67631172&hm=651b786a6830cd71493c62652535f0773e12930a9e5d037fa93b57c964763930&
18:16:23FromDiscord<kreed1415> (edit) "conI" => "I"
18:16:39FromDiscord<kreed1415> but it almost always starts to hang after ever save
18:16:45FromDiscord<kreed1415> (edit) "ever" => "every"
18:16:55FromDiscord<anuke> In reply to @bostonboston "https://github.com/nim-lang/vscode-nim Is actively": Yes, that is the repository I was referring to. The last commit was 2 months ago, and there are some [obvious long-standing issues](<https://github.com/nim-lang/vscode-nim/issues/74>) with no developer response.
18:17:37FromDiscord<kreed1415> it's essentially unusable for me
18:18:17FromDiscord<bostonboston> 2 months is not a long time (its also the holidays). The lead developers of the extension from what I understand are employees of Status, and likely have other things to deal with as well
18:20:27FromDiscord<anuke> Right, I'm not blaming anyone in particular, but in my experience the plugin has enough serious long-standing issues to make it pretty much unusable outside of basic syntax highlighting
18:20:45FromDiscord<kreed1415> syntax hilighting doesn't even work anymore
18:20:58FromDiscord<kreed1415> I have to close and reopen vscode every 2 minutes for it to work
18:21:23FromDiscord<smartdev0809> sent a long message, see https://pasty.ee/CScALfWs
18:22:08FromDiscord<kreed1415> am I crazy or is this definitely not correct:
18:22:12FromDiscord<kreed1415> https://media.discordapp.net/attachments/371759389889003532/1319006816398475314/image.png?ex=67646452&is=676312d2&hm=4bb5d04afc947d163f4d92817765dbb976fc6d0e064eb0d2b850162efa3afbad&
18:22:27FromDiscord<kreed1415> it just keeps doing this over and over and hanging
18:22:44FromDiscord<k0ts> Has https://github.com/nim-lang/choosenim/issues/13 been mentioned yet
18:22:57FromDiscord<k0ts> <@&371760044473319454> spam above
18:23:07FromDiscord<kreed1415> In reply to @k0ts "Has https://github.com/nim-lang/choosenim/issues/13": oh this is interesting
18:23:17*Goodbye_Vincent1 quit (Quit: )
18:23:30FromDiscord<kreed1415> the problem is caused by choosenim
18:24:10FromDiscord<kreed1415> so i need to abandon choosenim?
18:24:23FromDiscord<k0ts> Try without choosenim and see if it solves the problem
18:24:28FromDiscord<bostonboston> I'm unfamiliar with the problems, the only thing I can report is the I use choosenim, and the extension on windows without much issue
18:24:50FromDiscord<bostonboston> Other than I have to restart vs code for newly installed nimble packages to be found
18:28:34*beholders_eye quit (Ping timeout: 248 seconds)
18:30:40FromDiscord<kreed1415> In reply to @k0ts "Try without choosenim and": any idea how to remove choosenim?
18:40:14FromDiscord<kreed1415> nvm yeah I think that fixed it for me
18:51:02*beholders_eye joined #nim
18:53:12*nils` joined #nim
19:07:41FromDiscord<kreed1415> IO lied
19:07:43FromDiscord<kreed1415> (edit) "IO" => "I"
19:07:45FromDiscord<kreed1415> it's still broken
19:08:14*beholders_eye quit (Ping timeout: 244 seconds)
19:09:00*disso-peach joined #nim
19:16:42*Goodbye_Vincent1 joined #nim
19:19:49*nils` quit (Ping timeout: 248 seconds)
19:51:32FromDiscord<ambient3332> I see it was actually a bug that nimsuggest.exe was left hanging in the background. How hard would it be to modify choosenim to also close the child process?
20:01:37FromDiscord<Elegantbeef> Think there is a PR to choosenim that resolves it for linux
20:01:45FromDiscord<Elegantbeef> Work is still required for windows if I recall correctly
20:45:52FromDiscord<wug.s> sent a code paste, see https://paste.rs/aQKk0
20:45:55FromDiscord<wug.s> for some reason this doesn't work
20:46:05FromDiscord<luteva> In reply to @nasuray "you likely need to": Thx! I'll try that!
20:46:26FromDiscord<wug.s> sent a code paste, see https://play.nim-lang.org/#pasty=AyHSvyHr
20:46:32FromDiscord<wug.s> (edit) "https://paste.rs/O4cHg" => "https://play.nim-lang.org/#pasty=WWCAkart"
20:46:51FromDiscord<wug.s> actually in general, using tuples for types like that doesn't work, which is strange
20:46:57FromDiscord<wug.s> unless im forgetting something?
20:47:02FromDiscord<Elegantbeef> Well yea
20:47:11FromDiscord<Elegantbeef> It's `(Vector[int], Vector[int])` if you want anonymous
20:47:25FromDiscord<Elegantbeef> If you want named fields you use `tuple[a: T, b: Y]`
20:51:22FromDiscord<wug.s> ahhh ok that makes sense
20:51:58FromDiscord<wug.s> thanks
20:52:02FromDiscord<wug.s> (edit) "thanks" => "thanks, it worked"
20:52:22FromDiscord<wug.s> sent a code paste, see https://play.nim-lang.org/#pasty=IycxUShn
20:52:27*xet7 quit (Remote host closed the connection)
20:52:32FromDiscord<wug.s> (edit) "sent a code paste, see https://play.nim-lang.org/#pasty=iyDNQVJk" => "so you only use `tuple[stuff]` if you want named?"
20:53:04FromDiscord<ambient3332> Personally, I find hard to think of any good use cases for anonymous tuples 🤷‍♂️
20:53:46*xet7 joined #nim
20:54:00FromDiscord<Elegantbeef> Personally I find very little merit in named tuples
20:54:17*beholders_eye joined #nim
20:54:33FromDiscord<ambient3332> if you want array, you use array, if you want tuple, each element has some meaning and you lose information if you don't name them
20:54:48FromDiscord<Elegantbeef> Right but if I want to name them I want distinct typing
20:54:57FromDiscord<Elegantbeef> So why would I name a tuple then lose distinct typing
20:55:04FromDiscord<ambient3332> So you would use something like object?
20:55:10FromDiscord<Elegantbeef> Correct
20:55:20FromDiscord<Elegantbeef> I only use tuples for variadic generics or unpacking
20:55:42FromDiscord<ambient3332> I guess I use them as inline objects, which may not be super smart
20:55:50FromDiscord<Elegantbeef> So I might use named tuples to document return parameters but I never have a tuple on the left side of anything
20:56:12FromDiscord<Elegantbeef> If it's the left side of an expression it's an object cause I want distinct typing
20:58:12FromDiscord<ambient3332> Even as function return values named tuples are kinf of an ad hoc type definition
20:58:34FromDiscord<Elegantbeef> They are but I only use it for unpacking
20:58:51FromDiscord<wug.s> In reply to @ambient3332 "if you want array,": i mean its mostly just good to know and unnamed is faster to write
20:59:05FromDiscord<wug.s> im doing advent of code so it doesn't matter much
20:59:13FromDiscord<wug.s> its small-scale code and its easy to write
21:00:02FromDiscord<wug.s> In reply to @ambient3332 "I guess I use": as long as you don't need mutability, whats the difference?
21:00:03FromDiscord<ambient3332> Especially for complex AoC I would prefer named tuples, because keeping what all the indexing in my head means is just needless cognitive overhead
21:00:25FromDiscord<wug.s> day 16 is not that complicated 🤷‍♂️
21:00:29FromDiscord<wug.s> im slightly behind
21:01:35FromDiscord<Elegantbeef> Ambient that sounds like "use an object" to me
21:01:49FromDiscord<ambient3332> maybe I'm allergic to objects
21:02:43FromDiscord<Elegantbeef> Well if you don't mind structurally typing keep on using tuples, but it's weak typed nightmare if you ask me
21:02:47FromDiscord<ambient3332> Never know if I should put all the global type definitions at the top of the file or sprinkle them in between procs
21:02:55FromDiscord<Elegantbeef> Just cause two objects have the same field names and types does not mean they're interopable
21:03:27FromDiscord<kreed1415> so in getting emscripten to work I was told to add this to my config. It works but im curious what this block is called and what's happening?
21:03:29FromDiscord<kreed1415> https://media.discordapp.net/attachments/371759389889003532/1319047407542997064/image.png?ex=67648a20&is=676338a0&hm=46c3894cb6b8f5fe89bb4fbf6ff4168cb7ccca18f0d1de4d4e0c4c83189fda4d&
21:04:00FromDiscord<Elegantbeef> `when defined` not `if`
21:04:12FromDiscord<Elegantbeef> It's just a when statement
21:04:15FromDiscord<kreed1415> but is this a macro or something?
21:04:17FromDiscord<Elegantbeef> THere is nothing special in the config
21:04:31FromDiscord<Elegantbeef> the `--` is a template yes
21:04:33FromDiscord<ambient3332> Do tuples and objects have the same performance characteristics in Nim?
21:04:38FromDiscord<kreed1415> ok that's the issue then
21:04:48FromDiscord<Elegantbeef> Of course they do
21:05:06FromDiscord<Elegantbeef> The difference between an object and a tuple is that an object is typed by name, whereas a tuple is typed by shape
21:05:18FromDiscord<Elegantbeef> An object is more like a `distinct tuple`
21:05:25FromDiscord<Elegantbeef> It's not the same but it's close
21:05:28FromDiscord<kreed1415> sent a code paste, see https://play.nim-lang.org/#pasty=wGmoZCEO
21:05:41FromDiscord<Elegantbeef> You just showed it
21:05:47FromDiscord<kreed1415> it doesn't seem to work
21:05:50FromDiscord<Elegantbeef> \`--passL\:"Bleh"
21:06:02FromDiscord<Elegantbeef> It's a template so it has to be valid Nim still
21:06:03FromDiscord<kreed1415> if I pass a string literal that's fine
21:06:18FromDiscord<kreed1415> but if I pass a variable that is a string it doesn't work
21:06:33FromDiscord<Elegantbeef> If you're using a dynamically computed value it has to be `switch("passL", ...)`
21:06:41FromDiscord<Elegantbeef> Cause the `--` is untyped and just poops out what you give it
21:07:07FromDiscord<kreed1415> yeah I assumed it was something like that I just didn't know the solution
21:07:10FromDiscord<kreed1415> so it's switch?
21:07:41FromDiscord<Elegantbeef> the `--` is just a template over `switch` which does `switch(firstParameter, astToStr(secondParameter))`
21:09:10FromDiscord<kreed1415> In reply to @Elegantbeef "the `--` is just": incredibly helpful
21:09:49FromDiscord<helwastaken> Anyone know how to fix the issue in #tooling
21:10:02FromDiscord<helwastaken> With nimlangserver not working fully
21:10:08FromDiscord<Elegantbeef> But alas it's just the latter half
21:10:08FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=bMnnIJhl
21:10:22FromDiscord<Elegantbeef> Did you use choosenim to install it?
21:12:28FromDiscord<helwastaken> In reply to @Elegantbeef "Did you use choosenim": Nope just downloaded and added to path
21:13:47FromDiscord<Elegantbeef> Well that removes the #1 issue that people run into
21:13:48FromDiscord<Elegantbeef> My job here is done
21:13:57FromDiscord<Elegantbeef> Do you have a .nimble file?
21:14:16FromDiscord<helwastaken> I did try with choosenim as well tho
21:14:22FromDiscord<helwastaken> Month or two ago
21:14:32FromDiscord<helwastaken> This is a long lasting issue i had
21:19:45*beholders_eye quit (Ping timeout: 248 seconds)
21:20:19*ntat quit (Quit: Leaving)
21:25:27*beholders_eye joined #nim
21:31:45FromDiscord<spotlightkid> The PR actually now contains the fix for Windows as well. But there are no tests, thatswhy it is still a draft PR. But I use the change form the PR in my choosenim package for Arch Linux since a couple of weeks now without problems.
21:31:55*beholders_eye quit (Ping timeout: 265 seconds)
22:08:40FromDiscord<kreed1415> So, how would I write a nimscript that runs nimhttpd?
22:08:52FromDiscord<kreed1415> I've tried doing it and you can't simply exec that command
22:08:56FromDiscord<Elegantbeef> `exec`
22:09:34FromDiscord<kreed1415> you get an OSerror
22:09:42FromDiscord<kreed1415> unless you run gorgeEx
22:09:54FromDiscord<kreed1415> but then it just runs and immediately shuts down
22:11:49FromDiscord<Elegantbeef> Which says?
22:15:42FromDiscord<kreed1415> In reply to @Elegantbeef "Which says?": it doesn't say anything
22:15:55FromDiscord<Elegantbeef> So you have an OsError with no message?
22:16:06FromDiscord<kreed1415> oh you mean the os error?
22:16:47FromDiscord<Elegantbeef> Yes the OSError will provide diagnostic information
22:17:46FromDiscord<kreed1415> it says it cant find the file specified but i literally gave it a full url
22:18:13FromDiscord<Elegantbeef> Full path to the `nimhttpd` binary?
22:18:24FromDiscord<kreed1415> oh it can't find that
22:18:35FromDiscord<kreed1415> i assumed it was the file I wanted to serve
22:25:18FromDiscord<kreed1415> ah ok that's weird that it can't find it despite being in my path
22:25:27FromDiscord<kreed1415> so i gotta figure out how to get the nimble path in there
22:34:08FromDiscord<.throwstar> Someone please tell me what im doing wrong↵https://play.nim-lang.org/#pasty=QhvjEkTj
22:37:50*beholders_eye joined #nim
22:37:55FromDiscord<Elegantbeef> `0..<sample_count`
22:37:56FromDiscord<ambient3332> sent a code paste, see https://play.nim-lang.org/#pasty=hVsAsbap
22:38:26FromDiscord<Elegantbeef> Same values now
22:38:27FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=aAkwcXsh
22:39:00FromDiscord<.throwstar> Theres no way
22:39:07FromDiscord<.throwstar> Ive been stuck on this for days
22:39:15FromDiscord<Elegantbeef> `a..b` is inclusive 😄
22:39:41FromDiscord<Elegantbeef> I take it you didn't think it was odd the Nim side had 8 values?
22:40:10FromDiscord<.throwstar> I quickly made that example to share I wasnt paying full attention
22:42:49FromDiscord<Elegantbeef> Ambient Nimsuggest doesn't like methods
22:43:08FromDiscord<.throwstar> Nim should add c for loops so I can fight my own incompetence rather than the language
22:43:25FromDiscord<Elegantbeef> Nah C for loops suck
22:44:12FromDiscord<ambient3332> You can do all kinds of crazy stuff with templates and macros. Customizing for loops to your liking shouldn't be that complex
22:44:26FromDiscord<Elegantbeef> It's not really possible to do that
22:44:34FromDiscord<Elegantbeef> `for x in y` is hard coded in Nim
22:46:18FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=HwaCxXfx
22:46:46FromDiscord<Elegantbeef> Ah sorry that'd need to be `(var x = 0)`
22:48:41FromDiscord<Elegantbeef> I have no idea how that's better than `for x in 0..<10` but who am I to judge
22:51:32FromDiscord<.throwstar> In reply to @Elegantbeef "I have no idea": I typically refer to c code when Im looking for algorithms just cause theres not a whole lot of nim examples
22:51:47FromDiscord<.throwstar> + Im more used to the c for loop style, its easier for me to read
23:10:24*coldfeet joined #nim
23:31:14FromDiscord<ambient3332> Every child class method has to also exist in the parent class "virtual" methods?
23:33:13FromDiscord<Elegantbeef> What does that even mean
23:34:59FromDiscord<ambient3332> I try and make some example code
23:35:02FromDiscord<ambient3332> brb
23:38:33*beholders_eye quit (Ping timeout: 265 seconds)
23:43:36*beholders_eye joined #nim
23:46:10FromDiscord<ambient3332> sent a code paste, see https://play.nim-lang.org/#pasty=hiLfYeQY
23:46:49FromDiscord<Elegantbeef> Well yea that's what `{.base.}` is for
23:49:15FromDiscord<Elegantbeef> If `setBreed` is supposed to exist for all `Animal`s it needs to be there
23:49:26FromDiscord<ambient3332> Only for some animals
23:49:38FromDiscord<ambient3332> That have relevant data fields
23:49:52FromDiscord<Elegantbeef> So then implement it for the root type that needs it
23:50:41FromDiscord<Elegantbeef> Either use `doAssert false` or raise an exception if the base method is called
23:50:56FromDiscord<Elegantbeef> If you need all children of `Animal` to have `setBreed`
23:51:11FromDiscord<Elegantbeef> otherwise you need to implement a `BreedAnimal`
23:51:25FromDiscord<ambient3332> The issue is that I need some fields and some functions to exist only in certain children. Other children to have other fields and functions
23:51:45FromDiscord<Elegantbeef> I mean you're using inheritance so make the tree up
23:51:54FromDiscord<ambient3332> Although I have no ides what the backend for seq[Animal] would look like then
23:54:13FromDiscord<Elegantbeef> "backend"?
23:54:14FromDiscord<Elegantbeef> Do question if you can use an object variant instead
23:54:20FromDiscord<Elegantbeef> Inheritance trees and methods are easy to use but chaotic to live
23:54:43FromDiscord<ambient3332> I shall look into it