<< 18-01-2025 >>

00:25:10FromDiscord<Robyn [She/Her]> ~~Never~~
00:49:07*GnuYawk67 quit (Quit: The Lounge - https://thelounge.chat)
00:49:37*GnuYawk67 joined #nim
02:03:09FromDiscord<takemichihanagaki3129> From [Learn X in Y minutes](https://learnxinyminutes.com/nim/), is this a valid Nim code?↵Or it was at some time... https://media.discordapp.net/attachments/371759389889003532/1329994459332739174/image.png?ex=678c5d5d&is=678b0bdd&hm=254f19a0b7d232d86f8e1452e8360ee5ec9071fc76ed0bb5df31d060a0b079f0&
02:03:18FromDiscord<takemichihanagaki3129> (edit) "time..." => "time ago?"
02:11:57strogon14Why don't you ask the compiler? Do you have an actual error?
02:12:57FromDiscord<takemichihanagaki3129> In reply to @strogon14 "Why don't you ask": This is what I'm getting...↵I always use `newHouse` procs to initiate it. https://media.discordapp.net/attachments/371759389889003532/1329996924736114810/image.png?ex=678c5fa9&is=678b0e29&hm=5eac0ec1885ffdabdaf668133ac5461b91ba058c3425a82b458adca31b6619b7&
02:18:48FromDiscord<spotlightkid> drop the parentheses after `Room` in `new Room`.
02:23:02FromDiscord<takemichihanagaki3129> In reply to @spotlightkid "drop the parentheses after": Ohhh, thank you a lot!
03:36:57FromDiscord<xtrayambak> In reply to @takemichihanagaki3129 "Ohhh, thank you a": You could also just do `Room()`
03:40:04FromDiscord<xtrayambak> In reply to @justunknown666 "hi guys , i'm": Welcome :^)↵↵Basically any editor that supports LSP can be used to write Nim - I personally use Neovim with the [nim.nvim](https://github.com/alaviss/nim.nvim) plugin. You just need to install nimlsp (imo it's better than the official nimlangserver) and install the Nim extension from the VSC marketplace
04:07:27FromDiscord<lainlaylie> https://github.com/nim-lang/Nim/pull/24620
04:08:15FromDiscord<lainlaylie> what a shame, now the authors of libraries i use will never fix them and I'll be stuck with the warning spam↵(i like the feature)
04:45:28FromDiscord<janakali> @lainlaylie I believe you can turn this on per module, at least that's how it works now with `{.experimental: "strictDefs".}`
05:27:01FromDiscord<lainlaylie> yes, but if it's not default authors won't feel the need to fix their code to place nice with it
05:27:08FromDiscord<lainlaylie> (edit) "place" => "play"
05:27:43FromDiscord<lainlaylie> and i dont want to have to add that experimental pragma in each of my modules
05:51:20*SchweinDeBurg quit (Quit: WeeChat 4.6.0-dev)
05:51:47*SchweinDeBurg joined #nim
05:54:29FromDiscord<yummy_licorice> is it possible to get the result of pkg-config in a config.nims file
05:55:40FromDiscord<yummy_licorice> i was thinking of using the exec function but it doesnt return output
05:56:05FromDiscord<Elegantbeef> `gorge`
06:07:06FromDiscord<yummy_licorice> thank you
07:16:29FromDiscord<bubblie> for nim is there any libraries for reading .obj models of sorts or something for opengl and vulkan?
07:16:57FromDiscord<Elegantbeef> Assimp has some bindings
07:17:31FromDiscord<Elegantbeef> But obj is afterall made simple so you can write a parser in an hour
07:17:50FromDiscord<bubblie> ah okay
07:19:25FromDiscord<bubblie> is there anything for gltf?
07:19:51FromDiscord<Elegantbeef> Assimp is what I use for gltf
07:21:14FromDiscord<bubblie> is there nim bindings for assimp?
07:21:21FromDiscord<bubblie> like a link
07:21:22FromDiscord<bubblie> sorry
07:21:57FromDiscord<Elegantbeef> https://github.com/beef331/nimassimp/ is what I use slightly more maintained than what's in the registry
07:22:17FromDiscord<bubblie> thank you!
07:24:41*xet7 quit (Remote host closed the connection)
09:05:52*krux02 joined #nim
10:12:59*krux02 quit (Quit: Leaving)
10:33:45FromDiscord<bsdooby> In "Nim in Action" nothing on casting is explained. Was/is this by intention ?
10:44:59FromDiscord<solitudesf> In reply to @bsdooby "In "Nim in Action"": nim in action author hasn't been involved with nim for years now, so we will never know.
11:32:15FromDiscord<madonuko> somebody should have made a package for something like rust itertools + std iterator but in nim
11:41:52FromDiscord<tauruuuuuus> Seems like my Nim compiler does not see nimble packages
11:42:46FromDiscord<tauruuuuuus> `nimble build` works but `nim c ...` does not find them, I checked `nim dump` and it does not show the path, I was under the impression that it would have worked by default
11:43:45FromDiscord<tauruuuuuus> Anyone knows how to fix this? I'm asking mainly because I tend to use clion, and it uses `nim dump` for library discovery, and right now it does not allow 3rd party navigation/discovery because of this
11:58:50FromDiscord<madonuko> for example you have `a.nimble`, then `nim c src/a` should work
12:19:03*ntat joined #nim
12:22:33*ensyde quit (Ping timeout: 265 seconds)
12:27:35FromDiscord<solitudesf> In reply to @tauruuuuuus "`nimble build` works but": does it work after `nimble setup`
12:27:37FromDiscord<solitudesf> (edit) "setup`" => "setup`?"
12:31:21FromDiscord<lainlaylie> there was something like that years ago when nimble started installing packages to `pkgs2`
12:31:23FromDiscord<lainlaylie> https://forum.nim-lang.org/t/10472
13:09:17FromDiscord<janakali> sent a code paste, see https://play.nim-lang.org/#pasty=uJquHtHF
13:10:16FromDiscord<tauruuuuuus> In reply to @solitudesf "does it work after": It does, guess it's time to RTFM again 😄
13:11:06FromDiscord<tauruuuuuus> Thanks for the help everyone, time to study the nimble workflow page I guess
13:17:14FromDiscord<lainlaylie> nim should be able to find globally installed nimble packages (i.e. not `-l`) without `nimble setup`, so there's something wrong with your nim configuration
13:24:59FromDiscord<tauruuuuuus> Oh I see
13:25:45FromDiscord<tauruuuuuus> If it helps, I installed by cloning, compiling with build_all.sh and then putting the Nim/bin directory in the PATH
13:38:36FromDiscord<lainlaylie> that should be fine
13:39:10FromDiscord<lainlaylie> did you check your configs like janAkali suggested
14:14:10FromDiscord<solitudesf> also remove `~/.nimble/pkgs/`
14:20:13FromDiscord<tauruuuuuus> In reply to @janakali "<@375951998337417229> check that you're": Doesn't seem so :/ I tried in many different directories
14:20:25FromDiscord<tauruuuuuus> In reply to @solitudesf "also remove `~/.nimble/pkgs/`": I have no pkgs directory either
14:20:33FromDiscord<tauruuuuuus> Maybe I fucked something up when installing?
14:27:42FromDiscord<solitudesf> In reply to @tauruuuuuus "Maybe I fucked something": do you have global nim config or nimble config?
14:31:12*m5zs7k quit (Ping timeout: 252 seconds)
14:35:51*m5zs7k joined #nim
14:36:37FromDiscord<tauruuuuuus> How do i check that? I only see the stuff in `.../Nim/config` <- installation dir
14:36:44FromDiscord<tauruuuuuus> I think they're just the defaults
14:42:41FromDiscord<lainlaylie> when you invoke the nim compiler, e.g. by `nim dump` or `nim c`, at the top of the output it tells you which config files are being used
14:43:00FromDiscord<lainlaylie> let's take a step back↵where are the nimble packages you are trying to import? are they in `~/.nimble/pkgs2`?
15:29:59FromDiscord<tauruuuuuus> In reply to @lainlaylie "let's take a step": Yup
15:31:35FromDiscord<tauruuuuuus> In reply to @lainlaylie "when you invoke the": Yes, these are just the defaults, as you can see I have a clean `git status` and I checked out the v2.2.0 tag https://media.discordapp.net/attachments/371759389889003532/1330197905662808094/image.png?ex=678d1ad6&is=678bc956&hm=380470d076cefda3ca6987b8350b667996b4ce40408bda6fc68b932b00f3b805&
15:47:15FromDiscord<lainlaylie> there are also per-project configs, make sure you don't have anything like --noNimbleDir in there
15:47:20FromDiscord<lainlaylie> other than that, i dunno
15:49:28FromDiscord<starkiller1493> sent a code paste, see https://play.nim-lang.org/#pasty=iYdlfzsx
15:49:42FromDiscord<starkiller1493> (edit) "https://play.nim-lang.org/#pasty=ojPeffFj" => "https://play.nim-lang.org/#pasty=uJVeUIgD"
15:50:11FromDiscord<starkiller1493> (edit) "https://play.nim-lang.org/#pasty=vDcXbSqL" => "https://play.nim-lang.org/#pasty=AgCSCSOF"
15:59:20*xet7 joined #nim
15:59:46FromDiscord<lainlaylie> stuff like `cast[ptr int32](inp.read(4)[0].addr)[]` works
16:02:08FromDiscord<lainlaylie> ...but there's probably a better way. is there no readInt32?
16:11:51FromDiscord<starkiller1493> no, there's also `readInto` which reads into an array of bytes, which then doesnt seem to have an issue being cast but seems weird to do a temporary variable in place where it just gets used once
16:12:17FromDiscord<starkiller1493> (edit) "an" => "a given"
16:14:02FromDiscord<demotomohiro> There is `readInt32`: https://nim-lang.org/docs/streams.html#readInt32%2CStream
16:14:29FromDiscord<lainlaylie> i think this is status's faststreams which indeed only has read into openArray[byte]
16:14:50FromDiscord<starkiller1493> yep, i'm using faststreams
16:34:58FromDiscord<lainlaylie> sent a code paste, see https://play.nim-lang.org/#pasty=cckJlihY
16:41:17FromDiscord<lainlaylie> sent a code paste, see https://play.nim-lang.org/#pasty=tEvdTxQd
16:44:44FromDiscord<demotomohiro> https://github.com/status-im/nim-faststreams↵There is neither proper documentations nor example code.↵It looks like it is the project for other project and you are not supposed to use it directly.
16:46:28FromDiscord<demotomohiro> No convienient procedures, but just returns openArray[byte].
16:48:42FromDiscord<starkiller1493> The Readme seems like good enough documentation :shrunk:
16:50:21FromDiscord<starkiller1493> sent a code paste, see https://play.nim-lang.org/#pasty=PkkLdGUf
16:50:59FromDiscord<starkiller1493> (edit) "https://play.nim-lang.org/#pasty=emGbkVWQ" => "https://play.nim-lang.org/#pasty=RZOBxPFN"
16:51:42FromDiscord<lainlaylie> and then package it up into a couple of nice little procs like i did and pretend faststreams has it built in
16:51:45FromDiscord<lainlaylie> that's what i'd do
16:54:18*SchweinDeBurg quit (Ping timeout: 276 seconds)
16:55:47FromDiscord<starkiller1493> Yeah, I've probably should have done already, I think I've read various ints in like 40% of the procs i've written so far
16:56:01*SchweinDeBurg joined #nim
16:56:04FromDiscord<starkiller1493> (edit) "I've" => "I"
18:04:57*coldfeet joined #nim
19:02:27FromDiscord<mjsdev> Anyone know when trying to work around recursive dependencies will be a thing of the past? My understanding is it's a major goal for v3, but I didn't see any timeline on that.
19:11:08*coldfeet quit (Quit: Lost terminal)
19:15:50*beholders_eye joined #nim
19:56:09FromDiscord<albassort> https://raw.githubusercontent.com/neroist/brotli/refs/heads/main/tests/test1.nim
20:33:37FromDiscord<pmunch> No hard dates set on that yet
20:33:56FromDiscord<pmunch> I'm always surprised by how often this seems to come up with newcomers to Nim
20:34:25FromDiscord<pmunch> I've had it happen to myself a couple of times as well, but as you use Nim more I think you just start avoiding circular imports by reflex
20:35:42FromDiscord<Elegantbeef> It's planned to be a pragma for modules when it comes, I just use delayed imports like a drongo
20:36:27FromDiscord<Elegantbeef> It's a bit annoying with gamedev I find, but cyclical files are more annoying
20:36:28FromDiscord<mjsdev> I've been thinking about this distinction. For me, it still remains a distinction between people who are writing code for the code they want to write later vs. writing code for now. Which ironically would presumably include anyone developing features of the lang. Newcomers likely hit it not necessarily because they're writing code for the code they want to write, but writing code for whatever they came from.
20:38:02FromDiscord<mjsdev> In my case, I've probably had about ~1 week of Nim use... I certainly know I could write a lot of code the "Nim way" at this point, and I think I understand how to go about that without issue. For example, a major cause of my headaches is I'm specifically trying to enable breaking modules effectively into class structures.
20:38:45FromDiscord<Elegantbeef> Class structure bad
20:39:04FromDiscord<mjsdev> At least with the macro I've "borrowed" -- that means every type statement is separated. Even if I include all the "classes" in the same module. Which means reciprocal dependencies are not resolved.
20:39:16FromDiscord<mjsdev> In reply to @Elegantbeef "*Class structure bad*": Yeah, we're just going to disagree on that.
20:41:07FromDiscord<mjsdev> I get "nim doesn't really support class structures and doesn't intend to so if that's what you like/want, goodbye and goodluck" -- but "class structures bad" is a bit more prescriptive.
20:41:50FromDiscord<mjsdev> Doesn't help the marketing/branding which aligns to everything from python to Pascal
20:42:22FromDiscord<mjsdev> So yeah, you're going to have a lot of people who love and enjoy much more robust OOP, and with python very much consistent dynamic expectations.
20:45:42FromDiscord<Elegantbeef> Sure they might enjoy OOP, but they can learn other ways to program that does not involve runtime dispatch and pointer indirection 😛
20:45:43FromDiscord<solitudesf> zamn...
20:50:38FromDiscord<mjsdev> I'm sure they can. Why thought? This seems a very awkward and strange take from a language that seems to centralize expressiveness and "elegance."
20:51:11FromDiscord<mjsdev> Elegance is interpreted by most people aesthetically, (i.e. what the code looks like), not by some technical standard of directness and simplicity.
20:51:19FromDiscord<Elegantbeef> Well it all depends on what you mean elegance
20:51:25FromDiscord<mjsdev> Right
20:51:43FromDiscord<Elegantbeef> Speed, and coherence is elegant to me
20:51:48FromDiscord<Elegantbeef> Having to rely on RTTI to reason the path code will take is not really elegant if you ask me
20:51:50FromDiscord<mjsdev> Sure, and not someone else.
20:52:12FromDiscord<Elegantbeef> But I mean I also use trait interfaces for my stuffs anyway
20:52:27FromDiscord<Elegantbeef> It's just only a tool I reach for occasionally and I don't build by entire house using OOP
20:52:43FromDiscord<Elegantbeef> my entire\
20:53:32FromDiscord<Elegantbeef> OOP is just a tool after all the main issue is people reach for it for everything. Which causes memory, speed, and harms readability of the code.
20:53:45FromDiscord<Elegantbeef> memory and speed issues\
20:54:05FromDiscord<mjsdev> At the end of the day, all I can say is my experience, which is... yes, I want something statically typed, but I want something that makes static typing a lot easier. I want something compiled, ultimately, _relatively safe_ but doesn't block me from doing things if I'm 99% sure in most use-case it's going to be fine.
20:54:22FromDiscord<mjsdev> Most importantly, I want all that, and something I can write quickly, in patterns that match the way that I think.
20:54:49FromDiscord<mjsdev> Nims attraction was the meta-programming, because that gave me an opportunity to match the patterns of how I think.
20:55:28FromDiscord<mjsdev> So now I'm down this road... when I write tools/framewworks I write my interface first, i.e. how I want to interact with it. Then I "figure out how to do that" so to speak.
20:55:41FromDiscord<mjsdev> Sure, I make compromises along the way based on all sorts of constraints.
20:59:43FromDiscord<luteva> is it possible to generate Typescript instead of ("plain old") javascript code from nim code?
20:59:58FromDiscord<Elegantbeef> There is only a JS backend so nope
21:02:23FromDiscord<luteva> ok thx. because the type information in nim should be enough to generate the ts types, i think. i thought that mabye there's a lib/macro whatever that could generate the types beside the 'code'.
21:19:41FromDiscord<Robyn [She/Her]> In reply to @luteva "ok thx. because the": Like generating a `d.ts` file?
21:19:53FromDiscord<Robyn [She/Her]> it's definitely possible but no-one has done it afaik
21:34:09*termer joined #nim
21:37:58*Jjp137 quit (Remote host closed the connection)
21:42:26*Jjp137 joined #nim
21:43:21*Jjp137 quit (Client Quit)
21:45:02*Jjp137 joined #nim
21:58:26*ntat quit (Quit: Leaving)
22:33:16FromDiscord<starkiller1493> Has anyone tried compilling Nim for Windows on ARM?
22:47:29*beholders_eye quit (Ping timeout: 245 seconds)
23:18:05*thunder joined #nim
23:23:50FromDiscord<albassort> im gonna store sockets in an hashet and reference them in tables by ref
23:26:26FromDiscord<albassort> channel -> get -> addToHashset (moves mem) -> get ref of varaible -> add that variable to table ↵thereffore
23:26:34FromDiscord<albassort> (edit) "↵thereffore" => "↵thereffore|↵table -> ref of object stored in hashset"
23:35:48FromDiscord<albassort> sent a code paste, see https://play.nim-lang.org/#pasty=xnpmznjR
23:35:56FromDiscord<albassort> nej
23:36:08FromDiscord<albassort> (edit) "https://play.nim-lang.org/#pasty=zorcBEEL" => "https://play.nim-lang.org/#pasty=SAecWqsZ"
23:36:14FromDiscord<albassort> ok what if i do a linked list
23:37:29FromDiscord<albassort> ok that works better
23:58:19FromDiscord<albassort> is it possible for a stale refernecr to manage to referemce a mew pbkect
23:58:43FromDiscord<albassort> (edit) "refernecr" => "refernece" | "referemce" => "reference" | "pbkect" => "object"
23:59:51FromDiscord<albassort> sent a code paste, see https://play.nim-lang.org/#pasty=IwmPZztE