00:03:03 | * | jmdaemon joined #nim |
00:19:53 | FromDiscord | <monark.chan> How can I import a directory of nim files |
00:20:21 | FromDiscord | <monark.chan> Like in JavaScript I can loop through the files and require each one |
00:20:25 | FromDiscord | <Elegantbeef> There is no mechanism to automate that |
00:20:35 | FromDiscord | <Elegantbeef> You can write a macro to do it but nothing built in |
00:20:41 | * | xet7 joined #nim |
00:21:08 | FromDiscord | <monark.chan> Any examples on what that macro would look like? |
00:23:51 | * | jjido joined #nim |
00:23:57 | FromDiscord | <demotomohiro> You can write a module that imports modules in a directory and export symbols from imported module.↵https://nim-lang.org/docs/manual.html#modules-export-statement |
00:25:21 | NimEventer | New post on r/nim by Robert_Bobbinson: [noob] Circular dependency hell in Nim, see https://reddit.com/r/nim/comments/15bia07/noob_circular_dependency_hell_in_nim/ |
00:26:30 | FromDiscord | <demotomohiro> Getting a list of files in macro would fails if compiled with --os:any:↵https://github.com/nim-lang/Nim/issues/19414 |
00:27:27 | FromDiscord | <egomind> In reply to @monark.chan "Any examples on what": I'm new to Nim, so I don't know for sure, but maybe try getting the files in a directory and then return an import statement for each one? |
00:27:55 | FromDiscord | <monark.chan> In reply to @egomind "I'm new to Nim,": Can I use an import statement in a loop? |
00:28:01 | FromDiscord | <monark.chan> I don’t believe I can |
00:28:12 | FromDiscord | <egomind> The way I understand it, you don't actually important anything in your macro |
00:28:19 | FromDiscord | <egomind> you just add import statements to the AST, no? |
00:28:50 | FromDiscord | <egomind> Or am I misunderstanding how macros work |
00:29:02 | FromDiscord | <monark.chan> Wait what |
00:29:15 | FromDiscord | <monark.chan> Idk I’m pretty unfamiliar with macros |
00:29:22 | FromDiscord | <egomind> https://nim-lang.org/docs/macros.html |
00:29:30 | FromDiscord | <egomind> https://nim-by-example.github.io/macros/ |
00:29:38 | FromDiscord | <egomind> > Nim’s syntax is incredibly versatile, and macros can be used to rewrite the abstract syntax tree of a program. The general process for writing a macro consists of two steps that are repeated until the desired results are achieved:↵> ↵> Dump and examine the AST↵> Modify the AST to match the desired shape |
00:29:58 | FromDiscord | <egomind> The way I understand it, you get the AST and can play around with it |
00:30:15 | FromDiscord | <egomind> and the resulting code then gets transpiled to C or JS |
00:30:20 | FromDiscord | <egomind> or whatever |
00:30:36 | FromDiscord | <michaelb.eth> and/or build an AST, injecting things as it were |
00:31:26 | FromDiscord | <egomind> In case you don't know what an AST is: You're basically rewriting your program before transpiling it |
00:31:30 | FromDiscord | <michaelb.eth> `quote do:` and backticks help make the process less tedious than if you build all the NimNode instances imperatively, though sometimes you have to do that |
00:31:33 | FromDiscord | <egomind> but automatically |
00:31:43 | FromDiscord | <Elegantbeef> Technically one could use staticExec↵(@demotomohiro) |
00:31:56 | FromDiscord | <Elegantbeef> michael it's 2023 stop suggesting quote do 😛 |
00:32:07 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/genasts.html is the cooler kid on the block |
00:32:10 | FromDiscord | <michaelb.eth> really? it's not good? |
00:32:23 | FromDiscord | <michaelb.eth> ah, okay, yeah I haven't grok'd that yet, thanks for the reminder |
00:32:56 | FromDiscord | <Elegantbeef> I mean it's nice if you like manually quoting symbols that you want to inject |
00:33:16 | FromDiscord | <demotomohiro> @elegantbeef So, get a list of files in a directory with `ls` or `dir` command? |
00:33:28 | FromDiscord | <Elegantbeef> oh it's awful to do, but yes you could |
00:33:54 | FromDiscord | <egomind> I would think there's an OS function for this |
00:34:14 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/ap1Tm |
00:34:20 | FromDiscord | <Elegantbeef> god that's old Nim code of mine |
00:35:05 | FromDiscord | <michaelb.eth> In reply to @egomind "I would think there's": maybe, but shelling out can sometimes be more convenient because output of a command in the shell is already fairly easy to parse, e.g. newlines separate things, etc. |
00:35:37 | FromDiscord | <Elegantbeef> It's easier to just make nimscript prebuild task that generates your list of `import x` then just `include myfile` inside your program |
00:35:43 | FromDiscord | <Elegantbeef> or better yet a `import x; export x` list |
00:35:51 | FromDiscord | <Elegantbeef> to avoid include |
00:36:32 | FromDiscord | <demotomohiro> I think you can write a `config.nims` file that runs `switch("import", file)` to each files in a directory. |
00:37:02 | FromDiscord | <Elegantbeef> Right but that imports globally |
00:37:11 | FromDiscord | <Elegantbeef> They want a way to import all files in a directory |
00:37:35 | FromDiscord | <Elegantbeef> There is no built in way and assuming it's like my command stuff they are best to just make a single file before they build |
00:50:32 | * | jmdaemon quit (Quit: ZNC 1.8.2 - https://znc.in) |
00:50:50 | * | jmdaemon joined #nim |
00:51:19 | * | xet7 quit (Remote host closed the connection) |
00:52:08 | * | xet7 joined #nim |
00:59:07 | * | jmdaemon quit (Ping timeout: 245 seconds) |
01:00:14 | * | lumo_e joined #nim |
01:16:02 | * | disso-peach quit (Quit: Leaving) |
01:18:56 | * | jmd_ joined #nim |
01:31:37 | * | jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…) |
01:55:00 | FromDiscord | <monark.chan> How can I use the import command from a macro |
01:55:12 | FromDiscord | <monark.chan> I tried calling it as an ident but that doesn't work |
01:55:48 | FromDiscord | <Elegantbeef> It'd be `nnkImportStmt` |
01:55:59 | FromDiscord | <Elegantbeef> so `nnkImportStmt.newTree(....)` |
01:56:18 | FromDiscord | <Elegantbeef> I still wouldnt really suggest using a macro for importing a directory |
01:56:29 | FromDiscord | <monark.chan> In reply to @Elegantbeef "so `nnkImportStmt.newTree(....)`": Ok |
02:01:37 | FromDiscord | <Andreas> @monark.chan when i started with Nim, i was told that a macro is kind of a 'last resort'. In some cases a template might already solve a problem. In your case a `import/export' without a template or macro will do. And writing correct macros is not trivial - so i'd second beefs advice here.. |
02:03:28 | FromDiscord | <monark.chan> You would have to manually specify each file in an import/export |
02:03:55 | FromDiscord | <monark.chan> That would be no different than just importing everything manually into the main.nim file |
02:10:56 | FromDiscord | <Andreas> @ark right, gimme a figure - are you importing dozends or hundrets oy symbols ? |
02:11:13 | FromDiscord | <Andreas> (edit) "oy" => "of" |
02:16:18 | * | azimut quit (Ping timeout: 240 seconds) |
02:19:31 | FromDiscord | <that_dude.> sent a code paste, see https://play.nim-lang.org/#ix=4BFb |
02:19:49 | FromDiscord | <that_dude.> You may need to capture it and return it or smth tho |
02:31:12 | * | lumo_e quit (Quit: Quit) |
02:57:53 | FromDiscord | <BanannaMan> Guys, how do I get better at nim? Im stuck at this weird mental blockage where i understand the problem but I only have a half baked idea of how to solve it. This goes for any language and i feel like I don't know anything despite me learning for a decade. Am I not cut out for programming? |
02:58:49 | FromDiscord | <BanannaMan> I seriously don't know what to do anymore |
03:00:36 | FromDiscord | <egomind> In reply to @BanannaMan "Guys, how do I": How do you typically approach problems? |
03:00:47 | FromDiscord | <egomind> Like, which steps do you take to get to a solution |
03:08:30 | FromDiscord | <elamandeep> sent a code paste, see https://play.nim-lang.org/#ix=4BFf |
03:09:21 | FromDiscord | <elamandeep> sent a code paste, see https://play.nim-lang.org/#ix=4BFg |
03:09:45 | FromDiscord | <graveflo> sent a long message, see http://ix.io/4BFi |
03:09:52 | FromDiscord | <Elegantbeef> `some(@[])` or `none(seq[HandlerAsync])` |
03:10:25 | FromDiscord | <egomind> In reply to @graveflo "Everyone has been there": ? |
03:11:16 | FromDiscord | <graveflo> In reply to @BanannaMan "Guys, how do I": wrong ping |
03:12:31 | FromDiscord | <that_dude.> In reply to @BanannaMan "Guys, how do I": In my experience, you "just gotta do". You are unlikely to ever build a complete plan in your head. Just write a list of requirements, and start grinding away. Don't be afraid of wasted effort. Feel free to keep deleting and changing your mind as needed. Feel free to use git if deleting code you worked on makes your heart ache. |
03:12:41 | FromDiscord | <BanannaMan> In reply to @graveflo "Everyone has been there": The problem that I'm having a hard time understanding is determining the number of sides different kinds of triangles have |
03:12:53 | FromDiscord | <elamandeep> In reply to @Elegantbeef "`some(@[])` or `none(seq[HandlerAsync])`": I didn't get |
03:13:30 | FromDiscord | <egomind> In reply to @BanannaMan "The problem that I'm": 3..? |
03:13:33 | FromDiscord | <graveflo> In reply to @BanannaMan "The problem that I'm": that sounds like an interesting problem because it's 3? |
03:13:43 | FromDiscord | <elamandeep> sent a code paste, see https://play.nim-lang.org/#ix=4BFj |
03:14:20 | FromDiscord | <elamandeep> (edit) "https://play.nim-lang.org/#ix=4BFj" => "https://play.nim-lang.org/#ix=4BFk" |
03:14:30 | FromDiscord | <that_dude.> In reply to @elamandeep "I didn't get": https://nim-lang.org/docs/options.html↵Basically you wrap the value in an object that can either represent a value or the lack of one |
03:14:37 | FromDiscord | <elamandeep> (edit) "https://play.nim-lang.org/#ix=4BFk" => "https://play.nim-lang.org/#ix=4BFl" |
03:14:46 | FromDiscord | <Elegantbeef> Look at the error |
03:14:49 | FromDiscord | <that_dude.> It's kind a simmilar to how a pointer can point to nil or the object itself |
03:14:53 | FromDiscord | <that_dude.> (edit) "simmilar" => "similar" |
03:15:01 | FromDiscord | <Elegantbeef> > required type for middlewares\: Option[seq[HandlerAsync]]↵> 'middlewares = @[CorsMiddleware(@["\"], re"", @["GET"], @[], @[], false, 7200,↵> @[])]' is of type\: seq[HandlerAsync] |
03:15:43 | FromDiscord | <BanannaMan> In reply to @graveflo "that sounds like an": It's this problem in particular:↵https://www exercism.org/tracks/nim/exercises/triangle |
03:15:52 | FromDiscord | <BanannaMan> (edit) "particular:↵https://www exercism.org/tracks/nim/exercises/triangle" => "particular:↵https://www.exercism.org/tracks/nim/exercises/triangle" |
03:16:42 | FromDiscord | <that_dude.> So what's the hard part? |
03:16:52 | FromDiscord | <elamandeep> In reply to @elamandeep "from what I got": @that_dude. i need to put cors on every route? |
03:18:01 | FromDiscord | <that_dude.> sent a code paste, see https://play.nim-lang.org/#ix=4BFm |
03:18:11 | FromDiscord | <graveflo> In reply to @BanannaMan "It's this problem in": ok so for this one what you want to do is just focus on one thing at a time. Have you taken algebra class in school? You want to define your given information and then define each step one at a time until the problem is solved. You essentially just need to define what was said in the post. Don't try and do it all at once |
03:18:17 | FromDiscord | <that_dude.> I haven't used prologue so idk tbh |
03:18:54 | FromDiscord | <BanannaMan> In reply to @graveflo "ok so for this": What do you mean? |
03:19:37 | FromDiscord | <BanannaMan> You mean in terms of procedural programming? |
03:20:59 | FromDiscord | <graveflo> In reply to @BanannaMan "What do you mean?": since this problem is dealing with triangles, and their sides defined as `a`, `b` and `c` first you will want tot define those variables. Then you want to make sure they are a triangle (the post explained a simple check for this). Next you want to translate the logic that they had specified about each type of triangle into code. Since there can be several discrete choices you will probably w |
03:21:28 | FromDiscord | <BanannaMan> In reply to @graveflo "since this problem is": I tried using a switch case flow but it didn't work |
03:21:39 | FromDiscord | <BanannaMan> That's what I immediately thought |
03:21:48 | FromDiscord | <graveflo> then try `if` |
03:22:03 | FromDiscord | <that_dude.> If it's a triangle, that's a small enough number of sides where you can hardcode your tests/checks |
03:22:03 | FromDiscord | <BanannaMan> But I dunno. Maybe I didn't do it right. |
03:22:56 | FromDiscord | <graveflo> one other thing I'll say is wrap this into a `proc` if you have not already. It might help you reason if `a`, `b` and `c` are parameters to a function |
03:23:49 | FromDiscord | <BanannaMan> A, b and c are an array |
03:24:03 | FromDiscord | <that_dude.> sent a code paste, see https://play.nim-lang.org/#ix=4BFn |
03:24:06 | FromDiscord | <BanannaMan> Yep |
03:24:23 | FromDiscord | <BanannaMan> I dunno man. |
03:24:43 | FromDiscord | <that_dude.> Well just do the first one |
03:24:53 | FromDiscord | <that_dude.> What is it asking for? |
03:25:07 | FromDiscord | <BanannaMan> Maybe it's because I have a rudimentary amount of knowledge on how to write operands and use control flows properly |
03:26:18 | FromDiscord | <BanannaMan> How do I continuously practice the basics? |
03:26:43 | FromDiscord | <BanannaMan> Just go over everything in the nim tutorials? |
03:26:56 | FromDiscord | <BanannaMan> Maybe I should just do that |
03:27:04 | FromDiscord | <that_dude.> How much general programming experince do you have? |
03:28:46 | FromDiscord | <BanannaMan> In reply to @that_dude. "How much general programming": I spent a decade learning how to read and write C, C++, VB.Net, etc but I never mastered any of them. I know what a program does by looking at every component of it but I can't write my own projects. |
03:29:00 | FromDiscord | <BanannaMan> I guess it's because I didn't try hard enough or I just suck |
03:29:31 | FromDiscord | <that_dude.> I guess you have to turn on the creative part of your brain more |
03:30:02 | FromDiscord | <that_dude.> Generally your knowledge of other languages should carry over to this one as well. |
03:30:11 | FromDiscord | <BanannaMan> In reply to @that_dude. "I guess you have": That's a other issue. I have tons of wonderful ideas, but I don't have the expertise to make it happen |
03:30:12 | FromDiscord | <graveflo> Can you post what your current solution is to the triangle problem? I am curious. It will also help understand your thought process so maybe we can give a pointer or two |
03:31:04 | FromDiscord | <BanannaMan> In reply to @graveflo "Can you post what": https://media.discordapp.net/attachments/371759389889003532/1134327133708243055/20230727_233054.jpg |
03:31:20 | FromDiscord | <that_dude.> You can take a look into any of these https://nim-lang.org/documentation.html if you don't know what is possible in this lang yet |
03:31:57 | FromDiscord | <graveflo> alright the first is a misunderstanding of how the case statement works as well as `or` |
03:31:58 | FromDiscord | <BanannaMan> (edit) "a other" => "another" |
03:33:04 | FromDiscord | <that_dude.> So it looks like the spacing/indentation is wrong. Because Nim is white space significant, isEquilateral will always use return false due to an implicit false. The case part does get run, but not in the proc |
03:33:05 | FromDiscord | <graveflo> this is mostly just syntax, but I'll tell you that your woes will go away if you track the meaning and mechanics of these directives down to their source. You will be uncomfortable with any language if you don't understand it's fundamentals |
03:33:29 | FromDiscord | <that_dude.> (edit) "So it looks like ... the" added "one issue is that" |
03:34:05 | FromDiscord | <that_dude.> Also why are you trying to test if any of the numbers is a 3? |
03:34:25 | FromDiscord | <that_dude.> Aren't `a, b, c` the lengths of each side of a triangle? |
03:34:51 | FromDiscord | <graveflo> sent a code paste, see https://play.nim-lang.org/#ix=4BFp |
03:34:58 | FromDiscord | <that_dude.> Don't we have a bot in here that can run things? |
03:36:51 | FromDiscord | <graveflo> In a language like Nim, we may not immediately know what `or` means in the context of two integer values. One of the things it could do is conver the integers to bools and then do a logical or on them. It could also just do a bitwise or on them: https://en.wikipedia.org/wiki/Bitwise_operation#OR |
03:39:07 | FromDiscord | <graveflo> and when you are doing more than one conditional you should not need to say `case sides` because that is not relevant to the conditions. when you say `case sides` you are testing the values of `sides` against the value of each of the cases. You want to use `if` here instead and don't test `sides` instead test `a` `b` and `c` |
03:39:27 | FromDiscord | <graveflo> (edit) "values" => "value" |
03:41:29 | FromDiscord | <BanannaMan> Okay |
03:41:32 | FromDiscord | <BanannaMan> Thanks |
03:43:03 | FromDiscord | <graveflo> I think your indentation my be messed up too. Basically, you will not be so frustrated if you get pedantic about syntax and what everything "does". Once you understand that well then you won't get confused. You seem to understand the idea of what to do, you just don't know the language well enough to translate |
03:46:47 | FromDiscord | <BanannaMan> In reply to @graveflo "I think your indentation": Exactly |
03:46:57 | FromDiscord | <BanannaMan> And that goes for every language I know |
03:47:12 | FromDiscord | <BanannaMan> And I'm mad at myself for it because I don't know how to get better |
03:48:11 | FromDiscord | <that_dude.> If you don't have nim installed localy, you can just use this for testing. https://play.nim-lang.org/ |
03:48:30 | FromDiscord | <BanannaMan> I have it installed already |
03:48:38 | FromDiscord | <graveflo> I'm tell you, if this is a re-occuring problem then you are not diving deep enough into fundamentals. You really need to understand the logical rules or each language directive instead of just having a "feel" for how they work. Think like a computer sometimes |
03:48:40 | FromDiscord | <that_dude.> Can you make a hello world program from scratch? |
03:49:30 | FromDiscord | <that_dude.> I'm kinda struggling to on what angle of help ya need |
03:49:34 | FromDiscord | <that_dude.> (edit) "need" => "need, ya know" |
03:49:34 | FromDiscord | <BanannaMan> In reply to @graveflo "I'm tell you, if": You're right. I'll spend time to learn more about the fundamentals and build small programs to demonstrate my understanding |
03:49:59 | FromDiscord | <that_dude.> I think you should try to build the fibinocci functions |
03:50:34 | FromDiscord | <that_dude.> both recursive and not. |
03:50:53 | FromDiscord | <that_dude.> (edit) "fibinocci" => "fibonacci" |
03:51:26 | FromDiscord | <BanannaMan> In reply to @that_dude. "I think you should": Stahp |
04:15:39 | * | cornfeedhobo joined #nim |
04:48:43 | FromDiscord | <Phil> 😦 ↵No `find` proc in sequtils.↵Not a big deal, you can easily write your own in like 10 lines or so, but still bummer |
04:54:26 | FromDiscord | <Elegantbeef> `find` is in system |
04:54:26 | FromDiscord | <that_dude.> I've had a simmilar situation where I expected smth like a dist proc |
04:55:02 | FromDiscord | <that_dude.> Is there a reason that system things don't show up in the index? |
04:55:02 | FromDiscord | <Phil> 👀 |
04:55:23 | FromDiscord | <Elegantbeef> They do |
04:55:34 | FromDiscord | <Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/1134348400314290186/image.png |
04:55:45 | FromDiscord | <that_dude.> https://media.discordapp.net/attachments/371759389889003532/1134348444996206703/image.png |
04:55:58 | FromDiscord | <that_dude.> Fair |
04:56:07 | FromDiscord | <Elegantbeef> > Returns the first index of item in a or -1 if not found. This requires appropriate items and == operations to work. |
04:56:43 | FromDiscord | <that_dude.> Another question I've had, how come concepts aren't used more for things like this |
04:56:53 | FromDiscord | <that_dude.> Would it make things more confusing? |
04:56:57 | FromDiscord | <Phil> More in a FP sense, I'd want the first item for which a condition is true, should return Optional basically |
04:57:04 | FromDiscord | <Elegantbeef> Concepts are experimental is the only thing I can say |
04:57:20 | FromDiscord | <Phil> Or an index with a sentinel value if no entry in the list fulfills the condition, I'll take either |
04:57:55 | FromDiscord | <that_dude.> So like -1 that it returns? |
04:58:28 | FromDiscord | <Phil> If no value matches, yeah, it's one of the options.↵Optional of the actual value would be preferrable |
04:58:43 | FromDiscord | <Phil> Looking through the functional programming libs and I'm surprised that I'm not finding anything either |
04:59:39 | FromDiscord | <Phil> zero-functional seems to have one that returns index, but no docs on it |
05:03:24 | FromDiscord | <Phil> Ohhh nimfp also has it, it's just somewhat buried |
05:04:13 | FromDiscord | <Phil> But nimfp appears to make a giant linked list and that seems slow as hell |
05:04:31 | FromDiscord | <Phil> (edit) "make" => "first demand that seqs etc. must be" | removed "giant" |
05:10:38 | FromDiscord | <odexine> In reply to @isofruit "But nimfp appears to": not really? i mean test your hypotheses |
05:27:09 | FromDiscord | <Phil> Compared to arrays which cache much more nicely?↵I'm not willing to burn the 5 minutes to do that testing when I can't even see a conceptual reason why linked lists wouldn't be slow (compared to arrays) for what they're doing. |
05:27:33 | FromDiscord | <elamandeep> how to make post request in prologue? |
05:28:09 | FromDiscord | <Phil> As in make the prologue server itself send an http request?↵Or have prologue receive a POST request? |
05:29:09 | FromDiscord | <elamandeep> In reply to @isofruit "As in make the": recieve post request |
05:32:46 | FromDiscord | <Phil> In reply to @elamandeep "recieve post request": https://planety.github.io/prologue/routing/↵https://planety.github.io/prologue/coreapi/application.html#addRoute%2CPrologue%2Cstring%2CHandlerAsync%2CopenArray%5BHttpMethod%5D%2Cstring%2CopenArray%5BHandlerAsync%5D↵↵Take a look at the addRoute procs (there are multiple variants depending on how you want your route to look like), basically just add a route-handler using addRoute that use |
05:44:56 | FromDiscord | <elamandeep> In reply to @isofruit "https://planety.github.io/prologue/routing/ https:/": I'm really I'm not getting how to use it. |
05:45:09 | FromDiscord | <elamandeep> (edit) "I'm really" => "Really" |
05:46:33 | FromDiscord | <elamandeep> they don't have something like decorator |
05:47:00 | FromDiscord | <elamandeep> sent a code paste, see https://play.nim-lang.org/#ix=4BFO |
05:47:09 | FromDiscord | <elamandeep> (edit) |
05:48:06 | FromDiscord | <odexine> Nim does not have Python-style decorators, only something similar |
05:48:18 | FromDiscord | <odexine> But I assume they’re not used equivalently in prologue either |
05:56:10 | FromDiscord | <Phil> sent a long message, see http://ix.io/4BFQ |
05:56:48 | FromDiscord | <Phil> (edit) "http://ix.io/4BFQ" => "http://ix.io/4BFR" |
05:59:52 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4BFS |
06:29:03 | * | kenran joined #nim |
06:39:45 | FromDiscord | <egomind> Could you technically make decorators a thing in Nim? :ArcueidCurious: |
06:40:26 | FromDiscord | <egomind> Or is the @ just a reserved symbol that can't be used in macros |
06:40:42 | FromDiscord | <egomind> Ahhh, I wanna play around with the language |
06:41:27 | FromDiscord | <odexine> In reply to @egomind "Or is the @": It’s not reserved |
06:41:30 | * | rockcavera quit (Remote host closed the connection) |
06:41:42 | FromDiscord | <odexine> But syntax wouldn’t allow the macro to capture the function below |
06:41:45 | FromDiscord | <Phil> In reply to @egomind "Could you technically make": You could, you could also use pragmas I think for compile-time known data |
06:41:55 | FromDiscord | <egomind> In reply to @odexine "But syntax wouldn’t allow": Not even with indentation? |
06:42:03 | FromDiscord | <odexine> In reply to @egomind "Not even with indentation?": With indentation yes |
06:42:07 | FromDiscord | <odexine> You can |
06:42:11 | FromDiscord | <egomind> I see |
06:42:48 | FromDiscord | <odexine> I guess it might collide with sequence proc @ |
06:42:55 | FromDiscord | <odexine> Not sure how that would work but eh |
06:43:00 | FromDiscord | <Phil> But honestly I prefer not having to deal with decorator magic |
06:43:17 | FromDiscord | <Elegantbeef> Best just to use a different operator if one really wanted |
06:43:47 | FromDiscord | <egomind> Oh, yeah, I'd just do it for fun |
06:43:55 | FromDiscord | <egomind> I don't really like decorators most of the time |
06:44:23 | FromDiscord | <odexine> I’d say they’re fine |
06:44:52 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/4u3Cw |
06:45:22 | FromDiscord | <Phil> Yeah, context stuff I think could be an okay way of expressing things |
06:46:28 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4BG0 |
06:46:43 | FromDiscord | <Phil> (edit) "https://play.nim-lang.org/#ix=4BG0" => "https://play.nim-lang.org/#ix=4BG1" |
06:48:33 | FromDiscord | <Phil> And basically just have that mask generating an anonymous proc that you attach to `app` via an `addRoute` proc call. |
06:49:20 | FromDiscord | <Phil> (edit) "call." => "call for which you use the parameters passed to `HttpController`." |
06:50:19 | FromDiscord | <Phil> But still meh imo since it just hides some stuff |
06:54:40 | FromDiscord | <Phil> Funnily enough the mapping-proc-generator thing I started playing around with for a couple hours I originally tried to reimplement using pragmas for mapping annotations before thinking better of it and just writing a `Mapping` type that the mapping proc generator accepts |
06:55:02 | FromDiscord | <Phil> (edit) "Funnily enough the mapping-proc-generator thing I started playing around with for a couple hours I originally tried to reimplement using pragmas for mapping annotations before thinking better of it and just writing a `Mapping` type that the mapping proc generator accepts ... " added "directly.↵↵No dealing with pragmas involved because it's not necessary to make it that complicated" |
06:55:10 | FromDiscord | <Phil> (edit) "Funnily enough the mapping-proc-generator thing I started playing around with for a couple hours I originally tried to reimplement using pragmas for mapping annotations before thinking better of it and just writing a `Mapping` type that the mapping proc generator accepts directly.↵↵No dealing with pragmas ... involved" added "or annotations" |
07:13:42 | * | ntat joined #nim |
09:02:35 | * | ntat quit (Quit: leaving) |
09:19:54 | * | disso-peach joined #nim |
09:24:12 | FromDiscord | <mesosan> hello |
09:25:35 | FromDiscord | <mesosan> sent a code paste, see https://play.nim-lang.org/#ix=4BGv |
09:25:41 | * | junaid_ joined #nim |
09:25:51 | FromDiscord | <mesosan> like i know that nim can compile to js |
09:26:09 | FromDiscord | <mesosan> but can we use prewritten js modules in nim? |
09:26:26 | FromDiscord | <mesosan> cus otherwise writing everything for nim doesn't seem ideal |
09:26:45 | FromDiscord | <mesosan> also if yes, then say i compile this code to cpp, now would that be possible? |
09:27:04 | FromDiscord | <mesosan> since i am using a js module import in nim code and compiling to cpp |
09:31:15 | FromDiscord | <odexine> it kinda makes no sense that it would work in C++ |
09:31:24 | FromDiscord | <odexine> In reply to @mesosan "guys does nim support": but yes its possible iirc |
09:31:33 | FromDiscord | <odexine> just use {.emit: "js code here".} |
09:32:28 | FromDiscord | <mesosan> In reply to @odexine "but yes its possible": damn |
09:32:47 | FromDiscord | <odexine> it needs a bit of setup but its possible |
09:32:48 | FromDiscord | <mesosan> so me calling a js function in nim that was imported from a js module was legal? |
09:32:51 | FromDiscord | <mesosan> wow |
09:33:06 | FromDiscord | <odexine> yeah you can call js implemented functions in nim |
09:33:35 | FromDiscord | <odexine> you just need to uh tell nim what the signature is via importc, theres a lot more details to this |
09:33:36 | FromDiscord | <mesosan> does nim have a ast transformer to nim and from nim for every lang |
09:33:41 | FromDiscord | <odexine> noi |
09:33:41 | FromDiscord | <mesosan> cus this is some mindblwoing stuff |
09:33:48 | FromDiscord | <mesosan> how does it do js to cpp then |
09:33:55 | FromDiscord | <odexine> wdym? |
09:33:59 | FromDiscord | <odexine> if you import js you must compile to js |
09:34:04 | FromDiscord | <mesosan> oh |
09:34:18 | FromDiscord | <mesosan> In reply to @odexine "it kinda makes no": i mean it may not working in js |
09:34:22 | FromDiscord | <mesosan> (edit) "js" => "cpp" |
09:34:26 | FromDiscord | <mesosan> but can i compile to cpp |
09:34:38 | FromDiscord | <odexine> i dont understand |
09:34:54 | FromDiscord | <odexine> you want to put javascript code into your nim code but then compile to c++? |
09:35:06 | FromDiscord | <mesosan> yes, maybe not imported javascript code |
09:35:11 | FromDiscord | <mesosan> explicitly written one if that helps |
09:35:27 | FromDiscord | <odexine> i dont really understand, do you just want to store the code as a string or something? |
09:38:21 | FromDiscord | <mesosan> sent a code paste, see https://play.nim-lang.org/#ix=4BGy |
09:38:32 | FromDiscord | <mesosan> (edit) "https://play.nim-lang.org/#ix=4BGy" => "https://play.nim-lang.org/#ix=4BGz" |
09:38:32 | FromDiscord | <mesosan> so can i compile this to cpp? |
09:38:41 | FromDiscord | <mesosan> like i haven't imported any external js |
09:38:55 | FromDiscord | <mesosan> and the js used is not depending on any special js runtime features |
09:39:06 | FromDiscord | <mesosan> (edit) "features" => "features/environment" |
09:39:13 | FromDiscord | <mesosan> so i am hoping that this can compile to cpp |
09:39:27 | FromDiscord | <mesosan> (edit) "https://play.nim-lang.org/#ix=4BGz" => "https://play.nim-lang.org/#ix=4BGA" |
09:40:35 | FromDiscord | <odexine> no |
09:40:47 | FromDiscord | <odexine> js code will not work in c++ |
09:40:55 | FromDiscord | <odexine> nim makes no effort to translate anything like that |
09:41:29 | FromDiscord | <mesosan> okay |
09:41:39 | FromDiscord | <mesosan> do you any langs that allow this kind of thing |
09:41:43 | * | junaid_ quit (Remote host closed the connection) |
09:41:52 | FromDiscord | <mesosan> like they allow embeding other langs in their synyax |
09:42:00 | FromDiscord | <mesosan> and then transpile to diff langs |
09:42:05 | FromDiscord | <mesosan> (edit) "synyax" => "syntax" |
09:42:11 | FromDiscord | <mesosan> even if very limited in scop |
09:42:13 | FromDiscord | <mesosan> (edit) "scop" => "scope" |
09:45:13 | FromDiscord | <mesosan> In reply to @odexine "just use {.emit: "js": okk so this would just emit the code in {.emit} directly right? |
09:45:26 | FromDiscord | <mesosan> cus now that target lang is fixed there is no real transpiling involved |
09:45:35 | FromDiscord | <mesosan> except for the nim syntax |
09:46:01 | FromDiscord | <odexine> In reply to @mesosan "do you know any": no |
09:46:07 | FromDiscord | <odexine> because that's a herculean effort |
09:47:15 | FromDiscord | <mesosan> truly |
09:47:45 | FromDiscord | <mesosan> i think what could make it simpler would be writing ast transformers to and from the lang |
09:48:01 | FromDiscord | <mesosan> like nim to cpp already exists |
09:48:16 | FromDiscord | <mesosan> but if cpp to nim existed (even if with limited support) |
09:48:26 | FromDiscord | <mesosan> then nim to js could be performed by chaining |
09:48:33 | FromDiscord | <mesosan> so cpp to js would be possible |
09:48:41 | FromDiscord | <mesosan> like to and from for each lang with the arbitrary lang |
09:49:00 | FromDiscord | <mesosan> would that work? or am i just too new to this stuff to see what will fail |
09:50:56 | FromDiscord | <graveflo> It would "work" but it would be weird and there would have to be 0 non-agnostic code. The issues would be in nim compiler internal features like the pragmas. It's just not very feasible. Not worth the effort either |
09:52:53 | FromDiscord | <mesosan> In reply to @graveflo "It would "work" but": true, i think it can be feasiable in very small scoped enviornments like say simple scripting langs like bash and batch |
09:52:57 | FromDiscord | <mesosan> maybe not with a lang like nim |
09:53:00 | FromDiscord | <mesosan> maybe something simpler |
09:53:20 | FromDiscord | <graveflo> also C and C++ syntax is pretty complicated I think. It would be no small task to implement a lexer for that |
09:53:40 | FromDiscord | <mesosan> yeah, makes sense :(( |
09:53:56 | FromDiscord | <mesosan> what do you think about the bash/bat thing i said above |
09:54:08 | FromDiscord | <mesosan> actually i wanna make my compiler course project this |
09:54:14 | FromDiscord | <mesosan> with bash and batch as the target langs |
09:54:24 | FromDiscord | <mesosan> that's why polling what's feasiable and what not |
09:55:39 | FromDiscord | <graveflo> can you reply to it? |
09:55:43 | FromDiscord | <graveflo> so i can see |
09:58:53 | FromDiscord | <graveflo> also look at futhark if you want an example if a macro that reads C syntax and emits Nim code. It's not what you are trying to do but at least it's relatable |
09:59:07 | FromDiscord | <graveflo> (edit) "if a macro" => "of macros" |
10:01:10 | FromDiscord | <mesosan> In reply to @graveflo "can you reply to": oh one sec |
10:01:19 | FromDiscord | <mesosan> In reply to @mesosan "true, i think it": this one |
10:03:35 | FromDiscord | <mesosan> sent a code paste, see https://play.nim-lang.org/#ix=4BGI |
10:03:48 | FromDiscord | <mesosan> (edit) |
10:04:03 | FromDiscord | <mesosan> so it is a lang that allows bash and batch embedding and compiles to bash and batch |
10:04:29 | FromDiscord | <mesosan> so my plan is to write ast transformer from this lang and to this lang from both bash and batch |
10:05:27 | FromDiscord | <mesosan> unfortunately this does mean that you can only use those features of bash in this if compiling to batch that exist in the new lang |
10:05:48 | FromDiscord | <mesosan> since it is gonna act as the middleware |
10:08:38 | FromDiscord | <graveflo> alright, well. That isn't impossible but I suppose that means you'll be implementing bash functions in Nim. At that point one could also just use Nim to call the bash functions. As far as Nim "as is" is concerned the meta-programming does not let you step out of the bounds of the syntax spec, so youll have to wrap direct bash embeds in strings unless you add a new level of meta programming to Nim. It's actually not hard to make a `proc` |
10:09:27 | FromDiscord | <graveflo> I'm not sure if the bash back end to Nim will work out just from a coverage standpoint but I'm not going to say impossible |
10:11:11 | * | ntat joined #nim |
10:12:22 | * | ntat quit (Remote host closed the connection) |
10:12:49 | * | ntat joined #nim |
10:16:55 | FromDiscord | <mesosan> In reply to @graveflo "alright, well. That isn't": that meks sense |
10:17:00 | FromDiscord | <mesosan> (edit) "meks" => "makes" |
10:17:12 | FromDiscord | <mesosan> ok considering nim to not be the middleware language |
10:17:29 | FromDiscord | <mesosan> let's say it's some arbitrary new lang made for just this purpose |
10:18:31 | FromDiscord | <mesosan> it's definitely not ideal to sue the new lang as the middleware tbh |
10:18:59 | FromDiscord | <mesosan> cus then what is even the point of having the option to write bash |
10:19:02 | FromDiscord | <mesosan> (edit) "bash" => "bash/batch" |
10:19:32 | FromDiscord | <mesosan> since you're limited by the functionality of the new lang |
10:21:08 | FromDiscord | <graveflo> its fine to use Nim as the middleware. I was just letting you know some limitations. I can't help you much otherwise since this is your idea. I would just write Nim funcs that do what I want and then use Nim instead of bash / other lang 😅 |
10:22:58 | FromDiscord | <mesosan> that makes sense |
10:23:04 | FromDiscord | <mesosan> thanks for your time! |
10:24:48 | * | ntat quit (Quit: leaving) |
10:58:44 | FromDiscord | <gogolxdong666> Is waitForAll is still there or any replacement? |
11:02:28 | FromDiscord | <gogolxdong666> in another word is how to wait multiple Future |
11:28:00 | * | grom358 joined #nim |
11:45:35 | FromDiscord | <elamandeep> sent a code paste, see https://play.nim-lang.org/#ix=4BH7 |
11:46:17 | FromDiscord | <elamandeep> unable to connect database |
12:08:30 | * | grom358 quit (Quit: Client closed) |
12:10:22 | NimEventer | New post on r/nim by qtless: Big Components Update, see https://reddit.com/r/nim/comments/15bvotx/big_components_update/ |
12:21:37 | * | jjido joined #nim |
12:27:56 | * | cyraxjoe quit (Ping timeout: 244 seconds) |
12:34:42 | * | kenran quit (Remote host closed the connection) |
12:41:12 | * | jmd_ quit (Ping timeout: 246 seconds) |
13:02:26 | FromDiscord | <Dale Y Pearlman> Do you know that you can earn $5,000 or more weekly from crypto Trading? With Just $500… 100% Inbox Admin on Telegram for more details 👇👇👇👇👇👇 https://t.me/PROFITSWITHSTEVE |
13:18:21 | * | azimut joined #nim |
13:35:53 | * | lucasta joined #nim |
13:37:06 | * | lucasta quit (Remote host closed the connection) |
13:37:31 | * | lucasta joined #nim |
13:43:51 | * | jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…) |
14:06:14 | * | rockcavera joined #nim |
14:36:45 | om3ga | /qiot |
14:41:15 | FromDiscord | <odexine> whoops misspelled quit |
14:41:17 | FromDiscord | <odexine> 😛 |
14:41:23 | FromDiscord | <odexine> (edit) "whoops ... misspelled" added "ya" |
16:44:07 | * | ntat joined #nim |
16:50:00 | * | lucasta quit (Quit: Leaving) |
17:01:45 | * | ntat quit (Quit: leaving) |
17:02:18 | * | ntat joined #nim |
17:04:53 | * | xet7 quit (Read error: Connection reset by peer) |
17:09:00 | * | jmdaemon joined #nim |
17:37:05 | * | jjido joined #nim |
17:45:41 | * | jjido quit (Ping timeout: 260 seconds) |
17:51:01 | * | ntat quit (Quit: leaving) |
18:28:15 | * | xet7 joined #nim |
19:12:40 | NimEventer | New Nimble package! chatgptclient - Native gui client for OpenAI chatgpt, see https://github.com/jaredmontoya/chatgptclient |
19:26:42 | * | ntat joined #nim |
19:54:28 | FromDiscord | <Phil> Okay, time to head into battle.↵Somehow I want to turn `x, "y.z"` into `x.y.z` but basically the static string can be unknown levels deep. |
19:54:41 | FromDiscord | <Phil> (edit) "battle.↵Somehow" => "battle and expand the final piece of functionality to my mapping thing.↵Somehow" |
19:55:31 | FromDiscord | <Phil> I think first guess would be to turn "y.z" into a static seq and statically iterate over that seq (?) |
19:55:55 | FromDiscord | <Phil> (edit) "(?)" => "to do individual field fetches(?)" |
20:04:49 | FromDiscord | <Phil> Oh god do I need to solve this with a recursive macro? |
20:25:39 | FromDiscord | <Elegantbeef> Depends @Phil how complex will the string be? |
20:25:52 | FromDiscord | <Elegantbeef> it wont be like `x[0].y.z[3].w[a]`? |
20:26:10 | FromDiscord | <Phil> only ever "x.y.z", no index access |
20:26:30 | FromDiscord | <Phil> And I think also no map access, I think with what I recall from macros I'm getting somewhere |
20:26:46 | FromDiscord | <Phil> Since I think I can just loop over the elements and create a dot expression with a dot expression etc. |
20:27:57 | FromDiscord | <Phil> Macros can return the final expression in the shape of a NimNode that they want to generate, right? |
20:29:03 | FromDiscord | <Elegantbeef> Also insert an error |
20:29:04 | FromDiscord | <Elegantbeef> `result = a` whoops |
20:29:10 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/0BJTs |
20:29:42 | FromDiscord | <Phil> Ah dang, you were faster |
20:29:43 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4BIW |
20:30:08 | FromDiscord | <Phil> And further ahead, hadn't done the transformation of static string to static seq yet |
20:30:23 | FromDiscord | <Elegantbeef> I'm just better 😛 |
20:30:42 | FromDiscord | <Phil> Given that this is literally the first macro I wrote on my lonesome I'm pretty proud on how quickly I managed to throw that together |
20:32:30 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4BIY |
20:32:55 | FromDiscord | <Elegantbeef> I did say it's `result = a` |
20:33:40 | FromDiscord | <Phil> Okay yeah that did the thing |
20:36:21 | * | Guest__ joined #nim |
20:47:27 | FromDiscord | <Phil> ... is there a way to only have to define an object variant generic over a single field and treating the object variant as generic is only required when it is of that particular kind?↵... I know the answer is no but still |
20:47:41 | FromDiscord | <Phil> (edit) "kind?↵..." => "kind that has the generic field?↵..." |
20:48:35 | * | ntat quit (Quit: leaving) |
20:52:10 | FromDiscord | <huantian> that's a lotta words |
20:54:22 | * | ntat joined #nim |
20:55:52 | FromDiscord | <Elegantbeef> @Phil I assume you just want all the none generic delimited branches implicitly converted to another type? |
20:56:49 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/WFo2U |
20:56:53 | FromDiscord | <Phil> Found a different way to do the thing, I'm good.↵It was that I wanted to store constant values of unknown types in a seq of the same object variant.↵But I solve it the same way I do it elsewhere now, by just using function pointers |
20:57:11 | FromDiscord | <Phil> Though now I need to figure out how to access the pointer to an anonymous function |
20:57:14 | FromDiscord | <Phil> (edit) "function" => "proc" |
20:57:36 | FromDiscord | <Elegantbeef> The anonymous proc is a pointer |
20:57:56 | FromDiscord | <Elegantbeef> Unless it's a closure |
20:58:00 | FromDiscord | <Elegantbeef> Then it's an `(env, proc)` |
20:58:02 | FromDiscord | <Phil> It is a closure |
20:58:28 | FromDiscord | <Elegantbeef> `rawProc` |
20:58:33 | FromDiscord | <Elegantbeef> `rawEnv` |
20:59:21 | FromDiscord | <Elegantbeef> Alternatively if possible only use nimcall and make your life easier |
21:00:36 | FromDiscord | <Phil> I mean, I'm essentially trying to turn a value into a proc that returns the value, closure seems like the only choice here |
21:01:21 | FromDiscord | <Elegantbeef> You're thunking |
21:01:35 | FromDiscord | <Elegantbeef> Depending on what you're doing that could be derived from the arguments of a procedure |
21:02:08 | FromDiscord | <Phil> One sec |
21:03:37 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4BJa |
21:04:15 | FromDiscord | <Phil> Later I'm casting pointer to a proc-type that I'm inferring it must be to map an inferred type A to an inferred type B, that is the operation that seems to fail here. |
21:06:32 | * | tiorock joined #nim |
21:06:32 | * | rockcavera is now known as Guest1370 |
21:06:32 | * | Guest1370 quit (Killed (cadmium.libera.chat (Nickname regained by services))) |
21:06:33 | * | tiorock is now known as rockcavera |
21:09:10 | FromDiscord | <Phil> Essentially I don't really want the type, I'll infer it later which will blow up if the user throws in something invalid |
21:20:10 | * | ntat quit (Quit: leaving) |
21:25:54 | * | Guest__ quit (Remote host closed the connection) |
21:32:10 | FromDiscord | <Elegantbeef> You're doing type erasure so yea |
21:33:18 | * | Guest_ joined #nim |
21:34:50 | FromDiscord | <Phil> That's pretty much what I want to do, "Screw you type, I know what you will be later" |
21:35:00 | FromDiscord | <Elegantbeef> `pointer` |
21:35:04 | * | Guest_ is now known as ajunior |
21:35:47 | FromDiscord | <Phil> Yeah but how do I get the closure into a pointer without it blowing up in my face?↵I have to carry the environment around as well, right? |
21:35:58 | FromDiscord | <Elegantbeef> correct |
21:36:16 | FromDiscord | <Elegantbeef> Though I do have to ask what's the point in the closure? |
21:36:24 | FromDiscord | <Elegantbeef> You arent even thunking it properly |
21:36:34 | FromDiscord | <Phil> I dunno what you mean by thunking |
21:36:44 | FromDiscord | <Elegantbeef> At this point you should just use `ref T` |
21:37:00 | FromDiscord | <Elegantbeef> Thunking is a process of delaying a instantiation but using a procedure |
21:37:05 | FromDiscord | <Phil> But generally:↵I'm writing a proc that generates mapping procs, that transform type A to B |
21:37:08 | FromDiscord | <Elegantbeef> so instead of taking `T` you take `proc(): T` |
21:37:48 | FromDiscord | <Phil> For any fields for which I can't say "Oh, same name on both types and they both have the same type? just transfer the value over" I demand the user give me so called "Mapping" objects that define stuff |
21:38:13 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4BJt |
21:38:56 | FromDiscord | <Phil> Like maybe one type has a field `name` and the other has `otherName`, they give me the MappingObject that expresses that contains both names and when generating the proc I transfer the value from `otherName` on type A to field `name` on type B |
21:38:58 | FromDiscord | <Elegantbeef> If you're making procs that convert between types why isnt there a parameter? |
21:39:50 | FromDiscord | <Elegantbeef> I do not get why this is done dynamically, but yea I do not get how this is converting anything |
21:40:16 | FromDiscord | <Phil> You might just want to define that a field on type B gets fed with a constant value instead of a value from type A |
21:40:19 | FromDiscord | <Phil> That's what I'm adding |
21:40:49 | FromDiscord | <Phil> So I need to store that constant value somewhere.↵If I store it in the `Mapping` object, I need to deal with `Mapping` suddenly becoming a generic object which is a PITA |
21:41:51 | FromDiscord | <Phil> The alternative I could think of was turning it into a proc, storing the pointer and cast the pointer into `proc(): <The Type of the Field where this mapping gets applied to>` later on then execute it |
21:42:29 | FromDiscord | <Elegantbeef> I'm a bit stupid cause I'm wondering why this isnt just `proc convertTo(a: MyType, dest: typedesc[Target]): Target` |
21:43:11 | FromDiscord | <Phil> Because it's a lib to generate mapping procs↵`proc generateMapper[SOURCETYPE, TARGETTYPE](x: typedesc[SOURCETYPE], y: typedesc[TARGETTYPE], mappings: static seq[Mapping]): MapProc[SOURCETYPE, TARGETTYPE] =` |
21:44:08 | FromDiscord | <Elegantbeef> This is in a whole different postal code from me, so I'll just shush |
21:49:06 | FromDiscord | <Chronos [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4BJv |
21:49:15 | FromDiscord | <Chronos [She/Her]> (edit) "https://play.nim-lang.org/#ix=4BJv" => "https://play.nim-lang.org/#ix=4BJw" |
21:50:53 | FromDiscord | <Elegantbeef> No you shouldnt cause that's not Nim |
21:51:50 | FromDiscord | <Elegantbeef> Given that there's not much reason to have your smaller integers use a smaller sized integer there is no reason not to do `of IntLiterals: intVal: int` |
21:51:52 | FromDiscord | <Chronos [She/Her]> I can't remember the exact syntax rn but something like that |
21:52:04 | FromDiscord | <System64 ~ Flandre Scarlet> https://github.com/vanyle/NimPlus↵Is it nice? |
21:52:39 | FromDiscord | <Chronos [She/Her]> In reply to @Elegantbeef "Given that there's not": Fair and makes sense |
22:01:41 | FromDiscord | <Elegantbeef> You also get to define what happens for overflow |
22:08:16 | FromDiscord | <Chronos [She/Her]> Unless it's int64 |
22:08:28 | FromDiscord | <Chronos [She/Her]> Well, still can but with manual checks and stuff |
22:08:43 | FromDiscord | <Chronos [She/Her]> Preventing it from ever going beyond it's max value |
22:08:50 | FromDiscord | <Chronos [She/Her]> Idk what I'm saying I am sleep deprived |
22:26:08 | * | xet7 quit (Remote host closed the connection) |