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