<< 16-08-2023 >>

00:04:29FromDiscord<_gumbercules> I remember talking to you years ago about Scala collections in here - I think even before Nim discord was a thing (I think the Gitter bridge was at thing then)
00:09:48FromDiscord<eb442a17a2aaee577399ca9e38eb67b5> Compiled nim files are PE's right?
00:11:06FromDiscord<eb442a17a2aaee577399ca9e38eb67b5> How do I compile nim down to a C# executable
00:11:11FromDiscord<eb442a17a2aaee577399ca9e38eb67b5> (edit) "How do I compile nim down to a C# ... executable" added ".NET"
00:11:17FromDiscord<eb442a17a2aaee577399ca9e38eb67b5> or is it not possible
00:14:19FromDiscord<_gumbercules> You don't because Nim doesn't have a .NET backend
00:14:40FromDiscord<_gumbercules> You would instead compile your Nim program to a DLL and call into it from C#
00:14:42FromDiscord<eb442a17a2aaee577399ca9e38eb67b5> How does winim work then?
00:14:45FromDiscord<_gumbercules> or a static library
00:15:13FromDiscord<_gumbercules> winim simply wraps C/C++ APIs that the windows SDK exposes
00:15:34FromDiscord<eb442a17a2aaee577399ca9e38eb67b5> ok
00:16:04FromDiscord<eb442a17a2aaee577399ca9e38eb67b5> Would this work? found it on github
00:16:05FromDiscord<eb442a17a2aaee577399ca9e38eb67b5> sent a code paste, see https://play.nim-lang.org/#ix=4DBT
00:16:31FromDiscord<_gumbercules> Well...
00:17:48FromDiscord<_gumbercules> to be honest, I haven't done this sort of thing before because I just use Nim and not much C#. The `stdcall`, `exportc` and `dynlib` pragmas all look correct. As for the naming of `DllMain` / `importc` of `NimMain` I cannot say. I also don't know how you'd consume this in a C# program. If you're finding stuff on Github though - it's probably going to be better than whatever I can offer.
00:18:16FromDiscord<_gumbercules> https://stackoverflow.com/questions/33348222/how-to-create-a-nim-dll-and-call-it-from-c-sharp↵https://www.euantorano.co.uk/posts/2016/09/30/nim-with-c-sharp-net/
00:18:32FromDiscord<_gumbercules> https://gist.github.com/zah/fe8f5956684abee6bec9 - Generally you can trust stuff from Zahary
00:30:44FromDiscord<heysokam> is there an existing pragma for `{.passC: "-I/some/path".}` for C headers? 🤔
00:31:22FromDiscord<heysokam> something like `{.link.}`, but for includes
00:40:42FromDiscord<Elegantbeef> Other than `emit:"/INCLUDESECTION/...."`
00:40:48FromDiscord<Elegantbeef> ?
00:41:21*Guest50 joined #nim
00:42:06*Guest50 quit (Client Quit)
01:00:48*cnx quit (Remote host closed the connection)
01:02:03*cnx joined #nim
01:21:40*lucasta_ joined #nim
01:24:49FromDiscord<heysokam> sent a code paste, see https://play.nim-lang.org/#ix=4DC7
01:25:09FromDiscord<heysokam> (edit) "https://play.nim-lang.org/#ix=4DC7" => "https://play.nim-lang.org/#ix=4DC8"
01:30:55*krux02 quit (Remote host closed the connection)
01:30:58FromDiscord<eb442a17a2aaee577399ca9e38eb67b5> tf?
01:31:01FromDiscord<eb442a17a2aaee577399ca9e38eb67b5> sent a code paste, see https://play.nim-lang.org/#ix=4DCa
01:31:23FromDiscord<Elegantbeef> epoch time doesnt take a float
01:31:35FromDiscord<Elegantbeef> It returns a float
01:31:38FromDiscord<eb442a17a2aaee577399ca9e38eb67b5> What does it take then, because it says float
01:31:41FromDiscord<eb442a17a2aaee577399ca9e38eb67b5> oh
01:31:44FromDiscord<eb442a17a2aaee577399ca9e38eb67b5> So what do I give it?
01:31:53FromDiscord<Elegantbeef> Nothing
01:42:37FromDiscord<terrygillis> sent a code paste, see https://play.nim-lang.org/#ix=4DCc
01:42:59FromDiscord<terrygillis> (edit) "https://play.nim-lang.org/#ix=4DCc" => "https://play.nim-lang.org/#ix=4DCd"
01:43:58FromDiscord<Elegantbeef> The output as in the generate code does not actually export the symbol, or `repr` doesnt show the ``?
01:44:30FromDiscord<terrygillis> The output doesn't export the symbol
01:44:48FromDiscord<Elegantbeef> Well without an actual test case I can only say "you're wrong"
01:46:00FromDiscord<terrygillis> And it only happened with type names e.g: `type A =` but the fields of object variants still include (`field1: int, field2: string`)
01:51:03FromDiscord<terrygillis> https://play.nim-lang.org/#ix=4DCf a reproduction of my problem
01:51:40FromDiscord<terrygillis> despite the nnkPostfix it doesn't output the after the type name "DEMO"
01:52:34FromDiscord<terrygillis> neither is it included when exported to a string
01:52:48FromDiscord<Elegantbeef> Well then it's not in the ast
01:52:51FromDiscord<Elegantbeef> `echo result.treeRepr`
01:55:32FromDiscord<terrygillis> In reply to @Elegantbeef "`echo result.treeRepr`": when echoing that in the macro itself it does include in the
01:56:44FromDiscord<terrygillis> in fact `echo result.repr` in the macro ITSELF includes it but once it leaves the macro the postfix just disappear
01:57:12FromDiscord<Elegantbeef> Are you inside a block where exporting is not sensible?
01:57:28FromDiscord<Elegantbeef> Without the code it's impossible to say the issue
01:57:34FromDiscord<terrygillis> https://play.nim-lang.org/#ix=4DCh
01:58:30FromDiscord<terrygillis> somehow the macro invocation sanitised away the star postfix as in the snippet
01:59:02FromDiscord<Elegantbeef> But it's actually exported
01:59:54FromDiscord<Elegantbeef> You're echoing typed ast `` is dropped cause it's not needed
02:00:31FromDiscord<terrygillis> Is there any way to retain the
02:00:35FromDiscord<terrygillis> (edit) "Is there any way to retain the ... " added "?"
02:00:57FromDiscord<Elegantbeef> Change the compiler so it's rendering of PNodes includes `` inside exported typedefs
02:01:32FromDiscord<Elegantbeef> Write your own stringification procedure
02:03:03FromDiscord<terrygillis> Now if only there were some magic that turns me into a compiler dev 🤣
02:03:21FromDiscord<Elegantbeef> That's always the step beforebeing one
02:05:11FromDiscord<Elegantbeef> https://github.com/nim-lang/Nim/blob/ade75a148332e670244a719202f7f0337d2e469a/compiler/renderer.nim#L1501-L1509 How hard could it be!
02:10:51FromDiscord<terrygillis> https://github.com/nim-lang/Nim/blob/ade75a148332e670244a719202f7f0337d2e469a/compiler/renderer.nim#L82C6-L82C6 Is this where the problem begins. Just speculating for fun because I don't know shit 😆
02:11:42FromDiscord<Elegantbeef> The issue isnt really in `isExported` as much as the writing the symbol
02:11:55FromDiscord<Elegantbeef> There is no `TypeSection` inside g.inside\`
02:13:52FromDiscord<Elegantbeef> The `gsub` proc is basically just a big old state machine for rendering the AST
02:14:08FromDiscord<Elegantbeef> right now there just is no logic inside `nkTypeDef` to rendere the exported marker
02:14:42FromDiscord<ahungry> hi all - I'm trying a simple usage of httpClient - I'm stumbling on lack of SSL support, as I have openssl 3.1.2, and openssl 1.1 both installed (arch linux) - is there a setup or configuration step I need to do? (I don't see -dev or -lib versions of either of these in my package manager)
02:15:12FromDiscord<odexine> So what’s the issue you get
02:16:03FromDiscord<ahungry> What packages or libs do I need to install? or is the `-d:ssl` flag telling it "go ahead and include ssl in the compilation"? Maybe I was stupidly misreading that, thinking I could compile without SSL support and only hit http URLs
02:16:38FromDiscord<Elegantbeef> Basically all one really has to do terry is check if it's an exported symbol inside the `nkTypeDef` case and if so write a `` after it, it's really simple, but my urge to get more people tinkering says "have fun" 😄
02:17:03FromDiscord<Elegantbeef> Without ssl you should be able to request http
02:17:56FromDiscord<odexine> In reply to @ahungry "What packages or libs": The define flag does make Nim include SSL support, what did you assume it did? As a genuine question
02:18:16FromDiscord<ahungry> I thought it told it, "go ahead and compile without ssl" - like an http only client (as opposed to an https client)
02:18:38FromDiscord<ahungry> I have no idea why my brain went there, but it's great to feel like a noob in a language and learn something often 😂
02:18:57FromDiscord<odexine> Kinda weird lol
02:19:07FromDiscord<ahungry> Just the base compilation failing, I figured those were my options - fix libssl for global inclusion, or re-compile and use a D flag to omit entirely
02:19:57FromDiscord<ahungry> I had to go into the office for 9 hours today, for the first time in 4 years - apparently it friend my brain 🤣
02:20:08FromDiscord<ahungry> (edit) "friend" => "fried"
02:20:21FromDiscord<Elegantbeef> You see ivan when you do `--threads:off` what you're really saying is "turn the thread off switch on, so we have threads enabled"
02:20:42FromDiscord<odexine> Oh shit I can see beef’s dog again
02:20:51FromDiscord<Elegantbeef> We're back bitches!
02:21:08FromDiscord<Elegantbeef> CGI tongue looking mother fucker is back!
02:32:05FromDiscord<jordan4ibanez> https://tenor.com/view/sad-dog-gif-24691979
02:33:09FromDiscord<requiresupport> sent a code paste, see https://play.nim-lang.org/#ix=4DCn
02:34:07FromDiscord<Elegantbeef> take the address of `Object` offset it by `Pos sizeof(DWord) and assign `Val\` to that I believe
02:34:23FromDiscord<requiresupport> I think so too, is this possible in nim?
02:34:40FromDiscord<Elegantbeef> It's possible of course
02:34:41FromDiscord<Elegantbeef> It's just dumb
02:34:48FromDiscord<Elegantbeef> You lose all type safety
02:35:01FromDiscord<requiresupport> any other non dumb way I can do this
02:35:14FromDiscord<Elegantbeef> Use a case statement
02:35:43FromDiscord<requiresupport> thanks 🙏
02:35:45FromDiscord<Elegantbeef> But the Nim way is `cast[ptr UncheckedArray[DWord]](obj.f1.addr)[int pos] = val`
02:35:51FromDiscord<Elegantbeef> But it's so dumb it's not funny
02:36:15FromDiscord<Elegantbeef> If you want an array use an array why would one use pointer arithmetic this way
02:36:53FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4DCo
02:37:10FromDiscord<Elegantbeef> Then you just do `myType.fields[Field pos] = val`
02:38:37FromDiscord<Elegantbeef> And if one really wanted to have `.f1` as a field they could make properties, all without the manic code
02:54:43FromDiscord<acek7> been out of the nim scene for a bit, whats new?
02:56:12FromDiscord<odexine> the major version number
02:57:09FromDiscord<intellij_gamer> Orc is new default memory management
02:57:22FromDiscord<intellij_gamer> (edit) "Orc is new default memory management ... " added "(reason for the new major number)"
02:58:08FromDiscord<acek7> still compatiable with all the projects everyone has done?
03:00:20FromDiscord<Elegantbeef> Assuming they didnt rely on some odd refc behaviour
03:01:03FromDiscord<acek7> cool cool
03:01:08FromDiscord<acek7> whats the best way for me to upgrade?
03:01:13FromDiscord<odexine> In reply to @acek7 "still compatiable with all": mostly, nothing like python 3
03:01:22FromDiscord<acek7> Do i uninstall the old one
03:01:23FromDiscord<odexine> what did you originally use to install nim?
03:01:48FromDiscord<acek7> just the manual way of dropping the folder in the program files directory and setting up the environment path
03:02:26FromDiscord<odexine> theres this thing called choosenim which automates that, maybe you can use that instead of the manual way
03:02:37FromDiscord<odexine> unless you use a specific compiler? even if, its prolly easier
03:02:59FromDiscord<acek7> ill look into that
03:38:09FromDiscord<jos7388> @ElegantBeouf is there a lib to embed nimscript nicely? like generated bindings ands tuff
03:38:11FromDiscord<jos7388> (edit) "ands tuff" => "and stuff"
03:38:38FromDiscord<Elegantbeef> Part of nimscripter is that
03:38:55FromDiscord<Elegantbeef> It's not ideal though as it didnt make a proper nim file one could import
03:40:07FromDiscord<jos7388> okey dokey
03:40:11FromDiscord<jos7388> ill look at it ty
03:46:31FromDiscord<Elegantbeef> I do need to remake that for my dynamically loaded api, but I think some parts of that API are a dead end
03:46:58FromDiscord<Elegantbeef> For typedefs and the like it makes a lot of sense, but for procs it doesnt make much sense
04:28:03FromDiscord<jos7388> is it possible to get like a custom ref object
04:28:12FromDiscord<jos7388> like `type X = my_thing: poop`
04:28:16FromDiscord<jos7388> in place of ref object
04:28:20FromDiscord<jos7388> i dont really know what you would call that
04:28:47FromDiscord<jos7388> but i just wanna wrap `ref object`, and add some pragmas on it
04:29:07FromDiscord<jos7388> so my_thing would just convert to `type X {.requiresInit.} = ref object: poop`
04:29:33FromDiscord<jos7388> (edit) "so my_thing would just convert to `type X {.requiresInit.} = ref object: poop`" => "sent a code paste, see https://play.nim-lang.org/#ix=4DCF"
04:29:43FromDiscord<jos7388> (edit) "my_thing: poop`" => "my_thing\n poop: int`"
04:30:28FromDiscord<jos7388> is that possible
04:30:32FromDiscord<jos7388> (edit) "https://play.nim-lang.org/#ix=4DCF" => "https://play.nim-lang.org/#ix=4DCG"
04:33:49FromDiscord<Elegantbeef> You're describing inheritance
04:34:00FromDiscord<Elegantbeef> Wait nvm
04:34:24FromDiscord<Elegantbeef> Type section macros exist but are poorly documented
04:35:11FromDiscord<Elegantbeef> Though i'd just say "annotate the pragmas"
04:35:27FromDiscord<Elegantbeef> If you're doing a lot of pragmas alias the pragma using the pragma pragma
04:36:10FromDiscord<jos7388> the pragma pragma
04:36:44FromDiscord<Elegantbeef> https://nim-lang.org/docs/manual.html#userminusdefined-pragmas-pragma-pragma
04:36:58FromDiscord<jos7388> do you know why a NimNode's children is called sons
04:38:02FromDiscord<Elegantbeef> Cause it's a word that's shorter than daughters
04:38:48FromDiscord<jos7388> true and real
04:38:54FromDiscord<odexine> why not kids
04:39:03FromDiscord<Elegantbeef> Don't look at me
04:39:19FromDiscord<Elegantbeef> Knowing araq he'd say "They arent goats"
04:48:06FromDiscord<Phil> sent a long message, see http://ix.io/4DCI
04:48:21FromDiscord<Phil> (edit) "http://ix.io/4DCI" => "http://ix.io/4DCJ"
04:48:54FromDiscord<Elegantbeef> Depends what you're doing, sometimes you need to emit a call to another macro to get around the fact compilation is done in stages
04:49:16FromDiscord<odexine> its possible to do macros in macors
04:49:18FromDiscord<Phil> Ah, so macro calls macro in order to play around with order of compilation
04:49:19FromDiscord<odexine> (edit) "macors" => "macros"
04:49:31FromDiscord<Elegantbeef> If you need a macro to write your macro it could just be as simple as using enumerate or any other sugar macro
04:49:36FromDiscord<Elegantbeef> I mean you can use macros inside macros no different to normal code
04:49:42FromDiscord<Elegantbeef> So if that suites a problem it works
04:49:57FromDiscord<Phil> Yeah, I was mostly just trying to ponder what properties of a macro would make me want it
04:50:00FromDiscord<Elegantbeef> Now emitting a call to another macro might be needed if you have a untyped macro and want some extra typing i another macro
04:50:43FromDiscord<Phil> Because I start with a macros as an entrypoint to get access to NimNodes of whatever AST.↵Once I got those I couldn't think of another reason of using macros within macros (except for macros from the stdlib like fmt, but that would work just as well for me if it were a proc)
04:51:16FromDiscord<Phil> (edit) "macros" => "macro"
04:51:24FromDiscord<Elegantbeef> I mean it wouldnt work just aswell for you if it was a proc 😄
04:51:24FromDiscord<Elegantbeef> Cause then you'd be using `strutils.%`
04:52:26FromDiscord<Phil> Most of the time I just use strformat because they're like f-strings/template-strings/groovy-strings and are the most readable imo
04:52:29FromDiscord<huantian> In reply to @Elegantbeef "Now emitting a call": macro macro macro
04:52:40FromDiscord<Phil> But yeah your point stands
04:57:54FromDiscord<Phil> What is the order of compilation for macros?
04:58:03FromDiscord<Phil> Does the "inner" macro get compiled first? Or the "outer" macro?
04:58:15FromDiscord<Phil> (edit) "macro?" => "macro (which gets called by normal code)?"
04:58:19FromDiscord<Elegantbeef> Depends on if the argument is `typed` or `untyped`
04:58:40FromDiscord<Elegantbeef> If the argument is untyped then the inner one is not expanded
05:00:27FromDiscord<Phil> That argument being the argument of inner?
05:00:51FromDiscord<Phil> So inner macro with untyped param ↵--> Compiler first resolves outer macro in first pass, then Inner macro in second pass?
05:01:12FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4DCL
05:01:25FromDiscord<Elegantbeef> In this case `macroThatTakesUntyped` gets `macroThatTakesTyped: ...` as ast cause untyped explicitly is just "parse the macro"
05:01:38FromDiscord<Elegantbeef> well "parse the ast"
05:02:18FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4DCM
05:02:25FromDiscord<Elegantbeef> In this case the untyped is evaluated before the inner takes typed
05:03:07FromDiscord<Elegantbeef> If the argument is typed then it of course abides by the logic of the most indented evaluates first
05:05:06FromDiscord<Phil> In reply to @Elegantbeef "In this case `macroThatTakesUntyped`": Could you expand on that one?↵I'm trying to visualize it and coming up short
05:06:03FromDiscord<Elegantbeef> `typed` is explicitly "I want to have this code semantically checked and compile", `untyped` is "I want whatever ast the user typed as long as the compiler can parse it" when you remember `a: b: c` is just syntax sugar for `a(b(c))` you magically do not have this order of dispatch issue
05:06:37FromDiscord<Elegantbeef> Evaluation is done by the lowest typed macro in a chain
05:06:44FromDiscord<Elegantbeef> If they're all untyped then there is no other macro evaluated
05:08:36FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4DCO
05:09:02FromDiscord<Phil> (edit) "https://play.nim-lang.org/#ix=4DCO" => "https://play.nim-lang.org/#ix=4DCP"
05:09:12FromDiscord<Elegantbeef> In the first example there are only two macro evaluations
05:09:30FromDiscord<Elegantbeef> Since there is untyped inside typed, it depends on untyped to emit the macro again
05:09:51FromDiscord<Elegantbeef> In the second there would be 3 evaluations, first untyped then the indented typed, then finally the top
05:10:02FromDiscord<Elegantbeef> cause it's afterall `typedMac(typedMac(untypedMac(..)))`
05:15:55FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4DCQ
05:16:25FromDiscord<Elegantbeef> the first one only has two garuenteed evaluations
05:17:28FromDiscord<Elegantbeef> The compiler looks and sees a `typed` macro so then goes "ok evaluate this argument", it then steps forward and sees `untyped`. Since it's untyped there is no semantic checking for it's body, so it's ready to be invoked now
05:17:54FromDiscord<Elegantbeef> Untyped arguments completely skip semantic checking which means there is no invocation there
05:20:46FromDiscord<Phil> So basically even if there was a macro callchain 4 levels deep after the untyped, it would just skip them because untyped?
05:21:00FromDiscord<Phil> Do the rest of the macros then just get called after a second compiler pass?
05:21:10FromDiscord<Elegantbeef> There is no second compiler pass
05:21:27FromDiscord<Elegantbeef> The macro returns ast, that ast is placed where it was called
05:21:30FromDiscord<Phil> So I might end up with macro-code non-running because I made the compiler skip the parts it should evaluate by using untyped?
05:21:58FromDiscord<Elegantbeef> Indeed, this is why untyped macros suck, they do not compose
05:23:23FromDiscord<Phil> Okay let me do some experiments based on that
05:24:30FromDiscord<Elegantbeef> Araq does eventually want to remove `untyped` and replace it with `semityped` or whatever, where it has idents and syms
05:24:35FromDiscord<Elegantbeef> But that's a big ol' pipedream
05:24:54FromDiscord<Phil> Oh wait, you speak of guaranteed, so basically it's not well defined if the compiler does additional crap or not.↵Any time you have an inner untyped macro you may get evaluation but there are also scenarios where you may not
05:25:12FromDiscord<Elegantbeef> I mean it's not the compiler that defines it
05:25:23FromDiscord<Elegantbeef> Since macros can just disregard ast, it's down to the macro
05:26:20FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4DCT
05:26:45*advesperacit joined #nim
05:26:45FromDiscord<Phil> I asume does nothing
05:26:59FromDiscord<Phil> But might start doing stuff once it's `static: echo "1000"`
05:27:00FromDiscord<Elegantbeef> "assume", are you using the `body`?
05:27:07FromDiscord<Elegantbeef> No it wouldnt
05:27:19FromDiscord<Elegantbeef> if you do not return the ast to the place it's called, why would it do anything
05:27:51FromDiscord<Phil> Because maybe static evaluation happens before macro evaluation, but that example just provied me wrong
05:28:04FromDiscord<Elegantbeef> Again untyped code is not semantically checked
05:28:13FromDiscord<Elegantbeef> How do you do static evaluation on code that doesnt exist
05:29:15FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4DCU
05:29:24FromDiscord<Elegantbeef> There is no symbol, so the compiler cannot evaluate anything
05:30:24FromDiscord<Phil> Basically "AST expression goes into template, template returns AST expression or nothing, whatever gets returned by template gets evaluated. If nothing gets returned, nothing happens " ?
05:30:50FromDiscord<Elegantbeef> templates and macros have to return ast for the compiler to process yes
05:30:51FromDiscord<Phil> (edit) "template," => "template ↵-->" | "nothing," => "nothing↵-->" | """ => "↵""
05:31:20FromDiscord<Elegantbeef> macros can have side effects cause they run in the vm, but otherwise if you do not return ast, nothing happens
05:32:23FromDiscord<Elegantbeef> Macros are really user defined compiler passes
05:32:28FromDiscord<Elegantbeef> untyped macros especially
05:33:13*rockcavera quit (Remote host closed the connection)
05:39:10*fallback quit (Ping timeout: 246 seconds)
05:41:09FromDiscord<jos7388> i just realized the "warning" macro + inline errors = godlike debugging for macros
05:41:52FromDiscord<Elegantbeef> Or just use `warning` and `error` procedures inside macros
05:43:18FromDiscord<Phil> Or write your own `assertKind` and `expectKind` procs that use warning and error
05:43:52FromDiscord<Phil> (edit) "Or write your own `assertKind` and `expectKind` procs that use warning and ... errormessages" added "error, so that you can actually provide custom" | "error, so that you can actually provide customerror ... " added "messages"
05:44:00FromDiscord<Elegantbeef> This guy
05:44:23FromDiscord<Elegantbeef> You didnt even write your own `assertLen`
05:44:25FromDiscord<Phil> Or use micros
05:45:00FromDiscord<Elegantbeef> Well micros only covers a very small amount of the NimAst
05:45:01FromDiscord<Phil> And then still write your own `assertKind` in order to ensure that everything before micros is correctly typed and everything that comes out of micros is also correctly typed
05:45:10FromDiscord<Elegantbeef> Why do that
05:45:18FromDiscord<Elegantbeef> you can just use `isa`
05:45:27FromDiscord<Phil> Because I'm paranoid and I don't turst anything and don't know isa
05:45:36FromDiscord<Phil> (edit) "turst" => "trust"
05:45:44FromDiscord<Elegantbeef> It's my procedure I implement for every single distinct typed nimnode
05:45:47FromDiscord<Elegantbeef> Also used for my case statement macro
05:46:12FromDiscord<Elegantbeef> https://github.com/beef331/micros/blob/master/src/micros/definitions/identdefs.nim#L3-L8 for example
05:47:40*fallback joined #nim
05:49:20FromDiscord<jos7388> https://media.discordapp.net/attachments/371759389889003532/1141247300170154054/image.png
05:49:24FromDiscord<jos7388> so nice
05:49:29FromDiscord<jos7388> i can just see whatever i want
05:49:39FromDiscord<arathanis> beef, is your pfp your dog?
05:49:47FromDiscord<Elegantbeef> Yes
05:49:47FromDiscord<jos7388> it almost makes me want like a hover that shows each time it reached there and what the value was
05:49:52FromDiscord<arathanis> What kind of dog?
05:49:58FromDiscord<arathanis> it definitely looks like a terrier
05:50:03FromDiscord<Elegantbeef> A pug westie mix
05:50:09FromDiscord<arathanis> they are adorable
05:52:05FromDiscord<Elegantbeef> Phil did you see the case statement macro in micros?
05:52:21FromDiscord<Elegantbeef> https://github.com/beef331/micros/blob/master/tests/tcasemacro.nim#L17-L43 going to blow your mind! 😄
05:53:14FromDiscord<Elegantbeef> Takes in a NimNode and matches using the `isa` proc and then shadows it to the name it was
05:53:49FromDiscord<Elegantbeef> Fairly useful for more elaborate DSLs but I've never seriously used it
05:56:04FromDiscord<Phil> One sec, will take a look when I'm on the go, getting ready
06:05:49FromDiscord<Phil> So kind of a case statement over node but more like your distinct nimnode types instead?
06:06:00FromDiscord<Phil> (edit) "So kind of a case statement over node ... but" added "kind"
06:06:16FromDiscord<Elegantbeef> Yea so you get your desired distinct NimNode and all of it's type safe accessors
06:06:57FromDiscord<Phil> So what the case does is parse the incoming nimnode to the distinct nimnode type?
06:07:08FromDiscord<Phil> And then do a case over it
06:07:16FromDiscord<Elegantbeef> well "parse" is a loose term
06:07:33FromDiscord<Elegantbeef> it generates a `if isa(n, Type)`
06:15:16*PMunch joined #nim
06:49:04FromDiscord<requiresupport> sent a code paste, see https://paste.rs/ajCAp
06:50:43FromDiscord<arathanis> In reply to @requiresupport "what is the best": use `sequtils.filter
06:50:46FromDiscord<arathanis> (edit) "`sequtils.filter" => "`sequtils.filter`"
06:51:04FromDiscord<arathanis> wont even need the for loop
06:51:04FromDiscord<arathanis> https://nim-lang.org/docs/sequtils.html#filter%2CopenArray%5BT%5D%2Cproc%28T%29
06:51:32FromDiscord<arathanis> you give it a predicate and a sequence, and it only keeps items that make the predicate true
06:53:06FromDiscord<requiresupport> wow thats nice
06:53:18FromDiscord<arathanis> sent a code paste, see https://play.nim-lang.org/#ix=4DDa
06:53:25*ntat joined #nim
06:53:36FromDiscord<arathanis> In reply to @requiresupport "wow thats nice": yes! classic functional programming filter for some sequence type
06:53:53FromDiscord<requiresupport> thanks 🙏
06:54:03FromDiscord<arathanis> (edit) "https://play.nim-lang.org/#ix=4DDa" => "https://play.nim-lang.org/#ix=4DDb"
06:54:05FromDiscord<arathanis> np, also i edited it
06:54:13FromDiscord<arathanis> remember it keeps items that make the predicate true
06:54:21FromDiscord<arathanis> your initial implementation was looking to remove items that made it true
06:54:25FromDiscord<arathanis> be sure to invert your condition
07:01:44*ced1 is now known as cedb
07:03:19PMunchElegantBeef, this is awesome! https://forum.nim-lang.org/t/9897#65308
07:03:54PMunchShould definitely be part of sugar, if not just system..
07:04:22FromDiscord<Elegantbeef> "prs welcome" 😛
07:10:25FromDiscord<arathanis> https://tenor.com/view/you-do-it-curtis-payne-house-of-payne-from-heart-to-heart-s9e8-gif-25472601
07:17:02FromDiscord<_gumbercules> This is the kind of stuff that is going to turn people off of Nim honestly: https://forum.nim-lang.org/t/10405
07:17:34FromDiscord<_gumbercules> person ask a question, everyone takes it personally, and only one reply is really helpful
07:17:58FromDiscord<_gumbercules> (edit) "ask" => "asks"
07:18:36PMunchOne of the two replies? But I agree Araqs response was a bit unnecessary.
07:19:09FromDiscord<_gumbercules> Well there are three - I think even termer's came off in a way
07:19:36PMunchFair enough, it's not very helpful
07:19:52FromDiscord<_gumbercules> maybe I'm reading too much into it but either way - lead by example. We were having a discussion earlier today re: community issues and language growth in this channel.
07:20:17FromDiscord<_gumbercules> (edit) "maybe I'm reading too much into it but either way - lead by example. We were having a discussion earlier today re: community issues and ... languageadoption" added "community growth /" | "growth" => "adoption"
07:20:52termerI was attempting to be very careful with my wording to not sound patronizing
07:21:09termerwhether I did a good job or not is not something I know, but it was relegated only to facts
07:21:24FromDiscord<_gumbercules> I mean I can sense that but at the end of the day the first reply should have been a welcome to the community followed up by several links to examples of using SSH with Nim
07:21:41FromDiscord<_gumbercules> and that could have also been the only reply, other than other welcomes
07:21:54termerPerhaps
07:22:07FromDiscord<_gumbercules> assuming this was their first post / they recently joined, otherwise just a polite hello followed by some helpful links would have sufficed
07:22:14advesperacitthere is an offputting level of nonchalance rampant in online communities, the nim forum is unfortunately not immune
07:22:31termerAraq and I appear to have a similar personality, at least in how it comes off in online replies
07:22:40termerbut I'm just a cold person in general lol
07:23:02termerbut you are right _gumbercules
07:23:17termerIt would have been helpful to address the person with a welcome
07:23:18FromDiscord<_gumbercules> I mean, that's fine and everyone is who they are but people ask why Nim isn't growing and why it's not more popular and I'm simply pointing out the answers
07:23:35FromDiscord<_gumbercules> this is definitely one reason, amongst others
07:23:45termeryou've heard my opinion on the subject
07:23:57termerimprovement can be had in all areas though, so what you're saying is completely valid
07:24:18FromDiscord<Elegantbeef> Yea termer light a candle your cold hearted bastard
07:24:24FromDiscord<arathanis> sent a code paste, see https://play.nim-lang.org/#ix=4DDi
07:24:26FromDiscord<_gumbercules> yeah I know - I've heard a lot of people's opinions haha. I've also seen a lot of Nim history first hand
07:25:02termerI wasn't active in the community until 2022
07:25:07termerbut I had been using it since 2020
07:25:18FromDiscord<_gumbercules> I've been around since 2015
07:25:22termermost regulars on IRC and Discord know more than me
07:26:22FromDiscord<_gumbercules> mostly anyway - I stepped away from the community for a bit but regardless I only bring that up because after a while you start to recognize patterns if you're paying attention to anything in life
07:27:17termerfor sure
07:28:28FromDiscord<_gumbercules> I'm pretty sure at this point I know several of the reasons that Nim doesn't grow as quickly as other systems programming languages or attract the same number of contributors but no need to beat that horse again.
07:29:25FromDiscord<Elegantbeef> We should have this conversation daily so anyone new just sees this conversation and thinks that the Nim community is stuck a groundhog day scenario never accepting no one uses the language
07:29:32termerhahahaha
07:29:35termerI was thinking about that
07:29:55termerit's fun to have meta conversation, why do you think all the most popular threads are meta?
07:30:06advesperacitI think a little more inclination towards being helpful and less, snark perhaps, would go a long way in general.
07:30:11FromDiscord<Elegantbeef> Who wants to be bill murray?!
07:30:39termersnark replies are never appropriate unless the person asking the question is genuinely an idiot who has asked something multiple times and not used the information given previously
07:30:39FromDiscord<Elegantbeef> Less snark, but that's all I have
07:31:01FromDiscord<Elegantbeef> That's a long winded way of saying "Unless I termer asked the question"
07:31:17termerI ask the same questions all the time and forget the answers
07:31:37FromDiscord<Elegantbeef> What was the question again?
07:31:42termernice one
07:31:45termerdumbass!
07:32:03FromDiscord<Elegantbeef> Lol, also i remembered you do not use `contains` for your stack strings
07:32:16termerthere's a reason for that
07:32:20FromDiscord<Elegantbeef> so I cannot do `"hello" in myStackString"` or `'a' in myStackString`
07:32:29termerthe type system dies
07:32:39FromDiscord<Elegantbeef> Why you always lying
07:32:41termerit gets very confused
07:33:00*PMunch_ joined #nim
07:33:01termerYou can try for yourself, a few of the tests don't compile when using those names
07:33:14termeralthough maybe they can be qualified internally using the full package name
07:33:18termerhowever that defeats the purpose
07:33:44termeralso, when someone linked a post and then said that my reply might not have been helpful, I was almost certain it was going to be referring to the post I made saying "Scala 3 sucks lol"
07:34:23termerNobody caught on to the potentially damning nuances of that comment
07:35:13FromDiscord<Elegantbeef> So uhh I just tested the contains and it seems to work for me
07:35:35*PMunch quit (Ping timeout: 244 seconds)
07:38:02termerElegantbeef, Maybe it was a weird circumstance for me
07:38:17termerif you replace all the runnableExamples with contains, does it still compile at docgen time?
07:39:01termerand does it shit itself if the find variants are also named find
07:39:12FromDiscord<Elegantbeef> Yea
07:39:25termeranother TODO added
07:41:01FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=4DDk to save you a few
07:41:06FromDiscord<Elegantbeef> too lazy to make a PR right now
07:43:35FromDiscord<Elegantbeef> Afaik you dont even technically need `find` for `'char'` as there is a generic `find` proc inside the stdlib
07:58:42NimEventerNew thread by Cnerd: NimBcs, see https://forum.nim-lang.org/t/10411
07:59:50FromDiscord<System64 ~ Flandre Scarlet> I guess Norm doesn't support async either?
08:11:16FromDiscord<acek7> how do you uninstall nim?
08:11:46NimEventerNew thread by xavjer: Close console terminal after initialization but keep application running, see https://forum.nim-lang.org/t/10412
08:39:42*azimut quit (Ping timeout: 246 seconds)
08:42:13FromDiscord<Phil> In reply to @sys64 "I guess Norm doesn't": Not to my knowledge, with sqlite that doesn't change much either way afaik
08:45:57NimEventerNew thread by chaemon: SomeFloat in std/complex, see https://forum.nim-lang.org/t/10413
09:01:49FromDiscord<System64 ~ Flandre Scarlet> In reply to @isofruit "Not to my knowledge,": Wait, SQLite doesn't support async too?
09:02:47NimEventerNew post on r/nim by qtless: HappyX And Python, see https://reddit.com/r/nim/comments/15skh6k/happyx_and_python/
09:41:18*jkl quit (Quit: Gone.)
09:50:23*jkl joined #nim
10:02:10FromDiscord<Phil> In reply to @sys64 "Wait, SQLite doesn't support": It does: https://www.sqlite.org/asyncvfs.html↵It's just that you won't have the data unless it's written.↵Further, IIRC not even std/db_sqlite supports it
10:03:05FromDiscord<Phil> So basically you'll need to start accessing the sqlite async procs available yourself
10:09:42FromDiscord<System64 ~ Flandre Scarlet> Oh alright
10:10:08FromDiscord<Phil> Could actually be an interesting task to figure out though how to access that
10:11:19FromDiscord<System64 ~ Flandre Scarlet> Now one sad thing is Norm doesn't support arrays
10:11:34FromDiscord<Phil> Does support seqs though
10:11:57FromDiscord<System64 ~ Flandre Scarlet> Oh, very nice↵I was afraid I had to do that https://media.discordapp.net/attachments/371759389889003532/1141313392477487156/image.png
10:12:57FromDiscord<Phil> The way norm works is basically you pass it a "shell" and norm populates it with data.↵If you pass it a seq with one entry with dummy-data, norm just duplicates that shell as often as needed and then fills it with data
10:13:30FromDiscord<Phil> Given what I now know of macros I wonder if that could be improved upon because the compile-time seqs I wrote aren't the easiest to understand
10:13:43FromDiscord<Phil> But on the other hand macros are never easy to understand so eh
10:15:42FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4DDW
10:17:39FromDiscord<System64 ~ Flandre Scarlet> Seems it doesn't support seq
10:47:35FromDiscord<duskhorn> In reply to @sys64 "Oh, very nice I": This looks interesting, what are you coding?
10:49:26FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4DE4
10:54:33FromDiscord<Phil> sent a long message, see http://ix.io/4DE7
10:55:22FromDiscord<Phil> Super alternatively:↵You can of course also just query all players belonging to that game, each of those player objects will contain a game object either way
10:57:47*advesperacit_ joined #nim
10:57:55*cm_ joined #nim
10:58:12*alice quit (Killed (lithium.libera.chat (Nickname regained by services)))
10:58:14*alice joined #nim
10:58:31*nmz- joined #nim
11:00:03*gshumway_ joined #nim
11:02:13*advesperacit_ quit (Ping timeout: 246 seconds)
11:02:56*advesperacit_ joined #nim
11:05:29*jkl quit (*.net *.split)
11:05:29*advesperacit quit (*.net *.split)
11:05:29*cm quit (*.net *.split)
11:05:29*gshumway quit (*.net *.split)
11:05:29*nmz quit (*.net *.split)
11:05:29*skulk quit (*.net *.split)
11:05:30*cm_ is now known as cm
11:07:33*jkl joined #nim
11:07:33*skulk joined #nim
11:10:52FromDiscord<System64 ~ Flandre Scarlet> In reply to @isofruit "If you want to": One player belongs to one game, but one game has 4 players at max
11:19:48FromDiscord<System64 ~ Flandre Scarlet> So I guess I have to store a reference to the game in my players?
11:20:41*junaid_ joined #nim
11:28:30FromDiscord<System64 ~ Flandre Scarlet> Btw is it possible to send messages between threads?
11:38:50FromDiscord<Chronos [She/Her]> In reply to @sys64 "Now one sad thing": Iirc doesn't support byte seqs which was an issue I had
11:44:51FromDiscord<System64 ~ Flandre Scarlet> In reply to @chronos.vitaqua "Iirc doesn't support byte": I have to think in reverse↵A game having multiple players doesn't work here↵I have to do multiple players belong to one game
11:46:21FromDiscord<Chronos [She/Her]> Fair
11:46:32*fallback quit (Ping timeout: 240 seconds)
11:48:35FromDiscord<System64 ~ Flandre Scarlet> Now I wonder if threads can send messages↵Because I want to have a global table with a code as key and a server address as value↵But I need to add and remove servers from this table
11:52:53*fallback joined #nim
11:53:29FromDiscord<System64 ~ Flandre Scarlet> sent a long message, see http://ix.io/4DEj
12:04:11FromDiscord<Chronos [She/Her]> In reply to @sys64 "Now I wonder if": Look at Nim channels
12:13:25FromDiscord<System64 ~ Flandre Scarlet> In reply to @chronos.vitaqua "Look at Nim channels": Will have a look, thanks!
12:29:02FromDiscord<Chronos [She/Her]> No worries!
13:03:32FromDiscord<Andreas> sent a code paste, see https://play.nim-lang.org/#ix=4DED
13:11:15FromDiscord<toma400> Is it only me that Nim docs stay on light mode after 2.0 update?
13:12:01FromDiscord<toma400> (I mean std ones, I loved their dark tone, also huge kudos for whoever wrote them, they are my absolute fav docs for language (and the only ones that I visit so frequently thanks to that))
13:12:07FromDiscord<toma400> (edit) "tone," => "tone;"
13:12:14FromDiscord<toma400> (edit) "for" => "to"
13:12:37FromDiscord<toma400> (edit) "update?" => "update, no matter switching mode manually or having dark ones as default OS?"
13:14:14FromDiscord<odexine> bug already known, fix already pushed, waiting on new release iirc
13:16:17FromDiscord<demotomohiro> In reply to @Andreas "Given a recent 64-bit": https://perf.wiki.kernel.org/index.php/Main_Page↵If you use linux, perf might helps you to study whether cache hit or miss happened.
13:17:18FromDiscord<ntzeno> In reply to @toma400 "Is it only me": it's known bug but you can temporarily use requestly extension if it annoys you so much https://media.discordapp.net/attachments/371759389889003532/1141360033981005954/image.png
13:19:48FromDiscord<toma400> Thanks everyone, wishing this will be soon ❤️ not really annoying for me, but it was comfy to have this beautiful dark one
13:27:45*rockcavera joined #nim
13:37:51*lucasta_ quit (Ping timeout: 260 seconds)
13:44:24*nyeaa492842301 quit (Ping timeout: 246 seconds)
14:13:06*PMunch_ quit (Quit: Leaving)
14:14:26*junaid_ quit (Remote host closed the connection)
14:21:32FromDiscord<Phil> Agreed, my seared retinas will never recover
14:22:47FromDiscord<ringabout> In reply to @toma400 "Thanks everyone, wishing this": Well, you can use the devel doc, which works fine with dark mode.
14:24:15FromDiscord<ringabout> https://nim-lang.github.io/Nim/manual.html
14:32:37*azimut joined #nim
14:44:47FromDiscord<System64 ~ Flandre Scarlet> In reply to @chronos.vitaqua "No worries!": Can I pass strings, objects, ints and so on through channels?
14:46:51*lucasta joined #nim
14:49:35FromDiscord<Chronos [She/Her]> In reply to @sys64 "Can I pass strings,": https://nim-lang.org/0.20.0/channels.html
14:49:44FromDiscord<Chronos [She/Her]> Wait that's old sorry
14:50:49FromDiscord<Chronos [She/Her]> Hm... Nim channels were removed
14:51:06FromDiscord<Chronos [She/Her]> In reply to @sys64 "Can I pass strings,": I think you're going to have to rely on sockets instead honestly
14:52:57*_0x00 joined #nim
14:53:01FromDiscord<System64 ~ Flandre Scarlet> In reply to @chronos.vitaqua "I think you're going": aren't sockets for networking?
15:00:34FromDiscord<Chronos [She/Her]> In reply to @sys64 "aren't sockets for networking?": Yeah but there's no reason you can't use them locally too for communication
15:02:09FromDiscord<odexine> channels doc has been assimilated into system iirc
15:04:15FromDiscord<System64 ~ Flandre Scarlet> In reply to @odexine "channels doc has been": https://nim-lang.org/0.20.0/channels.html↵That?
15:04:22FromDiscord<System64 ~ Flandre Scarlet> In reply to @chronos.vitaqua "Yeah but there's no": Netty goes BRRRRRRRR
15:04:26FromDiscord<odexine> https://nim-lang.org/docs/system.html#example
15:04:49FromDiscord<System64 ~ Flandre Scarlet> Oooooh!
15:05:32FromDiscord<System64 ~ Flandre Scarlet> Thanks, I will study that
15:07:55FromDiscord<Chronos [She/Her]> In reply to @odexine "channels doc has been": Oh has it? Didn't know that lol
15:11:14FromDiscord<System64 ~ Flandre Scarlet> I hope I won't suffer like I did with async/await
15:18:43FromDiscord<Chronos [She/Her]> Lol
15:48:06*xet7 joined #nim
16:36:20*lucasta quit (Quit: Leaving)
16:50:39termerTo whoever was asking about async sqlite: you don't need async for that
16:50:59termeryou can't do concurrent queries anyway
16:51:26termerand for blocking concerns, your OS should already have cached the DB so it's not hitting disk anyway
16:51:44termerIf you're worried though, but sqlite in another thread
16:52:50termerAt first it seems like a no-brainer to use some async wrapper around sqlite, but actually that'll only get you higher latency and worse performance in general
16:53:36termerGood anecdotal proof of this is the fact that among the 2 most popular Node.js bindings for SQLite, the non-async one performs better in all metrics
16:55:18FromDiscord<System64 ~ Flandre Scarlet> Oh alright, so I shouldn't care about async then
16:56:38termerin the context of sqlite, no
16:56:56termernetwork-bound DBs, yes
16:57:06termerbut sqlite has no networking
16:57:32termerit's just a C library, it has no daemon
16:58:14termerI have a suspicion that Nim's sqlite wrapper leaks memory
16:58:28termeryou should be my canary and try tiny_sqlite lol
16:58:41*lucasta_ joined #nim
17:02:28FromDiscord<jos7388> @beefbroccoli i was thinking about nimscript the other day
17:02:29FromDiscord<jos7388> wait
17:02:38FromDiscord<jos7388> @ElegantBeouf i was thinking about nimscript the other day and wanted to ask u some stuff
17:02:53FromDiscord<jos7388> what is the compilation unit in nimscript? is it the entire program?
17:02:57FromDiscord<Phil> In reply to @jos7388 "<@391728494058405890> i was thinking": bwahahahahaahha
17:03:16FromDiscord<Phil> Okay that was hilarious 😄
17:03:21FromDiscord<jos7388> too many beef guys on here 🙂
17:04:11FromDiscord<jos7388> (edit) "what is the compilation unit in nimscript? is it the entire program? ... " added "i'm wondering how hot reload can be scaled up to multiple little files"
17:04:57*lucasta_ quit (Ping timeout: 245 seconds)
17:05:06*krux02 joined #nim
17:19:57FromDiscord<_gumbercules> where is @beefncheddar?
17:28:08FromDiscord<Phil> Maybe at a bar with beefbacon
17:30:34FromDiscord<arathanis> Anytime someone has a somewhat complicated question on this server: https://media.discordapp.net/attachments/371759389889003532/1141423770121281628/image.png
17:34:52FromDiscord<System64 ~ Flandre Scarlet> build failed↵Reason : None https://media.discordapp.net/attachments/371759389889003532/1141424855225479219/message.txt
17:39:03FromDiscord<Phil> Er.... what?↵Okay never seen that happen before, as in, ever
17:39:22FromDiscord<Phil> Like, for the compiler to completely fail to tell why shit's broken is pretty new to me
17:44:31FromDiscord<System64 ~ Flandre Scarlet> Even clearing the cache doesn't work
17:44:54FromDiscord<Phil> Yeah I'd wager it's something about the code, it's just I don't see what could cause this
17:45:11FromDiscord<Phil> That is so far beyond my expertise it's not even funny
17:47:26FromDiscord<System64 ~ Flandre Scarlet> I hate when the compiler says nothing about the error
17:53:28FromDiscord<Phil> Undo changes until it compiles again?
17:55:21FromDiscord<System64 ~ Flandre Scarlet> I found the issue, attempt to assign an undeclared field in a template
17:57:03FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4DG5
18:04:24FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4DG9
18:04:40FromDiscord<Phil> You may have murdered the compiler through recursion
18:05:35FromDiscord<Phil> Like, the first line of the template very much looks to me like that template itself getting invoked again
18:05:50FromDiscord<System64 ~ Flandre Scarlet> OOF
18:06:28FromDiscord<System64 ~ Flandre Scarlet> Can I put an underscore at the begining to differentiate it?
18:06:34FromDiscord<System64 ~ Flandre Scarlet> like _myField?
18:07:19FromDiscord<Phil> I mean you can. ↵I'd ask again why this is a template when it simply looks like it's assigning a couple values to a layer field
18:08:03FromDiscord<System64 ~ Flandre Scarlet> sould setting this to a proc solve the problem?
18:08:33FromDiscord<Phil> might? I tend to not do a ton of operator overloading so I'm not insanely aware of how that'll work out.↵But generall it goes↵Proc >>> Template >>> Macros↵In terms of complexity
18:09:00FromDiscord<Phil> Or rather↵Proc > Generics > Templates > Macros
18:10:24FromDiscord<Phil> But this is me guessing tbh, I don't have a true understanding of why this is exploding
18:10:40FromDiscord<Phil> Can you give me the layer, tilemap types and LAYER_TILEMAP value for a minimal example?
18:10:49FromDiscord<System64 ~ Flandre Scarlet> The error : no reason is solved
18:11:00FromDiscord<Phil> ?
18:11:11FromDiscord<Phil> Ah, as in using a proc solves the issue
18:11:13FromDiscord<System64 ~ Flandre Scarlet> In reply to @sys64 "build failed Reason :": This problem is solve
18:11:20FromDiscord<System64 ~ Flandre Scarlet> (edit) "solve" => "solved"
18:12:41FromDiscord<Phil> sent a long message, see http://ix.io/4DGc
18:14:50FromDiscord<System64 ~ Flandre Scarlet> Oh alright, gotta use procs then
18:17:24FromDiscord<Phil> 👍 ↵At least that's my view on it.
18:27:18FromDiscord<dersnof> whats best nim lib for discord api
18:27:24FromDiscord<dersnof> wrapper
18:27:34FromDiscord<dersnof> to develop discord bot
18:27:36FromDiscord<Phil> Anyone got a good testament example?↵I'm trying to grok it since I want to compile tests with different compilation flags
18:27:54FromDiscord<dersnof> https://github.com/krisppurg/dimscord
18:28:00FromDiscord<dersnof> this looks nice but only 206 stars
18:28:06FromDiscord<dersnof> i'm not sure if its reliable lib
18:28:17FromDiscord<Phil> (edit) "flags" => "flags↵However, I'm not sure whether e.g. a `discard """ """` block needs to be defined per unittest or per unittest file and if testament is supposed to be used on its own or with std/unittest"
18:28:37FromDiscord<Phil> Keep in mind the nim ecosystem isn't particularly masssive, 206 stars is fine
18:28:51FromDiscord<dersnof> but what if they dump project in future
18:28:54FromDiscord<dersnof> and my bot groke
18:28:58FromDiscord<dersnof> (edit) "groke" => "broke"
18:29:09FromDiscord<dersnof> i would have to rewrite everything
18:29:36FromDiscord<Phil> That is an issue you face with any project
18:30:42FromDiscord<Phil> When I mention that the nim ecosystem isn't particularly massive, this is one of the things that I mean.↵The group of maintainers isn't gargantuan and so the amount of times you hit a package with bus-factor 1 is quite high.
18:32:44FromDiscord<dersnof> hmm btw
18:32:46FromDiscord<dersnof> in coding i start to believe that, unrelated to however you are good at it, there is always some asian teen better than u
18:32:53FromDiscord<dersnof> seeing developer of million.js
18:33:24FromDiscord<Phil> In reply to @dersnof "in coding i start": That has nothing to do with asian and more to do with how vast a field coding is in general
18:33:41FromDiscord<dersnof> In reply to @isofruit "That has nothing to": asian part is generally due to competitive nature of asian countries
18:33:47FromDiscord<dersnof> they have more strict education system and so on
18:34:03FromDiscord<dersnof> they have same brain, but they work harder
18:36:39FromDiscord<Phil> sent a long message, see http://ix.io/4DGo
18:37:11FromDiscord<Phil> Though that's just the technical aspects, there's also the massive amount of communication that coding also encompasses
18:37:22FromDiscord<Phil> (edit) "technical" => "technical/problem solving"
18:37:57FromDiscord<dersnof> I start to think, I might want to switch teams inside my job
18:38:12FromDiscord<dersnof> like it doesnt sound nice to do cobol pl/i and mainframe lifetime
18:38:12FromDiscord<dersnof> lol
18:38:21FromDiscord<dersnof> but i just started, i should have patience
18:38:26FromDiscord<Phil> That sounds like it might belong more in offtopic 😉
18:38:37FromDiscord<dersnof> oh right
18:39:57termerIf you want to write a Discord not with Nim then do it
18:40:22termerI view that lib as pretty reliable considering the bridge I'm using to communicate with you right now is using it
18:40:35termerIt's pretty important Nim community infrastructure
18:41:17termernormally I don't trust random Discord libs to stay up to date, but since it's used for the official IRC-Discord bridge, it should be pretty reliable with updates
18:41:39FromDiscord<dersnof> nice
18:41:46FromDiscord<dersnof> it would be nice experiment i suppose
18:41:56termerdo it and enjoy it
18:42:01termeryou'll have fun
18:43:34*junaid_ joined #nim
18:46:13FromDiscord<Elegantbeef> @jos7388\: nimscript has a single entry and you need an interpreter for every file if you want code reloading with state saving
19:02:07FromDiscord<summarity> sent a code paste, see https://play.nim-lang.org/#ix=4DGw
19:03:56FromDiscord<Elegantbeef> Use two overloads
19:04:21FromDiscord<Elegantbeef> Whoops
19:04:22FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4DGz
19:05:29FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4DGA
19:08:28FromDiscord<summarity> hmm, that's not bad
19:12:00FromDiscord<Phil> Yeh, overloads are generally the way to go imo when you want to provide the same functionality but with different proc signatures
19:29:05FromDiscord<jos7388> In reply to @Elegantbeef "<@610710352254205952>\: nimscript has a": can you save, load and link bytecode? Or just nimscript sources
19:29:58FromDiscord<Chronos [She/Her]> I'm pretty sure Nimscript has no bytecode
19:30:57FromDiscord<Elegantbeef> I mean it has bytecode sorta, but yea it does not really have any
19:31:48FromDiscord<Elegantbeef> I think it technically is bytecode if it's only primitives
19:34:39FromDiscord<Elegantbeef> Nim's VM is quite literally made specifically for easy interop for macros, so it does not do anything overly intelligent for speed and the like. Objects are stored as PNodes which means it's AST based instead of tables or similar
19:39:51FromDiscord<jos7388> so it’s like a tree walk interpreter I guess?
19:40:13FromDiscord<jos7388> ok I’m probably gonna use lua or something then
19:43:12FromDiscord<Elegantbeef> I mean it's not a tree walk interpreter
19:43:14FromDiscord<Elegantbeef> It just uses the PNodes for objects
19:44:21FromDiscord<dersnof> sent a code paste, see https://play.nim-lang.org/#ix=4DGT
19:44:21FromDiscord<dersnof> ngl i expected error
19:44:32FromDiscord<dersnof> i gave seq to openArray argument
19:44:56FromDiscord<Elegantbeef> That's the entire point of `openArray` it's a type that abstracts all arrays, seqs, and slices
19:46:28FromDiscord<dersnof> oh okay
19:52:17FromDiscord<mr.whis> WTF is a Seq???
19:53:44*junaid_ quit (Remote host closed the connection)
19:54:43FromDiscord<dersnof> Btw how do i compile multiple files together
19:54:45FromDiscord<dersnof> in Nüm
19:54:50FromDiscord<dersnof> (edit) "Nüm" => "Nim"
19:55:27FromDiscord<jordan4ibanez> ``import my_cool_folder/my_cool_thing``
19:55:46FromDiscord<jordan4ibanez> or ``import ../my_cool_blep/flarp``
19:55:50FromDiscord<arathanis> I dont Nim's compiler compiles from a single file. You need to organize your application into have a single entrypoint
19:55:58FromDiscord<arathanis> (edit) "dont" => "think"
19:56:43FromDiscord<dersnof> Oh, are there guide for it. Im trying to understand visible objects stuff
19:56:50FromDiscord<dersnof> So i was trying multiple modules
19:56:52FromDiscord<dersnof> Like files
19:57:09FromDiscord<jordan4ibanez> sent a code paste, see https://paste.rs/VOaFf
19:57:48FromDiscord<jordan4ibanez> Unfortunately, you'd have to import notImport
19:58:32FromDiscord<dersnof> Cant you just import whole file
19:58:37FromDiscord<dersnof> Then use stuff inside
19:59:10FromDiscord<jordan4ibanez> Ye
19:59:35FromDiscord<Phil> You may see the word "include" in places
19:59:37FromDiscord<Phil> Ignore it
19:59:41FromDiscord<Phil> Ban it from your memory if you see it
19:59:45FromDiscord<jordan4ibanez> sent a code paste, see https://play.nim-lang.org/#ix=4DGX
19:59:52FromDiscord<Phil> That is a tool for very special circumstances that will only bring you pain 99.9% of the time
20:00:01FromDiscord<Phil> And I still haven't found the 0.1% where it's valid
20:01:29FromDiscord<jordan4ibanez> export can be your friend also
20:01:36FromDiscord<jordan4ibanez> (edit) "export" => "``export``"
20:01:47FromDiscord<jordan4ibanez> cyclical deps are a bad time
20:01:54FromDiscord<Phil> Yeh
20:06:23FromDiscord<jordan4ibanez> You can treat nim like java, or C, or python (kinda), it's pretty dang neat tbh
20:06:40FromDiscord<jordan4ibanez> It will just make your life a lot easier der snof
20:07:13FromDiscord<jordan4ibanez> I've never used an indentation lang before but I see the advantage
20:07:43FromDiscord<Phil> Now if I could get the gdb debugger to break on breakpoints like in java that'd be neat
20:08:21FromDiscord<jordan4ibanez> sent a code paste, see https://play.nim-lang.org/#ix=4DH3
20:08:25FromDiscord<jordan4ibanez> https://tenor.com/view/house-explosion-explode-boom-kaboom-gif-19506150
20:11:26FromDiscord<jordan4ibanez> https://tenor.com/view/spongebob-melting-gif-25326789
20:11:36FromDiscord<jordan4ibanez> I think that's a better representation of your expectation
20:14:19FromDiscord<jordan4ibanez> Oh oh, I almost forgot, another neat thing is like in curly langs or like in lua's ``do`` block there's nim's ``block`` ...block. So you want a temp var or sub procedure without being functional, there you go
20:25:18FromDiscord<Elegantbeef> `if true:` is more proper
20:26:28FromDiscord<jordan4ibanez> wat
20:29:17FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/tdE5g
20:29:20FromDiscord<Elegantbeef> It's more proper cause it doesnt eat a `break`
20:30:36FromDiscord<jordan4ibanez> Then why is the ``block`` scope even in the language?
20:32:59FromDiscord<Phil> Beef?↵Are you aware of a simple project using testament?↵For mapster I kind of want to have specific sets of tests that deal with specific flags my lib may be compiled with, the only option I'm seeing for doing that is testament
20:33:38FromDiscord<Phil> The examples in nim-section about testament don't really tell me if you're supposed to do a discard statement a file or a unit-test, nor whether it integrates well with std/unittest
20:33:41FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4DH9
20:33:55FromDiscord<Elegantbeef> Discard statement goes at the top of a file
20:34:02FromDiscord<Elegantbeef> No clue about projects that use it
20:34:22FromDiscord<Phil> Check, so one discard for an entire set of tests in a file
20:35:37FromDiscord<Elegantbeef> As far as I know, yes
20:35:56FromDiscord<jordan4ibanez> I'll just stick to ``block`` :nim1:
20:37:44FromDiscord<arathanis> sent a code paste, see https://play.nim-lang.org/#ix=4DHb
20:37:49FromDiscord<arathanis> (edit) "https://play.nim-lang.org/#ix=4DHb" => "https://play.nim-lang.org/#ix=4DHc"
20:38:10FromDiscord<jordan4ibanez> No, no it can't be true, that's not real
20:38:24FromDiscord<jordan4ibanez> https://tenor.com/view/scream-cat-loud-angry-gif-26168455
20:42:21FromDiscord<Phil> Wait what does that even express
20:45:16FromDiscord<jordan4ibanez> I dunno man I was just being dramatic about a discard statement
20:45:42FromDiscord<arathanis> In reply to @isofruit "Wait what does that": you have never had a 3rd party block your jira story and been enraged because you are their lowest priority?
20:45:50FromDiscord<nnsee> sorry if this has already been asked or pointed out, but am I the only one for whom setting the docs theme doesn't work? console spews out a `setTheme is not defined`
20:45:52FromDiscord<Phil> the discard is fine, but the fuck does `block <variable>` even mean?!
20:46:12FromDiscord<arathanis> In reply to @isofruit "the discard is fine,": named block, so you can "break <block-name>"
20:46:34FromDiscord<jos7388> does nimscript evaluate expressions like `type X = enum`>
20:46:35FromDiscord<jos7388> (edit) "enum`>" => "enum`?"
20:46:43FromDiscord<arathanis> sent a code paste, see https://play.nim-lang.org/#ix=4DHy
20:46:44FromDiscord<arathanis> @Phil ^
20:46:46FromDiscord<jordan4ibanez> beat me to it
20:47:02FromDiscord<nnsee> sent a code paste, see https://paste.rs/8Km43
20:47:35FromDiscord<nnsee> slightly different syntax (you set a label for the loop itself) but it works the same
20:47:39FromDiscord<Phil> Ohh not variable name, block name
20:47:44FromDiscord<Phil> Check
20:48:00FromDiscord<arathanis> i was just making a jira joke using the word "block"
20:48:10FromDiscord<Phil> Yeh, got that one, was confused by named block
20:48:51FromDiscord<Phil> Also it shouldn't be too hard to just make namedFor macro that writes a normal for-loop in a named block
20:49:02FromDiscord<Phil> To get smoother syntax
20:49:05FromDiscord<arathanis> In reply to @isofruit "Also it shouldn't be": Beef did this yesterday
20:49:23FromDiscord<arathanis> https://discord.com/channels/371759389889003530/371759389889003532/1141265923316129812
20:49:51FromDiscord<Phil> I assume he did it half asleep with one hand tied behind his back balacning on a mountain-top while bears attack him from both sides
20:50:02FromDiscord<arathanis> ok beef did it 6 years ago
20:50:09FromDiscord<arathanis> but PMunch brought it up yesterday haha
20:50:47FromDiscord<arathanis> (edit) "6" => "~~6" | "ago" => "ago~~ in February"
20:58:29FromDiscord<Elegantbeef> No that's not an expression↵(@jos7388)
21:03:13FromDiscord<jos7388> when i add pragmas and stuff the AST looks a lot like an expression
21:03:18FromDiscord<jos7388> what is evaluating that to produce a type?
21:03:25FromDiscord<jos7388> the nim compiler seems so nutty
21:04:05FromDiscord<Elegantbeef> What?
21:04:22FromDiscord<Elegantbeef> I mean it's compiled into typed ast
21:04:28FromDiscord<Elegantbeef> Is that evaluation... uhhh
21:05:09FromDiscord<jos7388> so nimscript just produces an AST i guess
21:05:24FromDiscord<Elegantbeef> No
21:05:30FromDiscord<jos7388> macros do
21:05:34FromDiscord<jos7388> and macros are nimscript ye?
21:05:40FromDiscord<Elegantbeef> The compiler compiiles code, believe it or not 😄
21:07:15FromDiscord<Phil> Sounds illegal, called the cops
21:07:34FromDiscord<dersnof> sent a code paste, see https://play.nim-lang.org/#ix=4DHE
21:07:45FromDiscord<dersnof> instead of importing every proc one by one
21:07:47FromDiscord<Elegantbeef> Macros are a usage of nimscript yes
21:07:48FromDiscord<Elegantbeef> they return AST yes
21:08:41FromDiscord<jos7388> so type information is just a data source, like a traditional symbol table, for macros
21:09:05FromDiscord<Elegantbeef> type information is for semantic analysis
21:09:17FromDiscord<jos7388> yeah of course
21:09:26FromDiscord<jos7388> but it can also be read by macros
21:09:35FromDiscord<jos7388> right? like macros in rust are just lexical, only consume AST
21:09:40FromDiscord<Elegantbeef> Right cause the code inside the macro is semantically checked
21:09:46FromDiscord<jos7388> but in nim, you can actually query type information i think
21:09:59FromDiscord<Elegantbeef> Nim asts are inspired by lisp
21:10:13FromDiscord<Elegantbeef> Nim macros\
21:10:19FromDiscord<Elegantbeef> They take in ast and return ast
21:10:34FromDiscord<jos7388> i feel once you start querying type information in macros, you run into a lot of issues with compilation order
21:10:36FromDiscord<Elegantbeef> this means they have access to type information and everything the compiler has access to if it were to compile the code
21:10:52FromDiscord<Elegantbeef> Nope cause compilation is bottom up
21:10:55FromDiscord<Elegantbeef> The lowest type macro is evaluated first
21:11:03FromDiscord<Elegantbeef> typed\
21:12:28FromDiscord<jos7388> i see
21:12:48FromDiscord<jos7388> is typed macro a macro that reads a `typed` parameter?
21:13:24*ntat quit (Quit: leaving)
21:13:40FromDiscord<jos7388> i can't find any docs on what typed vs untyped is doing-- i'm guessing that typed has more type information.. somehow but i dont really know what extra it has
21:17:55FromDiscord<Elegantbeef> typed macros require arguments to pass semantic analysis, untyped only parse the arguments
21:18:01FromDiscord<Elegantbeef> as such typed has type information, untyped does not
21:18:09FromDiscord<Elegantbeef> phil and I discussed this in detail last night
21:18:10FromDiscord<Elegantbeef> so find that
21:22:25FromDiscord<dersnof> Are there any nice Nim project that i can inspect its modularization and stuff
21:22:29FromDiscord<dersnof> Shouldnt be huge project
21:22:39FromDiscord<dersnof> So i can inspect codes easier
21:23:24*advesperacit_ quit ()
21:27:59FromDiscord<michaelb.eth> In reply to @dersnof "Are there any nice": I'd suggest nim-chronos as well organized project that shows off organization of Nim code into layers of modules:↵https://github.com/status-im/nim-chronos
21:28:08FromDiscord<michaelb.eth> (edit) "In reply to @dersnof "Are there any nice": I'd suggest nim-chronos as ... well" added "a"
21:29:23FromDiscord<dersnof> In reply to @michaelb.eth "I'd suggest nim-chronos as": Oh okay it can teach me multi files Nim architecture
21:35:57FromDiscord<jos7388> In reply to @Elegantbeef "typed macros require arguments": ok cool, this makes sense to me
21:36:01FromDiscord<jos7388> thanks very helpful
21:42:43FromDiscord<summarity> sent a code paste, see https://play.nim-lang.org/#ix=4DHL
21:43:22FromDiscord<Chronos [She/Her]> `cast[proc()](foo)`
21:43:36FromDiscord<Chronos [She/Her]> In reply to @summarity "When I have a": But why not store the proc type itself?
21:46:08FromDiscord<summarity> sent a code paste, see https://play.nim-lang.org/#ix=4DHN
21:46:44FromDiscord<Chronos [She/Her]> Hm I'm not too sure, that should work
21:47:08FromDiscord<Chronos [She/Her]> I'm confused why you're not doing `foo: ProcType` instead though honestly
21:48:06FromDiscord<summarity> It's a bit of weird situation, the proc ptr goes through a layer of callbacks and hooks with other C code, and I need to recover it (and yet I know exactly what signature it has).
21:49:42FromDiscord<summarity> Ah it was missing {.cdecl, gcsafe.}
21:50:14*Yew joined #nim
22:00:56FromDiscord<dersnof> Hmm i have an idea
22:00:59FromDiscord<dersnof> So i love Vue
22:01:10FromDiscord<dersnof> And there is Karax to output JS from Nim
22:01:35FromDiscord<dersnof> So would there maybe way to write Vue stuff in Nim and produce JS
22:01:50FromDiscord<dersnof> (edit) "Vue" => "Vue.JS"
22:04:07*_0x00 quit (Ping timeout: 245 seconds)
22:28:10*rockcavera quit (Remote host closed the connection)
22:30:27FromDiscord<arathanis> oh god
22:30:32FromDiscord<arathanis> noooooooooooo
22:30:52*genr8eofl_ joined #nim
22:30:57FromDiscord<arathanis> someone in a channel im in at work just said:↵> a post-mortem is definitely in order
22:31:01FromDiscord<arathanis> pray for me, friends
22:33:06*genr8eofl quit (Ping timeout: 246 seconds)
22:34:17FromDiscord<Chronos [She/Her]> In reply to @summarity "It's a bit of": Ah fair
22:40:19*rockcavera joined #nim
22:47:10FromDiscord<ygorko> Hello everyone o/
22:48:35FromDiscord<ygorko> I'm new to Nim, and I've decided to make a tiny game with naylib to learn the language, but I've encountered a problem
22:48:45FromDiscord<ygorko> specifically with nil checks
22:48:57FromDiscord<arathanis> what previous languages have you used/
22:48:57FromDiscord<arathanis> (edit) "used/" => "used?"
22:50:05FromDiscord<ygorko> oh, lots of them haha
22:50:22FromDiscord<ygorko> to name compiled ones: C/C++, Java, C#, Kotlin, etc
22:50:57FromDiscord<ygorko> I have a struct "Game", that has a currentScene field https://media.discordapp.net/attachments/371759389889003532/1141504395855548466/image.png
22:51:12FromDiscord<arathanis> > struct
22:51:15FromDiscord<arathanis> so definitely used C
22:51:17FromDiscord<arathanis> 😂
22:51:18FromDiscord<ygorko> mb
22:51:40FromDiscord<ygorko> well, C is the most recent thing i've used, so my vocabulary is affected a bit 🥴
22:52:24FromDiscord<ygorko> I also have a scene ~~struct~~object type, which is just a bunch of closures https://media.discordapp.net/attachments/371759389889003532/1141504761506582548/image.png
22:53:01FromDiscord<ygorko> and here's my update function that has the problem: https://media.discordapp.net/attachments/371759389889003532/1141504918017019944/image.png
22:53:27FromDiscord<arathanis> sent a code paste, see https://play.nim-lang.org/#ix=4DHT
22:53:34FromDiscord<arathanis> if you are into that sort of thing
22:54:09FromDiscord<ygorko> I'll definitely try it out later, but now i'm bugged over compiler yelling at me
22:54:54FromDiscord<arathanis> what is it complaining about?
22:55:03FromDiscord<ygorko> https://media.discordapp.net/attachments/371759389889003532/1141505429432709191/image.png
22:55:30FromDiscord<arathanis> currentScene is a ref type, and you have not nullchecked it
22:55:39FromDiscord<arathanis> oh wait, you did wth
22:55:44FromDiscord<ygorko> it tells me that it cant deref a currentScene as it may be nil, even though I've assigned it to a non nillable var just fine
22:55:46FromDiscord<ygorko> yea
22:56:08FromDiscord<arathanis> so SceneRef, assuming its a ref type, is still nullable
22:56:21FromDiscord<Elegantbeef> using not nil, what a brave soul
22:56:34FromDiscord<arathanis> maybe the compiler is confused, you did check if game.currentScene is not nil
22:56:35FromDiscord<ygorko> In reply to @ygorko "I also have a": i dont think it is
22:56:54FromDiscord<arathanis> but maybe now that you reassign it it does not understand the nil checks trannsitivity
22:57:05FromDiscord<arathanis> looks like you get to submit a compiler PR, lucky you!
22:57:38FromDiscord<ygorko> In reply to @arathanis "but maybe now that": actually i reassign it because i figured it would understand them better if i assigned it to a non nillable variable explicitly 😂
22:58:02FromDiscord<arathanis> is SceneRef not a ref type and therefore nullable?
22:58:28FromDiscord<ygorko> In reply to @ygorko "I also have a": it is a ref type
22:58:30FromDiscord<arathanis> sent a code paste, see https://play.nim-lang.org/#ix=4DHU
22:58:35FromDiscord<arathanis> ref types can be nil
22:58:39FromDiscord<Elegantbeef> You have a `ref ref`
22:58:42FromDiscord<ygorko> no, i need to keep it a ref type
22:58:54FromDiscord<Elegantbeef> Wait nvm misread
22:59:05FromDiscord<arathanis> SceneRef is a nullable type
22:59:08FromDiscord<arathanis> if it a ref
22:59:12FromDiscord<arathanis> (edit) "it" => "its"
22:59:15FromDiscord<Elegantbeef> I'd say stop using not nil annotations, they're experimental for a reason
22:59:28FromDiscord<Elegantbeef> Use `Option[Scene]` instead
22:59:32FromDiscord<ygorko> In reply to @Elegantbeef "I'd say stop using": 🙃
23:00:00FromDiscord<arathanis> In reply to @Elegantbeef "I'd say stop using": is not nil notation just `!= nil`?
23:00:17FromDiscord<Elegantbeef> No
23:00:20FromDiscord<arathanis> (edit) "notation" => "annotations"
23:00:28FromDiscord<Elegantbeef> `SceneRef = ref Scene not nil`
23:00:32FromDiscord<arathanis> oh its the `a: SceneRef not nil` lol
23:00:59FromDiscord<Elegantbeef> It's a flow analysis to ensure that you never deference a nil ref, it's practically `Option[ref]`
23:01:08FromDiscord<Elegantbeef> But with flow control analysis
23:03:32FromDiscord<arathanis> you should listen to beef and be at least a little suspect of experimental features
23:03:42FromDiscord<arathanis> perhaps try using `concepts`?
23:03:45FromDiscord<arathanis> 😉
23:05:25FromDiscord<ygorko> In reply to @arathanis "you should listen to": yeah, I guess I'll have to stick to good ol' Options for now
23:05:40FromDiscord<ygorko> In reply to @arathanis "perhaps try using `concepts`?": arent concepts experimental too? 🥴
23:05:47FromDiscord<arathanis> In reply to @ygorko "arent concepts experimental too?": hence the winking emoji
23:05:52FromDiscord<ygorko> i see
23:05:57FromDiscord<arathanis> i was clowning on concepts for being experimental forever
23:06:05FromDiscord<arathanis> its awesome when they work
23:06:11FromDiscord<jviega> Cool so nimcrypto, something that's barely used by a dependency of a dependency of a dependency, just pushed a new change 30 mins ago, and it breaks everything downstream. But I can't clone and pin, because they don't even use release numbers??
23:06:22FromDiscord<jviega> Makes my low opinion of it even lower
23:06:43FromDiscord<arathanis> classic
23:07:08FromDiscord<arathanis> In reply to @jviega "Cool so nimcrypto, something": clone at a working commit and embed into your system?
23:07:11FromDiscord<arathanis> (edit) "system?" => "project?"
23:07:59FromDiscord<jviega> Yeah, sucks that I have to do that. I'm going to have to rip out my few dependencies and wrap C/C++ libs I actually trust
23:08:48FromDiscord<jviega> It's an AWS lib I had to fix anyway because there's nothing good, that uses an HMAC library, that imports nimcrypto for.... who knows what.
23:09:12FromDiscord<jviega> There are good C++ AWS libraries, just no good wrapping. It's silly
23:10:35FromDiscord<Elegantbeef> Concepts are experimental, but they're more usable that not nil annotations
23:11:18FromDiscord<arathanis> In reply to @Elegantbeef "Concepts are experimental, but": in my experience you mostly have to keep them on the simpler side
23:11:32FromDiscord<arathanis> if you try and get very complex with concepts you run into the experimental edges and fall off the end of the compiler
23:11:52FromDiscord<Elegantbeef> I mean if you do dumb shit, yes
23:11:56FromDiscord<Elegantbeef> Concepts work if you do sensible shit
23:12:30FromDiscord<arathanis> what do you consider to be sensible shit, and what do you consider to be dumb shit?
23:12:43FromDiscord<Elegantbeef> "I just tried representing a recursive monoid, it's not dumb it works in haskell"
23:13:16FromDiscord<Elegantbeef> Sensible shit is using it as a declarative type match, which it is
23:14:28FromDiscord<arathanis> My biggest problem is the Experimental Features page is still wrong
23:14:38FromDiscord<arathanis> one of the examples doesn't even work
23:14:43FromDiscord<arathanis> for concepts
23:14:45FromDiscord<jviega> @arnetheduck Don't know if you're aware, but you seem to have broken the build on most platforms.
23:14:59FromDiscord<arathanis> it is a monoid but it is used as an example lol
23:15:01FromDiscord<jviega> sent a code paste, see https://play.nim-lang.org/#ix=4DHZ
23:15:47FromDiscord<ygorko> I don't think I have a use case for concepts yet
23:16:04FromDiscord<Elegantbeef> Right arath, it's the exact wrong case to use concepts imo
23:16:23FromDiscord<Elegantbeef> First it uses concepts recursively
23:16:26FromDiscord<Elegantbeef> Which is just ugh
23:16:28FromDiscord<ygorko> They do seem to be quite interesting, as a tool to restrict what kind of generic types are allowed in functions, but idk where I'd use them for now
23:16:47FromDiscord<arathanis> In reply to @Elegantbeef "Right arath, it's the": I can see this. I just wish the examples didn't contain something so misleading 😂
23:17:23FromDiscord<arathanis> So you think the sensible shit is basic structure matching without craziness
23:17:34FromDiscord<arathanis> "if it is at least this, then it works"
23:17:42FromDiscord<Elegantbeef> I mean it uses concepts recursively, that's just awful
23:17:53FromDiscord<arathanis> its kind of like duck typing
23:18:01FromDiscord<arathanis> or structural typing
23:18:16FromDiscord<arathanis> "if it has at least this structure you may use it here"
23:18:41FromDiscord<Elegantbeef> User defined duck typing is what concepts are
23:19:11FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4DI0
23:19:20FromDiscord<Elegantbeef> This is a much more sensible thing that does not cause a recurse inside of a concept
23:19:42FromDiscord<Elegantbeef> Though the doc concept works
23:19:43FromDiscord<Elegantbeef> So...
23:20:21FromDiscord<arathanis> In reply to @Elegantbeef "Though the doc concept": I just ran it
23:20:27FromDiscord<arathanis> it compiles but prints false not true
23:20:43FromDiscord<arathanis> sent a code paste, see https://play.nim-lang.org/#ix=4DI2
23:21:13FromDiscord<Elegantbeef> There is no `val` for options
23:22:17FromDiscord<arathanis> oh does it just need an edit?
23:22:26FromDiscord<Elegantbeef> Well that's the first issue I see
23:22:39FromDiscord<arathanis> it should be f.get, right?
23:22:47FromDiscord<arathanis> or `f.get()`
23:22:47FromDiscord<Elegantbeef> It might work there, but that's odd
23:23:56FromDiscord<Elegantbeef> We went over this before though, afaik this is just wrong to begin with, you cannot bind a type here to `MatcheGenericType`
23:24:35FromDiscord<arathanis> yeah we did go over it before
23:24:42FromDiscord<arathanis> im not trying to fight it into working now
23:24:54FromDiscord<arathanis> just commenting that the page its on was updated for 2.0.0 and this is unchanged and still incorrect.
23:32:19FromDiscord<heysokam> sent a code paste, see https://play.nim-lang.org/#ix=4DI4
23:32:54FromDiscord<Elegantbeef> `RPG(discord = newDiscordClient(token))`
23:33:00FromDiscord<Elegantbeef> whoops \`\:
23:33:50FromDiscord<ygorko> Can i ask another question?
23:34:04FromDiscord<Elegantbeef> Nope the quota has been reached, you'll have to come back in a month or two
23:34:09FromDiscord<ygorko> ah crap
23:34:11FromDiscord<heysokam> In reply to @Elegantbeef "`RPG(discord = newDiscordClient(token))`": `=`?
23:34:16FromDiscord<Elegantbeef> "Why does it say bot next to your name" is an invalid question
23:34:19FromDiscord<Elegantbeef> I mean `:`
23:34:20FromDiscord<heysokam> woudln't it be `:`?
23:34:20FromDiscord<Elegantbeef> of course
23:34:32FromDiscord<heysokam> but that's what wasn't working
23:34:46FromDiscord<Elegantbeef> Well maybe if you provided an error instead of just saying that I might help more
23:34:50FromDiscord<heysokam> hmm wait
23:35:02FromDiscord<heysokam> i was saying `new RPG(...)` because its a ref object
23:35:08FromDiscord<heysokam> does it change anything?
23:35:18FromDiscord<Elegantbeef> yes `new T()` is invalid
23:35:27FromDiscord<heysokam> ah i see
23:35:30FromDiscord<Elegantbeef> Nim does not have a `new` that takes in a value
23:35:45FromDiscord<ygorko> awesome, that was one of my questions
23:35:47FromDiscord<Elegantbeef> You do not need new when allocating ref objects with constructors
23:35:47FromDiscord<Elegantbeef> they do it i implicitly
23:35:56FromDiscord<heysokam> ohhh kk i didn't know that
23:36:03FromDiscord<ygorko> What is the difference between constructing new instance of Type with `new Type` and `Type()`?
23:36:12FromDiscord<ygorko> assuming `Type` is a `ref object`
23:36:17FromDiscord<Elegantbeef> You like typing more
23:36:44FromDiscord<ygorko> alright, thanks!
23:37:18FromDiscord<Elegantbeef> Any more questions and you'll have to put a penny in the hat out front
23:42:32FromDiscord<summarity> > cannot use symbol of kind 'proc' as a 'param'↵is this a known limitation of `template`s?
23:42:47FromDiscord<Elegantbeef> depends, what are you doing
23:43:31FromDiscord<summarity> passing a proc to a template
23:43:39FromDiscord<Elegantbeef> That's not helping
23:43:56FromDiscord<Elegantbeef> Are you passing a proc to a template then using that parameter name as a parameter's field ident
23:44:08FromDiscord<Elegantbeef> If so, welcome to templates, they replace all parameters with their name
23:44:32FromDiscord<Elegantbeef> So if you write `template doThing(i: untyped) = proc(i: int) = discard` that `i` inside that `proc` is whatever you passed in
23:44:48FromDiscord<Elegantbeef> so `doThing "hmm"` will error about a string being placed inside a ident def
23:46:09FromDiscord<summarity> ah yes, that led me to the issue, it was accidentally overwriting a type name
23:48:36*Yew left #nim (.)