<< 26-01-2024 >>

00:01:31FromDiscord<Elegantbeef> It has to be a generic cause it's polymorphic
00:01:37FromDiscord<Elegantbeef> There are so many interpretations of it
00:02:11FromDiscord<Elegantbeef> In some places there is even an antithesis of it so it certainly is a typeclass cause you can do `not Heaven`
00:03:25*azimut_ quit (Remote host closed the connection)
00:03:56*azimut joined #nim
00:13:10*tiorock joined #nim
00:13:10*tiorock quit (Changing host)
00:13:10*tiorock joined #nim
00:13:10*rockcavera quit (Killed (zirconium.libera.chat (Nickname regained by services)))
00:13:10*tiorock is now known as rockcavera
00:14:00FromDiscord<Elegantbeef> @Arkanoid jokes aside do you have a practical example of the issue your code faces?
00:19:04FromDiscord<Elegantbeef> Since I've put a lot of work in my trait library this conversation makes me think it's a possible solution to your DI problem
00:22:20*advesperacit quit ()
00:26:49*raynei quit (Ping timeout: 264 seconds)
00:28:40FromDiscord<Arkanoid> I'm trying to reformat my code to light up the issue. Basically it's recursive import due to shared state in my js app
00:34:17FromDiscord<Arkanoid> since all components have a render proc, but also the pages have a render proc, and pages contains components, I'm trying to shred some light if I should just dedup procedures, or implement dynamic dispatch, or use some ninja generics
00:34:34FromDiscord<Elegantbeef> I mean if you can do it statically generics are the best bet
00:34:40FromDiscord<Elegantbeef> If you cannot do it statically use some dynamic dispatch
00:35:00FromDiscord<Elegantbeef> Might I suggest traitor πŸ˜› https://github.com/beef331/traitor#what-does-it-do
00:35:54FromDiscord<Arkanoid> I fear traitor as I don't understand it. I mean, it's beautiful, too beautiful, but far from my level of confidence
00:36:07FromDiscord<Elegantbeef> It's much simpler now
00:36:35FromDiscord<Elegantbeef> It's practically just a way to do interfaces that does not require the user to do `type Bleh = ref object of RootObj`
00:36:55FromDiscord<Elegantbeef> You define the procs you want to match then simply convert to a trait object that encapsulates them
00:37:22FromDiscord<Elegantbeef> https://github.com/beef331/traitor/blob/master/traitor/streams.nim I even implemented `FileStream` and `StringStream`
00:37:52FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=bDiTSWvfgoFT
00:40:30FromDiscord<Arkanoid> what's the advantage over Stream = ref object of RootObj + overriding methods on child objects?
00:40:47FromDiscord<Elegantbeef> This does not require runtime dispatch always to use the child objects
00:40:57FromDiscord<Elegantbeef> It can be statically dispatched if you do not need it
00:41:05FromDiscord<Elegantbeef> Plus this works with `object` so it's not annoying to write destructors
00:41:30FromDiscord<Arkanoid> last one is a big plus
00:41:31FromDiscord<Elegantbeef> It also uses a vtable so it's faster to dispatch than the Nim `method`
00:41:47FromDiscord<Elegantbeef> I havent benchmarked the last though, it's just a theory
00:47:27FromDiscord<piman_discriminator_1010> sent a code paste, see https://play.nim-lang.org/#pasty=HLJtGomPzQnO
00:48:35FromDiscord<Elegantbeef> What's the error
00:48:47FromDiscord<piman_discriminator_1010> sent a code paste, see https://play.nim-lang.org/#pasty=rXcRWRYWgIex
00:49:12FromDiscord<Elegantbeef> Really was a `has no type` error
00:49:21FromDiscord<piman_discriminator_1010> you don't want the full error, it's like 30 lines long πŸ’€ ↡but essentially something about `genSYM0` has no type
00:49:44FromDiscord<Elegantbeef> Yea shame araq didn't want to take the PR for macros not expanding in error messages
00:52:32*SchweinDeBurg joined #nim
00:53:55FromDiscord<piman_discriminator_1010> wait, how is a `proc` being shoved into an `int32`?
00:53:59FromDiscord<piman_discriminator_1010> https://media.discordapp.net/attachments/371759389889003532/1200242195475726366/image.png?ex=65c577a6&is=65b302a6&hm=d52584591eaddb22c8ab07e9e06915f761e74cfc7e80983d5050504679631ddc&
01:00:59FromDiscord<piman_discriminator_1010> :ThinkConfused: its....... a constant? I am very confused
01:01:42FromDiscord<Elegantbeef> Probably has a getter and a proc that takes a proc
01:10:45FromDiscord<piman_discriminator_1010> says it's a const https://media.discordapp.net/attachments/371759389889003532/1200246415415320616/image.png?ex=65c57b94&is=65b30694&hm=961173ac93f0314817bea1475e63928e931c916738d64d81ab78b3fc8500baaa&
01:12:44FromDiscord<piman_discriminator_1010> https://media.discordapp.net/attachments/371759389889003532/1200246912184500304/image.png?ex=65c57c0b&is=65b3070b&hm=e0ea8b93d28ba66c42144d0ce054d1b1d55264646a070fce97657479b5c3043a&
01:13:03FromDiscord<piman_discriminator_1010> (idk if i'm doing an anonymous proc right though)
01:14:59FromDiscord<Elegantbeef> `proc() =`
01:17:43FromDiscord<piman_discriminator_1010> same error
01:18:43FromDiscord<Elegantbeef> wasnt it working with `pane.wEvent_Size do: ....`?
01:18:54FromDiscord<Elegantbeef> that's `panel.wEvent_Size(proc() = ...)`
01:19:43FromDiscord<piman_discriminator_1010> In reply to @Elegantbeef "wasnt it working with": it was, I'm trying to figure out what tf that is doing though
01:20:19FromDiscord<Elegantbeef> it's calling a proc named `wEvent_Size` with your anonymous proc
01:20:56FromDiscord<piman_discriminator_1010> even though the docs say it's a `const` `uint32`
01:21:01FromDiscord<piman_discriminator_1010> :mood:
01:21:15FromDiscord<piman_discriminator_1010> so you're saying it's both?
01:21:23FromDiscord<piman_discriminator_1010> (edit) "so you're saying it's both? ... " added "(a proc and a const)"
01:21:23FromDiscord<Elegantbeef> https://github.com/khchen/wNim/blob/4dc3afd62c46b4892dbf8d456ae199e5ebf13647/wNim/private/events/wSizeEvent.nim#L32 probably defined here
01:21:35FromDiscord<Elegantbeef> I'm saying it's a constant and a event since Nim has overloading
01:22:42FromDiscord<piman_discriminator_1010> alright, I'm going to blame this confusion on wNim docs then
01:23:05FromDiscord<piman_discriminator_1010> you say an event, like C# events?
01:23:36FromDiscord<Elegantbeef> Read the docs on that pag
01:23:39FromDiscord<Elegantbeef> page\
01:25:56FromDiscord<piman_discriminator_1010> In reply to @Elegantbeef "Read the docs on": for nim events? (I'm not finding anything)
01:26:54FromDiscord<Elegantbeef> Nim doesn't have events
01:26:58FromDiscord<Elegantbeef> The package has events
01:29:15FromDiscord<piman_discriminator_1010> so it's a `const` and a `proc` then
01:31:59FromDiscord<Elegantbeef> Sure
01:32:11FromDiscord<Elegantbeef> Believe it or not I'm not the Nim compiler
01:50:41FromDiscord<piman_discriminator_1010> sent a code paste, see https://play.nim-lang.org/#pasty=uVLqaIpcLPpg
02:07:25FromDiscord<Arkanoid> I have this piece of generic karax code that I don't understand why fails to compile on the last line https://play.nim-lang.org/#pasty=FZQKJXvChlzq
02:08:56FromDiscord<Arkanoid> is `select` a reserved keyword somehow?
02:10:30FromDiscord<Elegantbeef> `select` is a module inside karax
02:10:36FromDiscord<Arkanoid> nevermind, solved, `select` is a keyword of karax
02:10:38FromDiscord<Elegantbeef> So it's overloaded
02:10:39FromDiscord<Arkanoid> exacly
02:12:04FromDiscord<Elegantbeef> Damn traitor is on average slower than Nim methods
02:12:13FromDiscord<Elegantbeef> Turns out calling 2 procs is slower than calling one 1 proc
02:12:23FromDiscord<Arkanoid> 😦
02:16:23FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=vUOmuscfXAHB
02:16:35FromDiscord<Elegantbeef> But it's also sadly slower since I have two procedure calls which is required to support value types πŸ˜„
02:33:12NimEventerNew Nimble package! getopty - POSIX compliant command line parser, see https://github.com/amnr/getopty
02:33:14*cvoxel quit (Ping timeout: 256 seconds)
02:34:19*_________ quit (Ping timeout: 256 seconds)
02:43:27FromDiscord<Arkanoid> In reply to @Elegantbeef "But it's also sadly": interestin results
02:44:00FromDiscord<Elegantbeef> It's not great when you add in static dispatch πŸ˜„
02:44:12FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=SITdIhGaCXSq
02:44:50FromDiscord<Elegantbeef> Static dispatch is certainly getting inlined not that I looked at the ASM
02:48:32NimEventerNew thread by aiac: Is `concept` similar to `interface` / `trait`? , see https://forum.nim-lang.org/t/10917
02:49:13FromDiscord<ringabout> Did you check the performance of `--experimental:vtables`?
02:49:18FromDiscord<Elegantbeef> Nope
02:49:51FromDiscord<Elegantbeef> Having to have all the procs in the same scope means I care very little about it
02:51:15*SchweinDeBurg quit (Quit: WeeChat 4.3.0-dev)
02:56:44*krux02 quit (Remote host closed the connection)
02:56:57FromDiscord<Elegantbeef> The performance is even worse though
02:57:15FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=qQnxOQqAXNYQ
02:57:38FromDiscord<Elegantbeef> I beat the vtable solution hard
02:59:06FromDiscord<Elegantbeef> In the cache thrash example atleast
02:59:10FromDiscord<Elegantbeef> I do realise now that I can optimise a proc call away when the argument is a `var`, so that's nice I guess πŸ˜„
03:18:04*raynei joined #nim
03:29:10FromDiscord<Elegantbeef> @ringabout where is the vtable stored in that implementation?
03:30:15FromDiscord<ringabout> in the the type header of objects: `TNimTypeV2`
03:35:43FromDiscord<Elegantbeef> Ah so expected cache thrashing destroys it
03:36:25FromDiscord<Elegantbeef> Sorta odd that in the compiler one doesn't generate a global vtable
04:16:36FromDiscord<user2m> In reply to @saint.___. "Oh hey sorry for": no worries!
04:17:14FromDiscord<user2m> In reply to @saint.___. "Could you give me": ill send a pr
04:28:42FromDiscord<bubblie> sent a code paste, see https://play.nim-lang.org/#pasty=KaiNfqSBakTp
04:29:23FromDiscord<Elegantbeef> `nimble build` works but `nim c` fails?
04:29:58rockcaverais there any better way than using an `nkIdent` to make `renderer.renderModule()` emit a simple comment?
04:30:32rockcaveracompiler renderer
04:31:11FromDiscord<bubblie> yeah because its still going off the old version of vulkan despite the fact I have the nimble file done correctly
04:31:15FromDiscord<bubblie> it wont let me uninstall
04:32:55FromDiscord<Elegantbeef> just `rm` it
04:32:56FromDiscord<Elegantbeef> Nimble 0.14+ is awful
04:34:12FromDiscord<bubblie> yeah it wont let me rm it either its giving me the same error 😭 should I try editing the json?
04:35:38FromDiscord<Elegantbeef> I mean `rm` in shell
04:36:10*SchweinDeBurg joined #nim
04:48:07FromDiscord<intellij_gamer> In reply to @bubblie "it wont let me": add the `-i` flag to remove it.↡`-i` also removed anything that depends on it (dw your projects will be safe)
04:48:13FromDiscord<intellij_gamer> (edit) "removed" => "removes"
04:48:52FromDiscord<intellij_gamer> In reply to @Elegantbeef "Nimble 0.14+ is awful": +1↡The random warnings about missing meta files is what annoys me
04:52:41FromDiscord<Elegantbeef> I mean it just doesn't work anymore ime
04:52:50FromDiscord<Elegantbeef> `devel` doesn't work `uninstall` doesn't work πŸ˜„
05:16:56FromDiscord<bubblie> thank you amadan it worked
05:17:21FromDiscord<bubblie> sent a code paste, see https://play.nim-lang.org/#pasty=cTbWfLGRSCSO
05:17:37FromDiscord<bubblie> this happens when I execute nimble build
05:20:51FromDiscord<Elegantbeef> You need a `bin = "somenim"` for `nimble build` to work
05:33:42FromDiscord<odexine> I think it has to be an array
05:33:59FromDiscord<odexine> Maybe? I forgot already
05:56:26*_________ joined #nim
06:01:08*raynei quit (Ping timeout: 268 seconds)
06:07:55*rockcavera quit (Remote host closed the connection)
06:41:55*azimut quit (Remote host closed the connection)
06:42:19*azimut joined #nim
07:06:45NimEventerNew thread by geohuz: Question of modeling with type system, see https://forum.nim-lang.org/t/10918
07:16:45FromDiscord<yummy_licorice> hi
07:16:59FromDiscord<yummy_licorice> i need some help with futhark
07:17:15FromDiscord<yummy_licorice> https://media.discordapp.net/attachments/371759389889003532/1200338645975044116/image.png?ex=65c5d17a&is=65b35c7a&hm=39313ec7efc85ccaaf4ad728253e19e6326fd4e9dff1b6cb13e89044eab6a649&
07:17:42FromDiscord<yummy_licorice> the screenshot shows the error, my code, and the file structure
07:17:59FromDiscord<Elegantbeef> You do not provide a syspath that is proper
07:18:04FromDiscord<Elegantbeef> `syspath` should be your system's include path
07:18:20FromDiscord<yummy_licorice> /usr/include doesnt work
07:18:29FromDiscord<yummy_licorice> it wont find gtk or glib
07:18:44FromDiscord<Elegantbeef> That should be `path`
07:19:06*khazakar joined #nim
07:19:36FromDiscord<Elegantbeef> `syspath` should point to your clang's include folder
07:19:49FromDiscord<yummy_licorice> ok
07:20:16FromDiscord<yummy_licorice> `/usr/lib/clang/16/include/`?
07:22:10FromDiscord<yummy_licorice> yea that path works
07:22:12FromDiscord<yummy_licorice> ty
07:35:46*advesperacit joined #nim
07:42:50*PMunch joined #nim
07:54:08Amun-Rais syspath really needed and not path?
07:55:58FromDiscord<Elegantbeef> My understanding is `path` is `-I` and `syspath` is your system's include path which includes the C stdlib
07:56:22Amun-Raright
07:56:39Amun-Rahttps://dpaste.com/3LTPUHMYD
08:16:36*Guest15 joined #nim
08:16:36Guest15Ls
08:16:45*Guest15 quit (Client Quit)
08:29:57FromDiscord<Arkanoid> nim js, object vs ref object, what's the deal here?
08:32:24NimEventerNew thread by aiac: How to get lower/upper bound of Slice, see https://forum.nim-lang.org/t/10919
08:38:34FromDiscord<tauruuuuuus> Hi everyone, I'm struggling to understand how you add a dependency pinned to a specific version with `atlas use`, is it possible?
08:38:47FromDiscord<tauruuuuuus> Like you would do with `pip install xyz==1.2.3`
08:42:59Amun-Rarequire "xyz == 1.2.3"
08:43:10Amun-Rarequires*
08:43:38Amun-Rayou've to place it in the nimble file
08:53:56FromDiscord<tauruuuuuus> ok so you can't do it from cli, got it
08:53:58FromDiscord<tauruuuuuus> thanks!
08:59:48Amun-Rathere is nimble install <packagename>/<url> but I'm not aware whether you can add version constraints this way
09:00:02*azimut quit (Ping timeout: 255 seconds)
09:07:09FromDiscord<Elegantbeef> Atlas isn't nimble πŸ˜„
09:07:51FromDiscord<Elegantbeef> @Arkanoid Nim `object`s have value semantics
09:11:42FromDiscord<tauruuuuuus> In reply to @Elegantbeef "Atlas isn't nimble πŸ˜„": Yeah, I'm a bit confused on the usage still obviously πŸ˜…
09:12:11FromDiscord<tauruuuuuus> I'm trying to understand a bit of both, still can't understand if I can really use them as libraries tho
09:12:37FromDiscord<Elegantbeef> You probably do `atlas use package@commit`
09:13:19Amun-RaElegantbeef: I missed that… :|
10:38:13*jmdaemon quit (Ping timeout: 246 seconds)
10:51:52NimEventerNew thread by aiac: How to determine whether Import expected packages?, see https://forum.nim-lang.org/t/10920
11:19:41*lucasta_ joined #nim
11:19:46*lucasta_ quit (Client Quit)
13:46:12*rockcavera joined #nim
13:46:46*lucasta joined #nim
13:58:52*azimut joined #nim
14:04:51FromDiscord<ringabout> In reply to @Amun-Ra "you can disable using": progress: https://github.com/nim-lang/Nim/pull/23259
14:05:58Amun-Raringabout: nice job!
14:06:38Amun-RaRobyn: ^
14:12:57*PMunch quit (Quit: Leaving)
14:26:45FromDiscord<saint.___.> In reply to @user2m "ill send a pr": Thank you! That would be awesome!
15:17:44FromDiscord<Robyn [She/Her]> In reply to @Amun-Ra "Robyn: ^": I saw :D
16:09:20*raynei joined #nim
16:37:31*nomn joined #nim
16:41:35*junaid_ joined #nim
16:46:05*SchweinDeBurg quit (Quit: WeeChat 4.3.0-dev)
17:14:29*raynei quit (Ping timeout: 240 seconds)
17:31:31*pbsds quit (Ping timeout: 276 seconds)
17:31:59*pbsds joined #nim
17:34:37FromDiscord<Robyn [She/Her]> Is `type` discouraged?
17:44:17*azimut quit (Ping timeout: 255 seconds)
17:46:07FromDiscord<demotomohiro> iirc, there is an issue about keyword '`type`' is too generic and hard to google. So it should be '`typeof`'.
17:53:46*lucasta quit (Quit: Leaving)
17:54:25FromDiscord<Robyn [She/Her]> Fair
17:56:07FromDiscord<Robyn [She/Her]> Anyone know how I'd replace `int('10110', base=2)` in Nim? Also need the same thing but for hexadecimal
17:58:24Amun-RaparseHexInt iirc
17:58:41Amun-Rayupe
17:59:28Amun-Rathere's one in std/strutils (raises an exception on error) andone in std/parseutils (returns false on error)
18:29:22FromDiscord<auxym> well, parseBin, actually, since it's base 2
18:29:26FromDiscord<auxym> in parseutils
18:30:15FromDiscord<auxym> or `0b10110` if its a constant (also works in python btw)
18:30:22FromDiscord<auxym> `0x...` for hex
18:31:32Amun-Ra"but for hexadecimal"
18:34:44*SchweinDeBurg joined #nim
18:35:01*azimut joined #nim
18:49:23FromDiscord<Robyn [She/Her]> In reply to @auxym "or `0b10110` if its": This isn't a constant aha, but thanks!
18:49:32FromDiscord<Robyn [She/Her]> In reply to @Amun-Ra "there's one in std/strutils": Thanks Amun-Ra!
18:51:07FromDiscord<user2m> sent a code paste, see https://play.nim-lang.org/#pasty=CNTkAhvfQqrW
19:28:30*jmdaemon joined #nim
19:33:27*def- quit (Quit: -)
19:33:40*def- joined #nim
19:53:26FromDiscord<void418> Is there another way to buy the Mastering Nim: A complete guide to the programming language ebook? Amazon says it's not available in my region, but I'd love to buy the book...
20:08:01*lucasta joined #nim
20:43:45FromDiscord<void418> I'd love to pay the author and get the file, it's a shame amazon is not letting me ;-;
20:50:13*krux02 joined #nim
20:51:24*junaid_ quit (Remote host closed the connection)
21:18:23FromDiscord<khazakar> In reply to @void418 "Is there another way": Me too, just because I don't want to feed this soulless corpo which does such regionalization, promotes crappy things and other stuff. I can even pay extra
21:28:49*deadmarshal_ quit (Ping timeout: 255 seconds)
21:35:59*raynei joined #nim
22:21:03*deadmarshal_ joined #nim
22:24:43*raynei quit (Ping timeout: 268 seconds)
22:51:49*krux02 quit (Remote host closed the connection)
22:52:13*raynei joined #nim
23:29:20FromDiscord<bubblie> sent a code paste, see https://play.nim-lang.org/#pasty=EVBPHSDvCfvQ
23:34:55FromDiscord<nasuray> In reply to @bubblie "what would bin =": Did you check the nimble docs? It should be `bin = @["vulkanmain"]` where the string is a file within your srcDir without the ext.
23:35:29FromDiscord<bubblie> ahhhh
23:35:43FromDiscord<bubblie> yeah I was looking at the nimble docs but was having a hard time finding stuff I appreciate it
23:37:23FromDiscord<odinshat> I was learning Nim using the usual methods. Reading docs and started creating something useful I wanted. Then I remembered AI was a thing so I asked AI to write me an app that did what I needed.↡It did it. Now I'm not sure what the point of learning anything is anymore. \:(
23:46:30*advesperacit quit ()
23:51:43FromDiscord<bubblie> WOOO I got nimble to finally use the newest version thank you beef if you see this
23:51:57FromDiscord<bubblie> I gotta restart this entire project now
23:58:20FromDiscord<odinshat> I knew someone called Beef in high school. He was a cannon ball with legs. Surprisingly good at football.