00:01:23 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=RYPNrNEL |
00:01:47 | FromDiscord | <Elegantbeef> Though `static` is not required |
00:04:40 | FromDiscord | <sOkam! 🫐> ic |
00:06:33 | FromDiscord | <Elegantbeef> Though that case statement makes more sense as a boolean expression |
00:06:34 | FromDiscord | <Elegantbeef> Atleast to me |
00:07:42 | FromDiscord | <Elegantbeef> `ext in [ext.unix.bin, ext.win.bin, ext.mac.bin] or ext notin [ext.unix.lib, ext.win.lib, ext.mac.lib, ext.unix.obj, ext.win.obj]` |
00:07:53 | FromDiscord | <Elegantbeef> Replace with a static hashset if it pleases 😄 |
00:09:29 | FromDiscord | <Elegantbeef> Also dynamic libraries are binaries |
00:09:44 | FromDiscord | <Elegantbeef> More likely than not so are object files |
00:10:28 | FromDiscord | <sOkam! 🫐> then what are `.exe` files? |
00:10:38 | FromDiscord | <Elegantbeef> executables |
00:10:42 | FromDiscord | <sOkam! 🫐> that's what "binary" means there, technicalities aside |
00:10:43 | FromDiscord | <Elegantbeef> But the thing with linux is all files are executable |
00:10:54 | FromDiscord | <Elegantbeef> You can make a jpeg executable 😄 |
00:11:05 | FromDiscord | <Elegantbeef> Extensions do not exist! |
00:11:14 | FromDiscord | <Elegantbeef> They played us for fools |
00:11:34 | FromDiscord | <sOkam! 🫐> 🤷♂️ but confy does not compile jpeg 😄 so idc about technicalities there, a binary is just a binary app for simplicity |
00:11:51 | FromDiscord | <Elegantbeef> I'd name it `executable` instead but you do you |
00:13:31 | FromDiscord | <sOkam! 🫐> problem with that is `isExe` implies `hasFileExt(".exe")` intuitively when reading it, so `isBin` is clearer to me |
00:13:41 | FromDiscord | <sOkam! 🫐> but I see your point |
00:14:09 | FromDiscord | <Elegantbeef> This is your mind on windows |
00:14:24 | FromDiscord | <etra> an exe can also be a dll iirc |
00:14:39 | FromDiscord | <etra> extensions are a societal agreement |
00:15:02 | FromDiscord | <Elegantbeef> Extensions are silly |
00:15:05 | FromDiscord | <Elegantbeef> Use a header inside the binary |
00:16:09 | FromDiscord | <Elegantbeef> a variable length ascii encoded file type should be the first bytes in any file! |
00:16:41 | FromDiscord | <Elegantbeef> Without that it should be just considered an 'untyped' file! |
01:00:03 | * | nazgulsenpai quit (Quit: ZNC 1.8.2 - https://znc.in) |
01:02:27 | * | nazgulsenpai joined #nim |
01:24:53 | * | beholders_eye quit (Read error: Connection reset by peer) |
01:30:27 | * | beholders_eye joined #nim |
01:33:31 | FromDiscord | <demotomohiro> sent a code paste, see https://play.nim-lang.org/#pasty=usIENbRJ |
01:39:01 | FromDiscord | <sOkam! 🫐> In reply to @demotomohiro "These per OS extension": with different names |
01:55:45 | * | def- quit (Quit: -) |
01:58:00 | * | def- joined #nim |
02:44:08 | * | def- quit (Quit: -) |
03:01:57 | * | krux02 quit (Remote host closed the connection) |
03:04:09 | * | def- joined #nim |
03:29:35 | FromDiscord | <albassort> adding a socket reading stream changes the behavior of the code beforei tr |
03:29:36 | FromDiscord | <albassort> (edit) "beforei tr" => "before it" |
03:29:39 | FromDiscord | <albassort> is this expected> |
03:29:42 | FromDiscord | <albassort> (edit) "expected>" => "expected?" |
03:39:11 | FromDiscord | <polylokh_39446> time-travel shouldn't happen in general, no. |
03:39:28 | FromDiscord | <Elegantbeef> I smell dangling pointers |
03:39:42 | FromDiscord | <albassort> hmm its strange |
03:39:48 | FromDiscord | <albassort> so im working on the socks side of my program |
03:40:06 | FromDiscord | <albassort> and im realizing, i need a way to read all types of tcp data completely, so parsing ssl is stupid |
03:40:15 | FromDiscord | <albassort> so i tried to use the streams |
03:40:44 | FromDiscord | <albassort> but the sockst headers and communications transformed into http communications when i added it |
03:40:46 | FromDiscord | <albassort> (edit) "it" => "it, at any point" |
03:41:01 | FromDiscord | <albassort> i also learned that, they're barely implemented and don't work really |
03:41:16 | * | def- quit (Quit: -) |
03:41:39 | * | def- joined #nim |
03:59:23 | * | beholders_eye quit (Ping timeout: 264 seconds) |
04:30:49 | * | def- quit (Quit: -) |
04:35:34 | FromDiscord | <albassort> lol im stupid i figured it out haha |
04:50:45 | * | def- joined #nim |
07:09:51 | * | ntat joined #nim |
07:12:57 | * | coldfeet joined #nim |
07:31:27 | * | marcus quit (Remote host closed the connection) |
07:33:22 | * | marcus joined #nim |
07:50:10 | FromDiscord | <Phil> In reply to @michaelb.eth "I don’t know offhand,": I just went through source of nim chronos. If there is anything, I don't see it. I was contemplating writing my own version of poll for a hot second there until I realized that whatever while-loop its got going on is hidden inside nested procs somewhere and by the time I understand this massive proc I'd be ancient |
08:13:35 | * | gshumway quit (Quit: .) |
08:16:13 | * | gshumway joined #nim |
09:24:43 | * | ntat quit (Quit: Leaving) |
09:33:19 | FromDiscord | <Phil> ... do we have anyone else with deeper chronos experience or am I once again about to become that person? |
10:05:13 | * | def- quit (Quit: -) |
10:06:02 | * | def- joined #nim |
10:09:31 | * | def- quit (Client Quit) |
10:11:41 | * | def- joined #nim |
10:32:52 | * | def- quit (Quit: -) |
10:33:37 | * | def- joined #nim |
11:09:50 | FromDiscord | <odexine> "maybe robyn" |
11:28:54 | * | def- quit (Quit: -) |
11:29:30 | * | def- joined #nim |
11:35:04 | * | def- quit (Quit: -) |
11:35:28 | * | def- joined #nim |
11:54:13 | * | coldfeet quit (Remote host closed the connection) |
12:10:13 | FromDiscord | <Robyn [She/Her]> Lmao |
12:10:40 | FromDiscord | <Robyn [She/Her]> Didn't Arnetheduck work on Status-im projects? |
12:12:26 | FromDiscord | <Robyn [She/Her]> Think they made an announcement relating to chronos at one point |
12:16:14 | * | coldfeet joined #nim |
12:18:01 | * | krux02 joined #nim |
13:06:04 | * | def- quit (Quit: -) |
13:06:47 | * | def- joined #nim |
13:31:39 | FromDiscord | <Phil> In reply to @chronos.vitaqua "Didn't Arnetheduck work on": Yes, Arne does work on that, just not sure if he'd appreciate the ping |
13:32:16 | FromDiscord | <Robyn [She/Her]> Could ask on the GitHub issue tracker |
13:34:59 | FromDiscord | <Phil> Given that I already opened 3 issues, only one of which received a reply, and that this is more of a "How do I do this" rather than "This doesn't work/Feature request" situation I'm hesitant |
13:35:15 | FromDiscord | <Phil> (edit) "Given that I already opened 3 ... issues," added "on other" |
13:35:31 | FromDiscord | <Phil> That one reply also was around after 1 month |
13:35:41 | FromDiscord | <Phil> (edit) "month" => "month, and since nothing has happened" |
13:41:54 | NimEventer | New thread by Qtless: HappyX web framework got a new sponsor, see https://forum.nim-lang.org/t/11616 |
14:00:04 | * | coldfeet quit (Remote host closed the connection) |
14:22:51 | * | coldfeet joined #nim |
14:23:31 | FromDiscord | <Robyn [She/Her]> In reply to @isofruit "That one reply also": Ah okay then |
14:43:08 | * | def- quit (Quit: -) |
14:44:34 | * | def- joined #nim |
15:04:29 | * | def- quit (Quit: -) |
15:04:57 | * | def- joined #nim |
15:12:41 | * | def- quit (Quit: -) |
15:13:00 | * | def- joined #nim |
15:25:13 | * | coldfeet quit (Quit: leaving) |
15:25:49 | * | coldfeet joined #nim |
15:28:38 | FromDiscord | </-+> Please I want to ask can Nim be use to develop operating system and compilers.i m new to this language |
15:30:56 | * | def- quit (Quit: -) |
15:31:16 | * | def- joined #nim |
15:34:24 | * | def- quit (Client Quit) |
15:35:18 | * | def- joined #nim |
15:36:27 | FromDiscord | <Phil> I have absolutely no clue of the problem space so I'm out |
15:37:04 | FromDiscord | <Phil> Like, you can do it, but I have no clue how one does work on any of those |
15:41:30 | NimEventer | New thread by slangmgh: GC refc or MarkAndSweep bug with msvc compiler optimizer., see https://forum.nim-lang.org/t/11618 |
15:50:33 | FromDiscord | <Robyn [She/Her]> In reply to @/-+ "Please I want to": Yes and yes, it can do both |
15:51:08 | FromDiscord | <Robyn [She/Her]> This is a kernel written in Nim https://github.com/dom96/nimkernel and the Nim compiler is also written in Nim, but it compiles to C |
15:51:21 | FromDiscord | <Robyn [She/Her]> There is NLVM which compiles Nim to LLVM IR |
16:06:39 | FromDiscord | <fenilli> sent a code paste, see https://play.nim-lang.org/#pasty=NcKWOluH |
16:08:03 | FromDiscord | <fenilli> there are some cases that `world.nim` would also be needed to call something like `changeScene` from it, and that in itself does have an instance of WorldScene to call init again if needed. |
16:08:46 | FromDiscord | <Phil> Typically split out the types into a separate file, import them in both modules |
16:09:30 | FromDiscord | <Phil> At least that's what I often tend to do - types that are tightly interwoven tend to end up in the same module on my end |
16:12:21 | FromDiscord | <Phil> Like here where the concept of subscription and observable are tightly linked, they end up in the same file: ↵https://github.com/minamorl/rex/blob/main/src%2Frex%2Fcore.nim#L9 |
16:15:05 | FromDiscord | <Phil> I also tend to end up with a lot of files that just define the type and generally the very simple interactions with it that I want to be possible, and all the more complex logic that requires multiple different concepts tend to be their own modules that just use the types with their simple procs |
16:15:20 | FromDiscord | <fenilli> oh I didn't knew that nim had a `export` keyworld I thought it was only with , so should I use a "JS" idea where we have a single place to export and import from it? |
16:16:57 | FromDiscord | <fenilli> In reply to @isofruit "Typically split out the": also this idea follows c convention a bit no? like a header file for forward declarations? |
16:17:41 | Amun-Ra | export turns off name mangling |
16:18:12 | FromDiscord | <Phil> You mean barrel files? Absolutely a valid pattern, I tend to abstract away "larger packages"that way. ↵Case in point the current approach to my unfinished concurrency lib with its serverActor.nim file abstracting away the code in the server actor directory↵https://github.com/PhilippMDoerner/Slacktors/blob/master/src%2Fslacktors%2FserverActor.nim |
16:19:09 | FromDiscord | <Phil> The above exports I will likely reduce to the bare minimum when I get to the polish phase of the package |
16:19:31 | FromDiscord | <fenilli> cool this was the only pain point I faced when using nim, so far really liking the language. |
16:20:07 | FromDiscord | <fenilli> I guess because my project is rather small doing a file for types should be fine |
16:20:38 | FromDiscord | <fenilli> with that in mind tho, is there a convention for filenames? I saw std uses lowercase for every file so even things like `actormanager` would look like this. |
16:21:32 | FromDiscord | <Phil> No. ↵I tend to camelcase everything out of consistency, std lib is all lowercase |
16:21:44 | FromDiscord | <odexine> filenames tend to be either complete lowercase or snake case |
16:22:20 | FromDiscord | <odexine> camelcase modules are rare in that ive only seen phil do it so far xd |
16:22:22 | FromDiscord | <fenilli> with those 2 ansers I guess the answer is " do whenever you feel better " |
16:22:46 | FromDiscord | <odexine> usually thats how nim operates |
16:22:56 | FromDiscord | <Phil> Pretty much 😄↵If you want a style guide you can look at what status is doing and adopt theirs |
16:23:32 | FromDiscord | <Phil> There are some solid recommendations in there if you don't already have your own preconceived notions how code should look like |
16:23:47 | FromDiscord | <fenilli> status? where could I look it? |
16:24:18 | FromDiscord | <Phil> https://status-im.github.io/nim-style-guide/ |
16:25:00 | FromDiscord | <fenilli> oh cool thanks for the help gius |
16:25:02 | FromDiscord | <fenilli> (edit) "gius" => "guys" |
16:25:49 | FromDiscord | <Phil> Happy to help |
16:40:55 | NimEventer | New thread by Nello41: Working with sequences, see https://forum.nim-lang.org/t/11619 |
17:02:48 | * | def- quit (Quit: -) |
17:15:07 | NimEventer | New thread by take1234: Number sequences, see https://forum.nim-lang.org/t/11620 |
17:20:37 | * | def- joined #nim |
17:30:21 | FromDiscord | <fenilli> sent a code paste, see https://play.nim-lang.org/#pasty=jeBgIgPp |
17:32:07 | FromDiscord | <fenilli> I guess the question could be more like what is the equivalent of `Vec2 myVec` and `changeX(&myVec)` |
17:32:24 | FromDiscord | <fenilli> (edit) "`changeX(&myVec)`" => "`ChangeX(&myVec)`" |
17:35:17 | Amun-Ra | var works for ref and non ref data |
17:37:06 | FromDiscord | <fenilli> it sure does, but does it behave the same? meaning doe a non ref object "become" a ref one when passed? or is just changing how it is passed, move vs copy. |
17:38:05 | Amun-Ra | you can't pass var object via neither move nor copy |
17:38:42 | Amun-Ra | I mean that wouldn't much sense |
17:38:44 | Amun-Ra | have* |
17:42:45 | FromDiscord | <demotomohiro> ref types are reference counted and can be referenced by multiple references.↵ref types are always allocated on heap.↵var parameter is just for changing the value of argument. |
17:43:34 | FromDiscord | <demotomohiro> var parameter is not ref counted and can refer variables on stack. |
17:45:01 | FromDiscord | <fenilli> ok so basically its mostly about how in memory they are handled and how you pass those around. |
17:45:20 | FromDiscord | <fenilli> and the `ref Vec2` is just a type to enforce passing a reference object. |
17:48:57 | FromDiscord | <Phil> In reply to @fenilli "and the `ref Vec2`": Kind of.↵Overall you're honestly best served not trying to think too deply about how nim will treat `var` parameters under the hood and focus on "value-types are pass by value, even if nim might, under the hood use ref-types there to represent your data. |
17:51:45 | FromDiscord | <fenilli> I'm trying to understand more about which one should I use when dealing with mutable objects that will be passed around. |
17:51:58 | FromDiscord | <fenilli> I guess the best bet for long lived ones would be a ref object right? |
17:54:03 | FromDiscord | <Phil> In reply to @fenilli "I guess the best": It really depends on your mental model.↵If all the time you're thinking of a single instance of an object being passed around, then yeah, ref-type is the way to go |
17:54:19 | * | def- quit (Quit: -) |
17:54:28 | FromDiscord | <Phil> If you don't have that mental model or don't care or this is a single instance of you needing to modify a type, value-type is the way to go |
17:54:46 | FromDiscord | <Phil> Note that value types provide better security than ref-type in terms of not blowing up in your face |
17:55:38 | * | def- joined #nim |
17:55:44 | FromDiscord | <demotomohiro> In reply to @fenilli "I guess the best": Use ref types when you need multiple objects need to refer one objects or need to use inheritance.↵If not, you don't need to use refs.↵This might helps you to understand about ref object:https://internet-of-tomohiro.pages.dev/nim/faq.en#type-when-to-use-ref-object-vs-plain-object-qmark |
17:55:46 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#pasty=XrdTJOAi |
17:56:12 | FromDiscord | <odexine> valid as of now |
17:56:24 | FromDiscord | <odexine> if ever strict functions becomes the default it will no longer be |
17:56:40 | FromDiscord | <Phil> ... wouldn't that just affect `func`? |
17:57:10 | FromDiscord | <odexine> hm i had thought it would enforce mutability to be marked for references |
17:57:22 | FromDiscord | <odexine> perhaps thats another feature, i recall it being mentioned |
17:58:50 | * | def- quit (Client Quit) |
17:59:05 | * | def- joined #nim |
17:59:49 | FromDiscord | <odexine> as in i recall something akin to `ref var T` |
18:00:25 | FromDiscord | <fenilli> Well if I'm reading correctly, if I don't know why I need a ref, just use non ref with vars and later if needed update to a ref? |
18:01:02 | FromDiscord | <Phil> Sure. Really all boils down to the mental model you have of your code |
18:01:15 | FromDiscord | <fenilli> As the cases I'm thinking I wouldn't use an object to have a reference to another, but be passed to functions to be used instead. |
18:01:35 | FromDiscord | <fenilli> well thanks |
18:01:44 | FromDiscord | <odexine> id say in that case i would go with just var |
18:02:11 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#pasty=zNpnOYSR |
18:02:33 | FromDiscord | <Phil> In reply to @fenilli "As the cases I'm": Yeah that's a classic example of value-type objects, so your assessment sounds spot on to me |
18:02:55 | FromDiscord | <demotomohiro> Non-ref types are usually faster as it can be allocated on stack or data segment.↵No pointer indirection.↵Non-ref types are allocated on memory contiguously when using array or seq. |
18:04:31 | FromDiscord | <Phil> Also 0 change of a segfault happening due to nil-access |
18:04:37 | FromDiscord | <Phil> (edit) "change" => "chance" |
18:10:55 | * | ntat joined #nim |
18:11:53 | FromDiscord | <fenilli> cool I will use these for the time being until I found a reason to use ref. |
18:12:08 | FromDiscord | <fenilli> as things like ecs probably could use some ref objects, or not. haha |
18:13:56 | * | def- quit (Quit: -) |
18:14:18 | * | def- joined #nim |
18:15:43 | FromDiscord | <fenilli> sent a code paste, see https://play.nim-lang.org/#pasty=scwNcYUP |
18:15:45 | FromDiscord | <fenilli> or something like this. |
18:15:52 | FromDiscord | <fenilli> does that seen correct? |
18:17:07 | FromDiscord | <fenilli> still new to both game development and nim, learning both at the same time so i'm lost on these basic stuff. |
18:31:48 | FromDiscord | <tauruuuuuus> Hiya, I can't seem to understand how to successfully import `compiler/parser` or anything from the compiler pkg from the nim internals |
18:32:11 | FromDiscord | <tauruuuuuus> Can anyone point me in the right direction? Thanks in advance |
18:32:19 | FromDiscord | <odexine> Well what have you tried so far? |
18:37:43 | FromDiscord | <odexine> I assume you installed the package with nimble? |
18:38:21 | FromDiscord | <demotomohiro> In reply to @tauruuuuuus "Hiya, I can't seem": My code imports compiler module like: `import "$nim"/compiler/platform`. |
18:46:30 | FromDiscord | <morgan> is the best way to define a c type with a union for part of it as two types, one for the union and one for the rest? |
18:46:45 | FromDiscord | <morgan> that's how futhark did it but im curious if there's a cleaner way |
18:48:18 | Amun-Ra | you mean an object with one non-union member and the other union one? |
18:48:43 | FromDiscord | <morgan> yeah |
18:48:52 | Amun-Ra | then yes |
18:49:06 | FromDiscord | <morgan> sent a code paste, see https://play.nim-lang.org/#pasty=yKCbxFXa |
18:49:10 | FromDiscord | <morgan> ok |
18:50:48 | Amun-Ra | https://play.nim-lang.org/#pasty=WYDuhoCI |
18:52:47 | FromDiscord | <morgan> 👍 |
18:53:31 | Amun-Ra | note you can't have anonymous members in nim |
18:59:32 | * | def- quit (Quit: -) |
19:01:03 | * | def- joined #nim |
19:22:53 | * | def- quit (Quit: -) |
19:23:41 | * | def- joined #nim |
19:40:34 | FromDiscord | <tauruuuuuus> In reply to @demotomohiro "My code imports compiler": Thanks!! Could not find this info anywhere, is this documented and I just missed it? |
19:43:14 | FromDiscord | <Elegantbeef> I think it's documented somewhere or that might just be an issue |
19:44:40 | FromDiscord | <that_dude.> sent a code paste, see https://play.nim-lang.org/#pasty=shLLmtAB |
19:45:14 | FromDiscord | <that_dude.> (I would have cleaned it up but I'm afraid I would have broken something else while at it) |
19:45:40 | FromDiscord | <that_dude.> https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-emit-pragma↵Talks about using a list to insert variable values so I thought I was doing this right |
19:46:07 | FromDiscord | <that_dude.> I initially tried to use backtics but they had the exact same issue |
19:46:28 | FromDiscord | <Elegantbeef> Of course it inserts the variable name |
19:46:42 | FromDiscord | <Elegantbeef> How would it insert the value of a runtime value? |
19:47:14 | FromDiscord | <that_dude.> Ah right |
19:49:19 | FromDiscord | <that_dude.> Is this something where changing the direction prarameter to static could help? |
19:50:07 | FromDiscord | <Elegantbeef> If it is meant to be static, possibly |
19:50:09 | FromDiscord | <that_dude.> Otherwise I'll probably just use a macro |
19:50:13 | FromDiscord | <that_dude.> (edit) "macro" => "template" |
19:53:05 | FromDiscord | <polylokh_39446> if sync_option is const, the value will be interpolated |
19:53:35 | FromDiscord | <polylokh_39446> but, maybe not in an expected way |
19:54:06 | FromDiscord | <polylokh_39446> sent a code paste, see https://play.nim-lang.org/#pasty=btpCnlXW |
19:54:20 | FromDiscord | <polylokh_39446> (edit) "https://play.nim-lang.org/#pasty=ETahoJyx" => "https://play.nim-lang.org/#pasty=pIUJiemf" |
19:54:39 | FromDiscord | <Elegantbeef> That's what I expected to be honest |
19:55:13 | FromDiscord | <Elegantbeef> It's an easy fix in the compiler atleast |
19:56:40 | FromDiscord | <Elegantbeef> That also depends on the backend |
19:56:45 | FromDiscord | <Elegantbeef> so JS might behave differently |
19:57:11 | * | def- quit (Quit: -) |
19:57:24 | FromDiscord | <Elegantbeef> But if it's a constant you can just do `emit: """...""" & syncOption & """..."""` |
19:57:30 | FromDiscord | <polylokh_39446> sent a code paste, see https://play.nim-lang.org/#pasty=bRTTDLlF |
19:58:21 | FromDiscord | <Elegantbeef> Or use `strutils.%` or `strformat` .... |
19:59:38 | FromDiscord | <that_dude.> I ended up copy and pasting the code with two different procs and now it works. I had a proc that was defined `proc syncfs(direction: Direction) =` because I wanted to try to keep it cleaner. That said I forgot about const. I always use it for hard coded values, I forgot about storing calculations in them |
20:00:57 | * | def- joined #nim |
20:02:39 | FromDiscord | <that_dude.> Yep that's all it was LOL. I forgot to use const |
20:02:46 | * | ntat quit (Quit: Leaving) |
20:03:00 | FromDiscord | <that_dude.> All this emscripten stuff is messing with me |
20:04:28 | FromDiscord | <that_dude.> Nim code emits C so that I can call emscripten c macros that emit js. Also the js calls async functions |
20:04:44 | FromDiscord | <that_dude.> (edit) "Nim code emits C so that I can call emscripten c macros that emit js. Also the js calls ... async" added "are" |
20:10:20 | FromDiscord | <Elegantbeef> The web was a mistake |
20:12:32 | FromDiscord | <that_dude.> It was, but I need it for my mvp. I want to be able to play without downloading anything |
20:12:50 | FromDiscord | <Elegantbeef> Sorry but opening a webpage is downloading.... you freeloader |
20:17:18 | FromDiscord | <fenilli> sent a code paste, see https://play.nim-lang.org/#pasty=SRIWbjSU |
20:17:51 | FromDiscord | <Elegantbeef> `players` |
20:17:59 | FromDiscord | <Elegantbeef> The convention is to make them plural |
20:18:10 | FromDiscord | <fenilli> the filename? |
20:18:17 | FromDiscord | <fenilli> (edit) "the filename? ... " added "or the var?" |
20:18:27 | FromDiscord | <Elegantbeef> yes |
20:18:27 | FromDiscord | <Elegantbeef> The filename |
20:18:31 | FromDiscord | <fenilli> ok cool thanks |
20:59:56 | * | beholders_eye joined #nim |
21:00:07 | * | coldfeet quit (Remote host closed the connection) |
21:08:29 | * | beholders_eye quit (Ping timeout: 252 seconds) |
21:20:38 | FromDiscord | <demotomohiro> In reply to @tauruuuuuus "Thanks!! Could not find": https://nim-lang.org/docs/manual.html#modules-import-statement↵> String literals can be used for import/include statements. The compiler performs path substitution when used. |
21:28:43 | * | def- quit (Quit: -) |
21:30:52 | * | def- joined #nim |
21:35:25 | * | def- quit (Client Quit) |
21:35:49 | * | def- joined #nim |
21:57:51 | Amun-Ra | I'm trying to modify my macro that iterates object members to an alternative that iterates over typedesc[members], I wonder why children returns no data: https://play.nim-lang.org/#pasty=YsaZbmfk |
21:59:53 | FromDiscord | <Elegantbeef> Cause `[1]` returns a `nnkSym` |
22:03:00 | Amun-Ra | is there a way to resolve that to nnkObjectTy? |
22:03:04 | FromDiscord | <Elegantbeef> Personally I'd suggest https://play.nim-lang.org/#pasty=yrkFOJXH |
22:03:12 | FromDiscord | <Elegantbeef> I mean you can do `getTypeImpl` and iterate thaat |
22:03:17 | FromDiscord | <Elegantbeef> But it's better to work with an instance |
22:03:39 | Amun-Ra | hmm |
22:03:41 | FromDiscord | <Elegantbeef> Personally I'd not use a macro |
22:06:02 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#pasty=zHLmQWNc |
22:06:03 | FromDiscord | <Elegantbeef> Works just fine |
22:06:09 | FromDiscord | <Elegantbeef> Except on case objects |
22:07:20 | Amun-Ra | ah, right, .fields |
22:07:20 | FromDiscord | <Elegantbeef> To support case objects you need to recurse down the tree inside the macro I linked |
22:08:31 | Amun-Ra | this is for counting bytes of objects that contains primitive types only |
22:09:12 | Amun-Ra | this is what I had until now https://play.nim-lang.org/#pasty=lbGdJqqn .fields is much much simpler |
22:09:39 | FromDiscord | <Elegantbeef> Using compiletime on a proc that works with Nimnodes |
22:09:41 | FromDiscord | <Elegantbeef> Talk about paranoid |
22:10:24 | Amun-Ra | ;) |
22:10:33 | Amun-Ra | expressive ;) |
22:22:23 | Amun-Ra | thanks for the tip |
22:25:10 | * | deadmarshal_ quit (Quit: IRCNow and Forever!) |
22:58:48 | * | def- quit (Quit: -) |
22:59:31 | * | def- joined #nim |
23:30:34 | * | SchweinDeBurg quit (Read error: Connection reset by peer) |
23:36:13 | * | SchweinDeBurg joined #nim |
23:39:14 | * | def- quit (Quit: -) |
23:39:50 | * | def- joined #nim |
23:42:59 | * | deadmarshal_ joined #nim |
23:43:19 | * | def- quit (Client Quit) |
23:45:09 | * | def- joined #nim |
23:46:15 | FromDiscord | <ilsqr> @kreatoo yaptığın işlere hayranım dostum eline sağlık |
23:46:18 | FromDiscord | <ilsqr> son nim bükücü |
23:47:59 | * | lucasta joined #nim |
23:50:07 | * | def- quit (Quit: -) |
23:50:19 | * | def- joined #nim |
23:57:03 | FromDiscord | <fenilli> What would be the easiest way to get a random item from a enum? as of now i'm doing this `[AsteroidSize.Small, AsteroidSize.Medium, AsteroidSize.Large][rand(0..2)]` but if I change the enum I need to change here too, is there a easier way? |
23:57:29 | FromDiscord | <Elegantbeef> Heh |
23:57:35 | FromDiscord | <Elegantbeef> `rand(AsteroidSize)` |
23:57:46 | FromDiscord | <fenilli> do I need to import something? |
23:57:54 | FromDiscord | <Elegantbeef> No |
23:58:07 | FromDiscord | <fenilli> sent a code paste, see https://play.nim-lang.org/#pasty=UNeiIHlv |
23:58:11 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/random.html#rand%2Ctypedesc%5BT%5D |
23:58:23 | FromDiscord | <fenilli> oh yeh it is not a Ordinal enum |
23:58:33 | FromDiscord | <fenilli> sent a code paste, see https://play.nim-lang.org/#pasty=hFvixyLb |
23:58:44 | FromDiscord | <Elegantbeef> Right then you need an array |
23:59:10 | FromDiscord | <Elegantbeef> Stop using non ordinal enums |
23:59:49 | FromDiscord | <fenilli> in this case what would you suggest? a ord enum, and having a if sttm to get a value based on the enum? |