<< 27-11-2022 >>

00:01:20FromDiscord<albassort> cant get any of these gui libraries to compile
00:01:26FromDiscord<albassort> having a problem linking with gcc
00:03:26FromDiscord<albassort> https://github.com/khchen/wNim/tree/master/examples
00:03:35FromDiscord<albassort> can anyone get these examples to compile?
00:10:40FromDiscord<guttural666> how can I get the number of fields of an object?
00:10:45FromDiscord<.tochka> `Error: cannot generate VM code for ` kinda cool
00:13:02FromDiscord<wick3dr0se> sent a code paste, see https://play.nim-lang.org/#ix=4gY9
00:14:36FromDiscord<guttural666> In reply to @wick3dr0se "Could you guys help": https://nim-lang.org/docs/os.html#walkDir.i%2Cstring
00:14:52FromDiscord<wick3dr0se> I was looking at that proc earlier actually
00:15:35FromDiscord<wick3dr0se> In reply to @wick3dr0se "would std/os walkDir be": I think walkPattern may be even better?
00:16:11FromDiscord<.tochka> In reply to @guttural666 "how can I get": there's field iterator in system/iterators, could could via that, maybe there's better way
00:16:32FromDiscord<.tochka> (edit) "could" => "work" | "that," => "that probably,"
00:16:40FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/xli
00:16:57FromDiscord<guttural666> In reply to @.tochka "there's field iterator in": yeah, wanted to avoid the caveman version of var i and then emtpy for looping over the fields just to count 😛
00:17:22FromDiscord<guttural666> seems to be the way to go though haha
00:17:36FromDiscord<Elegantbeef> you can do `static: fieldCount(myObj)` and it does it at CT
00:17:36FromDiscord<wick3dr0se> So many like `walkPattern("./")`
00:17:59FromDiscord<guttural666> In reply to @Elegantbeef "you can do `static:": that's way better, thanks!
00:18:41FromDiscord<guttural666> In reply to @wick3dr0se "So many like `walkPattern("./*")`": https://media.discordapp.net/attachments/371759389889003532/1046218468577509386/image.png
00:18:43FromDiscord<Elegantbeef> You also could write a macro
00:20:17FromDiscord<wick3dr0se> Thanks.. I'm trying to write a macro that per each file in current directory, is a directory or regular file
00:21:01FromDiscord<wick3dr0se> I just got back to learning Nim, so I have to read back through my notes as I'm going
00:21:55FromDiscord<Elegantbeef> The macro comment was to guttural not you
00:22:53FromDiscord<wick3dr0se> In reply to @guttural666 "": Actually does what I just described above. Thanks a lot
00:23:47FromDiscord<guttural666> In reply to @wick3dr0se "Actually does what I": actually yields a tuple of kind and the actual path, but you'll figure it out with the docs
00:25:32FromDiscord<.tochka> In reply to @.tochka "`Error: cannot generate VM": what could cause that even
00:25:33FromDiscord<wick3dr0se> In reply to @guttural666 "actually yields a tuple": Hopefully lol. I'm going to attempt writing a small file manager. I managed to write a basic image getter-setter before but this requires more string manipulation and stuff I'm not familiar with yet
00:26:34FromDiscord<Elegantbeef> What are you using that relies on ``↵(@.tochka)
00:27:02FromDiscord<.tochka> error is in here https://media.discordapp.net/attachments/371759389889003532/1046220570838175824/image.png
00:29:24FromDiscord<Elegantbeef> Worth noting your code is equivlent to `abs(v.x abs(v.y abs(v.z)))`
00:29:40FromDiscord<.tochka> ye fixed it already
00:29:43FromDiscord<.tochka> lul
00:30:04FromDiscord<Elegantbeef> Are you calling area at CT for a type that relies on C interop?
00:30:16FromDiscord<.tochka> ok so looks like problem is in matrix https://play.nim-lang.org/#ix=4gYb
00:33:34*mahlon joined #nim
00:33:58FromDiscord<guttural666> sent a code paste, see https://play.nim-lang.org/#ix=4gYd
00:34:16*mahlon quit (Client Quit)
00:35:41FromDiscord<Elegantbeef> It's an implicit generic
00:35:51FromDiscord<Elegantbeef> it's the same as `proc countFields[T: object](obj: T): int`
00:36:17FromDiscord<guttural666> okay but I do need to specifiy that it is an object when doing it with the [T] syntax
00:36:24FromDiscord<Elegantbeef> It's a generic constraint
00:36:37FromDiscord<Elegantbeef> You technically should do `T: object or tuple` to be most specific
00:36:52FromDiscord<guttural666> ah okay
00:37:04FromDiscord<Elegantbeef> Though tuples have `typetraits.tuplelen`
00:40:06*krux02 quit (Remote host closed the connection)
00:40:45FromDiscord<Elegantbeef> This is an odd bug tochka
00:41:43FromDiscord<.tochka> tochka the bug hunter
00:41:46FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=4gYf does compile
00:42:23FromDiscord<guttural666> how do I set the nth element of a generic object? also with a loop over the fields?
00:42:28FromDiscord<Elegantbeef> RFC\: "Change tochka's name to dragonfly"
00:42:39FromDiscord<Elegantbeef> Yep↵(@guttural666)
00:43:59FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4gYh
00:44:34FromDiscord<Elegantbeef> whoops `enumerate obj.fields`
00:45:33FromDiscord<Elegantbeef> `when field is T` is needed aswell
00:45:49FromDiscord<.tochka> In reply to @Elegantbeef "https://play.nim-lang.org/#ix=4gYf does compile": looks like changing stuff to template is solution for almost everything
00:45:52*mahlon joined #nim
00:46:17FromDiscord<Elegantbeef> For a lot of things since pasting the code directly removes many issues
00:47:40FromDiscord<guttural666> wait wait, where is the enumerate going? and the when field is T is a type check against the thing I want to put for safety right?
00:47:55FromDiscord<Elegantbeef> It's not for safety it's cause it's required
00:48:17FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4gYj
00:48:54FromDiscord<guttural666> very cool, thanks!
00:49:01FromDiscord<Elegantbeef> You cannot do `someStringField = 300`
00:49:43FromDiscord<@thatrandomperson5-6310e3b26da03> Isnt varargs[typed] type supposed to except anything? I get an error for my custom type
00:50:02FromDiscord<Elegantbeef> Inside a macro/template it should accept anything
00:50:13FromDiscord<Elegantbeef> Are you perhaps doing `[a, b]` instead of `a, b`
00:50:30*mahlon quit (Remote host closed the connection)
00:51:22*mahlon joined #nim
00:52:37FromDiscord<guttural666> that enumerate macro is really cool
00:53:07FromDiscord<Elegantbeef> yea it's the 'future' way of doing pairs iterators that just yield the index
00:53:50FromDiscord<guttural666> yeah, really useful when parallel looping through multiple collections or stuff like that
00:55:13FromDiscord<@thatrandomperson5-6310e3b26da03> sent a long message, see http://ix.io/4gYk
00:55:53FromDiscord<Elegantbeef> You `OriNode` is a `ref object`
00:55:59FromDiscord<Elegantbeef> Nim does not have a `$` defined for `ref object`
00:56:59FromDiscord<@thatrandomperson5-6310e3b26da03> > Nim does not have a `$` defined for `ref object`↵I tried adding one, it did nothing
00:57:26FromDiscord<Elegantbeef> Are you lying to me
00:57:58FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4gYl
00:59:56FromDiscord<@thatrandomperson5-6310e3b26da03> sent a code paste, see https://play.nim-lang.org/#ix=4gYm
01:00:02FromDiscord<Elegantbeef> Code or it didnt happen
01:00:21FromDiscord<@thatrandomperson5-6310e3b26da03> sent a code paste, see https://play.nim-lang.org/#ix=4gYo
01:00:39FromDiscord<@thatrandomperson5-6310e3b26da03> sent a code paste, see https://paste.rs/pV3
01:00:59FromDiscord<@thatrandomperson5-6310e3b26da03> sent a code paste, see https://play.nim-lang.org/#ix=4gYr
01:01:12FromDiscord<@thatrandomperson5-6310e3b26da03> sent a code paste, see https://play.nim-lang.org/#ix=4gYs
01:01:23FromDiscord<@thatrandomperson5-6310e3b26da03> what?
01:01:30FromDiscord<wick3dr0se> It just keeps populating with duplicate edits plus changes 😄
01:01:30FromDiscord<Yardanico> there's discord or IRC that are bridged as well, and you can ideally paste the code in a separate service
01:01:34FromDiscord<Elegantbeef> Provide a reproducable example
01:01:37FromDiscord<Yardanico> In reply to @wick3dr0se "It just keeps populating": yeah matrix bridge not the best sadly
01:01:55FromDiscord<huantian> or rather discord doesn't support bridges well
01:02:05FromDiscord<Yardanico> ?
01:02:05FromDiscord<wick3dr0se> Likely the case lol
01:02:08FromDiscord<Yardanico> webhooks work fine
01:02:23FromDiscord<Yardanico> you can edit webhook msgs too
01:02:30FromDiscord<Yardanico> it's just a matter of implementing that
01:02:31FromDiscord<huantian> wait yeah I forgot about that
01:02:38FromDiscord<huantian> wonder why it doesn't edit the webhook
01:03:45FromDiscord<@thatrandomperson5-6310e3b26da03> > Provide a reproducable example↵Like [this](https://play.nim-lang.org/#ix=4gYu)?
01:05:13FromDiscord<@thatrandomperson5-6310e3b26da03> Oh wait
01:05:14FromDiscord<@thatrandomperson5-6310e3b26da03> sorry
01:05:19FromDiscord<@thatrandomperson5-6310e3b26da03> my brain ded
01:05:19FromDiscord<Yardanico> test text
01:05:25FromDiscord<Yardanico> test text edit edit 2
01:05:33FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4gYw
01:05:45FromDiscord<Yardanico> I think it might be the case that t2bot is using their own custom fork of matrix-discord bridge
01:05:55FromDiscord<Yardanico> because https://github.com/matrix-org/matrix-appservice-discord/ seems to actually support that
01:06:03FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/1046230390534320168/image.png
01:07:00FromDiscord<Elegantbeef> Yea they do suggest running the upstream if self hosting
01:07:07FromDiscord<Elegantbeef> Odd that they dont arent more recent
01:07:15FromDiscord<@thatrandomperson5-6310e3b26da03> sent a code paste, see https://play.nim-lang.org/#ix=4gYx
01:07:15FromDiscord<Yardanico> lmao funny staircase text
01:07:18FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/1046230702976401449/image.png
01:07:46FromDiscord<Elegantbeef> Someone really should go to matrix or discord instead of using gitter
01:07:56FromDiscord<Elegantbeef> I know gitter is matrix backed but it still does fucky things
01:08:31FromDiscord<Yardanico> that too, idk how they are still alive
01:09:25FromDiscord<Elegantbeef> It's now matrix based and owned by element, so it's odd that it does things like using css for code blocks
01:09:43FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/1046231314090700841/unknown.png
01:09:51FromDiscord<Yardanico> anyone remember we still have the irc bridge? 💀
01:10:06FromDiscord<Elegantbeef> Hey zevv uses it!
01:10:12FromDiscord<Yardanico> is it even alive
01:10:19FromDiscord<Elegantbeef> It is
01:10:21FromDiscord<Elegantbeef> Pmunch also uses it
01:10:25FromDiscord<Elegantbeef> So does a few others
01:10:42FromDiscord<wick3dr0se> sent a code paste, see https://play.nim-lang.org/#ix=4gYz
01:10:51FromDiscord<Elegantbeef> No but using tuples there is a sin
01:11:05FromDiscord<wick3dr0se> What should I use?
01:11:09FromDiscord<Elegantbeef> An object
01:11:20FromDiscord<Elegantbeef> A car is a unique entity not all `(int, string)` is a car
01:11:34FromDiscord<Elegantbeef> `type Car = object` then do what you did for the latter
01:13:27FromDiscord<sneakyfish> Question about enums. Let's say I have two files A and B. I write a proc that takes in an enum in A. I import that file into B. Do i need to define the enum in A so i don't have to write it again in B and other files that use A?
01:13:34FromDiscord<wick3dr0se> Ok thanks. I'll have to look more into objects and tuples. I get confused between all the various types. Theres enums and God knows whatever else
01:14:07FromDiscord<Yardanico> In reply to @sneakyfish "Question about enums. Let's": it's the same for all types, not just enums - you can export the type
01:14:10FromDiscord<Yardanico> with ``
01:14:24FromDiscord<Yardanico> ah, your question is a bit different
01:14:45FromDiscord<Yardanico> Nim doesn't do well with recursive imports so the usual option is to separate shared types into a separate file like `types.nim` and import it in all files
01:15:20FromDiscord<sneakyfish> Ahh I see
01:15:24FromDiscord<Elegantbeef> There are also delayed imports which can be used
01:15:29FromDiscord<Elegantbeef> But that depends on your required design
01:15:32FromDiscord<sneakyfish> So i'd need to import both A and a type
01:16:31FromDiscord<sneakyfish> Yeah, I just started contrubuting to a git repo so im not to sure about the full design.
01:17:30FromDiscord<sneakyfish> I could just use a string tbh. I just thought it would look nicer
01:17:45FromDiscord<Elegantbeef> Using enums are the correct way so they're the way to do it
01:18:00FromDiscord<Elegantbeef> Using strings or integers is a path of madness that only clueless programmers partake
01:18:21FromDiscord<sneakyfish> 😅
01:18:37FromDiscord<sneakyfish> okay cool. Enums then
01:30:23FromDiscord<sneakyfish> btw are cases preferred? in other langs i used something like x = { 'test': procTest } to cut down on a large amount of ifs.
01:31:04FromDiscord<Elegantbeef> case statements are generally better
01:31:21FromDiscord<sneakyfish> cool thanks
01:37:35FromDiscord<Yardanico> In reply to @sneakyfish "btw are cases preferred?": as yet another feature you can index arrays with any ordinal type
01:37:47FromDiscord<Yardanico> not for procs of course, but for normal key/value if the key is ordinal
01:37:51FromDiscord<Yardanico> = an enum value
01:38:03FromDiscord<Elegantbeef> Enum indexed arrays are lovely
01:38:06FromDiscord<Yardanico> <https://github.com/nim-lang/Nim/wiki/Lesser-known-Nim-features/98854ba8d6d792f8f635f05e60cd9d66be69d9bf#using-enums-as-array-indexes>
01:38:11FromDiscord<Elegantbeef> It's a shame how few languages support them
01:38:13FromDiscord<Yardanico> and this is very fast and efficient and all that
01:38:17FromDiscord<sneakyfish> oh great
01:38:20FromDiscord<sneakyfish> thanks!!
01:39:02FromDiscord<Yardanico> and yes, stemming from that same feature nim arrays can start at any int value, not just 0
01:45:14FromDiscord<sneakyfish> In reply to @Yardanico "not for procs of": this looks like it works with procs as well
01:45:25FromDiscord<Yardanico> yes it will, but your procs need to all have the same type
01:45:29FromDiscord<Yardanico> which is the same even for tables though
01:45:40FromDiscord<sneakyfish> oh i see
01:46:00FromDiscord<sneakyfish> got it, it's limited on type
01:46:03FromDiscord<sneakyfish> cool thanks!
01:46:35FromDiscord<Yardanico> it's just as it would be in any other statically typed language, so if you want to have procs that accept different types, you'd need to do type pruning or encapsulate all different types with inheritance or object variants
02:18:10FromDiscord<dedraiaken> Is there a convenient way to consume an iterator to do something like this `sorted(table.keys())`?
02:19:47FromDiscord<Elegantbeef> `toSeq`
02:21:04FromDiscord<dedraiaken> In reply to @Elegantbeef "`toSeq`": Aha, to the rescue again! Worked. 👍
02:35:33FromDiscord<albassort> gtk is cursed
02:48:34FromDiscord<Yepoleb> Yes
03:20:52FromDiscord<Tuatarian> I can't test this easily since I'm not at my computer
03:21:15FromDiscord<Tuatarian> But can you take a (raw) pointer to a generic proc the same way I would for anything else?
03:21:32FromDiscord<Elegantbeef> You need to take it to the generic instance
03:21:45FromDiscord<Tuatarian> Meaning?
03:21:53FromDiscord<Elegantbeef> so `proc doThing(a: auto)` you need to do like `(proc(a: int))(doThing)`
03:22:02FromDiscord<Tuatarian> I see
03:22:49FromDiscord<Tuatarian> `(proc[T](a : T))(garbaçao)` doesn't work?
03:22:59FromDiscord<Elegantbeef> Of course it doesnt
03:23:03FromDiscord<Tuatarian> Ok that makes sense
03:23:26FromDiscord<Elegantbeef> Those are not concrete procedures
03:23:27FromDiscord<Tuatarian> Would the method we used for iterating over all procs with a given name work for generics?
03:23:59FromDiscord<Elegantbeef> Of course not cause it can have N number of instantiations where N is the number of types you have
03:24:01FromDiscord<Tuatarian> Given all the real procs are generated at comp time?
03:24:13FromDiscord<Tuatarian> When is it instantiated?
03:24:23FromDiscord<Elegantbeef> When something uses it
03:24:30FromDiscord<Elegantbeef> Either call directly or when you take the address of it
03:24:43FromDiscord<Tuatarian> So not comptime?
03:24:52FromDiscord<Tuatarian> That's strange...
03:25:08FromDiscord<Tuatarian> Or is it comptime but only generated for the cases that are used in code
03:25:12FromDiscord<Elegantbeef> It's instantiated at compile time, nim is AOT compiled
03:25:27FromDiscord<Elegantbeef> But it's only instantiated on the case it's used
03:25:28FromDiscord<Tuatarian> Right
03:25:41FromDiscord<Elegantbeef> if it instantiated for all types you'd need infinite memory for `proc(a: auto)`
03:25:53FromDiscord<Tuatarian> Assuming infinite types yeah
03:26:02FromDiscord<Elegantbeef> Not even infinite types
03:26:12FromDiscord<Elegantbeef> `proc(a: auto)` implies `proc(a: proc(a: auto))`
03:26:15FromDiscord<Elegantbeef> Which implies....
03:28:11FromDiscord<Tuatarian> I see
03:28:15FromDiscord<Tuatarian> Infinite nesting yeah
03:28:23FromDiscord<Tuatarian> I was briefly afk
03:28:52FromDiscord<Tuatarian> So how would I iterate over all instances of a generic proc in a macro (or is it not possible?)
03:29:15FromDiscord<Elegantbeef> It's not possible cause as i said there are infinite possible
03:29:37FromDiscord<Elegantbeef> consider `proc doThing(a: tuple)` or `a: object)`
03:29:44FromDiscord<Tuatarian> No but they're not all jnstantiated obviously
03:29:50FromDiscord<Tuatarian> I only care about the ones that exist
03:30:01FromDiscord<Elegantbeef> Yea Nim doesnt have an API for that
03:30:20FromDiscord<Tuatarian> Alright that's definitely unfortunate
03:30:45FromDiscord<Tuatarian> Can I do this at runtime somehow? Does Jim hBe any sort of reflection?
03:30:57FromDiscord<Tuatarian> This doesn't all need to be comptime, though it would be nice of course
03:30:58FromDiscord<Elegantbeef> It does have reflection but i wouldnt use it
03:31:13FromDiscord<Tuatarian> Why not?
03:31:22FromDiscord<Elegantbeef> Cause runtime reflection is dumb
03:32:21FromDiscord<albassort> is nim-node interop viable?
03:32:42FromDiscord<Elegantbeef> There is a nodejs library and you can do system apis so of course
03:33:28FromDiscord<Elegantbeef> That does the same thing
03:33:31FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4gYT
03:34:23FromDiscord<Elegantbeef> Or just do what i said before where you convert the type
03:34:59FromDiscord<albassort> having one of those days where every library i try to use just doesn't fucking word
03:35:01FromDiscord<albassort> (edit) "word" => "work"
03:41:22FromDiscord<albassort> dooo you think dart interop would be viable for flutter
03:42:05FromDiscord<albassort> hmmmm
03:42:16FromDiscord<albassort> i guess i could operate using udp
03:42:52FromDiscord<albassort> alright I think there is not a single good gui platform, I've determined
03:43:13FromDiscord<Elegantbeef> gui was a mistake
03:43:34FromDiscord<albassort> indeed
03:43:42FromDiscord<albassort> abolish X
03:45:51FromDiscord<albassort> alright im doing this in haskell
03:46:17FromDiscord<Elegantbeef> Have fun
03:58:36*arkurious quit (Quit: Leaving)
04:01:48FromDiscord<yrashk> is there any way to get typing information for parameters from a given `FormalParams` AST node in a macro (it comes untyped as I am rewriting the given code)?
04:01:56FromDiscord<yrashk> (edit) "get" => "derive"
04:02:03FromDiscord<Elegantbeef> It has to be `typed`
04:02:56FromDiscord<yrashk> I see. Sadly, this leads to "typechecked nodes may not be modified"
04:03:14FromDiscord<Elegantbeef> `copyNimTree` then mutate that
04:36:01FromDiscord<yrashk> That worked, thanks!
04:38:16FromDiscord<yrashk> And going from there, what is the correct way to extract a particular parameter's type from that `typed` parameter? My macro is used as a pragma so I am getting the whole ProcDef
04:39:29FromDiscord<yrashk> or am I still out of luck?
04:39:53FromDiscord<Elegantbeef> you index it
04:40:01FromDiscord<Elegantbeef> `myProc.params[0]` is the return type for instance
04:40:18FromDiscord<Elegantbeef> `echo myProc.treeRepr` shows you the entire tree
04:40:24FromDiscord<Elegantbeef> you can use helper procs like `params` or `body` or manually index it
04:40:44FromDiscord<yrashk> but can I get a `typedesc` out of it?
04:40:56FromDiscord<Elegantbeef> The Nim node is a typedesc
04:41:19FromDiscord<Elegantbeef> `myProc[3][0]` is a typedesc of the return type
04:41:21FromDiscord<yrashk> I see. So, basically, `typed` just guarantees that it has been resolved
04:41:33FromDiscord<Elegantbeef> Correct typed is semantically checked code
04:41:42FromDiscord<Elegantbeef> untyped is parse but not semantically checked
04:42:39FromDiscord<yrashk> sent a code paste, see https://play.nim-lang.org/#ix=4gZ6
04:42:46FromDiscord<Elegantbeef> `[1]`
04:42:58FromDiscord<Elegantbeef> `typedesc[int32]` ==`int32`
04:46:28FromDiscord<Tuatarian> In reply to @Elegantbeef "Really i'd just use": I'm not sure what's happening here
04:46:36FromDiscord<Tuatarian> I couldn't find anything online about addEventProc
04:46:56FromDiscord<Elegantbeef> "the same logic we used prior"
04:46:59FromDiscord<Elegantbeef> I'm sayimg make a macro
04:47:14FromDiscord<Tuatarian> I have a macro that works for non generic procs
04:47:27FromDiscord<Elegantbeef> Sure and for generic procs make a new one
04:48:25FromDiscord<Tuatarian> That would take a generic proc and iterate over all it's used/generated/whatever instances and do something with that?
04:48:30FromDiscord<Elegantbeef> Where you call the procedure you want with the parameters you want
04:48:34FromDiscord<yrashk> I think I figured it out, I was looking for `getTypeImpl()`
04:48:43FromDiscord<Elegantbeef> No you just call the procedure you want which will give you an instantiated symbol
04:50:04FromDiscord<yrashk> (edit) "I think I figured it out, I was looking for `getTypeImpl()`" => "sent a code paste, see https://play.nim-lang.org/#ix=4gZ8"
04:50:13FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4gZ9
04:51:08FromDiscord<Elegantbeef> Sorry
04:51:11FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4gZa
04:52:08FromDiscord<Tuatarian> I see
04:52:22FromDiscord<Tuatarian> And then do whatever with the instantiated symbol
04:52:34FromDiscord<Elegantbeef> Correct
04:52:45FromDiscord<Elegantbeef> But that's the same as `(proc(a: int))(doThing)`
04:52:52FromDiscord<Tuatarian> Instead of passing the function name as an ident, pass a concrete instance of the function
04:53:01FromDiscord<Tuatarian> No not quite right?
04:53:30FromDiscord<Elegantbeef> In the first case you pass a call to the procedure which means you get the symbol to the concrete instance
04:53:37FromDiscord<Elegantbeef> In the later case you just instantiate it
04:57:00FromDiscord<Tuatarian> Oh ok
04:57:13FromDiscord<Tuatarian> And if I want to, I can choose not to care about the actual arguments themselves
04:57:46FromDiscord<Tuatarian> They're just there to force the appearance of a concrete instance of the symbol
04:58:36FromDiscord<Elegantbeef> This is the one major downside of monomorphic generics
05:10:14FromDiscord<huantian> We should add polymorphic generics to Nim then!
05:23:32FromDiscord<Tuatarian> Beef I think I'd need to do some weird stuff to do this
05:24:08FromDiscord<Tuatarian> I have a string (expression) which will not be known until runtime
05:24:34FromDiscord<Tuatarian> And I need to map strings (functions in the expression language) to nim functions
05:24:43FromDiscord<Tuatarian> That's why I was doing the stuff with raw pointers
05:25:33FromDiscord<Tuatarian> In theory, I could make it to strings (names of nim functions) but I'm not sure how I'd use that to run a particular nim function at runtime?
05:25:51FromDiscord<Tuatarian> Especially if that function isn't defined
05:53:29NimEventerNew thread by sls1005: Imported C++ type naming, see https://forum.nim-lang.org/t/9662
06:07:29FromDiscord<emanresu3> I'm having trouble understanding `genSym` and how to use it, how does it differ from `ident`?
06:07:50FromDiscord<emanresu3> Basically I expected `macro mymacro = result = newNimNode(nnkStmtListExpr) result.add(newVarStmt(ident"x", newLit 300))`
06:08:26FromDiscord<emanresu3> sent a code paste, see https://play.nim-lang.org/#ix=4gZl
06:09:02FromDiscord<emanresu3> sent a code paste, see https://play.nim-lang.org/#ix=4gZm
06:09:22FromDiscord<emanresu3> sent a code paste, see https://play.nim-lang.org/#ix=4gZn
06:09:33FromDiscord<emanresu3> sent a code paste, see https://play.nim-lang.org/#ix=4gZo
06:09:42FromDiscord<emanresu3> sent a code paste, see https://play.nim-lang.org/#ix=4gZp
06:09:57FromDiscord<emanresu3> sent a code paste, see https://play.nim-lang.org/#ix=4gZq
06:10:05FromDiscord<emanresu3> sent a code paste, see https://play.nim-lang.org/#ix=4gZr
06:10:31FromDiscord<emanresu3> sent a code paste, see https://play.nim-lang.org/#ix=4gZs
06:10:32ZevvYardanico: the bridge works, its pretty noise on irc. this guy "fromdiscord" just won't shut up
06:10:37FromDiscord<emanresu3> sent a code paste, see https://play.nim-lang.org/#ix=4gZt
06:53:35FromDiscord<leorize> @emanresu3 genSym generates an unique symbol, which also means you can only refer to that symbol via the generated node (or it's copies).
07:24:02FromDiscord<emanresu3> leorize\: I see so I should store genSym's result in a variable first and only refer to it from the variable, but why not just use `ident`?
07:25:27FromDiscord<emanresu3> sent a code paste, see https://play.nim-lang.org/#ix=4gZC
07:26:05FromDiscord<leorize> say your macro generates `x` as a temporary variable, but in the same scope the user (or another macro, even) also creates an `x` variable, you don't want the two to collide, basically
07:27:55FromDiscord<leorize> I'm not sure what do you mean by it's not working, it does compile
07:28:08FromDiscord<Elegantbeef> it also allows you to create a variable that a user cannot touch
07:28:15FromDiscord<Elegantbeef> This gives you protection from the user
07:28:47FromDiscord<emanresu3> Oh I get it, yeah I see the use cases now
07:28:51FromDiscord<Rika> In reply to @Zevv "<@177365113899057152>: the bridge works,": Not an issue from the discord IRC bridge but an issue of the matrix discord bridge
07:29:51FromDiscord<emanresu3> Yeah it compiles, but unlike with the other macro the created variable is not seen after the macro is called
07:29:57FromDiscord<emanresu3> I think because of this
07:30:43FromDiscord<emanresu3> So I see, it's kinda creating a "locally scoped" scoped symbol only accessible inside the macro
07:31:47NimEventerNew thread by Niminem: Do you have to use 'ref' for the field types within ref objects?, see https://forum.nim-lang.org/t/9663
07:31:49FromDiscord<Elegantbeef> You also sometimes want a globally unique symbol
07:33:28FromDiscord<leorize> yep, in fact this mechanism is basically how templates are "hygienic"
08:10:15*rockcavera quit (Remote host closed the connection)
08:14:17FromDiscord<&Makarov/1> yaay i've written elixir pipe operator in nim 🎉 https://media.discordapp.net/attachments/371759389889003532/1046338157660082186/image.png
08:14:45FromDiscord<Elegantbeef> if only we didnt have UFCS! 😛
08:14:49FromDiscord<&Makarov/1> but m still thinking how to make it with a `|>"\n"`
08:15:17FromDiscord<&Makarov/1> https://media.discordapp.net/attachments/371759389889003532/1046338411193188383/image.png
08:15:29FromDiscord<Elegantbeef> You cannot
08:15:37FromDiscord<emanresu3> I wish there was a pipe operator that could accept underscore calls like the dup macro
08:15:54FromDiscord<&Makarov/1> In reply to @Elegantbeef "You cannot": 🥹
08:16:01FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4gZL
08:16:10FromDiscord<&Makarov/1> alright
08:16:13FromDiscord<&Makarov/1> seems good also !
08:16:22FromDiscord<Elegantbeef> And you can already do that!
08:16:22FromDiscord<Tuatarian> Beef I'm curious how you would do what you were suggesting
08:16:39FromDiscord<Tuatarian> In reply to @iWonderAboutTuatara "I have a string": Since all this stuff
08:16:49FromDiscord<Tuatarian> You can do that by default yeah
08:16:52FromDiscord<&Makarov/1> but can i code this template to pass "123123" only as the echo first argument ?
08:17:06FromDiscord<Tuatarian> Just use.whatever and insert newlines where convenient
08:17:23FromDiscord<Tuatarian> Useful for building an ast with macros
08:17:29FromDiscord<&Makarov/1> sent a code paste, see https://play.nim-lang.org/#ix=4gZM
08:17:57FromDiscord<Elegantbeef> I dont get what you're doing tuatara. Are you trying to make a VM?
08:18:12FromDiscord<Tuatarian> Interpreted programming language
08:18:47FromDiscord<Tuatarian> But I'm avoiding doing any sort of research just to see how far I can get
08:18:54FromDiscord<Tuatarian> basically interpreted programming language
08:19:19FromDiscord<Elegantbeef> Yea the approach you're doing is weird
08:19:24FromDiscord<Tuatarian> Eventually algebra system but so far this is more or less going to be the same as writing a really basic mathematical expression interpreter
08:19:38FromDiscord<Tuatarian> How do people normally store functions?
08:19:56FromDiscord<Tuatarian> At least for "magic" functions which exist in the parent language
08:20:42FromDiscord<Tuatarian> This is obviously fine if I avoid using generics in my "magic" functions by the way, I'm aware that it's probably wise to do that anyway
08:21:21FromDiscord<Tuatarian> Actually, maybe it's fine
08:21:32FromDiscord<Elegantbeef> Well for built in procedures a more normal approach would manually dispatch
08:21:42FromDiscord<Tuatarian> But I'm definitely invested in the macro at this point :)
08:22:21FromDiscord<Elegantbeef> Instead of using a table you'd check if the procedure is built in or user then if it's builtin you'd rely on your own logic
08:22:21FromDiscord<Tuatarian> Yeah I'm not trying to do it in a normal way or anything like that
08:22:25FromDiscord<Elegantbeef> Otherwise you'd call the user procedure
08:22:28FromDiscord<Tuatarian> I'm curious to see how far I can get doing it my way
08:22:52FromDiscord<Tuatarian> (almost certainly objectively worse way, I am aware)
08:26:05FromDiscord<Elegantbeef> "almost certainly objectively worse"
08:26:16FromDiscord<Elegantbeef> That's a sentence
08:37:53FromDiscord<Tuatarian> Technically it isn't since it's a dependent clause but I get the sentiment
08:45:18*pro joined #nim
09:01:35*genpaku quit (Remote host closed the connection)
09:04:42*genpaku joined #nim
09:33:39FromDiscord<Rika> sent a code paste, see https://play.nim-lang.org/#ix=4h0b
09:33:48FromDiscord<Rika> Is the alternate syntax bad?
10:01:58*wallabra quit (Ping timeout: 268 seconds)
10:43:09*filcuc joined #nim
10:44:06filcucprobably i would need to RTFM but is there a way to check the nim compiler version and stop compilation if ORC/ARC is request but Nim compiler is <= VERSION
10:45:32filcucbasically with nimqml ORC/ARC was broken with old nim compiler version. I could enforce this requesting a higher nim compiler version in the .nimble file..but this seems a little bit too much imho
10:54:14FromDiscord<amadan> sent a code paste, see https://play.nim-lang.org/#ix=4h0k
10:55:27filcucthanks!
10:55:52filcucbtw when is orc/arc are going to be the default? is this targeted for Nim v2
10:55:55filcuc?
10:57:10FromDiscord<amadan> Thats the plan iirc↵I know devel atm has orc as the default
10:59:08filcucok but 1.6.10 still uses refc, right?
10:59:42FromDiscord<amadan> right
11:09:17FromDiscord<Riku> sent a code paste, see https://play.nim-lang.org/#ix=4h0o
11:15:03*ltriant joined #nim
11:29:40FromDiscord<Phil> sent a long message, see http://ix.io/4h0q
11:31:20FromDiscord<Phil> Though nothing in there on nim interaction with shared libs...hmmm
11:32:46FromDiscord<Phil> Man, I kinda want module-wide interfaces
11:34:05FromDiscord<Phil> Or is the trick in procedural programming that every public procedure is its own module? That feels like it'd be slightly insane, but I might be wrong there since I started with OO languages
11:36:02FromDiscord<Riku> Hmm yeah the article didn't quite get me there sadly. I saw an issue on github about not being able to import functions with no parameters I think though idk, I figured I'd ask here in case someone knew
11:36:12*ltriant quit (Ping timeout: 264 seconds)
11:37:45FromDiscord<Phil> Generally, for quick answers the discord works well if somebody that does this kinda thing is available.↵Folks for C/C++ interaction I can think of are Pmunch, ElegantBeef and Yardanico off the top of my head.↵If nobody is there at the moment, the forum is a pretty decent shout, you tend to get an answer there within an hour or two typically
11:38:15FromDiscord<Riku> Alright thanks for the tip
11:38:40FromDiscord<Phil> Sorry I couldn't be of more help, I'm mostly webdev that looks into appdev with QT on the side
11:38:52FromDiscord<Riku> No worries ;o
11:52:08*junaid_ joined #nim
11:59:59*filcuc quit (Ping timeout: 265 seconds)
12:05:54*filcuc joined #nim
12:08:23*ltriant joined #nim
12:13:09*ltriant quit (Ping timeout: 260 seconds)
12:14:14*filcuc quit (Remote host closed the connection)
12:21:42*ltriant joined #nim
12:34:11FromDiscord<Jessa> sent a code paste, see https://play.nim-lang.org/#ix=4h0G
12:35:46FromDiscord<Phil> In reply to @Jessa "i can't figure out": First things first, you are aware of what optionals are?
12:35:55FromDiscord<Jessa> i isuppose not
12:36:01FromDiscord<Phil> Alrighty, so you know what null is?
12:36:10FromDiscord<Phil> or nil in nim I suppose
12:36:11FromDiscord<Jessa> you mean nil?
12:36:16FromDiscord<Phil> Yeah
12:36:22FromDiscord<Jessa> i mean, yes
12:36:24FromDiscord<Jessa> lol
12:37:15FromDiscord<Phil> Hey, I don't know how much you know and nil is something you only encounter with ref types 😛↵Anyway, optionals allow you to explicitly express "this value may be nil or not nil"↵It's used so that you don't have to explicitly check "is this value nil or not" everywhere
12:37:41FromDiscord<Phil> "find" returns you an optional because it might find something or it might not, so it returns an optional.none if it doesn't find anything and an optional.some if it does
12:38:12FromDiscord<Phil> To get at the actual value inside of the optional you need to call the `get` method on it, which will throw an error if you call get on an optional.none
12:38:30FromDiscord<Jessa> yes
12:38:38FromDiscord<Jessa> that makes sense
12:40:58FromDiscord<Phil> Check. Now the key thing is you're not getting back an `Optional[string]` , you're getting back `Optional[RegexMatch]`↵So `found.get` is of type `RegexMatch`, by calling `.str` on that you're stringifying the entire match, which gives you back the entire string you originally looked on.↵Why it's transformed into a string like that I have no idea
12:41:33FromDiscord<Phil> The key now would be to stare at the nre lib (or re, no idea where the regexMatch type is from) and see how to extract the actual match from that type
12:42:38FromDiscord<Chibuzor Bobbi> sent a long message, see http://ix.io/4h0L
12:42:48FromDiscord<Chibuzor Bobbi> sent a long message, see http://ix.io/4h0L
12:42:54FromDiscord<Phil> Actually, the solution is much easier than I just anticipated.↵Looking at the docs reveals the answer:↵https://nim-lang.org/docs/nre.html#RegexMatch https://media.discordapp.net/attachments/371759389889003532/1046405755131154452/image.png https://media.discordapp.net/attachments/371759389889003532/1046405755525402744/image.png
12:43:10FromDiscord<Phil> In reply to @Chibuzor Bobbi "Hello Everyone ❗ choose": <@&371760044473319454> We've got hostiles! Namely me! Being hostile against this bot!
12:43:10FromDiscord<Chibuzor Bobbi> sent a long message, see http://ix.io/4h0L
12:43:25FromDiscord<Chibuzor Bobbi> sent a long message, see http://ix.io/4h0L
12:43:30FromDiscord<Jessa> see, that's the thing ↵↵I've been staring at the documentation for a while now, and i don't seem to be able to get the result back-↵the only way ii seem to be able to do it is with a `findAll`, which returns a seq of strings
12:43:47FromDiscord<Phil> In reply to @Jessa "see, that's the thing": Nah, what you're looking for is `echo found.get.match`
12:43:52FromDiscord<Jessa> i see
12:43:54FromDiscord<Jessa> lemme try
12:44:11FromDiscord<Chibuzor Bobbi> Hi
12:44:13FromDiscord<Jessa> ah
12:44:37FromDiscord<Jessa> :ded:
12:44:59FromDiscord<Jessa> i still have to get usedto this documentation website style
12:45:20FromDiscord<Jessa> thank you, though
12:45:23FromDiscord<Chibuzor Bobbi> I invited and got my profit last week and they also have a nice company
12:45:31FromDiscord<Phil> Fair shout.↵I tend to always just type in the word im searching for in the searchbar and click on the first few results
12:45:38FromDiscord<Phil> Dear god somebody please ban this idiot
12:45:43FromDiscord<Chibuzor Bobbi> I well love to invite also
12:46:11FromDiscord<Jessa> why are they a bot, anyway
12:46:16FromDiscord<Chibuzor Bobbi> Well it a very good company↵(@Phil)
12:46:20FromDiscord<Phil> In reply to @Chibuzor Bobbi "Well it a very": Fuck off
12:46:40FromDiscord<Chibuzor Bobbi> Have you had about Bitcoin mining before
12:46:51FromDiscord<Phil> In reply to @Jessa "why are they a": They may not actually be a bot, but there's another way of having chats kind of like discord, but via matrix
12:47:02FromDiscord<Jessa> matrix?
12:47:05FromDiscord<Phil> This channel and several others are bridged to matrix, essentially relaying posts from there to this server via bots
12:47:14FromDiscord<Phil> And vice versa
12:47:17FromDiscord<Jessa> i see
12:47:30FromDiscord<Phil> Though I'm not sure the versa runs via bots
12:47:40FromDiscord<Chibuzor Bobbi> Hello 👋 friend are you with me
12:48:03FromDiscord<scarf> hecc, wish leetcode supported nim
12:48:11FromDiscord<Chibuzor Bobbi> sent a long message, see http://ix.io/4h0M
12:48:44FromDiscord<Chibuzor Bobbi> Hello Everyone ❗ choose your age. Receive a quick reply immediately 18yrs 19yrs 20yrs 21yrs 22yrs 23yrs 24yrs 25yrs 26yrs 27yrs 28yrs 29yrs 30yrs 31yrs 32yrs 33yrs 34yrs 35yrs 36yrs 37yrs 38yrs 39yrs 40yrs 41yrs 42yrs 43yrs 44yrs 45yrs 46yrsyrs 47yrs 55syrs 55syrs 51 definitely guide you to testify it. Opportunity that will pay you 7000 USD, daily with startup of a little amount.↵Comment 'INTERESTED' if Interested 👇👇�
12:49:05FromDiscord<Phil> .... Can I apply for mod status for the sole purpose of banning bots? Like, I'm fine with having harsh stipulations that if I ever do something that goes out of line I get tarred and feathered or whatever but god damn these bots are robbing my nerves
12:49:24FromDiscord<Riku> tarred and feathered lmao
12:50:09FromDiscord<Chibuzor Bobbi> You don't say things like that just try and see you well love 💕 it↵(@Phil)
12:50:20FromDiscord<Chibuzor Bobbi> sent a long message, see http://ix.io/4h0N
12:50:20FromDiscord<planetis> Chibu run!
12:50:24FromDiscord<Chibuzor Bobbi> sent a long message, see http://ix.io/4h0L
12:50:29FromDiscord<Chibuzor Bobbi> Hello Everyone ❗ choose your age. Receive a quick reply immediately 18yrs 19yrs 20yrs 21yrs 22yrs 23yrs 24yrs 25yrs 26yrs 27yrs 28yrs 29yrs 30yrs 31yrs 32yrs 33yrs 34yrs 35yrs 36yrs 37yrs 38yrs 39yrs 40yrs 41yrs 42yrs 43yrs 44yrs 45yrs 46yrsyrs 47yrs 55syrs 55syrs 51 definitely guide you to testify it. Opportunity that will pay you 7000 USD, daily with startup of a little amount.↵Comment 'INTERESTED' if Interested 👇👇�
12:50:37FromDiscord<planetis> (edit) "Chibu" => "Bobbi"
12:50:41FromDiscord<Phil> In reply to @Chibuzor Bobbi "You don't say things": I'd love for you to fuck off
12:50:47FromDiscord<ajusa> Yeah honestly Phil should be a mod
12:50:53FromDiscord<Riku> In reply to @Chibuzor Bobbi "Hello Everyone ❗ choose": 死ね
12:51:08FromDiscord<Chibuzor Bobbi> sent a long message, see http://ix.io/4h0O
12:51:43FromDiscord<Chibuzor Bobbi> I well love 💕 to invite you to this best platform worldwide↵(@ajusa)
12:51:48FromDiscord<Chibuzor Bobbi> Hello Everyone ❗ choose your age. Receive a quick reply immediately 18yrs 19yrs 20yrs 21yrs 22yrs 23yrs 24yrs 25yrs 26yrs 27yrs 28yrs 29yrs 30yrs 31yrs 32yrs 33yrs 34yrs 35yrs 36yrs 37yrs 38yrs 39yrs 40yrs 41yrs 42yrs 43yrs 44yrs 45yrs 46yrsyrs 47yrs 55syrs 55syrs 51 definitely guide you to testify it. Opportunity that will pay you 7000 USD, daily with startup of a little amount.↵Comment 'INTERESTED' if Interested 👇👇�
12:52:01FromDiscord<Chibuzor Bobbi> sent a long message, see http://ix.io/4h0L
12:52:11FromDiscord<Chibuzor Bobbi> sent a long message, see http://ix.io/4h0R
12:52:21FromDiscord<Chibuzor Bobbi> sent a long message, see http://ix.io/4h0S
12:53:29FromDiscord<guttural666> trying to use find to find the substring \"> so I think I have to escape both \ and ", so I was trying find("\\\">" ....) but that is somehow wrong? can anybody help me out 😄
12:53:41FromDiscord<Phil> I hope for a world where people are in sufficiently good material conditions that such morally degrading work like the spamming of scams above is no longer necessary.
12:54:08FromDiscord<guttural666> (edit) "\">" => "[backslash]">"
12:54:24FromDiscord<scarf> i mean, if i had 7000 USD i'd keep it myself, not give out to some random people on discord
12:54:26FromDiscord<guttural666> (edit) "[backslash]">" => "\ ">" | "find("\\\">"" => "find("\ \ \ ">""
12:54:27FromDiscord<Phil> In reply to @guttural666 "trying to use find": All I'm parsing from that one is that you are trying to use find, but I'm not quite understanding how
12:55:13FromDiscord<Rika> :Gladsuna:
12:55:24FromDiscord<Rika> What a peaceful channel this is right now
12:55:38FromDiscord<Phil> In reply to @guttural666 "trying to use find": So the actual substring is `'\ ">'` (in between the `'`)?
12:56:14FromDiscord<guttural666> In reply to @Isofruit "So the actual substring": yes, I had to insert spaces, because Discord reinterpreted what I wrote
12:56:34FromDiscord<guttural666> I do know how find works, just having trouble escaping the escape character I think?
12:56:51FromDiscord<scarf> sent a code paste, see https://play.nim-lang.org/#ix=4h0T
12:56:58FromDiscord<scarf> (edit) "sent a code paste, see https://play.nim-lang.org/#ix=4h0T" => "In reply to @guttural666 "yes, I had to": you may want to use backtick (`) for literal characters"
12:57:13FromDiscord<scarf> (edit) "use" => "wrap them in"
12:58:02FromDiscord<Rika> `"\\ \">"` ?
12:58:36FromDiscord<guttural666> In reply to @Rika "`"\\ \">"` ?": thats what I thought just \ \ to get a \
12:58:46FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4h0U
12:59:06FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4h0V
12:59:16FromDiscord<Phil> (edit) "https://play.nim-lang.org/#ix=4h0V" => "https://play.nim-lang.org/#ix=4h0W"
12:59:20FromDiscord<Rika> Oh if you’re putting “re” before then you don’t need to escape anything with the downside you can’t use "
12:59:29FromDiscord<Rika> So you’d need triples like what Phil used
12:59:49FromDiscord<guttural666> okay, thanks for the input gonna try that
13:00:23*sagax quit (Remote host closed the connection)
13:01:18FromDiscord<Chibuzor Bobbi> Hello Everyone ❗ choose your age. Receive a quick reply immediately 18yrs 19yrs 20yrs 21yrs 22yrs 23yrs 24yrs 25yrs 26yrs 27yrs 28yrs 29yrs 30yrs 31yrs 32yrs 33yrs 34yrs 35yrs 36yrs 37yrs 38yrs 39yrs 40yrs 41yrs 42yrs 43yrs 44yrs 45yrs 46yrsyrs 47yrs 55syrs 55syrs 51 definitely guide you to testify it. Opportunity that will pay you 7000 USD, daily with startup of a little amount.↵Comment 'INTERESTED' if Interested 👇👇�
13:01:21FromDiscord<Chibuzor Bobbi> sent a long message, see http://ix.io/4h10
13:01:23FromDiscord<Chibuzor Bobbi> Hello Everyone ❗ choose your age. Receive a quick reply immediately 18yrs 19yrs 20yrs 21yrs 22yrs 23yrs 24yrs 25yrs 26yrs 27yrs 28yrs 29yrs 30yrs 31yrs 32yrs 33yrs 34yrs 35yrs 36yrs 37yrs 38yrs 39yrs 40yrs 41yrs 42yrs 43yrs 44yrs 45yrs 46yrsyrs 47yrs 55syrs 55syrs 51 definitely guide you to testify it. Opportunity that will pay you 7000 USD, daily with startup of a little amount.↵Comment 'INTERESTED' if Interested 👇👇�
13:01:23FromDiscord<Chibuzor Bobbi> Hello Everyone ❗ choose your age. Receive a quick reply immediately 18yrs 19yrs 20yrs 21yrs 22yrs 23yrs 24yrs 25yrs 26yrs 27yrs 28yrs 29yrs 30yrs 31yrs 32yrs 33yrs 34yrs 35yrs 36yrs 37yrs 38yrs 39yrs 40yrs 41yrs 42yrs 43yrs 44yrs 45yrs 46yrsyrs 47yrs 55syrs 55syrs 51 definitely guide you to testify it. Opportunity that will pay you 7000 USD, daily with startup of a little amount.↵Comment 'INTERESTED' if Interested 👇👇�
13:01:23FromDiscord<Chibuzor Bobbi> Hello Everyone ❗ choose your age. Receive a quick reply immediately 18yrs 19yrs 20yrs 21yrs 22yrs 23yrs 24yrs 25yrs 26yrs 27yrs 28yrs 29yrs 30yrs 31yrs 32yrs 33yrs 34yrs 35yrs 36yrs 37yrs 38yrs 39yrs 40yrs 41yrs 42yrs 43yrs 44yrs 45yrs 46yrsyrs 47yrs 55syrs 55syrs 51 definitely guide you to testify it. Opportunity that will pay you 7000 USD, daily with startup of a little amount.↵Comment 'INTERESTED' if Interested 👇👇�
13:01:24FromDiscord<Chibuzor Bobbi> Hello Everyone ❗ choose your age. Receive a quick reply immediately 18yrs 19yrs 20yrs 21yrs 22yrs 23yrs 24yrs 25yrs 26yrs 27yrs 28yrs 29yrs 30yrs 31yrs 32yrs 33yrs 34yrs 35yrs 36yrs 37yrs 38yrs 39yrs 40yrs 41yrs 42yrs 43yrs 44yrs 45yrs 46yrsyrs 47yrs 55syrs 55syrs 51 definitely guide you to testify it. Opportunity that will pay you 7000 USD, daily with startup of a little amount.↵Comment 'INTERESTED' if Interested 👇👇�
13:01:24FromDiscord<Chibuzor Bobbi> Hello Everyone ❗ choose your age. Receive a quick reply immediately 18yrs 19yrs 20yrs 21yrs 22yrs 23yrs 24yrs 25yrs 26yrs 27yrs 28yrs 29yrs 30yrs 31yrs 32yrs 33yrs 34yrs 35yrs 36yrs 37yrs 38yrs 39yrs 40yrs 41yrs 42yrs 43yrs 44yrs 45yrs 46yrsyrs 47yrs 55syrs 55syrs 51 definitely guide you to testify it. Opportunity that will pay you 7000 USD, daily with startup of a little amount.↵Comment 'INTERESTED' if Interested 👇👇�
13:01:27FromDiscord<Chibuzor Bobbi> sent a long message, see https://paste.rs/gKi
13:01:27FromDiscord<Chibuzor Bobbi> Hello Everyone ❗ choose your age. Receive a quick reply immediately 18yrs 19yrs 20yrs 21yrs 22yrs 23yrs 24yrs 25yrs 26yrs 27yrs 28yrs 29yrs 30yrs 31yrs 32yrs 33yrs 34yrs 35yrs 36yrs 37yrs 38yrs 39yrs 40yrs 41yrs 42yrs 43yrs 44yrs 45yrs 46yrsyrs 47yrs 55syrs 55syrs 51 definitely guide you to testify it. Opportunity that will pay you 7000 USD, daily with startup of a little amount.↵Comment 'INTERESTED' if Interested 👇👇�
13:01:28FromDiscord<Chibuzor Bobbi> Hello Everyone ❗ choose your age. Receive a quick reply immediately 18yrs 19yrs 20yrs 21yrs 22yrs 23yrs 24yrs 25yrs 26yrs 27yrs 28yrs 29yrs 30yrs 31yrs 32yrs 33yrs 34yrs 35yrs 36yrs 37yrs 38yrs 39yrs 40yrs 41yrs 42yrs 43yrs 44yrs 45yrs 46yrsyrs 47yrs 55syrs 55syrs 51 definitely guide you to testify it. Opportunity that will pay you 7000 USD, daily with startup of a little amount.↵Comment 'INTERESTED' if Interested 👇👇�
13:01:29FromDiscord<Chibuzor Bobbi> Hello Everyone ❗ choose your age. Receive a quick reply immediately 18yrs 19yrs 20yrs 21yrs 22yrs 23yrs 24yrs 25yrs 26yrs 27yrs 28yrs 29yrs 30yrs 31yrs 32yrs 33yrs 34yrs 35yrs 36yrs 37yrs 38yrs 39yrs 40yrs 41yrs 42yrs 43yrs 44yrs 45yrs 46yrsyrs 47yrs 55syrs 55syrs 51 definitely guide you to testify it. Opportunity that will pay you 7000 USD, daily with startup of a little amount.↵Comment 'INTERESTED' if Interested 👇👇�
13:01:30FromDiscord<Chibuzor Bobbi> Hello Everyone ❗ choose your age. Receive a quick reply immediately 18yrs 19yrs 20yrs 21yrs 22yrs 23yrs 24yrs 25yrs 26yrs 27yrs 28yrs 29yrs 30yrs 31yrs 32yrs 33yrs 34yrs 35yrs 36yrs 37yrs 38yrs 39yrs 40yrs 41yrs 42yrs 43yrs 44yrs 45yrs 46yrsyrs 47yrs 55syrs 55syrs 51 definitely guide you to testify it. Opportunity that will pay you 7000 USD, daily with startup of a little amount.↵Comment 'INTERESTED' if Interested 👇👇�
13:01:30FromDiscord<Chibuzor Bobbi> sent a long message, see http://ix.io/4h11
13:01:33FromDiscord<Chibuzor Bobbi> sent a long message, see http://ix.io/4h12
13:01:33FromDiscord<Chibuzor Bobbi> sent a long message, see https://paste.rs/UDT
13:01:39FromDiscord<Phil> God damn do I wish for somebody to step on a Lego right now
13:01:45FromDiscord<Phil> A very specific somebody
13:01:52FromDiscord<Riku> #modPhil
13:02:03FromDiscord<scarf> quick, all the mods are sleeping, bring the spams
13:02:11FromDiscord<guttural666> any way to ban this cretin?
13:02:17FromDiscord<Phil> There is, but mods be sleepin
13:02:26FromDiscord<guttural666> how date they haha
13:02:33FromDiscord<guttural666> (edit) "date" => "dare"
13:02:44FromDiscord<Phil> By talking to the other gender when they find them... damnit you edited to fast
13:03:06FromDiscord<guttural666> hahaha, indeed
13:03:44FromDiscord<scarf> this server could use some more mods tho
13:04:57FromDiscord<PMunch> Sorry for being so slow to remove and ban..
13:05:10FromDiscord<Phil> In reply to @PMunch "Sorry for being so": Thanks for doing the deed!
13:05:14FromDiscord<PMunch> And yeah, we should definitely get some more mods..
13:05:17FromDiscord<Riku> In reply to @PMunch "Sorry for being so": Tysm 😩
13:05:37FromDiscord<PMunch> And preferably some auto-spam remover bot
13:05:50FromDiscord<Phil> ... Can I apply for solely a bot-ban-mod position?
13:06:03FromDiscord<Phil> I have literally no interest in anything else, but that in particular affects me personally
13:06:56FromDiscord<ringabout> In reply to @Isofruit "... Can I apply": I'm rooting for you.
13:07:35FromDiscord<Phil> In reply to @ringabout "I'm rooting for you.": Why are you sudo'ing for me?
13:07:48FromDiscord<Phil> 😛
13:08:03FromDiscord<scarf> In reply to @Isofruit "Why are you sudo'ing": `sudo rm bots`
13:08:40FromDiscord<Phil> suddenly beef is nowhere to be seen
13:09:53FromDiscord<Phil> But in actuality, how does one apply for such a position?
13:10:14FromDiscord<Phil> Do I go on a quest to the secret nim mountains beyond the horizons?
13:11:03FromDiscord<hotdog> +1 for Phil being a mod!
13:11:32FromDiscord<ShalokShalom> In reply to @Isofruit "Do I go on": Yes, and you come back with two stone tablets
13:11:55FromDiscord<ShalokShalom> They shall have the community guidelines engraved in them
13:12:06FromDiscord<ShalokShalom> Or you may shall be doomed!!
13:12:14FromDiscord<Phil> Hell no you're not getting me to decide anything other than "you shall not scam-spam"
13:12:34FromDiscord<ShalokShalom> That's a good first rule 😄
13:12:44FromDiscord<Phil> Damnit, he's a crafty one
13:15:57FromDiscord<scarf> heh, but my dinner was spam
13:16:08FromDiscord<scarf> (edit) "heh," => "hecc,"
13:16:28FromDiscord<rakgew> `philAsModCounter.inc`
13:17:35FromDiscord<pmunch> @Phil\: your application has been received. I'll take it up with the other moderators
13:18:28FromDiscord<Rika> Nice
13:18:49FromDiscord<Phil> That trip to the nim mountains was faster than anticipated
13:23:36*ltriant quit (Ping timeout: 265 seconds)
13:30:48*ltriant joined #nim
13:35:36*ltriant quit (Ping timeout: 264 seconds)
13:39:51FromDiscord<ShalokShalom> To come down from a trip can take longer than anticipated 😅
13:42:25*ltriant joined #nim
13:42:53FromDiscord<ShalokShalom> In reply to @PMunch "And preferably some auto-spam": Someone suggested to block t.me links by default
13:47:24*ltriant quit (Ping timeout: 260 seconds)
13:54:02*ltriant joined #nim
13:54:45FromDiscord<𝒹𝒶𝓋𝑒> Hello people! Can anyone tell me if Nim has backwards compatibility with previous versions like golang does?
13:56:24FromDiscord<Rika> Best effort I believe, if you write code for 1.6 that uses introduced features on 1.6 of course it won’t work for 1.4 but in general it should work
13:56:50FromDiscord<Rika> Unless it is no longer supported, in which case regression fixes don’t get back ported
13:58:44*ltriant quit (Ping timeout: 260 seconds)
14:00:39FromDiscord<𝒹𝒶𝓋𝑒> So i can consider than a 50/50?
14:00:47FromDiscord<𝒹𝒶𝓋𝑒> (edit) "than" => "that"
14:01:49FromDiscord<federico3> @𝒹𝒶𝓋𝑒\: 50/50 on what scale?
14:04:03FromDiscord<Phil> In reply to @𝒹𝒶𝓋𝑒 "Hello people! Can anyone": Just for reference, I developed my web-application starting on from nim 1.6.4 at the end of last year, I jumped onto nim devel in the meantime, I had nothing to adjust because of this so far
14:04:20FromDiscord<Phil> However, that is while using very few low-level features
14:04:48FromDiscord<Phil> To me it feels fairly stable with the high-level stuff and I have no clue about lower level stuff such as interactions with C and the like
14:05:18FromDiscord<Phil> (edit) "nim" => "nim's compiler" | "nim's compilerdevel ... in" added "branch"
14:05:41*ltriant joined #nim
14:10:24*ltriant quit (Ping timeout: 264 seconds)
14:16:04FromDiscord<ali> Any particular framework or is htmlgen enough?↵(@Phil)
14:17:17*ltriant joined #nim
14:20:31FromDiscord<Phil> sent a long message, see http://ix.io/4h1q
14:21:27FromDiscord<federico3> compressing the HTTP Response in the service itself rather than in the HTTP server in front of it?
14:21:29FromDiscord<Phil> You may see me use a connection-pooling package if you google my main project, but that is no longer needed as norm now comes with its own ability to provide connection pooling
14:22:00*krux02 joined #nim
14:22:05*ltriant quit (Ping timeout: 265 seconds)
14:22:07FromDiscord<Phil> In reply to @federico3 "compressing the HTTP Response": I think by the time I wrote that middleware I'd been so deeply frustrated with anything nginx related because the configuration was such an incredible pain in my keister I wanted to do as little as possible in there
14:23:09FromDiscord<Phil> I've learned a lot since then, though Reverse-Proxy configuration will never become one of my strong suites, more one I somewhat manage to bumble through.↵But either way, I had very little reason to adjust since then
14:23:14FromDiscord<Phil> (edit) "adjust" => "adjust/refactor"
14:24:03FromDiscord<federico3> There are alternatives to Nginx if needed - but exposing services directly is usually really not recommended. Especially for the TLS termination, certificate regeneration etc
14:24:36FromDiscord<federico3> e.g. haproxy is quite nice
14:24:53FromDiscord<Phil> I mean, I don't, I do use nginx and did manage to get it all set up and running, after I did I just didn't want to bother looking into how to configure compression
14:25:41FromDiscord<Phil> The main reason I wrote docs on how to deploy a prologue application with nginx as a reverse proxy was because I never ever wanted to have to do that again without a guide to take over thinking for me
14:26:04FromDiscord<Phil> Because figuring that crap out was annoying enough the first time
14:31:38*junaid_ quit (Remote host closed the connection)
14:32:01*ltriant joined #nim
14:33:23FromDiscord<Phil> TIL generic methods are deprecated (not procs, just methods for dynamic dispatch)
14:33:44FromDiscord<Phil> On the one hand, understandable, on the other, I am very lazy and this saddens me in those cases
14:35:55FromDiscord<𝒹𝒶𝓋𝑒> In reply to @federico3 "<@660882846306795522>\: 50/50 on what": Basically partially supported?
14:37:04*ltriant quit (Ping timeout: 265 seconds)
14:43:36*ltriant joined #nim
14:46:12NimEventerNew thread by sls1005: Nimble master, see https://forum.nim-lang.org/t/9666
14:49:49*ltriant quit (Ping timeout: 260 seconds)
14:50:16*ltriant joined #nim
14:55:24*ltriant quit (Ping timeout: 264 seconds)
15:01:52*ltriant joined #nim
15:07:13*ltriant quit (Ping timeout: 268 seconds)
15:09:33*arkurious joined #nim
15:13:25*ltriant joined #nim
15:18:09*ltriant quit (Ping timeout: 265 seconds)
15:25:01*ltriant joined #nim
15:30:02*ltriant quit (Ping timeout: 268 seconds)
15:36:33*ltriant joined #nim
15:41:21*ltriant quit (Ping timeout: 265 seconds)
15:42:22*ltriant joined #nim
15:42:50FromDiscord<yrashk> Curious if there's a standard implementation of an iterator that takes an iterator and drops first n yields?
15:47:10*ltriant quit (Ping timeout: 265 seconds)
15:48:07*ltriant joined #nim
15:52:33*junaid_ joined #nim
15:52:49*ltriant quit (Ping timeout: 260 seconds)
15:53:56*ltriant joined #nim
15:58:59*ltriant quit (Ping timeout: 264 seconds)
16:00:16FromDiscord<ali> Like a Haskell drop?↵(@yrashk)
16:02:12FromDiscord<@thatrandomperson5-6310e3b26da03> sent a code paste, see https://play.nim-lang.org/#ix=4h1I
16:04:40FromDiscord<demotomohiro> Your code is hard to read here as there are many html tags in your code.↵Could you post it in other text sharing service?
16:05:28*ltriant joined #nim
16:07:28FromDiscord<@thatrandomperson5-6310e3b26da03> mine?
16:08:42Amun-Rayes
16:09:38FromDiscord<ali> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/1046455427405201461): Like a Haskell drop? Or dropWhile ?
16:09:46FromDiscord<@thatrandomperson5-6310e3b26da03> sent a code paste, see https://play.nim-lang.org/#ix=4h1J
16:09:59Amun-Rasame thing
16:10:00FromDiscord<@thatrandomperson5-6310e3b26da03> Ok, well, i did it
16:10:09Amun-Rawhat function raises that OSError?
16:10:12*junaid_ quit (Remote host closed the connection)
16:10:21*ltriant quit (Ping timeout: 265 seconds)
16:10:36Amun-Ranext time look for sth like "paste as plain text"
16:13:08FromDiscord<yrashk> In reply to @ali "Like a Haskell drop?": Yes, like Haskell drop
16:13:36FromDiscord<@thatrandomperson5-6310e3b26da03> What do you mean? It looks fine on my side↵(<@709044657232936960_=41mun-=52a=5b=49=52=43=5d>)
16:14:07FromDiscord<@thatrandomperson5-6310e3b26da03> also, npeg’s matchfile is cuasing the issue
16:15:38Amun-Rathatrandomper: that paste looks htmly, https://i.postimg.cc/wv3JB3dX/Screenshot-from-2022-11-27-17-14-49.png
16:17:03*ltriant joined #nim
16:17:21FromDiscord<ali> Other than introducing a block to introduce a scope I haven't seen anything other than a trivial loop↵(@yrashk)
16:19:06FromDiscord<! Nilts> In reply to @Amun-Ra "thatrandomper: that paste looks": that is a problem with the gitter.im link
16:19:53FromDiscord<! Nilts> (this is @thatrandomperson5's discord account)
16:21:07FromDiscord<! Nilts> sent a code paste, see https://play.nim-lang.org/#ix=4h1M
16:21:48*ltriant quit (Ping timeout: 264 seconds)
16:21:57Zevvit seems that the file open in matchFile fails with an OS error
16:22:31Zevvit tries to open your file with memfiles.open(), which does mmap under the hood
16:22:48Zevvwhat is your OS, and where does your file live?
16:24:49Amun-Racheck either open(2) or fopen(2) for possible EINVAL reasons
16:26:04Zevvit's not just open
16:26:06Zevvit uses memfile
16:26:27Zevvit mmaps the whole file into memory, it avoids alloc + read
16:26:33FromDiscord<! Nilts> In reply to @Zevv "what is your OS,": I think it is on ubuntu and the file lives in a random subdir
16:26:35Amun-Raah
16:26:46ZevvI'd be interested in an strace dump
16:26:59Zevvif the problem persists, just read the file yourself and match() it
16:27:04Zevvinstead of doing matchFile()
16:27:15FromDiscord<! Nilts> In reply to @Zevv "if the problem persists,": ok
16:27:17Zevvsudo apt install strace && strace <your program>
16:27:27Zevvi'd like to know what your problem is
16:28:01Zevvalso, never run sudo commands from strangers on irc
16:28:09Zevvthat's just common sense
16:28:35*ltriant joined #nim
16:28:55Amun-Rayupe, curl | sudo is my pet peeve
16:29:32FromDiscord<! Nilts> In reply to @Zevv "sudo apt install strace": i don't have acess to sudo or apt, i have nixos
16:29:40Zevvah ok
16:29:53ZevvAmun-Ra: well, it's actually no worse then installing whatever on your machine
16:30:05ZevvI could put stuff in npeg that does 'sudo rm -rf /' somewhere in there
16:30:07Amun-RaZevv: I only install via apt
16:30:10FromDiscord<nonce> hi guys, any of you have experience with prologue? https://github.com/planety/prologue↵i am struggling to find out how to send a file
16:30:20ZevvAmun-Ra: fine, then i'll put it in duc or in bucklespring
16:30:23Amun-Ra"rm -rf /" is safe
16:30:28Amun-Rarm -rf /* is not
16:30:48Amun-RaZevv: welcome to debian package team then
16:31:03FromDiscord<! Nilts> In reply to @Zevv "that's just common sense": i ran strace, it just spit out alot of crap
16:31:11Zevvit's supposed to do that
16:31:19Zevvcan you post that crap somewhere
16:31:23Amun-RaNilts: could you paste it somewhere online?
16:31:42Zevvthe last fewhundred lines will do, there is likely something like open() and mmap() in there
16:32:05Amun-RaI usually look for open|access
16:32:38FromDiscord<! Nilts> In reply to @Zevv "can you post that": https://hastebin.com/rukunobise.yaml
16:33:26Zevvmmap(NULL, 0, PROT_READ, MAP_SHARED, 3, 0) = -1 EINVAL (Invalid argument)
16:33:47*ltriant quit (Ping timeout: 264 seconds)
16:33:52Zevvha is your file size 0 maybe?
16:34:53FromDiscord<! Nilts> In reply to @Zevv "ha is your file": yes, its an empty file
16:35:25Amun-RaEINVAL (since Linux 2.6.12) length was 0.
16:35:30Amun-Ra(man mmap)
16:35:36Zevvyes, that's where I found it
16:35:47Zevvbecause it's not We don't like addr, length, or offset (e.g., they are too large, or not....
16:36:01ZevvNilts: when I'm done peeling potato's I'll make a fix and a new release
16:36:12FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4h1R
16:36:15Amun-Ratbh I'm not a fan of EINVAL on sizes of 0
16:36:40*ltriant joined #nim
16:36:54ZevvEZERO?
16:37:30FromDiscord<! Nilts> sent a code paste, see https://play.nim-lang.org/#ix=4h1S
16:37:53Amun-Rawhy not accept it and bail on access beyond the data limit
16:40:30Zevv?
16:40:44*xet7 joined #nim
16:42:48*ltriant quit (Ping timeout: 264 seconds)
16:43:44Zevvbwah I don't even know the size there, it's just nims memfiles.open that bails
16:44:06Zevvpff am i supposed to catch that and try a manual open+read instead . that's silly
16:44:09Amun-RaI mean 0 length file is a file, there should be no special case for that
16:44:19FromDiscord<demotomohiro> sent a code paste, see https://play.nim-lang.org/#ix=4h1W
16:44:44Amun-Raand access its data should work just like accessing data beyond any non-zero one
16:45:27ZevvSure, I agree
16:45:38Zevvso the bug is in nims memfiles.open(), not in npeg
16:45:52Zevvbut that doesnt mean I have to let that happen
16:46:14Amun-Ramhm
16:46:17Amun-Raor… a special case to look for
16:49:32*ltriant joined #nim
16:50:09Zevvtoday is a special day
16:50:12Zevvnpeg will go to 1.0.0
16:50:14ZevvI feel lucky
16:50:58Amun-Ra:>
16:51:35Amun-Rawell, today is a special day for me too, I fixed an old bug in my retro image viewer :>
16:52:11Zevvwe are feeling lucky!
16:53:29Amun-Ra\o/
16:54:20*ltriant quit (Ping timeout: 265 seconds)
16:55:19*ltriant joined #nim
16:57:39ZevvNilts: please update your npeg and try again
16:58:24*jmdaemon quit (Ping timeout: 264 seconds)
17:00:05*ltriant quit (Ping timeout: 268 seconds)
17:01:07*ltriant joined #nim
17:06:14*ltriant quit (Ping timeout: 268 seconds)
17:07:12FromDiscord<EyeCon> I have a question about npeg, maybe I misunderstand something here
17:07:36FromDiscord<EyeCon> sent a code paste, see https://play.nim-lang.org/#ix=4h28
17:07:52FromDiscord<EyeCon> I thought that would list all `code`s and operators
17:08:13FromDiscord<EyeCon> But it results in `@["Cod Z1Z", "Opr +", "Opr /"]`
17:08:17FromDiscord<EyeCon> What am I missing?
17:08:20Zevvfirst dinner, bbl
17:11:32*lumo_e joined #nim
17:12:53*ltriant joined #nim
17:14:09FromDiscord<EyeCon> Sure, appreciate you taking a look later
17:17:40*ltriant quit (Ping timeout: 248 seconds)
17:18:41*ltriant joined #nim
17:23:32*ltriant quit (Ping timeout: 248 seconds)
17:23:32Zevvwtf does nim playground change `*` into `
17:23:44Zevv
17:23:48Zevvit doesn't even render here
17:23:49Zevvthe math dot
17:23:58Zevvit breaks copy paste
17:24:38Zevvno it's you
17:24:44Zevvthe original ix.io is also broken :)
17:27:01Zevvha you're calling `push()`
17:27:13Zevvbut I'm not sure *which* push that is, you didn't define one
17:30:14*ltriant joined #nim
17:34:59*ltriant quit (Ping timeout: 264 seconds)
17:41:49*ltriant joined #nim
17:43:55FromDiscord<EyeCon> In reply to @Zevv "but I'm not sure": Me? The npeg documentation says:↵↵> A code block capture can also produce captures by calling the push(s: string) function from the code block. Note that this is an experimental feature and that the API might change in future versions.
17:44:37FromDiscord<EyeCon> The code sample compiles and runs, that's the entire thing
17:45:04Zevvoooh push(). dang.
17:45:07Zevvright let me look again
17:45:18Zevvi'm not /officially/ finished with my dinner, you know
17:45:41FromDiscord<EyeCon> I'm in no hurry whatsoever
17:45:50FromDiscord<EyeCon> Appreciate you taking a look
17:46:08Zevvnah, np. So, what is your expected output?
17:46:32*ltriant quit (Ping timeout: 265 seconds)
17:47:27FromDiscord<EyeCon> In reply to @Zevv "nah, np. So, what": I thought I would have pushed all codes and operators, so something like `@["Cod Z1Z", "Opr +", "Cod A1A", "Opr /", "Cod B1B", "Opr +", "Cod -C1C"]`
17:47:32Zevvright, I noticed
17:47:38*ltriant joined #nim
17:48:04ZevvThis push() thing, I didn't even rember why this was added
17:48:36FromDiscord<EyeCon> For poor folks like me who want the captured input transformed before the next step?
17:48:53Zevvi guess. too bad it's broken
17:48:56Zevvwhy have I no tests for that
17:49:31FromDiscord<EyeCon> OK, c'est la vie, then I'll think of something else, sorry to keep you from dinner
17:49:41Zevvwell, this needs to be fixed or dropped, either way
17:49:50Zevvso thanks for the report
17:49:56FromDiscord<EyeCon> Sure, anytime
17:51:19ZevvI made you a ticket, will pick this up one of these days
17:51:30Zevvman. You should have come yesterday. I *just* released 1.0.0 today
17:51:37Zevvafter stickign at 0.x for years
17:52:29*ltriant quit (Ping timeout: 268 seconds)
17:53:14FromDiscord<EyeCon> sent a code paste, see https://play.nim-lang.org/#ix=4h2e
17:53:24FromDiscord<EyeCon> In reply to @Zevv "man. You should have": Next time I'll come earlier 😄
17:53:43Zevvdo you have one of these hipster fonts
17:53:48Zevvyour asterisks are broken
17:53:52Zevvi can't run your code in nim playground
17:54:09FromDiscord<EyeCon> I... have difficulties believing that's because of a font?
17:54:18FromDiscord<EyeCon> Let me paste it into the playground then
17:54:22Zevvwhat you are pasting there are not asteriskses
17:55:20FromDiscord<EyeCon> I'm pretty sure they are, maybe it's something with the bridge? I'm on Discord
17:55:31FromDiscord<EyeCon> https://play.nim-lang.org/#ix=4h2g
17:55:42Zevvgood.
17:56:29Zevvit helps if you actually run your match
17:56:30FromDiscord<EyeCon> Hey, that doesn't run on the playground, I wonder why
17:56:31Zevvinstead of commenting it out
17:56:58FromDiscord<EyeCon> Very good catch
17:57:04Zevvi have a keen eye
17:57:20ZevvMy friends call me EyeZevv
17:58:04FromDiscord<EyeCon> That's what we would call our joint venture probably
17:58:42FromDiscord<EyeCon> OK, that runs at least on my machine
17:58:53Zevvgood.
17:59:01FromDiscord<EyeCon> Thanks a lot
17:59:11*ltriant joined #nim
17:59:44Zevvyw
18:04:19*ltriant quit (Ping timeout: 260 seconds)
18:07:31FromDiscord<@thatrandomperson5-6310e3b26da03> How do i get all attrs of an initialized type in nim?
18:10:01*krux02 quit (Quit: Leaving)
18:10:45*ltriant joined #nim
18:12:56FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4h2m
18:14:05*krux02 joined #nim
18:14:46FromDiscord<demotomohiro> In reply to @Isofruit "Thanks! I keep forgetting": `of` operator is explained in Nim manual: https://nim-lang.org/docs/manual.html#types-tuples-and-object-types
18:15:32*ltriant quit (Ping timeout: 265 seconds)
18:16:57FromDiscord<jtv> Random person: statically, you can use getType() in a macro. If you need it at runtime, use a macro to generate the specific info you need I'd think
18:19:43FromDiscord<jtv> What's the preferred paradigm for stating that I believe some block is unreachable (and I want the compiler to tell me if it can ever prove otherwise)? Often for me this is the `else` block of a `case` statement. Just let it compile in the runtime code?
18:21:15FromDiscord<locria> INim has a lot of duplicated code
18:22:17*ltriant joined #nim
18:27:12*ltriant quit (Ping timeout: 264 seconds)
18:28:10FromDiscord<Jessa> color code galore https://media.discordapp.net/attachments/371759389889003532/1046492644819345508/image.png
18:28:39FromDiscord<Jessa> finally added escapinig and background hex/rg
18:28:40FromDiscord<Jessa> (edit) "hex/rg" => "hex/rgb"
18:28:41FromDiscord<Phil> I'm kinda running into the issue that I can't go as fine-grained as I want with my generics =/
18:31:41FromDiscord<jtv> In reply to @Jessa "color code galore": Nice, would definitely use that if you release a package
18:32:26FromDiscord<Jessa> still gotta find out how to actually make a package aha
18:32:28FromDiscord<Jessa> (edit) "aha" => "ahaha"
18:32:46*dnh joined #nim
18:32:46FromDiscord<jtv> In reply to @jtv "Nice, would definitely use": Or else I'll give myself a similar API, I definitely have macros to do such things already
18:33:52*ltriant joined #nim
18:34:44FromDiscord<Jessa> the backend definitely isn't optimal or very pretty in areas↵↵but hey, this is me learning how to use nim so /shrug
18:35:31FromDiscord<jtv> It's a good interface
18:38:26*ltriant quit (Ping timeout: 256 seconds)
18:42:13FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4h2t
18:45:25FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4h2v
18:45:27*ltriant joined #nim
18:45:57FromDiscord<Phil> The goal is to provide a default stringification that the user can "overwrite" if they choose to
18:46:06FromDiscord<Phil> (edit) "to" => "to, by defining their proc `$` proc/method"
18:46:23FromDiscord<jtv> Yeah, just provide a base method for the base type; annotate its implementation with {.base.}
18:47:12FromDiscord<demotomohiro> In reply to @jtv "What's the preferred paradigm": You can put `assert false` or `doAssert false` in unreachable place (it is runtime check though).
18:47:53FromDiscord<jtv> Thanks, that's a compact way to do it. Was hoping there was an option that might improve the chance of a compile-time error when I make a mistake
18:48:48FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4h2w
18:49:25FromDiscord<Phil> `echo $x` should've been "model of 'B'"
18:50:35*ltriant quit (Ping timeout: 264 seconds)
18:52:31FromDiscord<jtv> Ah, I see. The problem is you don't have as much access to type info at runtime. I'd solve that by adding a macro wrapper to declare your subtypes that automatically adds the method for you, based on the static name
18:53:33FromDiscord<jtv> In particular, you end up losing naming info, it's just an ID at runtime I believe.
18:54:14FromDiscord<demotomohiro> In reply to @Isofruit "That doesn't quite work": I don't know how to get runtime type name.
18:54:42FromDiscord<Phil> Hmmm but then don't I run into the issue that, if the user defines their own `$`proc for B elsewhere, that it comes down to ambiguity issues so they'll have to manually specify whether to use the $ proc implicitly generated somewhere or their own
18:55:41FromDiscord<jtv> I don't understand that. What ambiguity issues? Wouldn't you want them to use your wrapper to declare subtypes?
18:55:47FromDiscord<demotomohiro> In reply to @jtv "Thanks, that's a compact": If you have when branches, you can use error/fatal/warning pragma:↵https://nim-lang.org/docs/manual.html#pragmas-error-pragma
18:57:00*ltriant joined #nim
18:57:24FromDiscord<Phil> In reply to @jtv "I don't understand that.": I kind of want to do it like an "opt in" feature. I don't want to force the user to define their own `$` proc, but if they do I magically want that theirs is being used instead of my default, with the runtime name ideally.
18:59:02FromDiscord<Phil> It's not that big a deal overall, this is more cosmetically than anything as I can well live with the default just being `Model #<id>`, having the subtype there would just be a bit nicer
18:59:38FromDiscord<jtv> In reply to @demotomohiro "If you have when": Well, if I do a when true: discard {.error.}, and the compiler can't prove it's unreachable I'm going to get noise I don't need too.
18:59:45FromDiscord<Phil> this is all about providing procs that will be used in a virtual fuckload of generics that are being generated
19:00:28FromDiscord<jtv> Yeah, then just have your macro stash the name in a const variable you define in the base class
19:00:38FromDiscord<jtv> And have your base method print using that variable
19:00:42FromDiscord<jtv> (edit) removed "const"
19:01:34FromDiscord<Phil> That is actually pretty clever
19:01:56*ltriant quit (Ping timeout: 265 seconds)
19:02:47*ltriant joined #nim
19:03:33FromDiscord<Phil> Wait, that still runs into issues, then that macro is still generating its own `$(model: B): string = "model of B"` proc/method/whatever, even when the user defines their `$(model: B): string = "Im a different implementation"`
19:04:09FromDiscord<jtv> No, I wouldn't have the macro generate your method in that case, just set the variable.
19:04:24FromDiscord<jtv> The only place you implement the method is in the base class, then people are free to define their own
19:05:35FromDiscord<Phil> Wait, how does that work then, how does the base-class implemented method know which variable to access for the print?↵Or do you mean by variable to store the class-name in a field of the object itself?
19:06:24FromDiscord<jtv> Well, you have to have a hidden method that actually sets the variable, that gets called when you're looking for it and it's null.
19:07:25*ltriant quit (Ping timeout: 260 seconds)
19:07:38FromDiscord<jtv> Unless you can now set default values for fields, I think I saw that was going in
19:07:49FromDiscord<jtv> But I think would be an experimental feature if so
19:08:13FromDiscord<Phil> You can and I am on nim-devel, doesn't work for DateTime fields yet and only does static assignments, though in this case it might not be problematic for the usecase
19:08:34FromDiscord<Phil> Correction: Does work for DateTime but not distinct DateTime fields
19:08:55FromDiscord<Phil> ~~I would know, I tried really damn hard to make it work~~
19:09:08FromDiscord<jtv> Got it, thanks
19:11:11FromDiscord<demotomohiro> sent a code paste, see https://play.nim-lang.org/#ix=4h2H
19:11:12FromDiscord<Phil> In reply to @jtv "Well, you have to": Could you rephrase that? I fail to properly parse the sentence.↵The hidden method is nil? And one would call that hidden method to get the value of the variable that was set and that you're interested in?↵I think I'm lacking the imaginination to see how it works
19:12:48FromDiscord<Phil> In reply to @demotomohiro "You can get runtime": The users of my lib would be the ones writing the derived types, the goal is to make it unnecessary for them to even know this must be defined.↵If I force them to implement a method, I could as well force them to just implement `$` themselves, the goal is to reduce the amount of things the user of the lib needs to be aware of.
19:12:54FromDiscord<jtv> Hidden in that the macro generates it but the user doesn't need to know it's there really
19:13:21FromDiscord<jtv> Like @demotomohiro 's getRuntimeTypeName(), that's the same basic idea
19:14:06FromDiscord<Phil> Ohhh... let me try that out
19:14:15FromDiscord<Phil> (edit) "Ohhh... let me try that out ... " added "in a minimal example"
19:14:23*ltriant joined #nim
19:16:05FromDiscord<Phil> So the goal would be to essentially generate `getRuntimeTypeName` , hmm
19:19:14*ltriant quit (Ping timeout: 256 seconds)
19:24:01FromDiscord<jtv> In reply to @Isofruit "So the goal would": Look at the example macro that generates a wrapper to make things look syntactically like Python's `class`: https://nim-by-example.github.io/macros/
19:24:24FromDiscord<jtv> Should make it very easy to do if you copy that
19:25:26FromDiscord<Phil> In reply to @jtv "Should make it very": Ohhh right, nim by example does have a macro section
19:25:38FromDiscord<Phil> Though that example seems like it could just be done via template
19:25:58*ltriant joined #nim
19:26:28FromDiscord<Phil> Thanks!
19:27:37FromDiscord<jtv> Well, good point, since you're not having to loop to generate multiple items, etc, you can probably get away with your wrapper being a template.
19:30:48*ltriant quit (Ping timeout: 264 seconds)
19:36:22FromDiscord<Screentapper> What is the most popular IDE to use for NIM development, based on your perception?
19:37:34*ltriant joined #nim
19:40:52FromDiscord<guttural666> can I loop over the fields of a type and print the field names?
19:41:36FromDiscord<rakgew> yes iirc via `.fieldPairs`
19:41:38FromDiscord<planetis> In reply to @guttural666 "can I loop over": Yes it's the fieldPairs iterator
19:42:29FromDiscord<guttural666> In reply to @planetis "Yes it's the fieldPairs": just looked at that but that seems to need an instance as an input?
19:42:48*ltriant quit (Ping timeout: 264 seconds)
19:42:51FromDiscord<rakgew> there was quite the interesting discussion on that over here\:↵https://forum.nim-lang.org/t/5631#35036
19:43:03FromDiscord<guttural666> seems to complain if I'm using a typedesc
19:43:03FromDiscord<rakgew> yes
19:43:25FromDiscord<rakgew> yep needs an instance
19:45:31FromDiscord<guttural666> hmm okay, thanks
19:46:03FromDiscord<rakgew> iirc in snorlogue it is done at compile time on the typedescs
19:46:32FromDiscord<rakgew> ah nope, it also instanciates
19:46:43FromDiscord<rakgew> https://github.com/PhilippMDoerner/Snorlogue/blob/9fb8e16099afa3d803d851c9c243be8a4c49f30f/src/snorlogue/service/modelAnalysisService.nim
19:47:44FromDiscord<rakgew> but I remembered compile time correctly apparently.
19:49:07*ltriant joined #nim
19:52:31*nyeaa492842 joined #nim
19:53:58*ltriant quit (Ping timeout: 268 seconds)
19:54:40*nyeaa49284 quit (Ping timeout: 260 seconds)
19:54:54*ltriant joined #nim
19:56:05FromDiscord<planetis> A macro that does the same with a typedesc wouldn't be complicated and pbl exists in a codebase somewhere
19:59:04FromDiscord<rakgew> would it be possible to collect all procs coming from a specific module with a macro?
19:59:35*ltriant quit (Ping timeout: 264 seconds)
20:02:07FromDiscord<rakgew> I am trying to find a way to collect procs with a specific pragma into a table so I can expose them as functionality (via autocomplete) in a cli tool.
20:02:28FromDiscord<Phil> In reply to @Screentapper "What is the most": Pretty sure it's VSCode, the nim plugin in IntelliJ is pretty decent as well though
20:02:46FromDiscord<rakgew> maybe it is easier when they come from a know module.
20:02:52FromDiscord<demotomohiro> In reply to @Screentapper "What is the most": Here is survey result and there is "What editor do you use when writing Nim?":↵https://nim-lang.org/blog/2022/01/14/community-survey-results-2021.html
20:02:55FromDiscord<Phil> In reply to @rakgew "ah nope, it also": It instantiates at compile time and iterates over that
20:03:27FromDiscord<rakgew> intellij works pretty well for me.
20:03:35FromDiscord<Phil> You can't really get past the need to instantiate, but even if one of the fields is stuff like DateTime you can actually do that
20:03:57FromDiscord<rakgew> but over console I enjoy `micro` as well.
20:04:01FromDiscord<Phil> norm for example does something similar for parsing a `Row` instance into a `Model` instance
20:04:15FromDiscord<Phil> I pushed a bunch of that code to act at compile time, among that the loop itself
20:05:04FromDiscord<Phil> In reply to @rakgew "but over console I": The only thing I ever use for console is nano to stare at config files
20:06:29*ltriant joined #nim
20:10:06FromDiscord<wick3dr0se> Anyone use Nim with Termux? I keep running into library issues. I installed with the package manager
20:11:29*ltriant quit (Ping timeout: 260 seconds)
20:12:08FromDiscord<Phil> Googles what Termux is
20:12:15FromDiscord<Phil> No
20:12:52FromDiscord<Phil> Wait, how are you developing with an android terminal emulator?
20:12:58FromDiscord<wick3dr0se> In reply to @Isofruit "*Googles what Termux is*": I'm always surprised that more people don't know of Termux
20:13:18FromDiscord<wick3dr0se> Its a pain in the ass but I wrote a classic snake game in BASH with Vim from Termux
20:13:37FromDiscord<wick3dr0se> Nim compiled won't work without root, so I'm using Nimscript
20:14:06FromDiscord<Phil> But isn't Termux basically for Android?↵Aren't you developing on something x86 based? Or is my google-fu just bad?
20:14:36FromDiscord<demotomohiro> I have termux and used nim and I didnt see much problems. But Im not using nim on termux recently.
20:14:39FromDiscord<wick3dr0se> It's a Linux terminal emulator really. It has Linux commands and debian package manager
20:15:20FromDiscord<wick3dr0se> It's an ARM based device but I don't have access to my PC rn so I'm working with what I can
20:15:33FromDiscord<wick3dr0se> It's either write small bs or write docs
20:15:50FromDiscord<Phil> And nobody wants to write docs, understandable
20:16:05FromDiscord<wick3dr0se> It's dreadful
20:16:15*wallabra joined #nim
20:16:52FromDiscord<Phil> I mean, I pretty much wrote the docs for my entire snorlogue lib over the last 2 days, so I feel that
20:17:12FromDiscord<wick3dr0se> Just another week, then I'll be back and can finally make something worth a crap. The snake game turned out half decent tho. Still needs some amounts of work but code base is tiny↵↵https://github.com/wick3dr0se/snake
20:17:25FromDiscord<demotomohiro> Nim in termux works almost in the same way as Nim on linux.
20:17:38FromDiscord<Phil> Huh, nice, I guess one still uses choosenim?
20:17:41FromDiscord<wick3dr0se> In reply to @demotomohiro "Nim in termux works": How do you execute a binary tho?
20:18:02*ltriant joined #nim
20:18:04FromDiscord<Phil> In reply to @wick3dr0se "How do you execute": Can't you just compile with the `--run` flag?
20:18:25FromDiscord<Phil> That is assuming executing a binary in Termux is not possible in general or sth
20:18:28FromDiscord<demotomohiro> @wick3dr0se I can run Nim and compile code without root.
20:19:37FromDiscord<wick3dr0se> Hasn't worked for me, I figured it was a root issue.↵↵I did whoami, copied the psuedo username and chown user:user file.nim and chmod u=x file.nim and still cant nim c -r file or ./file.nim if compiled
20:21:43FromDiscord<wick3dr0se> https://media.discordapp.net/attachments/371759389889003532/1046521222067920966/Screenshot_20221127-142056_Termux.jpg
20:22:22FromDiscord<demotomohiro> I can also run compiled executable without root.↵`nim c -r test1.nim` and `./test1` works without root.
20:22:41FromDiscord<wick3dr0se> Wtf
20:22:42*ltriant quit (Ping timeout: 256 seconds)
20:22:59FromDiscord<wick3dr0se> You dont need to even edit permissions?
20:24:04FromDiscord<demotomohiro> Yes. I have never changed permissions on termux.
20:24:54FromDiscord<wick3dr0se> I've never been able to execute a C or Nim binary. I have yet to try anything else but that is through factory resets and I have two different Android devices I use with Termux
20:25:39FromDiscord<demotomohiro> Maybe newer version of android have more strict security and they doesnt allow running compled code.
20:26:20FromDiscord<amadan> Can you do `cd /data/data/com.termux/files/home` maybe? Your path where the binary is seems bit weird
20:26:22FromDiscord<demotomohiro> Im using android 8.
20:29:36*ltriant joined #nim
20:33:13FromDiscord<demotomohiro> If you are using android 10 or newer: https://github.com/termux/termux-packages/wiki/Termux-and-Android-10
20:34:40*ltriant quit (Ping timeout: 268 seconds)
20:36:21FromDiscord<demotomohiro> `/data/data/com.termux/files/home` is cwd when I run termux.
20:40:51FromDiscord<Jessa> where can i read about how to set up a package
20:41:13*ltriant joined #nim
20:45:40*ltriant quit (Ping timeout: 248 seconds)
20:46:57*ltriant joined #nim
20:48:13FromDiscord<Jessa> Nevermind, found it
20:51:48*ltriant quit (Ping timeout: 264 seconds)
20:58:12FromDiscord<wick3dr0se> In reply to @amadan "Can you do `cd": Yes I can. I have $HOME path exported in /data/data/com.termux/files/usr/etc/profile and my custom BASH prompt, that's why it looks different
20:58:31*ltriant joined #nim
20:58:46FromDiscord<wick3dr0se> My $HOME env is set to /data/data/com.termux/file/home/storage/shared
21:02:35FromDiscord<wick3dr0se> In reply to @demotomohiro "If you are using": Man that blows.. I'm on Android 11 with a S10e snapdragon variant. I checked out the relevant issue linked and it was back in 2019 when they realized this would be an issue. Still no change to how their environment is set up, which is likely necessary proceeding with Termux.. Not many phones will be around for much longer with less than Android 10
21:03:15*ltriant quit (Ping timeout: 265 seconds)
21:08:17*doomduck joined #nim
21:09:21FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4h34
21:09:37FromDiscord<Phil> (edit) "https://play.nim-lang.org/#ix=4h34" => "https://play.nim-lang.org/#ix=4h35"
21:10:06*ltriant joined #nim
21:10:06FromDiscord<Elegantbeef> What is that line?
21:10:13FromDiscord<Phil> (edit) "https://play.nim-lang.org/#ix=4h35" => "https://play.nim-lang.org/#ix=4h36"
21:10:35FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4h37
21:11:02FromDiscord<Elegantbeef> I assume the issue is that `varargs[`$`, typed]` does not work for methods
21:11:19FromDiscord<Elegantbeef> so you probably need to make your `$` call the method `toString`
21:11:24FromDiscord<Phil> varargs?
21:11:35FromDiscord<Phil> Like, I know what varargs is, but where is that applied anywhere?
21:11:51FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4h38
21:11:53FromDiscord<Elegantbeef> You're calling `echo` i assume
21:12:17FromDiscord<Phil> Not quite, `$` is called a fuckton to render Model into a string to render it into HTML
21:13:58FromDiscord<Phil> A very typical use is for example if I have a foreign key field and want to represent that in a dropdown select field.↵To do that I need to represent a possible model-value of a dropdown with a label, the text for that label I get via `$model`
21:14:15FromDiscord<Elegantbeef> Hmph `$` does work as a method inside `echo`
21:14:28FromDiscord<Phil> Yeh, generally `$` methods do work
21:14:57FromDiscord<Elegantbeef> Hard to say what the issue is
21:15:12*ltriant quit (Ping timeout: 264 seconds)
21:15:17FromDiscord<Phil> I have the odd assumption that it's to do with how it's all different packages and that the compiler may see that `$` from the main application for specifically EncounterRead, before it sees the base `$` defined in snorlogue
21:18:17FromDiscord<Phil> Like, the dependency graph looks kinda like this: https://media.discordapp.net/attachments/371759389889003532/1046535455925096578/image.png
21:18:56FromDiscord<Phil> `EncounterRead` being a child-class of `Model`
21:19:19FromDiscord<Phil> And it actually works if I move the `$` for `Model` from snorlogue into norm
21:19:35FromDiscord<Phil> I just want to avoid that because that means coordinating with another package to change for my package which kinda smells like bad design
21:19:39FromDiscord<Phil> (edit) "I just want to avoid that because that means coordinating with another package to change for my package which kinda smells like bad design ... " added "on my end"
21:21:39*ltriant joined #nim
21:26:35*ltriant quit (Ping timeout: 264 seconds)
21:29:07FromDiscord<Jessa> In reply to @jtv "Nice, would definitely use": Package is currently uner review i suppose↵<https://github.com/nim-lang/packages/pull/2409>
21:29:54FromDiscord<Elegantbeef> Technically you already released a package since Nimble is decentralised 😄
21:31:04FromDiscord<Elegantbeef> Ugh using regex in a colouring library
21:31:05FromDiscord<Phil> I mean, I install my snorlogue package all the time so I don't have to copy paste stuff around locally
21:31:18FromDiscord<Phil> And that's not really released at all
21:31:48FromDiscord<Phil> So basically, if it's on github, it is kinda released
21:31:56FromDiscord<Elegantbeef> You know you can just `nimble develop`?
21:32:26FromDiscord<Phil> I can?
21:32:33FromDiscord<Elegantbeef> You can
21:32:38FromDiscord<Jessa> In reply to @Elegantbeef "Ugh using regex in": thanks for your nice feedback
21:32:43FromDiscord<Elegantbeef> It sym links that project into your nimble path
21:32:47FromDiscord<Elegantbeef> Then you can just work on all your packages
21:33:14*ltriant joined #nim
21:33:17FromDiscord<Phil> That is actually pretty sick
21:33:33FromDiscord<Elegantbeef> Well jessa i'll provide more feedback
21:35:03FromDiscord<Phil> In reply to @Jessa "thanks for your nice": Question, would a "Color" enum not also have worked?
21:35:11FromDiscord<Phil> instead of a colors table
21:35:44FromDiscord<Jessa> In reply to @Isofruit "Question, would a "Color"": i tried, i didn't really know how to make it work↵↵as i couldn't really do `someEnum[stringValue]` for the value
21:35:53FromDiscord<Phil> IIRC you still could've associated each enum with its own int value which should've worked I think (would that be what's considered a holey enum?)
21:35:56FromDiscord<Jessa> so i resorted to something that may or may not be the best
21:36:30FromDiscord<Elegantbeef> You can do `someEnum[stringValue]`
21:37:03FromDiscord<Phil> In reply to @Jessa "so i resorted to": It's perfectly valid, enum would just be my own personally preferred choice
21:37:37FromDiscord<Jessa> In reply to @Elegantbeef "You can do `someEnum[stringValue]`": https://media.discordapp.net/attachments/371759389889003532/1046540323242922145/image.png
21:37:49*ltriant quit (Ping timeout: 260 seconds)
21:39:03FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4h3e
21:39:11FromDiscord<Phil> (edit) "https://play.nim-lang.org/#ix=4h3e" => "https://play.nim-lang.org/#ix=4h3f"
21:39:36FromDiscord<Phil> Well, I guess `MyEnum(5)` would be clearer
21:39:53FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=4h3d no regex required
21:40:16FromDiscord<Phil> Oh is this about hex to rgb conversion?
21:40:36FromDiscord<Jessa> i thought you were mad about regex for the finding the parts in the string
21:40:45FromDiscord<Elegantbeef> I dont like regex at all
21:41:05FromDiscord<Elegantbeef> It's unreadable and unclear
21:41:08FromDiscord<Jessa> hear that from a lot of people surprisingly↵↵most of them being "hurr durr, hard to read"
21:41:10FromDiscord<Jessa> hahaha yea
21:41:21FromDiscord<Phil> I have no problem with regex generally, though I also had to work with it for ages so I'm somewhat biased
21:41:31FromDiscord<Jessa> i think it's fine for this simple-ish task
21:41:45FromDiscord<Jessa> if you get into the whole face onto keyboard shit i can understand it
21:42:13FromDiscord<Elegantbeef> Eh i have an inane distaste of wasteful APIs 😄
21:42:27FromDiscord<Elegantbeef> It needlessly allocates and does a bunch of fun stuff
21:42:34FromDiscord<Jessa> ¯\_(ツ)_/¯
21:44:49*ltriant joined #nim
21:45:14FromDiscord<Jessa> after package thingy is passed, can you immediately install it using the nimble install after refreshing it's package library/
21:45:15FromDiscord<Jessa> (edit) "library/" => "library?"
21:45:21FromDiscord<Elegantbeef> Yes
21:45:43FromDiscord<Elegantbeef> But like i said you can just do `nimble install packageurl` as is
21:46:44FromDiscord<Jessa> i think i may have done something wrong then?↵↵as it doesn't seem to show up when i type `nimble install nimcolor`
21:46:51FromDiscord<Jessa> or install for that matter
21:46:58FromDiscord<Phil> I would like to throw in interest to not use acronyms or shorthands. Those force me, the reader, to have to think about what that shorthand irepresents and I desire to be lazy.↵`input` > `inp`
21:46:58FromDiscord<Elegantbeef> the package url
21:47:00FromDiscord<Elegantbeef> Not the package name
21:47:12FromDiscord<Jessa> ah
21:47:12FromDiscord<Phil> (edit) "irepresents" => "represents"
21:48:35FromDiscord<Elegantbeef> You can pull `s: string` from my cold dead hands
21:49:15FromDiscord<Phil> How can I do that when they're warm, alive, and you're actually holding that s with your feet ?
21:50:15FromDiscord<Phil> Sidenote, doc-comments on public procs are pretty useful. Particularly since they automatically get used by the nim-docs that get generated
21:50:25FromDiscord<Jessa> In reply to @Isofruit "I would like to": i tend to use acryonims that are still understandable.↵`inp`, is easily understandable as input
21:50:38FromDiscord<Jessa> In reply to @Isofruit "Sidenote, doc-comments on public": good point, i still wanted to look into tha
21:50:39FromDiscord<Jessa> (edit) "tha" => "that"
21:50:53FromDiscord<Jessa> though, probably another time x3
21:51:37FromDiscord<Phil> Setting up a github workflow to automatically compile the docs and publish them to github pages is somewhat painful, but I managed by copious amounts of theft from the prologue repos
21:51:49FromDiscord<Phil> Took like an hour or so
21:52:14*dtomato4 quit (Quit: The Lounge - https://thelounge.chat)
21:53:51FromDiscord<Phil> In reply to @Jessa "i tend to use": The reason I prefer the "no acronym" rule in general because what's still understandable and what isn't depends on the amount of context one has.↵I have no idea for example what "reg" here is. And I needed to think for 2 seconds to note that "col" is for "color" here, not "column" which my first thought was since my primary pastime is webdev and thus DB interaction https://media.discordapp.net/attachme
21:54:24FromDiscord<Elegantbeef> > primary pastime is webdev and thus DB interaction↵Hey it's ok to admit you're wrong
21:54:44*dtomato4 joined #nim
21:55:06FromDiscord<yrashk> Is it possible to set a define in a nimscript? (kind of like what `switch` does but analogous to `-d:flag` instead of `--a:b`)
21:55:27*ltriant quit (Ping timeout: 268 seconds)
21:55:37FromDiscord<Elegantbeef> `--define: flag` inside a config.nims or `myProject.nim`
21:55:57FromDiscord<planetis> It's just switch template
21:56:00FromDiscord<yrashk> Thanks. Alternatively, is it possible to get project's name from a macro? I know I can get project's path, but don't seem to be able to find a way to get project name like I can in nimscript
21:56:31*ltriant joined #nim
21:56:43*dtomato4 quit (Client Quit)
21:56:45FromDiscord<yrashk> (edit) "Alternatively, is" => "Is"
21:56:57doomduckhey guys, anyone using hot code reloading in nim successfully?
21:58:11*dtomato4 joined #nim
21:58:20FromDiscord<Elegantbeef> I dont know of anyone that's seriously used Nim's HCR which is sad
21:58:28FromDiscord<planetis> In reply to @yrashk "Thanks. Is it possible": Maybe macros.getProjectPath
21:58:29FromDiscord<Elegantbeef> It does not work as well as it is advertised
21:58:55FromDiscord<yrashk> In reply to @planetis "Maybe macros.getProjectPath": Yeah, I am aware of getProjectPath
22:00:11FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4h3i
22:00:16FromDiscord<Jessa> Oooo
22:00:27doomduckElegantbeef yeah I noticed there's a bunch of open issues, but it'd be so nice to have it work, not many languages even advertise such a feature
22:00:37FromDiscord<Jessa> there's the one line thing i've been lookiing for
22:00:41FromDiscord<Jessa> thank you
22:00:42doomduckI'd 100% jump on nim if it worked :D
22:00:45FromDiscord<Phil> one line thing?
22:00:55FromDiscord<Phil> Ternary operator equivalent you mean?
22:00:55FromDiscord<Jessa> one line if statement like that
22:00:58FromDiscord<Jessa> yes
22:00:59FromDiscord<Jessa> that
22:01:08FromDiscord<Jessa> always forget iit's name
22:01:12FromDiscord<demotomohiro> @doomduck Nim's hot code reloading with GLFW sample.↵This code worked 3 years ago:↵https://gist.github.com/demotomohiro/64050496bb615c50fa608d7105509a53
22:01:15*ltriant quit (Ping timeout: 265 seconds)
22:01:17FromDiscord<Phil> Kinda wish we had the questionmark - colon syntax in nim
22:01:35FromDiscord<Elegantbeef> ternary operator is awful!
22:02:12FromDiscord<Elegantbeef> The mere existence of it means some one somewhere will think they're wise and chain it, then you're sitting there starring at it going "What the fuck is going on here"
22:02:17doomduckI mean the demo on the blog works too, but what about this https://github.com/nim-lang/Nim/issues/11974
22:02:19*ltriant joined #nim
22:02:22FromDiscord<Phil> Like, the if-else does the trick, at this point I just feel like `condition ? ontrue : onfalse` is almost on the same level as the if statement in terms of widespreadedness
22:02:33doomduckor just like any of the super strange issues with the HCR tag :D
22:02:58doomduckalso if I understand correctly the HCR tests are disabled? or maybe I misread in one of the commits
22:03:02FromDiscord<Yepoleb> In reply to @Elegantbeef "The mere existence of": it's great for optimizing code based on the assumption that less lines = faster
22:03:05FromDiscord<Phil> In reply to @Elegantbeef "The mere existence of": Beef about to discover that any language feature can be abused for evil
22:03:24FromDiscord<Elegantbeef> I mean i also think single line if expressions are awful phil
22:03:27FromDiscord<Elegantbeef> So.... yea
22:03:38FromDiscord<Elegantbeef> Ternary operator is always used on a single line
22:03:39FromDiscord<Phil> It's not about less lines of code, it's about being able to avoid mutable variables
22:03:51FromDiscord<Elegantbeef> What?
22:03:59FromDiscord<Phil> At least for me
22:04:05FromDiscord<Yepoleb> 🤔
22:04:09FromDiscord<Elegantbeef> Nim allows you to avoid mutable variables with if expressions
22:04:12FromDiscord<Elegantbeef> So i dont get your point
22:04:21FromDiscord<Jessa> In reply to @Elegantbeef "The mere existence of": i love doing that sometimes, for the fun of it
22:04:23FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4h3l
22:04:33FromDiscord<planetis> I would look in the source how projectName is implemented
22:04:34FromDiscord<Jessa> then get extremely mad at myself the next day when there's a bug in it
22:05:01FromDiscord<Elegantbeef> What's your point phil?
22:05:19FromDiscord<Elegantbeef> I think everyone that sincerely uses Nim agrees that the above is off
22:05:21FromDiscord<Phil> Because that means allowing myself the possibility to fuck up 10 lines later and manipulate x when I shouldn't and bam, issue generated
22:05:50FromDiscord<Elegantbeef> Oh you're just explaining why you used the if expression
22:06:28FromDiscord<Phil> Yeh, I was making a case for why ternary or basically doing a one-liner if-else expression is valid, because imo the alternative is way worse
22:06:44FromDiscord<Jessa> a singular ternary is useful
22:06:51FromDiscord<Jessa> chaining it into more than 1 is aweful
22:06:59*ltriant quit (Ping timeout: 260 seconds)
22:07:03FromDiscord<Elegantbeef> why do you specify one line if expression
22:07:04FromDiscord<Elegantbeef> Like why is a multi line if expression not valid 😄
22:07:04FromDiscord<Jessa> IMIO
22:07:09FromDiscord<Phil> I have not once in my life seen ternary chained
22:07:10FromDiscord<Phil> Ever
22:07:16FromDiscord<Elegantbeef> Cmon!
22:07:17FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4h3m
22:07:18FromDiscord<Phil> I didn't even know people did that until you guys brought it up
22:07:29FromDiscord<Elegantbeef> I've quite a bit
22:07:40FromDiscord<Elegantbeef> "Hey can you help with this" then they showcase an eldritch horror
22:07:44FromDiscord<Jessa> lolol
22:08:15FromDiscord<Jessa> i did that to myself at one poiint, but in python using list comprehensions, walrus operators and ternary operators all in one line
22:08:25FromDiscord<Phil> Man, the few times I help out I haven't stumbled over it yet
22:08:31FromDiscord<Jessa> Jynxed it
22:08:52FromDiscord<Elegantbeef> When you do phil you will wish death upon the inventor of the ternary operator
22:08:57FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4h3n
22:09:12FromDiscord<Elegantbeef> https://stackoverflow.com/questions/62885773/how-to-chain-ternary-operators
22:09:20FromDiscord<Elegantbeef> Vertical code \> horizontal
22:09:22FromDiscord<Elegantbeef> Fite me
22:09:32FromDiscord<Phil> If the first answer is not "don't" I will be severely disappointed
22:09:57FromDiscord<Phil> I have read the first answer
22:10:03FromDiscord<Phil> Not only am I severely disappointed
22:10:09FromDiscord<Elegantbeef> It gets even worse the more you look https://www.geeksforgeeks.org/c-nested-ternary-operator/
22:10:22FromDiscord<Phil> I am shocked, aghast, disgusted and sickened
22:10:39FromDiscord<Phil> The symbols beef, what do they mean!
22:10:42FromDiscord<Phil> (edit) "mean!" => "mean?!"
22:10:43FromDiscord<Elegantbeef> Fine phil we'll do `let x = (int(condition) + 1) 5`
22:11:00FromDiscord<Phil> blinks
22:11:02FromDiscord<Phil> What even is that
22:11:14FromDiscord<Elegantbeef> The same as `if condition: 10 else 5`
22:11:34FromDiscord<Phil> wait, that coerces boolean to 0 or 1, that entirely depends on one being the double of the other
22:11:37FromDiscord<Elegantbeef> `true` == `1` `(1 + 1) 5 == 10`
22:11:56FromDiscord<Elegantbeef> `false` == `0` `(0 + 1) 5 == 5`
22:12:10FromDiscord<Elegantbeef> It works for your example so stuff it!
22:12:55FromDiscord<Phil> Can you actually alias `if`with `?` and `else` with `:` I wonder... wait no, that'd have to be a macro, even if it worked
22:13:53*ltriant joined #nim
22:14:02FromDiscord<demotomohiro> sent a code paste, see https://play.nim-lang.org/#ix=4h3o
22:14:15FromDiscord<Elegantbeef> No you cannot↵(@Phil)
22:14:20FromDiscord<Elegantbeef> You can make `?:` work though
22:14:39FromDiscord<Phil> I'd be tempted to use the evils package but it goes against the grain in terms of syntax so at that point I might as well stick with single-lining if-else statements
22:14:45FromDiscord<Phil> (edit) "evils" => "elvis"
22:15:25FromDiscord<Phil> In reply to @demotomohiro "I used ?: operator": .... I desire to veto the code above
22:15:40FromDiscord<Elegantbeef> Too bad you're not on the security council
22:15:57FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4h3p
22:15:57FromDiscord<Elegantbeef> Bit of a hack but this works
22:16:21FromDiscord<Phil> how does the colon work?
22:16:35FromDiscord<Elegantbeef> Block syntax
22:16:38FromDiscord<Elegantbeef> `:` can be used to provide the next parameter
22:16:54FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4h3q
22:17:22*lumo_e quit (Quit: Quit)
22:18:11FromDiscord<Phil> In that case, isn't the above less of a hack and more of a perfectly functional implementation of a `?` operator?↵Am I overlooking any typical edgecases where that operator would break?
22:19:05FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4h3r
22:19:19FromDiscord<Phil> Fuck no
22:19:20FromDiscord<Phil> Curse that
22:19:42FromDiscord<Phil> I consider that breaking an intended feature
22:19:48FromDiscord<Phil> And an actual improvement
22:20:16FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4h3s
22:20:37FromDiscord<Phil> ~~in an ideal world, the above would also break simply because it's also ugly as hell~~
22:21:18FromDiscord<Elegantbeef> If ugly things were to be broken i'd be severely damaged!
22:21:36*jmdaemon joined #nim
22:22:22*lumo_e joined #nim
22:22:23FromDiscord<Phil> You're safe beef, you're not a language syntax
22:22:34FromDiscord<Elegantbeef> beef-lang exists
22:22:34FromDiscord<Phil> As far as I'm aware
22:22:36FromDiscord<Elegantbeef> Checkmate!
22:22:54FromDiscord<Phil> Are
22:23:03FromDiscord<Phil> Are you the personification of beef lang?
22:23:27FromDiscord<Elegantbeef> Nah I'm not overly specialised garbage
22:23:36FromDiscord<Elegantbeef> I'm rather generic garbage
22:23:39FromDiscord<Phil> Are you the sentience of beef-lang and learn nim simply because your own language was too painful?
22:23:56FromDiscord<Phil> (edit) "learn" => "learned"
22:24:43*pro quit (Quit: pro)
22:32:31*adium quit (Write error: Connection reset by peer)
22:33:12FromDiscord<Jessa> In reply to @Elegantbeef "Checkmate!": do i hear chess?
22:41:00*dnh quit (Ping timeout: 264 seconds)
22:45:31FromDiscord<huantian> In reply to @Elegantbeef "Fine phil we'll do": it's branchless!
22:45:32FromDiscord<huantian> definitely
23:39:42*krux02 quit (Remote host closed the connection)
23:46:10*lumo_e quit (Quit: Quit)