<< 02-07-2026 >>

00:10:34FromDiscord<Aceroph> i love that theres even an angry version, ill use that now↵(@nasuray)
00:11:19*Skippy8 quit (Ping timeout: 276 seconds)
00:13:45*Lord_Nightmare quit (Quit: ZNC - http://znc.in)
00:16:21FromDiscord<11clock> sent a code paste, see https://play.nim-lang.org/#pasty=mEZMvULH
00:21:43FromDiscord<DetermiedNim1> well, its not an object oriented programming language 🤷‍♂️
00:21:56FromDiscord<Aceroph> make a macro 😆
00:22:02FromDiscord<DetermiedNim1> lol yeah
00:22:20FromDiscord<DetermiedNim1> also this is reminding me of one of ruby's metaprogramming features
00:23:15FromDiscord<Aceroph> im making a de/serialization macro for OOP, its so powerful
00:26:31*Lord_Nightmare joined #nim
00:28:34FromDiscord<11clock> In reply to @Aceroph "make a macro 😆": It is a macro I am working on. The issue is that nim doesn't let you apply the export asterisk syntax because it complains about an incomplete expressiob
00:28:52FromDiscord<11clock> (edit) "expressiob" => "expression"
00:29:31FromDiscord<11clock> I did not see a way to make my macro compatible with the asterisk.
00:30:17FromDiscord<11clock> sent a code paste, see https://play.nim-lang.org/#pasty=tlShERps
00:31:59FromDiscord<11clock> It works, just don't like that it differs from nim's syntax.
00:32:42FromDiscord<timbuktu_guy> there are a lot of issues like that where u cant make macro syntax exactly like u want it
00:32:53FromDiscord<11clock> I threw in this error as a bonus at least https://media.discordapp.net/attachments/371759389889003532/1522037309732819024/image.png?ex=6a470334&is=6a45b1b4&hm=93fbac196c73b2c10a580045dfa2819ffe3e30458adf97c56281ebc718a12ee1&
00:32:54FromDiscord<timbuktu_guy> even untyped macros have to be parsed
00:33:44FromDiscord<11clock> Honestly it feels so satisfying to make my own class system after years of complaining about Java and C# lol
00:34:03FromDiscord<11clock> "Here is how it SHOULD work. Mwahahaha"
00:36:49FromDiscord<11clock> And for the most part it looks like normal nim. I made sure to avoid any parlor tricks.
00:39:54FromDiscord<DetermiedNim1> In reply to @11clock "I threw in this": what about smth like c++ for the access modifiers?
00:40:13FromDiscord<DetermiedNim1> sent a code paste, see https://play.nim-lang.org/#pasty=tQvGKcOF
00:40:57FromDiscord<11clock> I wanted to keep the asterisk syntax where I could, since it's already really concise and convenient.
00:41:13FromDiscord<11clock> Not a huge fan of keyword ceremony
00:42:02FromDiscord<DetermiedNim1> ig
00:42:22FromDiscord<DetermiedNim1> is it possible to detect whether something is marked as exported using macros
00:42:27FromDiscord<pevici> sent a long message, see https://pasty.ee/xtIdOGuC
00:42:38FromDiscord<DetermiedNim1> wth
00:42:45FromDiscord<DetermiedNim1> anyways...
00:42:55FromDiscord<11clock> In reply to @determiedmech1 "is it possible to": Yes. Otherwise that error I made wouldn't work.
00:43:06FromDiscord<11clock> If you try to use asterisks in an unexported class it will complain
00:43:21FromDiscord<DetermiedNim1> are you doing a one-class-per-file thing?
00:43:47FromDiscord<Aceroph> you cant?? i swear i saw something like such↵(@11clock)
00:43:51FromDiscord<DetermiedNim1> what if you don't want to export the class but you want other classes in the same file to be able to access public fields and members
00:44:46FromDiscord<11clock> In reply to @determiedmech1 "what if you don't": Unexported members are available throughout the whole file as per normal nim rules.
00:45:09FromDiscord<Aceroph> https://nim-by-example.github.io/macros/↵(@11clock)
00:45:23FromDiscord<DetermiedNim1> sent a code paste, see https://play.nim-lang.org/#pasty=fPvsixFL
00:45:46FromDiscord<11clock> In reply to @Aceroph "https://nim-by-example.github.io/macros/ (<@2140554": That only works because the example requires specifying inheritance.
00:45:56FromDiscord<DetermiedNim1> (edit) "https://play.nim-lang.org/#pasty=gTxMWtTz" => "https://play.nim-lang.org/#pasty=LSMHPblQ"
00:46:07FromDiscord<11clock> "class Person of RootObj:" is valid syntax
00:46:21FromDiscord<11clock> "class Person:" is not
00:46:55FromDiscord<DetermiedNim1> sent a code paste, see https://play.nim-lang.org/#pasty=fjhpjqLe
00:47:05FromDiscord<DetermiedNim1> how are you implementing the classes?
00:47:47FromDiscord<11clock> Untyped macro.
00:47:59FromDiscord<11clock> sent a code paste, see https://play.nim-lang.org/#pasty=RSVJucIj
00:48:04FromDiscord<11clock> That won't work
00:48:07FromDiscord<DetermiedNim1> well like
00:48:16FromDiscord<DetermiedNim1> what does the macro convert it to
00:48:37FromDiscord<11clock> It doesn't reach the macro because nim complains about a syntax error.
00:49:31FromDiscord<DetermiedNim1> ah yeah you're right
00:49:55FromDiscord<DetermiedNim1> oh wait why dont you just have pragmas for public, private, and protected
00:50:01FromDiscord<Aceroph> nim's simplicity allows it
00:50:06FromDiscord<DetermiedNim1> one of them could be default
00:50:20FromDiscord<DetermiedNim1> or you could do something like in ruby
00:50:31FromDiscord<11clock> In reply to @Aceroph "nim's simplicity allows it": Hmm? The above code snippet actually compiles for you?
00:50:44FromDiscord<DetermiedNim1> fields: private↵methods: public
00:50:51FromDiscord<DetermiedNim1> (edit) "private↵methods:" => "private by default↵methods:" | "private by default↵methods:public ... " added "by default"
00:51:58FromDiscord<11clock> https://media.discordapp.net/attachments/371759389889003532/1522042110738567168/image.png?ex=6a4707ad&is=6a45b62d&hm=d3fa8fe03f25a026e528e726d5ee392ca9345d0b7fc84f357bb54e9c8122c8d7&
00:52:19FromDiscord<11clock> Is there a way to somehow bypass this that I am unaware of?
00:52:37FromDiscord<11clock> Because nim just thinks I am trying to multiply Player by something and refuses to go into the macro
00:52:51FromDiscord<11clock> (edit) "Because nim just thinks I am trying to multiply Player by something ... and" added "undefined"
00:52:52FromDiscord<Aceroph> nim's simplicity allows it, and thats why i love it
00:56:08FromDiscord<11clock> Anyways "pubclass" I think should work alright for now. Inconsistent but still just an extra 2 characters.
00:56:37FromDiscord<11clock> In reply to @determiedmech1 "oh wait why dont": I considered this too, but uhh
00:57:27FromDiscord<11clock> https://media.discordapp.net/attachments/371759389889003532/1522043491188871279/668825d07482779bca0fa964e1f8a695.png?ex=6a4708f6&is=6a45b776&hm=558d86ac1e3aed2f34e057e5601e1f044b2dcf7512fa7061a60e49e32e1c6e2e&
00:57:37FromDiscord<11clock> Yeah invalid syntax here as well
00:57:53FromDiscord<11clock> But I haven't really looked into where nim allows pragmas yet
00:57:53FromDiscord<DetermiedNim1> weird
00:58:11FromDiscord<DetermiedNim1> What about before a field or methid
00:58:15FromDiscord<DetermiedNim1> (edit) "methid" => "method"
00:59:07FromDiscord<11clock> Doesn't work anywhere in the class header. I know that it works on method signatures though
01:01:35FromDiscord<DetermiedNim1> sent a code paste, see https://play.nim-lang.org/#pasty=WYTGIRTX
01:03:03FromDiscord<11clock> It almost works
01:03:06FromDiscord<11clock> https://media.discordapp.net/attachments/371759389889003532/1522044915243024455/6d78ce1c46c0e2f344b3140b8efa1841.png?ex=6a470a4a&is=6a45b8ca&hm=dc1ddb275f754f2a040f09140b51c6f4282054eecb3e29fd5879640df7c71edf&
01:03:32FromDiscord<11clock> But ehh, at that point I'd rather just use "pubclass"
01:04:07FromDiscord<Aceroph> yes, this example does, but then doesnt use it https://nim-by-example.github.io/macros/↵(@DetermiedNim1)
01:04:50FromDiscord<Aceroph> it checks if the nnkIdent \ is present
01:05:38FromDiscord<11clock> I explained why the example works earlier.
01:06:03FromDiscord<11clock> Because it enforces specifying the inheritance, which makes the header valid syntax
01:06:11FromDiscord<11clock> Because "" has a target
01:06:53FromDiscord<DetermiedNim1> In reply to @11clock "But ehh, at that": Imo id rather have more reusability through the pragma but its your pro}ect 🤷‍♂️
01:09:04FromDiscord<11clock> It depends on if I run into this problem elsewhere.
01:09:11FromDiscord<11clock> I do know that this works:
01:09:33FromDiscord<11clock> https://media.discordapp.net/attachments/371759389889003532/1522046538770153562/d4af9b6dfbd881c40543fa640f2807c7.png?ex=6a470bcd&is=6a45ba4d&hm=6d001d2aaa461cef7cf0b7ea674b7c6dcfa187723f2e7bc50c20a87ce047d1ae&
01:10:25FromDiscord<11clock> Oh yeah another neat thing about my class macro is that it handles ordering
01:10:41FromDiscord<11clock> It actually generates proc signatures before the actual procs 😄
01:11:08FromDiscord<11clock> So you don't have to worry about ordering anything in a class definition
01:11:31FromDiscord<11clock> And I have a "context" macro that expands this to multiple classes, for bidirectional dependencies.
01:13:30FromDiscord<Aceroph> have you tried to replicate what dumpTree tells you?↵(@11clock)
01:13:34FromDiscord<Aceroph> did u check the logs?
01:13:46FromDiscord<unclechu> sent a code paste, see https://play.nim-lang.org/#pasty=nHZahBKc
01:15:04FromDiscord<unclechu> Yes, there is this\:↵> ... SIGSEGV\: Illegal storage access. (Attempt to read from nil?)\\n'
01:15:11FromDiscord<11clock> In reply to @Aceroph "have you tried to": It doesn't tell me anything because it doesn't compile
01:16:55FromDiscord<11clock> It's a compiler error that says that it expects an expression after the asterisk
01:30:39FromDiscord<unclechu> sent a code paste, see https://play.nim-lang.org/#pasty=NnVUPDeG
01:31:09FromDiscord<11clock> This is how my oop module does getters/setters https://media.discordapp.net/attachments/371759389889003532/1522051974818697246/image.png?ex=6a4710dd&is=6a45bf5d&hm=813efdfd5dcf378bd95acfa265fdc6c603880868c86090e71564c58abafdf535&
01:31:28FromDiscord<11clock> Probably the most ergonomic I could make them while abiding by nim's syntax
01:31:38FromDiscord<11clock> (edit) "Probably the most ergonomic I could make them while abiding by nim's syntax ... " added "and not doing weird hacks."
01:33:57FromDiscord<DetermiedNim1> is it returning field
01:34:02FromDiscord<11clock> yep
01:34:12FromDiscord<DetermiedNim1> you can't use name?
01:34:30FromDiscord<11clock> That would cause recursion
01:34:34FromDiscord<DetermiedNim1> ah
01:34:38FromDiscord<11clock> (edit) "That would cause ... recursion" added "infinite"
01:50:49*termer quit (Remote host closed the connection)
01:53:37*termer joined #nim
02:02:27*Vyrnexis5 joined #nim
02:04:25*Vyrnexis quit (Ping timeout: 248 seconds)
02:04:26*Vyrnexis5 is now known as Vyrnexis
02:06:40*alexdaguy joined #nim
02:25:03FromDiscord<11clock> Added a subtle new feature. Wonder if you can notice it. It was stupid simple but I missed it from Ruby and Yuescript. https://media.discordapp.net/attachments/371759389889003532/1522065534437425213/image.png?ex=6a471d7e&is=6a45cbfe&hm=f10b8d46da8b7e086997d6cd90a9a4d5fd238a90a1d57c7824950ad845da3363&
02:25:25FromDiscord<11clock> It's a small shortcut for something 😄
02:26:40FromDiscord<11clock> ok I know that nim had a pragma for this, but I wanted it to be slightly more explicit.
02:26:49FromDiscord<11clock> (edit) "had" => "has"
02:29:44FromDiscord<DetermiedNim1> hmm
02:29:51FromDiscord<DetermiedNim1> i
02:29:56FromDiscord<DetermiedNim1> have no idea 😭
02:33:26FromDiscord<DetermiedNim1> hmm
02:35:40FromDiscord<DetermiedNim1> is there any way to model a tuple of multiple different types using generics
02:36:18FromDiscord<DetermiedNim1> ideally i want to be able to sa↵seq[ListOfPossibleTypes]
02:36:22FromDiscord<DetermiedNim1> (edit) "sa↵seq[ListOfPossibleTypes]" => "say↵seq[ListOfPossibleTypes]"
02:36:25FromDiscord<DetermiedNim1> i just had an idea
02:38:14FromDiscord<DetermiedNim1> where you could model fields and procs as smth like↵↵(MemberType, AccessType, MemberValue)
02:38:45FromDiscord<DetermiedNim1> but i dont think it would work in nim's type system
02:41:47FromDiscord<Aceroph> sent a code paste, see https://play.nim-lang.org/#pasty=sOAEpgyN
02:42:32FromDiscord<11clock> In reply to @determiedmech1 "have no idea 😭": It's the tilde. It's a tiny macro that replaces it with `self.`
02:42:53FromDiscord<DetermiedNim1> ohhh nice
02:43:17FromDiscord<DetermiedNim1> whoa cachy-update also manages flatpaks
02:43:33FromDiscord<11clock> sent a code paste, see https://play.nim-lang.org/#pasty=DsBbbDnY
02:44:05FromDiscord<DetermiedNim1> do you have a github or smth for the oop stuff?
02:44:19FromDiscord<11clock> not yet, may share it.
02:44:28FromDiscord<DetermiedNim1> 🙏
02:44:36FromDiscord<11clock> I am am super happy with it, so it may prove useful for others
02:44:43FromDiscord<11clock> (edit) removed "am"
02:45:00FromDiscord<11clock> Sure a couple of slight annoyances but it's overall pretty much what I want out of class syntax.
02:45:19FromDiscord<Aceroph> the tilde?
02:45:49FromDiscord<11clock> The oop stuff I have made so far. It's only missing two more important features
02:46:01FromDiscord<11clock> Value objects and inheritance.
02:46:09FromDiscord<11clock> Then it should have pretty much everything
02:46:25FromDiscord<11clock> Then I can add stuff later like auto constructors and whatnot
02:46:53FromDiscord<11clock> Honestly I should make auto constructor higher priority because built in types already do that so it seems like a regression lol
03:00:36*Vyrnexis9 joined #nim
03:02:23*Vyrnexis quit (Ping timeout: 265 seconds)
03:02:24*Vyrnexis9 is now known as Vyrnexis
03:12:52FromDiscord<Aceroph> example?↵(@DetermiedNim1)
03:18:05FromDiscord<DetermiedNim1> sent a code paste, see https://play.nim-lang.org/#pasty=IWhYcRmR
03:18:13FromDiscord<DetermiedNim1> (edit) "https://play.nim-lang.org/#pasty=aRcxcZnU" => "https://play.nim-lang.org/#pasty=fIMiARao"
03:19:20FromDiscord<DetermiedNim1> then there would be procs or macros (wtv necessary) for adding fields and methods to a class, as well as accessing them (in the implementatiom, hidden by some user-facing macro)
03:19:38FromDiscord<DetermiedNim1> basically just a big LUT of stuff
03:20:09FromDiscord<DetermiedNim1> i guess it might not be the most optimal idea
03:23:39FromDiscord<Aceroph> not rlly 😅
03:23:40FromDiscord<Aceroph> why store it in a data structure
03:23:44FromDiscord<Aceroph> the fields/methods
03:23:53FromDiscord<DetermiedNim1> first thing i thought of 🤷‍♂️
03:24:40FromDiscord<DetermiedNim1> like i said, i have zero doubt in my mind theres a better way to be doing this, but i don't quite have the macro knowledge to do some of the more complex macro stuff
03:27:50FromDiscord<Aceroph> i forgot, what are we trying to accomplish here?
03:30:34FromDiscord<DetermiedNim1> classes in nim
03:31:39*rockcavera quit (Remote host closed the connection)
03:37:49FromDiscord<Aceroph> can probably achieve c++ style classes pretty easily, and maybe even c# getter/setters
03:39:41FromDiscord<11clock> It's still crazy to me how much nim feels like a scripting language despite not being one.
03:45:01FromDiscord<DetermiedNim1> real
03:45:29FromDiscord<DetermiedNim1> I think a lot of it is the general lack of the kind of boilerplate you see in other system/compiled languages
03:45:52FromDiscord<DetermiedNim1> also the python-y style kind of exudes a sense of scripting lang
03:59:28*zero`_ joined #nim
04:02:43*zero` quit (Ping timeout: 276 seconds)
04:05:03*zero` joined #nim
04:09:02*zero`_ quit (Ping timeout: 271 seconds)
04:40:18*Vyrnexis quit (Quit: Ping timeout (120 seconds))
04:40:39*Vyrnexis joined #nim
04:40:48*redj joined #nim
04:50:59FromDiscord<11clock> While I am making a macro for OOP, I don't think I will be needing much other macros. The language looks ergonomic enough already.
04:51:13FromDiscord<11clock> (edit) "much" => "many"
04:51:30FromDiscord<11clock> Maybe some small stuff here and there.
04:52:01FromDiscord<zumi.dxy> insert something about "no braces"
05:00:36*xet7 joined #nim
05:20:35*Skippy8 joined #nim