<< 19-05-2024 >>

00:01:23FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=RYPNrNEL
00:01:47FromDiscord<Elegantbeef> Though `static` is not required
00:04:40FromDiscord<sOkam! 🫐> ic
00:06:33FromDiscord<Elegantbeef> Though that case statement makes more sense as a boolean expression
00:06:34FromDiscord<Elegantbeef> Atleast to me
00:07:42FromDiscord<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:53FromDiscord<Elegantbeef> Replace with a static hashset if it pleases 😄
00:09:29FromDiscord<Elegantbeef> Also dynamic libraries are binaries
00:09:44FromDiscord<Elegantbeef> More likely than not so are object files
00:10:28FromDiscord<sOkam! 🫐> then what are `.exe` files?
00:10:38FromDiscord<Elegantbeef> executables
00:10:42FromDiscord<sOkam! 🫐> that's what "binary" means there, technicalities aside
00:10:43FromDiscord<Elegantbeef> But the thing with linux is all files are executable
00:10:54FromDiscord<Elegantbeef> You can make a jpeg executable 😄
00:11:05FromDiscord<Elegantbeef> Extensions do not exist!
00:11:14FromDiscord<Elegantbeef> They played us for fools
00:11:34FromDiscord<sOkam! 🫐> 🤷‍♂️ but confy does not compile jpeg 😄 so idc about technicalities there, a binary is just a binary app for simplicity
00:11:51FromDiscord<Elegantbeef> I'd name it `executable` instead but you do you
00:13:31FromDiscord<sOkam! 🫐> problem with that is `isExe` implies `hasFileExt(".exe")` intuitively when reading it, so `isBin` is clearer to me
00:13:41FromDiscord<sOkam! 🫐> but I see your point
00:14:09FromDiscord<Elegantbeef> This is your mind on windows
00:14:24FromDiscord<etra> an exe can also be a dll iirc
00:14:39FromDiscord<etra> extensions are a societal agreement
00:15:02FromDiscord<Elegantbeef> Extensions are silly
00:15:05FromDiscord<Elegantbeef> Use a header inside the binary
00:16:09FromDiscord<Elegantbeef> a variable length ascii encoded file type should be the first bytes in any file!
00:16:41FromDiscord<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:31FromDiscord<demotomohiro> sent a code paste, see https://play.nim-lang.org/#pasty=usIENbRJ
01:39:01FromDiscord<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:35FromDiscord<albassort> adding a socket reading stream changes the behavior of the code beforei tr
03:29:36FromDiscord<albassort> (edit) "beforei tr" => "before it"
03:29:39FromDiscord<albassort> is this expected>
03:29:42FromDiscord<albassort> (edit) "expected>" => "expected?"
03:39:11FromDiscord<polylokh_39446> time-travel shouldn't happen in general, no.
03:39:28FromDiscord<Elegantbeef> I smell dangling pointers
03:39:42FromDiscord<albassort> hmm its strange
03:39:48FromDiscord<albassort> so im working on the socks side of my program
03:40:06FromDiscord<albassort> and im realizing, i need a way to read all types of tcp data completely, so parsing ssl is stupid
03:40:15FromDiscord<albassort> so i tried to use the streams
03:40:44FromDiscord<albassort> but the sockst headers and communications transformed into http communications when i added it
03:40:46FromDiscord<albassort> (edit) "it" => "it, at any point"
03:41:01FromDiscord<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:34FromDiscord<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:10FromDiscord<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:19FromDiscord<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:50FromDiscord<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:13FromDiscord<Robyn [She/Her]> Lmao
12:10:40FromDiscord<Robyn [She/Her]> Didn't Arnetheduck work on Status-im projects?
12:12:26FromDiscord<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:39FromDiscord<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:16FromDiscord<Robyn [She/Her]> Could ask on the GitHub issue tracker
13:34:59FromDiscord<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:15FromDiscord<Phil> (edit) "Given that I already opened 3 ... issues," added "on other"
13:35:31FromDiscord<Phil> That one reply also was around after 1 month
13:35:41FromDiscord<Phil> (edit) "month" => "month, and since nothing has happened"
13:41:54NimEventerNew 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:31FromDiscord<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:38FromDiscord</-+> 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:27FromDiscord<Phil> I have absolutely no clue of the problem space so I'm out
15:37:04FromDiscord<Phil> Like, you can do it, but I have no clue how one does work on any of those
15:41:30NimEventerNew thread by slangmgh: GC refc or MarkAndSweep bug with msvc compiler optimizer., see https://forum.nim-lang.org/t/11618
15:50:33FromDiscord<Robyn [She/Her]> In reply to @/-+ "Please I want to": Yes and yes, it can do both
15:51:08FromDiscord<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:21FromDiscord<Robyn [She/Her]> There is NLVM which compiles Nim to LLVM IR
16:06:39FromDiscord<fenilli> sent a code paste, see https://play.nim-lang.org/#pasty=NcKWOluH
16:08:03FromDiscord<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:46FromDiscord<Phil> Typically split out the types into a separate file, import them in both modules
16:09:30FromDiscord<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:21FromDiscord<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:05FromDiscord<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:20FromDiscord<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:57FromDiscord<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:41Amun-Raexport turns off name mangling
16:18:12FromDiscord<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:09FromDiscord<Phil> The above exports I will likely reduce to the bare minimum when I get to the polish phase of the package
16:19:31FromDiscord<fenilli> cool this was the only pain point I faced when using nim, so far really liking the language.
16:20:07FromDiscord<fenilli> I guess because my project is rather small doing a file for types should be fine
16:20:38FromDiscord<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:32FromDiscord<Phil> No. ↵I tend to camelcase everything out of consistency, std lib is all lowercase
16:21:44FromDiscord<odexine> filenames tend to be either complete lowercase or snake case
16:22:20FromDiscord<odexine> camelcase modules are rare in that ive only seen phil do it so far xd
16:22:22FromDiscord<fenilli> with those 2 ansers I guess the answer is " do whenever you feel better "
16:22:46FromDiscord<odexine> usually thats how nim operates
16:22:56FromDiscord<Phil> Pretty much 😄↵If you want a style guide you can look at what status is doing and adopt theirs
16:23:32FromDiscord<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:47FromDiscord<fenilli> status? where could I look it?
16:24:18FromDiscord<Phil> https://status-im.github.io/nim-style-guide/
16:25:00FromDiscord<fenilli> oh cool thanks for the help gius
16:25:02FromDiscord<fenilli> (edit) "gius" => "guys"
16:25:49FromDiscord<Phil> Happy to help
16:40:55NimEventerNew thread by Nello41: Working with sequences, see https://forum.nim-lang.org/t/11619
17:02:48*def- quit (Quit: -)
17:15:07NimEventerNew thread by take1234: Number sequences, see https://forum.nim-lang.org/t/11620
17:20:37*def- joined #nim
17:30:21FromDiscord<fenilli> sent a code paste, see https://play.nim-lang.org/#pasty=jeBgIgPp
17:32:07FromDiscord<fenilli> I guess the question could be more like what is the equivalent of `Vec2 myVec` and `changeX(&myVec)`
17:32:24FromDiscord<fenilli> (edit) "`changeX(&myVec)`" => "`ChangeX(&myVec)`"
17:35:17Amun-Ravar works for ref and non ref data
17:37:06FromDiscord<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:05Amun-Rayou can't pass var object via neither move nor copy
17:38:42Amun-RaI mean that wouldn't much sense
17:38:44Amun-Rahave*
17:42:45FromDiscord<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:34FromDiscord<demotomohiro> var parameter is not ref counted and can refer variables on stack.
17:45:01FromDiscord<fenilli> ok so basically its mostly about how in memory they are handled and how you pass those around.
17:45:20FromDiscord<fenilli> and the `ref Vec2` is just a type to enforce passing a reference object.
17:48:57FromDiscord<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:45FromDiscord<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:58FromDiscord<fenilli> I guess the best bet for long lived ones would be a ref object right?
17:54:03FromDiscord<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:28FromDiscord<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:46FromDiscord<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:44FromDiscord<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:46FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#pasty=XrdTJOAi
17:56:12FromDiscord<odexine> valid as of now
17:56:24FromDiscord<odexine> if ever strict functions becomes the default it will no longer be
17:56:40FromDiscord<Phil> ... wouldn't that just affect `func`?
17:57:10FromDiscord<odexine> hm i had thought it would enforce mutability to be marked for references
17:57:22FromDiscord<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:49FromDiscord<odexine> as in i recall something akin to `ref var T`
18:00:25FromDiscord<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:02FromDiscord<Phil> Sure. Really all boils down to the mental model you have of your code
18:01:15FromDiscord<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:35FromDiscord<fenilli> well thanks
18:01:44FromDiscord<odexine> id say in that case i would go with just var
18:02:11FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#pasty=zNpnOYSR
18:02:33FromDiscord<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:55FromDiscord<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:31FromDiscord<Phil> Also 0 change of a segfault happening due to nil-access
18:04:37FromDiscord<Phil> (edit) "change" => "chance"
18:10:55*ntat joined #nim
18:11:53FromDiscord<fenilli> cool I will use these for the time being until I found a reason to use ref.
18:12:08FromDiscord<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:43FromDiscord<fenilli> sent a code paste, see https://play.nim-lang.org/#pasty=scwNcYUP
18:15:45FromDiscord<fenilli> or something like this.
18:15:52FromDiscord<fenilli> does that seen correct?
18:17:07FromDiscord<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:48FromDiscord<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:11FromDiscord<tauruuuuuus> Can anyone point me in the right direction? Thanks in advance
18:32:19FromDiscord<odexine> Well what have you tried so far?
18:37:43FromDiscord<odexine> I assume you installed the package with nimble?
18:38:21FromDiscord<demotomohiro> In reply to @tauruuuuuus "Hiya, I can't seem": My code imports compiler module like: `import "$nim"/compiler/platform`.
18:46:30FromDiscord<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:45FromDiscord<morgan> that's how futhark did it but im curious if there's a cleaner way
18:48:18Amun-Rayou mean an object with one non-union member and the other union one?
18:48:43FromDiscord<morgan> yeah
18:48:52Amun-Rathen yes
18:49:06FromDiscord<morgan> sent a code paste, see https://play.nim-lang.org/#pasty=yKCbxFXa
18:49:10FromDiscord<morgan> ok
18:50:48Amun-Rahttps://play.nim-lang.org/#pasty=WYDuhoCI
18:52:47FromDiscord<morgan> 👍
18:53:31Amun-Ranote 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:34FromDiscord<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:14FromDiscord<Elegantbeef> I think it's documented somewhere or that might just be an issue
19:44:40FromDiscord<that_dude.> sent a code paste, see https://play.nim-lang.org/#pasty=shLLmtAB
19:45:14FromDiscord<that_dude.> (I would have cleaned it up but I'm afraid I would have broken something else while at it)
19:45:40FromDiscord<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:07FromDiscord<that_dude.> I initially tried to use backtics but they had the exact same issue
19:46:28FromDiscord<Elegantbeef> Of course it inserts the variable name
19:46:42FromDiscord<Elegantbeef> How would it insert the value of a runtime value?
19:47:14FromDiscord<that_dude.> Ah right
19:49:19FromDiscord<that_dude.> Is this something where changing the direction prarameter to static could help?
19:50:07FromDiscord<Elegantbeef> If it is meant to be static, possibly
19:50:09FromDiscord<that_dude.> Otherwise I'll probably just use a macro
19:50:13FromDiscord<that_dude.> (edit) "macro" => "template"
19:53:05FromDiscord<polylokh_39446> if sync_option is const, the value will be interpolated
19:53:35FromDiscord<polylokh_39446> but, maybe not in an expected way
19:54:06FromDiscord<polylokh_39446> sent a code paste, see https://play.nim-lang.org/#pasty=btpCnlXW
19:54:20FromDiscord<polylokh_39446> (edit) "https://play.nim-lang.org/#pasty=ETahoJyx" => "https://play.nim-lang.org/#pasty=pIUJiemf"
19:54:39FromDiscord<Elegantbeef> That's what I expected to be honest
19:55:13FromDiscord<Elegantbeef> It's an easy fix in the compiler atleast
19:56:40FromDiscord<Elegantbeef> That also depends on the backend
19:56:45FromDiscord<Elegantbeef> so JS might behave differently
19:57:11*def- quit (Quit: -)
19:57:24FromDiscord<Elegantbeef> But if it's a constant you can just do `emit: """...""" & syncOption & """..."""`
19:57:30FromDiscord<polylokh_39446> sent a code paste, see https://play.nim-lang.org/#pasty=bRTTDLlF
19:58:21FromDiscord<Elegantbeef> Or use `strutils.%` or `strformat` ....
19:59:38FromDiscord<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:39FromDiscord<that_dude.> Yep that's all it was LOL. I forgot to use const
20:02:46*ntat quit (Quit: Leaving)
20:03:00FromDiscord<that_dude.> All this emscripten stuff is messing with me
20:04:28FromDiscord<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:44FromDiscord<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:20FromDiscord<Elegantbeef> The web was a mistake
20:12:32FromDiscord<that_dude.> It was, but I need it for my mvp. I want to be able to play without downloading anything
20:12:50FromDiscord<Elegantbeef> Sorry but opening a webpage is downloading.... you freeloader
20:17:18FromDiscord<fenilli> sent a code paste, see https://play.nim-lang.org/#pasty=SRIWbjSU
20:17:51FromDiscord<Elegantbeef> `players`
20:17:59FromDiscord<Elegantbeef> The convention is to make them plural
20:18:10FromDiscord<fenilli> the filename?
20:18:17FromDiscord<fenilli> (edit) "the filename? ... " added "or the var?"
20:18:27FromDiscord<Elegantbeef> yes
20:18:27FromDiscord<Elegantbeef> The filename
20:18:31FromDiscord<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:38FromDiscord<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:51Amun-RaI'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:53FromDiscord<Elegantbeef> Cause `[1]` returns a `nnkSym`
22:03:00Amun-Rais there a way to resolve that to nnkObjectTy?
22:03:04FromDiscord<Elegantbeef> Personally I'd suggest https://play.nim-lang.org/#pasty=yrkFOJXH
22:03:12FromDiscord<Elegantbeef> I mean you can do `getTypeImpl` and iterate thaat
22:03:17FromDiscord<Elegantbeef> But it's better to work with an instance
22:03:39Amun-Rahmm
22:03:41FromDiscord<Elegantbeef> Personally I'd not use a macro
22:06:02FromDiscord<Elegantbeef> https://play.nim-lang.org/#pasty=zHLmQWNc
22:06:03FromDiscord<Elegantbeef> Works just fine
22:06:09FromDiscord<Elegantbeef> Except on case objects
22:07:20Amun-Raah, right, .fields
22:07:20FromDiscord<Elegantbeef> To support case objects you need to recurse down the tree inside the macro I linked
22:08:31Amun-Rathis is for counting bytes of objects that contains primitive types only
22:09:12Amun-Rathis is what I had until now https://play.nim-lang.org/#pasty=lbGdJqqn .fields is much much simpler
22:09:39FromDiscord<Elegantbeef> Using compiletime on a proc that works with Nimnodes
22:09:41FromDiscord<Elegantbeef> Talk about paranoid
22:10:24Amun-Ra;)
22:10:33Amun-Raexpressive ;)
22:22:23Amun-Rathanks 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:15FromDiscord<ilsqr> @kreatoo yaptığın işlere hayranım dostum eline sağlık
23:46:18FromDiscord<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:03FromDiscord<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:29FromDiscord<Elegantbeef> Heh
23:57:35FromDiscord<Elegantbeef> `rand(AsteroidSize)`
23:57:46FromDiscord<fenilli> do I need to import something?
23:57:54FromDiscord<Elegantbeef> No
23:58:07FromDiscord<fenilli> sent a code paste, see https://play.nim-lang.org/#pasty=UNeiIHlv
23:58:11FromDiscord<Elegantbeef> https://nim-lang.org/docs/random.html#rand%2Ctypedesc%5BT%5D
23:58:23FromDiscord<fenilli> oh yeh it is not a Ordinal enum
23:58:33FromDiscord<fenilli> sent a code paste, see https://play.nim-lang.org/#pasty=hFvixyLb
23:58:44FromDiscord<Elegantbeef> Right then you need an array
23:59:10FromDiscord<Elegantbeef> Stop using non ordinal enums
23:59:49FromDiscord<fenilli> in this case what would you suggest? a ord enum, and having a if sttm to get a value based on the enum?