00:01:31 | FromDiscord | <Elegantbeef> It has to be a generic cause it's polymorphic |
00:01:37 | FromDiscord | <Elegantbeef> There are so many interpretations of it |
00:02:11 | FromDiscord | <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:00 | FromDiscord | <Elegantbeef> @Arkanoid jokes aside do you have a practical example of the issue your code faces? |
00:19:04 | FromDiscord | <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:40 | FromDiscord | <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:17 | FromDiscord | <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:34 | FromDiscord | <Elegantbeef> I mean if you can do it statically generics are the best bet |
00:34:40 | FromDiscord | <Elegantbeef> If you cannot do it statically use some dynamic dispatch |
00:35:00 | FromDiscord | <Elegantbeef> Might I suggest traitor π https://github.com/beef331/traitor#what-does-it-do |
00:35:54 | FromDiscord | <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:07 | FromDiscord | <Elegantbeef> It's much simpler now |
00:36:35 | FromDiscord | <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:55 | FromDiscord | <Elegantbeef> You define the procs you want to match then simply convert to a trait object that encapsulates them |
00:37:22 | FromDiscord | <Elegantbeef> https://github.com/beef331/traitor/blob/master/traitor/streams.nim I even implemented `FileStream` and `StringStream` |
00:37:52 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=bDiTSWvfgoFT |
00:40:30 | FromDiscord | <Arkanoid> what's the advantage over Stream = ref object of RootObj + overriding methods on child objects? |
00:40:47 | FromDiscord | <Elegantbeef> This does not require runtime dispatch always to use the child objects |
00:40:57 | FromDiscord | <Elegantbeef> It can be statically dispatched if you do not need it |
00:41:05 | FromDiscord | <Elegantbeef> Plus this works with `object` so it's not annoying to write destructors |
00:41:30 | FromDiscord | <Arkanoid> last one is a big plus |
00:41:31 | FromDiscord | <Elegantbeef> It also uses a vtable so it's faster to dispatch than the Nim `method` |
00:41:47 | FromDiscord | <Elegantbeef> I havent benchmarked the last though, it's just a theory |
00:47:27 | FromDiscord | <piman_discriminator_1010> sent a code paste, see https://play.nim-lang.org/#pasty=HLJtGomPzQnO |
00:48:35 | FromDiscord | <Elegantbeef> What's the error |
00:48:47 | FromDiscord | <piman_discriminator_1010> sent a code paste, see https://play.nim-lang.org/#pasty=rXcRWRYWgIex |
00:49:12 | FromDiscord | <Elegantbeef> Really was a `has no type` error |
00:49:21 | FromDiscord | <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:44 | FromDiscord | <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:55 | FromDiscord | <piman_discriminator_1010> wait, how is a `proc` being shoved into an `int32`? |
00:53:59 | FromDiscord | <piman_discriminator_1010> https://media.discordapp.net/attachments/371759389889003532/1200242195475726366/image.png?ex=65c577a6&is=65b302a6&hm=d52584591eaddb22c8ab07e9e06915f761e74cfc7e80983d5050504679631ddc& |
01:00:59 | FromDiscord | <piman_discriminator_1010> :ThinkConfused: its....... a constant? I am very confused |
01:01:42 | FromDiscord | <Elegantbeef> Probably has a getter and a proc that takes a proc |
01:10:45 | FromDiscord | <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:44 | FromDiscord | <piman_discriminator_1010> https://media.discordapp.net/attachments/371759389889003532/1200246912184500304/image.png?ex=65c57c0b&is=65b3070b&hm=e0ea8b93d28ba66c42144d0ce054d1b1d55264646a070fce97657479b5c3043a& |
01:13:03 | FromDiscord | <piman_discriminator_1010> (idk if i'm doing an anonymous proc right though) |
01:14:59 | FromDiscord | <Elegantbeef> `proc() =` |
01:17:43 | FromDiscord | <piman_discriminator_1010> same error |
01:18:43 | FromDiscord | <Elegantbeef> wasnt it working with `pane.wEvent_Size do: ....`? |
01:18:54 | FromDiscord | <Elegantbeef> that's `panel.wEvent_Size(proc() = ...)` |
01:19:43 | FromDiscord | <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:19 | FromDiscord | <Elegantbeef> it's calling a proc named `wEvent_Size` with your anonymous proc |
01:20:56 | FromDiscord | <piman_discriminator_1010> even though the docs say it's a `const` `uint32` |
01:21:01 | FromDiscord | <piman_discriminator_1010> :mood: |
01:21:15 | FromDiscord | <piman_discriminator_1010> so you're saying it's both? |
01:21:23 | FromDiscord | <piman_discriminator_1010> (edit) "so you're saying it's both? ... " added "(a proc and a const)" |
01:21:23 | FromDiscord | <Elegantbeef> https://github.com/khchen/wNim/blob/4dc3afd62c46b4892dbf8d456ae199e5ebf13647/wNim/private/events/wSizeEvent.nim#L32 probably defined here |
01:21:35 | FromDiscord | <Elegantbeef> I'm saying it's a constant and a event since Nim has overloading |
01:22:42 | FromDiscord | <piman_discriminator_1010> alright, I'm going to blame this confusion on wNim docs then |
01:23:05 | FromDiscord | <piman_discriminator_1010> you say an event, like C# events? |
01:23:36 | FromDiscord | <Elegantbeef> Read the docs on that pag |
01:23:39 | FromDiscord | <Elegantbeef> page\ |
01:25:56 | FromDiscord | <piman_discriminator_1010> In reply to @Elegantbeef "Read the docs on": for nim events? (I'm not finding anything) |
01:26:54 | FromDiscord | <Elegantbeef> Nim doesn't have events |
01:26:58 | FromDiscord | <Elegantbeef> The package has events |
01:29:15 | FromDiscord | <piman_discriminator_1010> so it's a `const` and a `proc` then |
01:31:59 | FromDiscord | <Elegantbeef> Sure |
01:32:11 | FromDiscord | <Elegantbeef> Believe it or not I'm not the Nim compiler |
01:50:41 | FromDiscord | <piman_discriminator_1010> sent a code paste, see https://play.nim-lang.org/#pasty=uVLqaIpcLPpg |
02:07:25 | FromDiscord | <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:56 | FromDiscord | <Arkanoid> is `select` a reserved keyword somehow? |
02:10:30 | FromDiscord | <Elegantbeef> `select` is a module inside karax |
02:10:36 | FromDiscord | <Arkanoid> nevermind, solved, `select` is a keyword of karax |
02:10:38 | FromDiscord | <Elegantbeef> So it's overloaded |
02:10:39 | FromDiscord | <Arkanoid> exacly |
02:12:04 | FromDiscord | <Elegantbeef> Damn traitor is on average slower than Nim methods |
02:12:13 | FromDiscord | <Elegantbeef> Turns out calling 2 procs is slower than calling one 1 proc |
02:12:23 | FromDiscord | <Arkanoid> π¦ |
02:16:23 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=vUOmuscfXAHB |
02:16:35 | FromDiscord | <Elegantbeef> But it's also sadly slower since I have two procedure calls which is required to support value types π |
02:33:12 | NimEventer | New 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:27 | FromDiscord | <Arkanoid> In reply to @Elegantbeef "But it's also sadly": interestin results |
02:44:00 | FromDiscord | <Elegantbeef> It's not great when you add in static dispatch π |
02:44:12 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=SITdIhGaCXSq |
02:44:50 | FromDiscord | <Elegantbeef> Static dispatch is certainly getting inlined not that I looked at the ASM |
02:48:32 | NimEventer | New thread by aiac: Is `concept` similar to `interface` / `trait`? , see https://forum.nim-lang.org/t/10917 |
02:49:13 | FromDiscord | <ringabout> Did you check the performance of `--experimental:vtables`? |
02:49:18 | FromDiscord | <Elegantbeef> Nope |
02:49:51 | FromDiscord | <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:57 | FromDiscord | <Elegantbeef> The performance is even worse though |
02:57:15 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=qQnxOQqAXNYQ |
02:57:38 | FromDiscord | <Elegantbeef> I beat the vtable solution hard |
02:59:06 | FromDiscord | <Elegantbeef> In the cache thrash example atleast |
02:59:10 | FromDiscord | <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:10 | FromDiscord | <Elegantbeef> @ringabout where is the vtable stored in that implementation? |
03:30:15 | FromDiscord | <ringabout> in the the type header of objects: `TNimTypeV2` |
03:35:43 | FromDiscord | <Elegantbeef> Ah so expected cache thrashing destroys it |
03:36:25 | FromDiscord | <Elegantbeef> Sorta odd that in the compiler one doesn't generate a global vtable |
04:16:36 | FromDiscord | <user2m> In reply to @saint.___. "Oh hey sorry for": no worries! |
04:17:14 | FromDiscord | <user2m> In reply to @saint.___. "Could you give me": ill send a pr |
04:28:42 | FromDiscord | <bubblie> sent a code paste, see https://play.nim-lang.org/#pasty=KaiNfqSBakTp |
04:29:23 | FromDiscord | <Elegantbeef> `nimble build` works but `nim c` fails? |
04:29:58 | rockcavera | is there any better way than using an `nkIdent` to make `renderer.renderModule()` emit a simple comment? |
04:30:32 | rockcavera | compiler renderer |
04:31:11 | FromDiscord | <bubblie> yeah because its still going off the old version of vulkan despite the fact I have the nimble file done correctly |
04:31:15 | FromDiscord | <bubblie> it wont let me uninstall |
04:32:55 | FromDiscord | <Elegantbeef> just `rm` it |
04:32:56 | FromDiscord | <Elegantbeef> Nimble 0.14+ is awful |
04:34:12 | FromDiscord | <bubblie> yeah it wont let me rm it either its giving me the same error π should I try editing the json? |
04:35:38 | FromDiscord | <Elegantbeef> I mean `rm` in shell |
04:36:10 | * | SchweinDeBurg joined #nim |
04:48:07 | FromDiscord | <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:13 | FromDiscord | <intellij_gamer> (edit) "removed" => "removes" |
04:48:52 | FromDiscord | <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:41 | FromDiscord | <Elegantbeef> I mean it just doesn't work anymore ime |
04:52:50 | FromDiscord | <Elegantbeef> `devel` doesn't work `uninstall` doesn't work π |
05:16:56 | FromDiscord | <bubblie> thank you amadan it worked |
05:17:21 | FromDiscord | <bubblie> sent a code paste, see https://play.nim-lang.org/#pasty=cTbWfLGRSCSO |
05:17:37 | FromDiscord | <bubblie> this happens when I execute nimble build |
05:20:51 | FromDiscord | <Elegantbeef> You need a `bin = "somenim"` for `nimble build` to work |
05:33:42 | FromDiscord | <odexine> I think it has to be an array |
05:33:59 | FromDiscord | <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:45 | NimEventer | New thread by geohuz: Question of modeling with type system, see https://forum.nim-lang.org/t/10918 |
07:16:45 | FromDiscord | <yummy_licorice> hi |
07:16:59 | FromDiscord | <yummy_licorice> i need some help with futhark |
07:17:15 | FromDiscord | <yummy_licorice> https://media.discordapp.net/attachments/371759389889003532/1200338645975044116/image.png?ex=65c5d17a&is=65b35c7a&hm=39313ec7efc85ccaaf4ad728253e19e6326fd4e9dff1b6cb13e89044eab6a649& |
07:17:42 | FromDiscord | <yummy_licorice> the screenshot shows the error, my code, and the file structure |
07:17:59 | FromDiscord | <Elegantbeef> You do not provide a syspath that is proper |
07:18:04 | FromDiscord | <Elegantbeef> `syspath` should be your system's include path |
07:18:20 | FromDiscord | <yummy_licorice> /usr/include doesnt work |
07:18:29 | FromDiscord | <yummy_licorice> it wont find gtk or glib |
07:18:44 | FromDiscord | <Elegantbeef> That should be `path` |
07:19:06 | * | khazakar joined #nim |
07:19:36 | FromDiscord | <Elegantbeef> `syspath` should point to your clang's include folder |
07:19:49 | FromDiscord | <yummy_licorice> ok |
07:20:16 | FromDiscord | <yummy_licorice> `/usr/lib/clang/16/include/`? |
07:22:10 | FromDiscord | <yummy_licorice> yea that path works |
07:22:12 | FromDiscord | <yummy_licorice> ty |
07:35:46 | * | advesperacit joined #nim |
07:42:50 | * | PMunch joined #nim |
07:54:08 | Amun-Ra | is syspath really needed and not path? |
07:55:58 | FromDiscord | <Elegantbeef> My understanding is `path` is `-I` and `syspath` is your system's include path which includes the C stdlib |
07:56:22 | Amun-Ra | right |
07:56:39 | Amun-Ra | https://dpaste.com/3LTPUHMYD |
08:16:36 | * | Guest15 joined #nim |
08:16:36 | Guest15 | Ls |
08:16:45 | * | Guest15 quit (Client Quit) |
08:29:57 | FromDiscord | <Arkanoid> nim js, object vs ref object, what's the deal here? |
08:32:24 | NimEventer | New thread by aiac: How to get lower/upper bound of Slice, see https://forum.nim-lang.org/t/10919 |
08:38:34 | FromDiscord | <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:47 | FromDiscord | <tauruuuuuus> Like you would do with `pip install xyz==1.2.3` |
08:42:59 | Amun-Ra | require "xyz == 1.2.3" |
08:43:10 | Amun-Ra | requires* |
08:43:38 | Amun-Ra | you've to place it in the nimble file |
08:53:56 | FromDiscord | <tauruuuuuus> ok so you can't do it from cli, got it |
08:53:58 | FromDiscord | <tauruuuuuus> thanks! |
08:59:48 | Amun-Ra | there 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:09 | FromDiscord | <Elegantbeef> Atlas isn't nimble π |
09:07:51 | FromDiscord | <Elegantbeef> @Arkanoid Nim `object`s have value semantics |
09:11:42 | FromDiscord | <tauruuuuuus> In reply to @Elegantbeef "Atlas isn't nimble π": Yeah, I'm a bit confused on the usage still obviously π
|
09:12:11 | FromDiscord | <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:37 | FromDiscord | <Elegantbeef> You probably do `atlas use package@commit` |
09:13:19 | Amun-Ra | Elegantbeef: I missed that⦠:| |
10:38:13 | * | jmdaemon quit (Ping timeout: 246 seconds) |
10:51:52 | NimEventer | New 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:51 | FromDiscord | <ringabout> In reply to @Amun-Ra "you can disable using": progress: https://github.com/nim-lang/Nim/pull/23259 |
14:05:58 | Amun-Ra | ringabout: nice job! |
14:06:38 | Amun-Ra | Robyn: ^ |
14:12:57 | * | PMunch quit (Quit: Leaving) |
14:26:45 | FromDiscord | <saint.___.> In reply to @user2m "ill send a pr": Thank you! That would be awesome! |
15:17:44 | FromDiscord | <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:37 | FromDiscord | <Robyn [She/Her]> Is `type` discouraged? |
17:44:17 | * | azimut quit (Ping timeout: 255 seconds) |
17:46:07 | FromDiscord | <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:25 | FromDiscord | <Robyn [She/Her]> Fair |
17:56:07 | FromDiscord | <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:24 | Amun-Ra | parseHexInt iirc |
17:58:41 | Amun-Ra | yupe |
17:59:28 | Amun-Ra | there's one in std/strutils (raises an exception on error) andone in std/parseutils (returns false on error) |
18:29:22 | FromDiscord | <auxym> well, parseBin, actually, since it's base 2 |
18:29:26 | FromDiscord | <auxym> in parseutils |
18:30:15 | FromDiscord | <auxym> or `0b10110` if its a constant (also works in python btw) |
18:30:22 | FromDiscord | <auxym> `0x...` for hex |
18:31:32 | Amun-Ra | "but for hexadecimal" |
18:34:44 | * | SchweinDeBurg joined #nim |
18:35:01 | * | azimut joined #nim |
18:49:23 | FromDiscord | <Robyn [She/Her]> In reply to @auxym "or `0b10110` if its": This isn't a constant aha, but thanks! |
18:49:32 | FromDiscord | <Robyn [She/Her]> In reply to @Amun-Ra "there's one in std/strutils": Thanks Amun-Ra! |
18:51:07 | FromDiscord | <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:26 | FromDiscord | <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:45 | FromDiscord | <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:23 | FromDiscord | <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:20 | FromDiscord | <bubblie> sent a code paste, see https://play.nim-lang.org/#pasty=EVBPHSDvCfvQ |
23:34:55 | FromDiscord | <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:29 | FromDiscord | <bubblie> ahhhh |
23:35:43 | FromDiscord | <bubblie> yeah I was looking at the nimble docs but was having a hard time finding stuff I appreciate it |
23:37:23 | FromDiscord | <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:43 | FromDiscord | <bubblie> WOOO I got nimble to finally use the newest version thank you beef if you see this |
23:51:57 | FromDiscord | <bubblie> I gotta restart this entire project now |
23:58:20 | FromDiscord | <odinshat> I knew someone called Beef in high school. He was a cannon ball with legs. Surprisingly good at football. |