00:00:26 | * | SchweinDeBurg joined #nim |
00:13:21 | * | beholders_eye quit (Ping timeout: 244 seconds) |
00:15:53 | * | xutaxkamay_ joined #nim |
00:16:13 | * | xutaxkamay quit (Ping timeout: 260 seconds) |
00:16:50 | * | xutaxkamay_ is now known as xutaxkamay |
01:29:48 | FromDiscord | <nelsono6> I'll help the first 15 people interested on how to start earning $90k within 72hours, but you will reimburse me 10% of your profits when you receive it. Ask me how!! |
01:29:52 | FromDiscord | <nelsono6> If interested, send me a direct message. For more information…contact via.. TG↵@Nelson_owen↵https://t.me/Nelson_owen |
01:37:34 | * | rockcavera quit (Remote host closed the connection) |
01:40:12 | FromDiscord | <riku5543> sent a code paste, see https://play.nim-lang.org/#pasty=AExzbFXa |
01:45:32 | FromDiscord | <riku5543> (also <@&371760044473319454> there is a bit of spam in these channels) |
01:58:19 | * | SchweinDeBurg quit (Quit: WeeChat 4.8.0-dev) |
02:19:35 | FromDiscord | <demotomohiro> sent a code paste, see https://play.nim-lang.org/#pasty=GKMyZMUK |
02:30:55 | FromDiscord | <riku5543> Ah okay I see. Would it be bad if my wrapper kept track of the filename variable and just updated that when trying to assign to it? (and then I could destroy it later when, say, shutdown is called) |
02:33:26 | FromDiscord | <riku5543> I'm just not sure of wrappers having an internal state of sorts haha. But I guess stuff like sdl does that already |
03:46:48 | * | SchweinDeBurg joined #nim |
05:52:02 | * | alexdaguy joined #nim |
06:10:48 | * | alexdaguy quit (Quit: WeeChat 4.7.1) |
07:57:50 | * | skippy8 joined #nim |
08:09:30 | * | xtr00 quit (Read error: Connection reset by peer) |
08:15:38 | * | xtr00 joined #nim |
08:56:15 | * | xtr00 quit (Ping timeout: 258 seconds) |
08:57:11 | * | xtr00 joined #nim |
10:40:45 | * | mahlon quit (Ping timeout: 245 seconds) |
11:14:55 | * | mahlon joined #nim |
11:18:49 | * | xtr00 quit (Ping timeout: 256 seconds) |
11:18:49 | * | nils` quit (Ping timeout: 256 seconds) |
11:19:06 | * | nils` joined #nim |
11:19:39 | * | xtr00 joined #nim |
11:28:36 | * | xutaxkamay quit (Ping timeout: 244 seconds) |
11:28:37 | * | yeti quit (Ping timeout: 244 seconds) |
11:28:37 | * | FromDiscord quit (Ping timeout: 244 seconds) |
11:28:53 | * | xutaxkamay joined #nim |
11:34:48 | * | SchweinDeBurg quit (Ping timeout: 256 seconds) |
11:35:53 | * | dicot quit (*.net *.split) |
11:35:53 | * | Jjp137_ quit (*.net *.split) |
11:35:53 | * | computerquip quit (*.net *.split) |
11:35:54 | * | johuck quit (*.net *.split) |
11:35:54 | * | joast quit (*.net *.split) |
11:35:54 | * | GreaseMonkey quit (*.net *.split) |
11:35:54 | * | redj quit (*.net *.split) |
11:36:48 | * | SchweinDeBurg joined #nim |
11:40:23 | * | dicot joined #nim |
11:40:23 | * | feinfinger joined #nim |
11:40:23 | * | Jjp137_ joined #nim |
11:40:23 | * | computerquip joined #nim |
11:40:23 | * | johuck joined #nim |
11:40:23 | * | joast joined #nim |
11:40:23 | * | GreaseMonkey joined #nim |
11:40:23 | * | redj joined #nim |
11:40:59 | * | feinfinger is now known as Guest8695 |
11:41:15 | * | FromDiscord joined #nim |
11:44:29 | * | Guest8695 quit (Changing host) |
11:44:29 | * | Guest8695 joined #nim |
11:44:37 | * | Guest8695 is now known as yeti |
11:45:28 | * | xtr00 quit (Quit: ZNC 1.9.1 - https://znc.in) |
11:50:47 | * | xtr00 joined #nim |
11:58:22 | * | dicot quit (Read error: Connection reset by peer) |
12:04:05 | * | dicot joined #nim |
12:12:53 | FromDiscord | <ayex> [pmunch](https://matrix.to/#/%40_discord_392962235737047041%3At2bot.io) I assume that is referring to the message visible from matrix from nelsono6 from very early this day? |
12:16:18 | * | beholders_eye joined #nim |
13:09:21 | * | dicot left #nim (#nim) |
14:13:05 | * | bcksl quit (Server closed connection) |
14:19:48 | * | bcksl joined #nim |
15:10:45 | FromDiscord | <mitranim> Seems strange that empty types like `tuple[]` or `object` have `sizeof == 1`. In Go it's 0, which makes perfect sense. |
15:41:55 | FromDiscord | <Robyn [She/Her]> In reply to @mitranim "Seems strange that empty": in Go they're probably compiled away |
15:42:09 | FromDiscord | <Robyn [She/Her]> You can't have an object that exists at runtime and have it take up nothing, after all |
15:42:16 | FromDiscord | <tauruuuuuus> In reply to @mitranim "Seems strange that empty": IIRC it's actually implementation-dependent in go, but the main implementation has indeed that property |
15:42:37 | FromDiscord | <tauruuuuuus> actually I was messing around and it seems like they are compiled away in nim too.. |
15:42:57 | FromDiscord | <mitranim> It has some funky side effects. For example, a sequence of zero-sized values is also zero-sized. A zero-sized struct field shares its address with the next field. |
15:43:18 | FromDiscord | <mitranim> (edit) "sequence" => "backing array for a slice" |
15:43:20 | FromDiscord | <Robyn [She/Her]> huh weird |
15:44:13 | FromDiscord | <mitranim> This stuff sometimes saves space when you need to implement an interface but your type has no state at all |
15:48:27 | FromDiscord | <tauruuuuuus> in go it's useful in chans and for sets I guess, that's where it came in handy for me, bu anyways this is more for #offtopic lol |
15:50:27 | FromDiscord | <kiloneie> In reply to @Zoom "I don't know what": How is this ? |
15:50:33 | FromDiscord | <kiloneie> (edit) "In reply to @Zoom "I don't know what": How is this ? ... " added "https://pastecode.io/s/kmjza34m" |
16:27:56 | * | n|Phreak quit (Ping timeout: 256 seconds) |
16:29:42 | * | n|Phreak joined #nim |
16:45:22 | * | skippy8 quit (Quit: WeeChat 4.7.1) |
17:18:56 | * | SchweinDeBurg quit (Quit: WeeChat 4.8.0-dev) |
17:47:35 | FromDiscord | <tauruuuuuus> Requesting nimscript expertise |
17:49:13 | FromDiscord | <tauruuuuuus> sent a code paste, see https://play.nim-lang.org/#pasty=jgjEWqpy |
17:52:43 | Amun-Ra | run the command manually and test return code with echo $? |
17:52:51 | Amun-Ra | or echo $rc in fish |
17:54:50 | Amun-Ra | tauruuuuuus: wait… do you need to run that in static context? |
17:55:40 | Amun-Ra | ah, nimscript |
17:55:42 | Amun-Ra | nvm |
18:00:28 | FromDiscord | <tauruuuuuus> already done and tested both there and in nimscript by printing `code` through echo, or I wouldn't be thinking I'm going crazy lol |
18:06:44 | Amun-Ra | hmm, I added my own if before yours and mine works fine ;) |
18:10:14 | Amun-Ra | I can confirm that that code doesn't work here neither |
18:12:08 | Amun-Ra | https://play.nim-lang.org/#pasty=oGTqWLil |
18:23:15 | * | n|Phreak quit (Ping timeout: 256 seconds) |
18:23:23 | * | n|Phreak joined #nim |
18:30:56 | * | n|Phreak_ joined #nim |
18:31:00 | * | drawkula joined #nim |
18:32:04 | * | yeti quit (Killed (copper.libera.chat (Nickname regained by services))) |
18:32:04 | * | drawkula is now known as yeti |
18:34:22 | * | n|Phreak quit (*.net *.split) |
18:34:23 | * | Jjp137_ quit (*.net *.split) |
18:34:23 | * | computerquip quit (*.net *.split) |
18:34:23 | * | johuck quit (*.net *.split) |
18:34:23 | * | joast quit (*.net *.split) |
18:34:23 | * | GreaseMonkey quit (*.net *.split) |
18:34:24 | * | redj quit (*.net *.split) |
18:34:50 | * | Jjp137_ joined #nim |
18:34:50 | * | computerquip joined #nim |
18:34:50 | * | johuck joined #nim |
18:34:50 | * | joast joined #nim |
18:34:50 | * | GreaseMonkey joined #nim |
18:34:50 | * | redj joined #nim |
18:37:25 | * | yeti quit (Ping timeout: 256 seconds) |
18:37:57 | * | yeti joined #nim |
18:37:59 | * | nils` quit (Ping timeout: 256 seconds) |
18:38:17 | * | nils` joined #nim |
18:42:15 | FromDiscord | <Zoom> You're suppressing the error messages the OS gives you when the exception is thrown. Use `except IOError as e: echo e.msg`↵(@kiloneie) |
18:43:21 | FromDiscord | <Zoom> And don't catch defects, those are for logic errors in your code. Use asserts. |
18:59:20 | FromDiscord | <kiloneie> In reply to @Zoom "You're suppressing the error": Thank you 🙂 |
19:02:53 | FromDiscord | <riku5543> In reply to @pmunch "Which ones?": There was a message about telegram in all of the primary channels but they got deleted |
19:13:29 | * | oisota9 joined #nim |
19:15:21 | * | oisota quit (Ping timeout: 258 seconds) |
19:15:21 | * | oisota9 is now known as oisota |
19:17:49 | * | SchweinDeBurg joined #nim |
19:31:20 | * | skippy8 joined #nim |
20:05:13 | FromDiscord | <nasuray> sent a code paste, see https://play.nim-lang.org/#pasty=gZRyqWUz |
21:42:18 | * | syl quit (Quit: C-x C-c) |
21:44:32 | * | syl joined #nim |
21:45:24 | FromDiscord | <cloudperry> https://github.com/nim-lang/Nim/issues/25181 |
21:45:51 | FromDiscord | <cloudperry> Is this a bug or am I missing something obvious about how macros work? |
21:46:41 | FromDiscord | <Elegantbeef> You're taking in a typed section |
21:46:53 | FromDiscord | <cloudperry> Basically I'm trying to add align pragmas to object fields from a macro, but the align pragma does nothing |
21:48:11 | FromDiscord | <Elegantbeef> Change it to `untyped` and it'll work, you also can write a macro that you can use like `type MyType {.myMacro.} = object` |
21:48:27 | FromDiscord | <cloudperry> Ok thanks I will try that |
21:49:16 | FromDiscord | <cloudperry> So pragmas (or at least align) are applied already when taking in typed NimNodes? |
21:49:59 | FromDiscord | <Elegantbeef> Well typed is already semantically checked and compiled so adding things to `Type2` does nothing |
21:50:12 | FromDiscord | <Elegantbeef> You'd need to emit a new type with a different symbol |
21:50:26 | FromDiscord | <cloudperry> Ok makes sense |
21:50:48 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=MORThLdG |
21:50:58 | FromDiscord | <Elegantbeef> You're going to have a lot of fun btw |
21:51:49 | FromDiscord | <cloudperry> Haha I already made the OpenGL UBO generator and it works other than the align pragma not applying |
21:52:16 | FromDiscord | <Elegantbeef> Yea I was going to do the same thing but was going to just going to detect it instead of annotate it |
21:52:24 | FromDiscord | <Elegantbeef> Easier that way 😄 |
21:53:30 | FromDiscord | <cloudperry> Yep align does apply with untyped, but now I can't fix my macro to work with untyped |
21:53:56 | FromDiscord | <Elegantbeef> Right you need to remove the `nkSym` from the code and replace it with `nkIdent` |
21:55:11 | FromDiscord | <cloudperry> Wow Discord msg limits are extremely short https://media.discordapp.net/attachments/371759389889003532/1418717082622886019/message.txt?ex=68cf22be&is=68cdd13e&hm=ea99ec35f7a2c1066a449c282bb2f75c0558488558e3d12dacdbdc63b8ba9d16& |
21:55:29 | FromDiscord | <cloudperry> I shouldn't have made this as my literal first macro :D |
21:55:50 | FromDiscord | <Elegantbeef> You're making a dogs breakfast of it all indeed |
21:55:56 | FromDiscord | <cloudperry> Now its going to be a nightmare to understand how to fix this |
21:56:30 | FromDiscord | <Elegantbeef> Oh how happy I am to only ever use std430 😄 |
21:56:58 | FromDiscord | <cloudperry> Wait do you not use UBOs? I thought UBOs can only be std140. |
21:57:12 | FromDiscord | <Elegantbeef> I only use SSBOs |
21:57:22 | FromDiscord | <cloudperry> Ok |
21:58:00 | FromDiscord | <cloudperry> Can I add new object fields from a typed macro though? |
21:58:12 | FromDiscord | <cloudperry> I could just add padding fields if thats possible |
21:58:46 | FromDiscord | <Elegantbeef> Like I said if you remove the symbols, yes |
21:58:48 | * | zgasma joined #nim |
22:00:27 | * | zgasma quit (Client Quit) |
22:00:37 | * | zgasma joined #nim |
22:01:08 | FromDiscord | <Elegantbeef> The fun part about your align table is that it does not work with aliases |
22:01:46 | FromDiscord | <cloudperry> Yep I know working with types as strings is messy |
22:02:24 | FromDiscord | <Elegantbeef> You really would want to use a `std/macrocache`'s `CacheSeq` |
22:02:59 | FromDiscord | <Elegantbeef> Then use `a == b or sameType(a, b) or sameType(b, a) # There is a bug in Nim that is still not fixed afaik` |
22:03:16 | FromDiscord | <cloudperry> I'm too tired to fix this mess so I will have to look at this another day |
22:03:31 | FromDiscord | <cloudperry> Or is there a simple fix for my existing macro? |
22:04:01 | FromDiscord | <Elegantbeef> Replace the `nkSym` with `nkIdent` |
22:04:07 | FromDiscord | <Elegantbeef> It's like 5 lines of code |
22:04:42 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=NKcyFbXG |
22:04:58 | FromDiscord | <Elegantbeef> Run that after running your pragma macro |
22:05:09 | FromDiscord | <cloudperry> Yeah I'm just confused about where I even have an nkSym |
22:05:26 | FromDiscord | <Elegantbeef> `echo nimNode.treeRepr` |
22:05:33 | FromDiscord | <Elegantbeef> You have plenty of them cause you have `typed` code |
22:05:39 | FromDiscord | <Elegantbeef> Also sorry that's `nnkSym` |
22:06:42 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#pasty=rZpTZiaX for example |
22:07:41 | FromDiscord | <cloudperry> Ok I see my type names/aliases are Sym and the object type is Sym |
22:07:57 | FromDiscord | <Elegantbeef> Yes identifiers are looked up inside a `typed` macro |
22:10:15 | FromDiscord | <cloudperry> In reply to @Elegantbeef "Run that after running": Uhh so I just need to do that to all nnkSym nodes at the end of my macro? Or some time after I have added the pragmas? |
22:10:43 | FromDiscord | <Elegantbeef> Well not before adding the pragmas cause you want the type information |
22:11:35 | * | beholders_eye quit (Ping timeout: 245 seconds) |
22:19:30 | FromDiscord | <cloudperry> Idk what I'm doing that proc tbh https://media.discordapp.net/attachments/371759389889003532/1418723198429696010/message.txt?ex=68cf2871&is=68cdd6f1&hm=77da2e8c8f2de64c114f3e2e27c65dc0ebdc770f9731822076b04b112176abba& |
22:20:23 | FromDiscord | <cloudperry> I tried desymming just the type of the fields, but that doesn't seem to do anything |
22:20:54 | FromDiscord | <cloudperry> The only other Sym I have in my AST is the object type itself |
22:28:19 | FromDiscord | <Elegantbeef> just do `result.desym()` a the end |
22:29:49 | FromDiscord | <cloudperry> Oh wow that actually worked! Thanks :D |
22:33:03 | FromDiscord | <cloudperry> My Nim OpenGL project has been going quite nicely before this macro mess. I made tiny abstractions for shaders, UBOs, SSBOs, VAOs, VBOs and EBOs. For now I don't plan to make any more abstractions, because other OpenGL things I need seem quite simple to use just through the GLAD wrapper. |
22:33:45 | FromDiscord | <Elegantbeef> My abstraction for SSBOs is just `type SSBO[T: array or seq] = distinct Gluint` 😄 |
22:34:54 | FromDiscord | <Elegantbeef> https://codeberg.org/ElegantBeef/truss3D if you want a gander at any of my opengl work 😄 |
22:35:04 | FromDiscord | <cloudperry> I'm going to do a CSG/SDF sphere tracing shader and also trying to speed it up by rasterizing some parts of the scene |
22:35:52 | FromDiscord | <cloudperry> Its for my bachelor's thesis about rendering constructive solid geometry in real-time, but we'll see if I ever get there |
22:38:45 | FromDiscord | <cloudperry> In reply to @Elegantbeef "https://codeberg.org/ElegantBeef/truss3D if you wan": Good to see that there is at least some slightly larger Nim OpenGL projects out there |
22:39:15 | FromDiscord | <cloudperry> I haven't seen much actual projects just hello triangle level stuff |
22:39:25 | FromDiscord | <cloudperry> (edit) "is" => "are" |
22:40:15 | FromDiscord | <cloudperry> [This GLFW wrapper](https://github.com/johnnovak/nim-glfw) + GLAD generated OpenGL has been really nice so far |
22:41:06 | FromDiscord | <cloudperry> Only thing I'm missing is some good Imgui wrapper that would be easy to use with GLFW, but I don't need UI yet |
22:42:29 | FromDiscord | <Elegantbeef> simplescreenrecorder-2025-08-26\_11.24.33.mp4 [simplescreenrecorder-2025-08-26_11.24.33.mp4](https://t2bot.io/_matrix/media/v3/download/matrix.org/IdLRrVqmcYxPgepeTZJpqPeu) |
22:42:39 | FromDiscord | <Elegantbeef> Heh I can say for certainty the opengl stuff works |
22:43:08 | FromDiscord | <Elegantbeef> I don't exactly like imgui so I don't use them |
22:43:17 | FromDiscord | <Elegantbeef> But I did take a gander at koi for a bit |
22:45:02 | FromDiscord | <cloudperry> The main reason I will probably use some immediate mode GUI for this project is that I just need some simple debug UI type things |
22:45:19 | FromDiscord | <cloudperry> And I don't want to spend too much time on that, because there are hard graphics things to solve |
22:46:11 | FromDiscord | <cloudperry> I didn't know about Koi and it seems pretty much perfect for this project since I'm already using nim-glfw |
22:58:38 | FromDiscord | <mitranim> sent a long message, see https://pasty.ee/lrCWsHYl |
22:59:45 | FromDiscord | <Elegantbeef> Yes you can mixin procedures inside a generic |
23:00:12 | FromDiscord | <mitranim> Where to look for examples? |
23:01:26 | FromDiscord | <Elegantbeef> https://github.com/beef331/nimtrest/wiki/Code-snippets#using-generic-interfaces |
23:05:19 | FromDiscord | <mitranim> Looking into this... what the heck is `concept type`? The language manual doesn't mention this, and the compiler internals are rather sparse on the topic 😅 |
23:06:42 | FromDiscord | <mitranim> > In contrast to other programming languages, the vtable in Nim is stored externally to the object, allowing you to create multiple different vtable views for the same object. Thus, the polymorphism in Nim is unbounded - any type can implement an unlimited number of protocols or interfaces not originally envisioned by the type's author.↵Not in contrast with Go actually, the two languages completely align on this one point 😄 |
23:07:28 | FromDiscord | <Elegantbeef> Experimental feature, don't worry about it |
23:07:39 | FromDiscord | <mitranim> Oh wait, they don't! In Go, you can't extend the definition of a type from another package, which is sometimes a pain point. This paragraph implies you can in Nim. |
23:07:49 | FromDiscord | <Elegantbeef> Nim does not have vtables so idk where you got that |
23:07:56 | * | skippy8 quit (Quit: WeeChat 4.7.1) |
23:08:13 | FromDiscord | <mitranim> `doc/manual_experimental.md` |
23:08:16 | FromDiscord | <Elegantbeef> You don't use interfaces in Nim you use generics which instantiate on invoked |
23:09:20 | FromDiscord | <Elegantbeef> Nim types are just types procedures are unattached |
23:09:44 | FromDiscord | <mitranim> That works for single values, and also results in static dispatch, and that's great. But Go interface values / Rust boxed traits / "fat pointers" from this paragraph are required when constructing collections of values with different underlying concrete types which implement the same interface |
23:10:24 | FromDiscord | <mitranim> Also to me this seems like the only sane approach; bundling vtables _into_ objects is madness |
23:11:00 | FromDiscord | <mitranim> (edit) "That works for single values, and also results in static dispatch, and that's great. But Go interface values / Rust boxed traits / "fat pointers" from this paragraph are required when constructing collections of values with different underlying concrete types which implement the same interface ... " added "(at the cost of more memory usage and dynamic dispatch)" |
23:11:38 | FromDiscord | <Elegantbeef> Nim has no mechanism for this |
23:11:54 | FromDiscord | <Elegantbeef> You have to manually make you objects and bring the table around |
23:18:30 | * | xtr00 quit (Read error: Connection reset by peer) |
23:18:58 | FromDiscord | <mitranim> sent a code paste, see https://play.nim-lang.org/#pasty=nnicEHeH |
23:22:53 | FromDiscord | <Elegantbeef> You're just using generics |
23:22:53 | FromDiscord | <Elegantbeef> The concept does no binding though |
23:22:54 | FromDiscord | <Elegantbeef> Which means static dispatch |
23:23:30 | FromDiscord | <mitranim> Exactly how it should be. My worry was whether the compiler is able to pass the interface implementation back from user code to library code |
23:24:04 | FromDiscord | <mitranim> As in, does the language depend _entirely_ on in-scope proc overloads for such behaviors or not |
23:25:24 | FromDiscord | <mitranim> (edit) "not" => "can interface implementations cross module boundaries" |
23:26:08 | * | xtr00 joined #nim |
23:29:54 | FromDiscord | <Elegantbeef> You need in scope procedures at the place of instantiation |
23:29:59 | FromDiscord | <Elegantbeef> Like I said |
23:30:16 | FromDiscord | <Elegantbeef> You do not even need the concept |
23:30:42 | FromDiscord | <mitranim> So this doesn't carry over to a _third_ module which uses library code from A and type from B? |
23:30:53 | FromDiscord | <mitranim> Unless it imports everything from B including its proc? |
23:38:37 | FromDiscord | <mitranim> sent a code paste, see https://play.nim-lang.org/#pasty=DkyqQZAH |
23:39:22 | FromDiscord | <mitranim> (edit) "https://play.nim-lang.org/#pasty=gxRMNpLH" => "https://play.nim-lang.org/#pasty=YoaEEDFZ" |
23:39:36 | FromDiscord | <mitranim> (edit) "https://play.nim-lang.org/#pasty=tmJqeEGq" => "https://play.nim-lang.org/#pasty=grZZVVTX" |
23:48:16 | FromDiscord | <Elegantbeef> So perhaps stop using that import method 😄 |