<< 21-02-2025 >>

00:07:18FromDiscord<albassort> sent a code paste, see https://play.nim-lang.org/#pasty=rIzYUIDg
00:07:29FromDiscord<albassort> its a sock_seqpacket. hm...
00:46:09FromDiscord<albassort> sent a code paste, see https://play.nim-lang.org/#pasty=ivXslULf
00:48:55*Jjp137_ quit (Quit: Leaving)
00:50:38*Jjp137 joined #nim
02:13:29FromDiscord<janakali> @aintea @michael.lenz. it's an opt-out feature, just put `--styleCheck:error` in your global config to turn Nim into (mostly) case-sensitive language
02:33:39*beholders_eye quit (Ping timeout: 276 seconds)
02:55:47*disso-peach joined #nim
03:59:01*GnuYawk673 quit (Quit: The Lounge - https://thelounge.chat)
03:59:22*GnuYawk673 joined #nim
05:28:50FromDiscord<heysokam> In reply to @aintea "It is one of": i/e
05:29:25FromDiscord<heysokam> (edit) "i/e" => "you will change your mind as soon as you find a library that uses the opposite style of yours, and your codebase becomes a mess"
05:30:04FromDiscord<heysokam> cannot happen in Nim šŸ¤·ā€ā™‚ļø
05:55:26Amun-Rahernan604: I write in snake case :)
05:57:01*bcksl quit (Ping timeout: 252 seconds)
05:58:07*end quit (Ping timeout: 268 seconds)
05:58:58*ntat joined #nim
06:09:34*bcksl joined #nim
06:19:58*end joined #nim
06:28:43*ntat quit (Quit: Leaving)
07:33:12*alexdaguy joined #nim
08:12:19FromDiscord<aintea> snake_case for variables ā†µUPPER_SNAKE_CASE for constants ā†µcamelCase for functions/methodsā†µUpperCamelCase for types
08:12:24FromDiscord<aintea> This should be the norm
08:12:48FromDiscord<aintea> Nim code style decided otherwise so we need to follow it
08:15:16Amun-RaI tried to use camel case for functions but it's ugly and less readable (ymmv); I switch to python code style and never looked back
08:15:56Amun-Rait doesn't really matter in nim after all
08:17:49FromDiscord<fabric.input_output> pascal case for types, enums, constants, snake for variables, fields, getters/setters, camel for procs, methods, macros, templates
08:18:58Amun-Rathe only camel case I have left are std functions, I haven't decided yet to replace them with _
08:19:30Amun-Raalthough I don't use doAssert, compileTime anymore, just doassert and compiletime
08:52:28FromDiscord<lainlaylie> i would chime in with my preferred style but this is just pointless bikeshedding
09:06:55FromDiscord<ayex> sent a long message, see https://pasty.ee/UVsGtxal
09:17:53FromDiscord<pmunch> Is there a way to take an `openArray[T]` and, with static indices, slice out an `array[N, T]` from it?
09:18:09FromDiscord<pmunch> Just doing `myOpenArray[0..7]` returns a seq
09:19:09FromDiscord<pmunch> One possibility would of course be `cast[ptr array[8, T]](myOpenArray[0].addr)[]` but that's quite ugly
09:40:09FromDiscord<bosinski2023> In reply to @pmunch "One possibility would of": maybe not nice, but i'd do if its reliable. Maybe later look for a more aestethic API.
09:43:29Amun-RaI think cast is the only option if the size of a source array is known in rt
09:54:58*tokyovigilante quit (Remote host closed the connection)
09:55:13*tokyovigilante joined #nim
10:06:11*ntat joined #nim
10:48:07FromDiscord<michael.lenz.> In reply to @janakali "<@680384230227836970> <@812260016890576936> it's an": Thanks! I will try
11:18:04FromDiscord<madonuko> sent a code paste, see https://play.nim-lang.org/#pasty=NLqntdFd
11:19:25FromDiscord<madonuko> honestly I've no idea why this even happens https://media.discordapp.net/attachments/371759389889003532/1342455630740590592/image.png?ex=67b9b2bb&is=67b8613b&hm=d79ebf72c17d6ee4f5fe96cfa17eb411fbb4d64f7fd80e62b643c809bd25c236&
11:23:04FromDiscord<madonuko> idk if I'm doing this correctly, it's working after adding a `.nim.cfg` file with `-t:"-I/usr/include/qt6"`
11:25:52FromDiscord<arnetheduck> you can add include paths by adding `{.passc: gorge("pkg-config --cflags Qt5Widgets").}` and `{.passl: gorge("pkg-config --libs Qt5Widgets").}` to your main project
11:26:05FromDiscord<madonuko> ah
11:26:16FromDiscord<madonuko> that's genius
11:28:54FromDiscord<nnsee> sent a code paste, see https://play.nim-lang.org/#pasty=hroToDQw
11:29:12FromDiscord<nnsee> oh, got it
11:29:15FromDiscord<madonuko> you copy the entire ansi, thenā†µ\`\`\`ansiā†µstuff hereā†µ\`\`\`
11:29:16FromDiscord<nnsee> \`\`\`ansi
11:29:22FromDiscord<nnsee> nice, TIL
11:40:54FromDiscord<madonuko> sent a code paste, see https://play.nim-lang.org/#pasty=bFDXcPzs
11:42:08FromDiscord<madonuko> sent a code paste, see https://play.nim-lang.org/#pasty=kgobHSRz
11:42:26FromDiscord<madonuko> (edit) "https://play.nim-lang.org/#pasty=GTBSLHhE" => "https://play.nim-lang.org/#pasty=QoTcrmNF"
11:43:02FromDiscord<madonuko> honestly that still looks very ugly let me just give you syntax highlighting https://media.discordapp.net/attachments/371759389889003532/1342461577282195506/image.png?ex=67b9b845&is=67b866c5&hm=6b4c1ee5c7cd6d6097f28dea8ed34c6e66a6abd37288c6e19c8fb9a30f5e7a6d&
11:45:40FromDiscord<madonuko> ah so it's my issue https://media.discordapp.net/attachments/371759389889003532/1342462239331844159/image.png?ex=67b9b8e3&is=67b86763&hm=408cc4eb8efb7d3147bf195c3c007777ccb3c8d43b959377ab8fadd6a69c9e79&
11:48:34FromDiscord<arnetheduck> not sure what you're up to, but one thnig I'm playing with is a set of qt bindings that allow qt to be used with the C backend, which tends to be more stable: https://github.com/arnetheduck/nim-miqt-poc/pull/2 .. they're not ready for use, but might be of interest regardless
11:48:43FromDiscord<arnetheduck> (edit) "thnig" => "thing"
11:49:26FromDiscord<arnetheduck> one thing they do is to take care of cflags - but mainly, they offer the full qt api to the application
11:51:19FromDiscord<madonuko> In reply to @arnetheduck "not sure what you're": I'm using nimqml but I need things like `QKeySequence`, so I just use C++ to port the functions to nim
11:52:34FromDiscord<arnetheduck> yeah, I have a port of that too, https://github.com/arnetheduck/nimqml-miqt-poc/ - ie nimqml does not work well with qmetaobject and requires wrapping a lot of things in qvariant - the above solves that problem too by making nim fully qmetaobject-compatible
11:53:04FromDiscord<arnetheduck> (edit) "yeah, I have a port of that too, https://github.com/arnetheduck/nimqml-miqt-poc/ - ie nimqml does not work well with qmetaobject and requires wrapping a lot of things in qvariant - the above solves that problem too by making nim fully qmetaobject-compatible ... " added "(it reimplements moc as a nim macro, more or less)"
11:53:12FromDiscord<arnetheduck> (edit) "moc" => "`moc`"
11:54:39FromDiscord<madonuko> I kinda thought it was a go projectā†µI actually stumbled upon this before deciding to write my own quick and dirty C++ port
11:55:26FromDiscord<arnetheduck> In reply to @madonuko "I kinda thought it": well, miqt is - but the poc ports miqt to nim, more or less - or rather, it reuses the c bindings that miqt generates and imports them to nim
11:56:33FromDiscord<madonuko> ah ok https://media.discordapp.net/attachments/371759389889003532/1342464978388516966/image.png?ex=67b9bb70&is=67b869f0&hm=1f6f7dbb5fbf83b3048840d22fafe0ac8d2edb563e4a8715e9ecbac99fa8148a&
11:59:49FromDiscord<arnetheduck> yours is certainly the more expedient way if you're looking to get things done šŸ˜‰ the bindings still need some structural work before they become sustainable - that said, the are already functional in the sense that they exceed what DOtherSide / nimqml can do (yeah, QKeySequence is covered for example) .. happy to collaborate, it's quite a massive project
12:04:56FromDiscord<arnetheduck> more info here: https://github.com/mappu/miqt/issues/21#issuecomment-2674330023
12:07:31FromDiscord<madonuko> I'm currently figuring out how to use this
12:10:56FromDiscord<summarity> Something odd happenig with the default init for strtabs. If you have a field like `definitions = newStringTable()` (empty table is default), the rendered docs will look like this šŸ˜„ https://media.discordapp.net/attachments/371759389889003532/1342468598022672404/image.png?ex=67b9becf&is=67b86d4f&hm=7c21cfbf7c15fd77ccc6a0c14675ad531387344ec8c3707789d45c67153aa183&
12:22:30FromDiscord<madonuko> In reply to @arnetheduck "yours is certainly the": do I need to compile and run `nim-miqt-poc/cmd/genbindings/main.go`?
12:22:54FromDiscord<madonuko> in order to get the bindings in gen/qt-
12:23:25FromDiscord<arnetheduck> the generated code is available in a branch: https://github.com/arnetheduck/nim-miqt-poc/tree/qt-6.4
12:23:42FromDiscord<madonuko> intersting that saves a lot of time
12:26:11FromDiscord<arnetheduck> In reply to @madonuko "do I need to": but yeah, https://github.com/arnetheduck/nim-miqt-poc/tree/nim-poc2/gen is generated by genbindings in a docker container (to make it reproducible)
12:26:31FromDiscord<arnetheduck> (edit) "In reply to @madonuko "do I need to": but yeah, https://github.com/arnetheduck/nim-miqt-poc/tree/nim-poc2/gen is generated by ... genbindings" added "running"
12:26:46FromDiscord<arnetheduck> (edit) "reproducible)" => "reproducible with different qt version)"
12:26:49FromDiscord<arnetheduck> (edit) "version)" => "versions)"
12:27:44FromDiscord<madonuko> that makes sense
12:33:07FromDiscord<madonuko> just got it working
12:33:34FromDiscord<madonuko> required a manual symlink at the repo root qt-6.4 branch: `ln -s QtCore/ qt`
14:25:55*alexdaguy quit (Quit: w)
14:29:09hernan604Amun-Ra: huh?
14:30:57FromDiscord<odexine> what are you confused about
19:01:22*xet7 quit (Remote host closed the connection)
19:04:43*xet7 joined #nim
20:05:55*beholders_eye joined #nim
20:45:04FromDiscord<aintea> Are there any "nimlings" project going on ? If not does someone want to lead the project and let the community make small exercises ?ā†µI do think rustlings and ziglings are a really good way to exercise but I haven't seen it in Nim
20:49:37FromDiscord<Elegantbeef> There are two attempts at it, but yea no steam
20:49:37FromDiscord<Elegantbeef> https://github.com/search?q=language%3Anim%20%20nimlings&type=repositories
20:51:31FromDiscord<aintea> I'll try to do one, I think this is what I need to do, please correct me if needed since I have never made something like this:ā†µ- Make 30-ish files with 30 different conceptsā†µ- make 30-ish test filesā†µ- run the 30-ish test files in order
20:51:45FromDiscord<aintea> this is how I view it, if there are any more things please correct me
20:52:14FromDiscord<Elegantbeef> You could just make 30 different test files
20:52:26FromDiscord<Elegantbeef> Since it's all about fixing the code to make it work
20:53:16FromDiscord<aintea> ok then I'll try to make one
20:53:57FromDiscord<aintea> What are the topics you guys think should be in there except the classics that are common to all programming languages (variables, functions, "classes", generics, exceptions, ..)
20:54:43FromDiscord<Elegantbeef> Isn't the point to fix code to learn the language?
20:55:07FromDiscord<aintea> yes but I need more ideas than the classic stuff
20:56:18FromDiscord<aintea> sent a code paste, see https://play.nim-lang.org/#pasty=mSljJjrf
20:56:22FromDiscord<Elegantbeef> Make some basic terminal projects with some bugs I guess
20:56:40FromDiscord<aintea> Yeah just like the ziglings thingy
20:56:44FromDiscord<aintea> but I need topics
20:56:49FromDiscord<aintea> Language specific if possible
20:57:18FromDiscord<Elegantbeef> Object variants and creating some form of data structure that uses them
20:57:27FromDiscord<Elegantbeef> A stack based calculator would do the trick
20:57:40FromDiscord<Elegantbeef> If I didnt make toy programs in `/tmp` i'd have gifted you that
20:57:54FromDiscord<aintea> I'm not sure about mini projects since there is already Nim days
20:58:02FromDiscord<aintea> which does the job perfectly
20:58:08FromDiscord<aintea> In reply to @Elegantbeef "*If I didnt make": same
21:18:55FromDiscord<fl4shk> Does anyone know of a library like Python's Pillow for Nim code?
21:19:02FromDiscord<fl4shk> Or do I need to bust out a C library
21:19:06FromDiscord<fl4shk> (edit) "Or do I need to bust out a C ... library" added "or C++"
21:19:29FromDiscord<Elegantbeef> Pixie might work?
21:20:05FromDiscord<fl4shk> I only need to support PNGs, so maybe https://github.com/jangko/nimPNG
21:20:10FromDiscord<fl4shk> I'll look at Pixie too
21:20:13FromDiscord<fl4shk> I need to write this quickly...
21:20:17FromDiscord<fl4shk> (edit) "need" => "wish"
21:39:05*ntat quit (Quit: Leaving)
22:41:48FromDiscord<fl4shk> it looks like Pixie has a simple example that will do exactly what I'm looking for
22:42:27FromDiscord<fl4shk> (edit) "it looks like Pixie has a simple example that will do ... exactly" added "nearly"
22:42:31FromDiscord<fl4shk> it at least does the resize thing I need
23:50:55FromDiscord<fl4shk> okay got that written
23:56:34FromDiscord<fl4shk> it's small enough that I can show it here
23:56:41FromDiscord<fl4shk> (edit) "it's small enough that I can show it here ... " added "(fits on a small monitor!)"
23:57:05FromDiscord<fl4shk> https://paste.ee/p/DLFhweog