<< 10-06-2023 >>

00:00:14FromDiscord<demotomohiro> If they have different number of parameters or different type of parameters, it just works.
00:01:45FromDiscord<demotomohiro> If they still have same parameters, you can add module name to disambiguate call like `moduleA.getDb()` or `moduleB.getDb()`.
00:03:59FromDiscord<krab4t> like in Go (always module, well package, name)
00:04:00FromDiscord<demotomohiro> Nim has overloading procs but go doesn't have?
00:04:48FromDiscord<krab4t> no
00:05:26FromDiscord<krab4t> well with different number of parameters
00:05:51FromDiscord<krab4t> you have to name them differently iirc
00:06:55FromDiscord<demotomohiro> I didn't know that.↵In Nim, one module can have many overloaded procedures with same name.
00:07:24FromDiscord<krab4t> well only if you write func for Generic
00:08:27FromDiscord<krab4t> even then its one func with `funcName`
00:10:48FromDiscord<graveflo> are you asking if procs will overload on different signatures in different modules or are you asking if you can fully qualify a proc name to use a specific version defined in a specific module?
00:11:11FromDiscord<krab4t> so i want to split dbWorker.nim file from main.nim
00:11:36FromDiscord<krab4t> im asking if i can split files and access procs with `module.procName`
00:11:58FromDiscord<graveflo> I believe so. Its easy to test that though
00:13:24FromDiscord<graveflo> well I know you can bc I've done it there is just no reason to do that unless there is a binding issue like shadowing or using templates
00:14:32FromDiscord<krab4t> so you say nim its just plain bash
00:14:43FromDiscord<graveflo> ?
00:15:16FromDiscord<krab4t> i don't want access everything from any place
00:15:38FromDiscord<voidwalker> I tried to insert a binary file in sqlite, using allographer, and stumbled upon this: https://github.com/nim-lang/db_connector/issues/12
00:15:40FromDiscord<graveflo> okay I see what yo are saying. You want something like named scopes for organizational purposes
00:16:01FromDiscord<graveflo> kind of like classes LOL
00:16:09FromDiscord<krab4t> vs code extension says everything here is fine https://i.imgur.com/5hydNkt.png but its not
00:16:39FromDiscord<graveflo> `when(isMainModule)`
00:16:42FromDiscord<krab4t> yeah like scuffed packages in go which more like namespaces than classes
00:16:54FromDiscord<graveflo> yea you just use files for that in nim
00:16:57FromDiscord<krab4t> no `dbConn` its not imported
00:17:00FromDiscord<huantian> nim is not built with named scopes for modules as it's main priority, because of its UFC syntax
00:17:12FromDiscord<huantian> you usually import everything into the global scope
00:17:26FromDiscord<krab4t> `norm` imported in `dbModel`
00:17:38FromDiscord<krab4t> into global mess!
00:17:41FromDiscord<krab4t> like bash
00:18:51FromDiscord<huantian> there's measure in place to stop you if there's any name collisions, which happen rarely in the first place because of proc overloading
00:19:23FromDiscord<graveflo> I'm all for the hierarchical organizations. Maybe someone has made a library that will allow you to make new scopes. You can always just use the file system itself for this though. files in folders can be your hierarchical structure
00:19:37FromDiscord<graveflo> (edit) "new" => "named"
00:20:14FromDiscord<huantian> I'm not sure if that's relevant though, in this case we're simply talking about module importing
00:20:26FromDiscord<voidwalker> in 6 years the sqlite blob issue not fixed ? :\
00:20:56FromDiscord<graveflo> In reply to @huantian "I'm not sure if": module importing is the same as scope management. They have explicitly said they are looking to make scope hierarchies
00:22:41FromDiscord<huantian> Right but you’re talking about scope hierarchies in general in your example
00:22:52FromDiscord<huantian> Whereas modules are a specific instance ig
00:23:17FromDiscord<graveflo> is there an alternative?
00:23:25FromDiscord<huantian> Ie you wouldn’t use modules to do what you said
00:23:34FromDiscord<huantian> Wait nvm
00:23:38FromDiscord<huantian> I misread your message
00:23:41FromDiscord<huantian> Disregard
00:25:53FromDiscord<huantian> In reply to @krab4t "like bash": but going back to this, nim does this because it isn't bash, it's a compiled and statically typed language
00:27:26FromDiscord<huantian> https://narimiran.github.io/2019/07/01/nim-import.html
00:27:46FromDiscord<graveflo> I think they didn't post enough info to properly help them use qualified names to reference things LOL they might be long gone
00:30:16FromDiscord<krab4t> https://pastebin.com/SnpFvTB6 can i do stuff like that around `db()` and `var dbc` in nim?
00:31:55FromDiscord<huantian> That looks fine but I’m not sure about norm syntax
00:31:58FromDiscord<huantian> Does it compile?
00:32:14FromDiscord<graveflo> is `createTables` public?
00:32:22FromDiscord<huantian> (edit) "syntax" => "syntax, and I also just glanced at it"
00:32:34FromDiscord<huantian> I’d assume that’s a norm function?
00:34:11FromDiscord<krab4t> it compiles main.nim its just `import dbModel` and `dbModel.createTables()`
00:34:56FromDiscord<krab4t> but i can drop `dbModel` before `createTables()` and i hate it that way ...
00:35:28FromDiscord<huantian> In reply to @huantian "https://narimiran.github.io/2019/07/01/nim-import.h": Read this article, it can explain why that’s the case better than I can
00:46:34FromDiscord<krab4t> in that `complex.complex` section go would have something like `complex.NewComplex` and `complex.NewComplex64` etc
00:46:50FromDiscord<krab4t> which is not ugly at all.
00:50:37FromDiscord<JJ> i think it's ugly: you have types, why not use them?
00:52:49FromDiscord<JJ> neither the compiler nor the programmer need the `complex` prefix
00:55:17FromDiscord<JJ> note also that if you're writing code and you forgot which namespace a function comes from, the language server will tell you if you hover over it
00:57:01FromDiscord<krab4t> but they not types but constructors from package complex 😄
00:58:32FromDiscord<krab4t> well go actually has type `complex` its just an example
00:59:20FromDiscord<JJ> hmm i'm not sure what you mean
00:59:41FromDiscord<JJ> the types of the parameter in constructors/functions tell you unambiguously which one is which
01:04:27FromDiscord<krab4t> so here https://github.com/ba0f3/telebot.nim/blob/master/src/telebot.nim#L11 what is `result` inside?
01:04:35FromDiscord<krab4t> inside new()
01:17:43FromDiscord<huantian> It’s a `TeleBot`
01:18:15FromDiscord<huantian> It’s the return type of the proc
01:21:32*krux02_ quit (Remote host closed the connection)
01:23:47*beholders_eye joined #nim
01:52:13*beholders_eye quit (Remote host closed the connection)
02:28:24FromDiscord<krab4t> how to handle exception but do nothing? just except NotFoundError: discard?
02:29:31FromDiscord<huantian> Mhm
02:48:25FromDiscord<kcvinker> sent a code paste, see https://play.nim-lang.org/#ix=4xSy
03:12:06FromDiscord<kcvinker> sent a code paste, see https://play.nim-lang.org/#ix=4xSA
03:13:27*Batzy quit (Read error: Connection reset by peer)
03:16:34*Batzy joined #nim
03:21:39*rockcavera quit (Read error: Connection reset by peer)
03:22:00*rockcavera joined #nim
03:22:00*rockcavera quit (Changing host)
03:22:00*rockcavera joined #nim
03:23:18*oldpcuser quit (Remote host closed the connection)
03:23:38*oldpcuser joined #nim
03:38:51FromDiscord<Elegantbeef> Echo making it work sounds like some sort of race condition does `sleep(1)` work in it's place?
03:45:37FromDiscord<arathanis> that is an excellent point, beef
04:03:26FromDiscord<kcvinker> Oh I see. Since this code is working from a dll, it's a separate thread. Caller is in another thread.
04:48:25*oldpcuser quit (Quit: Windows was compiled with GCC)
04:51:27*oldpcuser joined #nim
05:05:14*qwestion quit (Ping timeout: 268 seconds)
05:07:12FromDiscord<xTrayambak> In reply to @voidwalker "yeah same old story": Hello! I'm the author and main developer of ferus and ferushtml. Currently all my efforts are going into making ferushtml implement more basic HTML. Another thing I'm doing is deprecating the FSM parser in favour of a consume-char parser. I mostly had some schoolwork to clear out which is why both the projects were a bit inactive.
05:11:21*oldpcuser is now known as oldpcuser_afk
05:18:44*oldpcuser_afk is now known as oldpcuser
05:27:22*rockcavera quit (Remote host closed the connection)
06:06:09*def- quit (Quit: -)
06:18:46FromDiscord<krab4t> how easy its to unmarshal json/xml into struct in nim? in go you simply annotate struct fields with json keys and then `xml.NewDecoder` or just `xml.Unmarshal`
06:21:15FromDiscord<graveflo> https://github.com/treeform/jsony↵https://nim-lang.org/docs/json.html↵https://nim-lang.org/docs/parsexml.html↵I'm not sure about automatically unmarshalling xml but these are where I would start
06:21:33FromDiscord<graveflo> there is also a marshal lib in nim std
06:25:46*def- joined #nim
06:30:19FromDiscord<krab4t> hmm should i go back to `go` then ...
06:48:41*def- quit (Quit: -)
06:49:13*def- joined #nim
07:02:36FromDiscord<graveflo> sounds like you got go on the mind my friend but will go take you back?
07:22:10FromDiscord<odexine> up to you
07:23:37FromDiscord<krab4t> No, i hate go because of insane amount of `if err != nil` on left and right, 100 times per file. But goland is very fast ide and it has proper debugging.
07:25:28*antranigv quit (Quit: ZNC 1.8.2 - https://znc.in)
07:25:39*xet7 joined #nim
07:26:10FromDiscord<krab4t> And also slices in go worlds first worst builtin type you can ever discover in a language.
07:26:48*antranigv joined #nim
07:27:02FromDiscord<odexine> slices are good but theyre strange in go iirc
07:27:18FromDiscord<odexine> nim is slowly developing support for slices
07:28:45*krux02 quit (Remote host closed the connection)
07:29:36FromDiscord<krab4t> look at this https://stackoverflow.com/questions/37334119/how-to-delete-an-element-from-a-slice-in-golang all answers with `[index+1:]...)` in it are wrong it will panic if element is last.
07:30:39FromDiscord<krab4t> Still nobody cares, 100 google results with same copy pasta.
07:39:10FromDiscord<xTrayambak> In reply to @odexine "slices are good but": the character slices are absolute carpal tunnel prevention machines
07:39:41*xet7 quit (Quit: Leaving)
07:39:59FromDiscord<xTrayambak> In reply to @voidwalker ""wild" ones : D": std/xmlparser is pretty good for that, I'll probably use it for implementing XML in ferushtml
07:43:23FromDiscord<krab4t> And google already copied slices functions from experimental package into main source tree, these just panic on out of bounds access not exceptions no errors
07:43:37FromDiscord<krab4t> For 1.21 release
07:48:12*antranigv quit (Quit: ZNC 1.8.2 - https://znc.in)
07:48:29FromDiscord<xTrayambak> By the way, are exceptions the only way to "gracefully" crash a program? Are there any equivalent to Rust's `panic!` macro?
07:48:37FromDiscord<xTrayambak> (edit) "equivalent" => "equivalents"
07:54:28*antranigv joined #nim
07:56:47FromDiscord<mratsim> In reply to @xTrayambak "By the way, are": `--panics:on`↵`quit 1`
07:56:54FromDiscord<krab4t> Unmarshaling /marshaling xml/json/yaml in nim should be as easy as in go via pragmas. (Annotations in go).
07:57:26FromDiscord<mratsim> `quit "Oh I'm f********`
07:57:32FromDiscord<mratsim> (edit) "f********`" => "f********"`"
08:03:23*xet7 joined #nim
08:09:07*xet7 quit (Remote host closed the connection)
08:16:13FromDiscord<odexine> In reply to @krab4t "Unmarshaling /marshaling xml/json/yaml in": whats wrong with jsony?
08:18:23*xet7 joined #nim
08:28:53FromDiscord<krab4t> In reply to @odexine "whats wrong with jsony?": It doesnt support xml?
08:33:21*xet7 quit (Remote host closed the connection)
08:34:54*derpydoo quit (Ping timeout: 268 seconds)
08:47:13*junaid_ joined #nim
08:52:04FromDiscord<Zoom> nimyaml worked for me, providing both yaml and json.↵(@krab4t)
09:06:28*azimut joined #nim
09:07:53FromDiscord<voidwalker> this is not merged, right ? https://github.com/nim-lang/Nim/commit/6fa82a5b3afbe644eef3fb41647a341d8e9b21c4
09:30:41*junaid_ quit (Remote host closed the connection)
09:31:38*blackbeard420 quit (Ping timeout: 268 seconds)
09:32:22*blackbeard420 joined #nim
09:38:05FromDiscord<filipemtx> Has anyone here experienced trouble with the virus wacatac.h!ml?↵It's the second time I compile a nim script and windows defender finds that trojan on the executable
09:38:43FromDiscord<filipemtx> I'm thinking twice before distributing a nim application... =\
09:42:02FromDiscord<filipemtx> https://forum.nim-lang.org/t/7885
09:42:08FromDiscord<filipemtx> I found this link
09:51:18*xet7 joined #nim
09:56:23FromDiscord<graveflo> Yes this has been an ongoing issue
10:09:48*derpydoo joined #nim
10:55:04NimEventerNew thread by alexeypetrushin: Cast to subtype without knowing it?, see https://forum.nim-lang.org/t/10264
11:57:10*disso-peach joined #nim
12:11:17FromDiscord<heysokam> how do you add an escape character to a string? im getting escaped escapes if I add more than one, and it doesn't seem to want to stick to being an actual `\`
12:12:44FromDiscord<heysokam> usecase is to parse the output of some bash commands, that end lines with `\` but the text in the next is meant to also be part of the previous line
12:12:55FromDiscord<demotomohiro> !eval echo "\\"
12:13:15FromDiscord<heysokam> that escapes the second "
12:13:55NimBotCompile failed: <no output>
12:14:04FromDiscord<demotomohiro> "\\" become single backslash
12:14:29FromDiscord<heysokam> that's the first thing i tried. but compiler says no
12:14:30FromDiscord<demotomohiro> '\\\\"
12:15:09FromDiscord<demotomohiro> Discord removes backslash 😦
12:15:38FromDiscord<heysokam> not ifyou get them in `\`
12:16:05FromDiscord<heysokam> so \`\ `\
12:16:22FromDiscord<heysokam> (edit) "`\" => "`"
12:16:51FromDiscord<demotomohiro> Putting 2 backslashes in "" or '' should work.
12:19:42FromDiscord<heysokam> `"\\"` worked, don't know why it was failing before. i guess i didn't try it correctly
12:19:59FromDiscord<heysokam> it doesn't match the text.... but it worked
13:13:55FromDiscord<exxjob> hi, for cpp bindings should i use git submodule? how is it packaged into nimble
13:34:28*derpydoo quit (Ping timeout: 265 seconds)
13:41:27NimEventerNew question by IvanS: How to make this pipe communication non-blocking?, see https://stackoverflow.com/questions/76446472/how-to-make-this-pipe-communication-non-blocking
13:42:08*ntat joined #nim
14:02:34*derpydoo joined #nim
14:54:31FromDiscord<demotomohiro> This supports non-blocking pipe but that question uses Windows API directly.↵https://github.com/cheatfate/asynctools
15:22:55FromDiscord<Zoom> Any ideas?
15:48:47*oldpcuser quit (Remote host closed the connection)
15:49:16*oldpcuser joined #nim
16:08:58FromDiscord<System64 ~ Flandre Scarlet> Is there some things I can do to improve performances such as flags I can enable?
16:12:49FromDiscord<odexine> other than release and lto?
16:14:06FromDiscord<System64 ~ Flandre Scarlet> In reply to @odexine "other than release and": lto?
16:14:30FromDiscord<odexine> i dont remember the flags for LTO
16:14:33FromDiscord<demotomohiro> lto = Link time optimization
16:14:44FromDiscord<odexine> tomohiro does your site have it
16:14:52FromDiscord<demotomohiro> https://internet-of-tomohiro.netlify.app/nim/faq.en.html#optimization-which-compiler-option-generate-smallest-executableqmark
16:14:53FromDiscord<System64 ~ Flandre Scarlet> How can I enable this?
16:15:36FromDiscord<demotomohiro> `--passC:-flto --passL:-flto` enables it
16:15:51FromDiscord<demotomohiro> If you use gcc as backend compiler
16:15:58FromDiscord<odexine> lto can improve speed of binary but not always
16:16:11FromDiscord<odexine> as usual it depends on a lot of things
16:16:21FromDiscord<odexine> just experiment with it, see if it helps
16:17:11FromDiscord<System64 ~ Flandre Scarlet> and --opt:speed?
16:18:56FromDiscord<odexine> already by default when you -d:release
16:19:24FromDiscord<System64 ~ Flandre Scarlet> oh alright
16:19:47FromDiscord<odexine> i have to wake up in 6 hours, good night
16:19:58FromDiscord<demotomohiro> good night
16:20:08FromDiscord<System64 ~ Flandre Scarlet> Good night!
16:20:09FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4xUQ
16:21:08FromDiscord<demotomohiro> it seems good.
16:21:40FromDiscord<System64 ~ Flandre Scarlet> And I can disable runtime checks too?
16:22:32FromDiscord<demotomohiro> `-d:danger` disables runtime checks.
16:23:06FromDiscord<System64 ~ Flandre Scarlet> In reply to @demotomohiro "`-d:danger` disables runtime checks.": It disables GC too?
16:23:18FromDiscord<demotomohiro> No
16:23:45FromDiscord<System64 ~ Flandre Scarlet> Nice
16:44:55*derpydoo quit (Read error: Connection reset by peer)
16:59:50FromDiscord<voidwalker> is it possible to read the memory of another process, running under the same user, in windows, without admin priviliges ? Would that trigger windows defender (if it gets past it in the first place because of simply being a nim program that is) ?
17:29:48*cm quit (Ping timeout: 240 seconds)
17:29:54*ntat quit (Quit: Leaving)
17:30:52*cm joined #nim
17:33:03Amun-Rahave you tried ReadProcessMemory?
17:49:48*derpydoo joined #nim
17:56:32FromDiscord<voidwalker> no I didn't try anyhting, I just thought to ask if it's possible in the first place, without explicitly giving admin access to the process
17:56:54FromDiscord<graveflo> yes
17:57:55FromDiscord<graveflo> there are some boundaries that are protected but you can read and write other processes memory. I haven't tried in a long time but you used to be able to use "createremotethreadex" to run code in another process without any privs either
17:59:26FromDiscord<voidwalker> https://github.com/byt3bl33d3r/OffensiveNim/blob/master/src/fork_dump_bin.nim
18:00:25FromDiscord<krisp0> sent a code paste, see https://play.nim-lang.org/#ix=4xVi
18:00:52FromDiscord<krisp0> though its a bit of a bad example since we know the key already but what if we dont know and say if the table is large
18:01:01FromDiscord<krisp0> (edit) "though its a bit of a bad example since we know the key already but what if we dont know and say if the table is large ... " added "like 200 messages"
18:01:23FromDiscord<graveflo> its not going to be optimized unless you make a two way table
18:10:07FromDiscord<krisp0> In reply to @graveflo "its not going to": what would the code be using that then?
18:11:32FromDiscord<graveflo> There are several ways to make a two way table structure, but most simply you would just make two tables. When you add or remove an element make sure you keep the second table up to date
18:12:06FromDiscord<krisp0> oh just the reverse table basically
18:12:43FromDiscord<graveflo> yea if one table is `key->value` just make another one that is `value->key` and keep then in sync
18:12:53FromDiscord<huantian> and make sure both tables are one to one
18:13:25FromDiscord<huantian> sent a code paste, see https://play.nim-lang.org/#ix=4xVl
18:16:26FromDiscord<that_dude.> Pretty sure that datastruct already exists in a nimble package
18:24:09*junaid_ joined #nim
18:26:36FromDiscord<michaelb.eth> sent a code paste, see https://play.nim-lang.org/#ix=4xVq
18:48:55*junaid_ quit (Remote host closed the connection)
19:07:54FromDiscord<graveflo> sent a code paste, see https://play.nim-lang.org/#ix=4xVx
19:19:01FromDiscord<guttural666> can I make this untyped block optional as well? otherwise I think I'll have to provide all the defaulted parameters every time and discard the block as well I think: https://media.discordapp.net/attachments/371759389889003532/1117171073788682240/image.png https://media.discordapp.net/attachments/371759389889003532/1117171074002596015/image.png
19:19:35FromDiscord<graveflo> you can just overload it with templates
19:22:32FromDiscord<guttural666> hmm, not sure if I get it, do you mean just copying the whole template and providing two apis? would maybe want to avoid maintaining two almost identical versions (except the additional block)
19:23:22FromDiscord<guttural666> or nested templates and pull out the common part?
19:23:45FromDiscord<graveflo> you can either split the functionality into two versions that have the untyped block and dont or keep it all in one place. The overloads have different parameters and one calls the other
19:24:57FromDiscord<guttural666> ah, think I get it, will try something
19:24:57FromDiscord<guttural666> thanks
19:37:33FromDiscord<guttural666> I think keeping just one beefy template doesn't work because the block has to be in the middle of that template, so it would also have to accept a block
19:38:04FromDiscord<guttural666> thinking about this as a possible solution: https://media.discordapp.net/attachments/371759389889003532/1117175871502037062/image.png
19:39:18FromDiscord<guttural666> noop(str: string) actually
20:18:38*Guest20 joined #nim
20:18:56*Guest20 quit (Client Quit)
20:19:15*Guest20 joined #nim
20:19:50*Guest20 quit (Client Quit)
20:57:22*oldpcuser quit (Read error: Connection reset by peer)
20:57:42*oldpcuser joined #nim
21:03:39FromDiscord<voidwalker> does anyone have a fully working implementation of a ReadProcessMemory proc, that takes a pid int and returns all the memory of the process ?
21:03:50FromDiscord<krab4t> how you make non blocking task queue probably in another thread that just waits for task object and do only one at the time ...
21:03:53FromDiscord<krab4t> any libs
21:12:04FromDiscord<graveflo> In reply to @voidwalker "does anyone have a": I've never tried this but you can try and use a winapi library https://github.com/khchen/winim
21:12:22FromDiscord<voidwalker> yeah that's what I meant, a higher level proc for that one : )
21:12:44FromDiscord<voidwalker> I think I just need to figure out where to get the starting address of the process memory
21:21:43FromDiscord<voidwalker> https://github.com/treeform/hottie/blob/87ce027ebbe07ae34a7cb9b677e740f38e131624/src/hottie/windows.nim#L52
21:21:45FromDiscord<voidwalker> this code was useful
21:22:05FromDiscord<voidwalker> how do you find the end address though ?
21:31:29FromDiscord<graveflo> it looks like `VirtualQueryEx` is used for this in a trail an error method
21:32:31FromDiscord<graveflo> other places seem to use a similar method. The win api can be a pain the butt. If you dont know how to do something you're going to have to read a lot of websites or some code that someone else figured out:↵https://stackoverflow.com/questions/55803328/how-to-identify-what-parts-of-the-allocated-virtual-memory-a-process-is-using
21:33:28FromDiscord<voidwalker> blah 😦
21:33:49FromDiscord<voidwalker> why can't we have a proc readMem(pid: int): string
21:36:58FromDiscord<graveflo> you basically can you just need to know the bounds of its memory regions. Its not as straight forward as reading a proc file like on linux but thats windows for you
21:37:20FromDiscord<voidwalker> I know we can, why didn't anyone make it, that's what I meant
21:37:39FromDiscord<voidwalker> I'm not interested in learning windows api for hacking, just want that piece of memory
21:38:26FromDiscord<graveflo> well there might be an easier way to get it. I've written small scripts that interact with a processes memory. Usually you just have to know the static address or pointer map to get to where you want
21:38:37FromDiscord<graveflo> and then its as simple as calling `ReadProcessMemory`
21:39:10FromDiscord<graveflo> but it depends on what you are trying to do. Reading an entire processes memory might be overkill for your needs
21:40:23FromDiscord<voidwalker> well I have to read it all to first find where I must look for the interesting bits
21:41:09FromDiscord<graveflo> try using something like cheat engine. If it fits your use case its easy
22:26:49FromDiscord<heysokam> how do you get the name of an enum in string representation, when the enum contains a string as its value? 🤔
22:28:33FromDiscord<voidwalker> the enum's string value ?
22:28:58FromDiscord<heysokam> sent a code paste, see https://play.nim-lang.org/#ix=4xWq
22:31:36FromDiscord<that_dude.> sent a code paste, see https://play.nim-lang.org/#ix=4xWs
22:32:06FromDiscord<heysokam> no, i mean having access to both `"x86"` and `"i386"` in some way
22:32:35FromDiscord<heysokam> if i use the $enum, it becomes the inner string. but i want both, because the goal is to compare them
22:32:40FromDiscord<voidwalker> parseEnum[EnumType](theStrVal) gives you the enum value
22:32:52FromDiscord<heysokam> (edit) "compare them" => "get the name based on the inner string"
22:34:28FromDiscord<heysokam> maybe im misunderstanding something, let me do some quick test
22:36:40FromDiscord<graveflo> https://nim-lang.org/docs/enumutils.html#symbolName%2CT
22:37:32FromDiscord<heysokam> sent a code paste, see https://play.nim-lang.org/#ix=4xWu
22:38:03FromDiscord<graveflo> `symbolName` and `$` should be what you need
22:38:14FromDiscord<heysokam> yeah symbolName! tyty
22:38:28FromDiscord<heysokam> didn't know that thing existed
22:46:43FromDiscord<krab4t> https://github.com/indiscipline/cozytaskpool nim has channels?
22:59:11FromDiscord<graveflo> I havent done anything w/ concurrency yet but I have heard people talk about hem
22:59:17FromDiscord<graveflo> (edit) "hem" => "them"
23:05:53FromDiscord<arathanis> In reply to @graveflo "Anyone know whats going": i've been toying with what is going on here, very weird
23:06:31*xet7 quit (Ping timeout: 240 seconds)
23:06:52FromDiscord<voidwalker> is it not possible to have a const array of an object without writing the object type and object fields, like this one here ? https://github.com/arvidn/libtorrent/blob/c2012b084c6654d681720ea0693d87a48bc95b14/src/identify_client.cpp#L148
23:07:06FromDiscord<voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=4xWH
23:07:07FromDiscord<voidwalker> any shorter syntax possible?
23:07:11FromDiscord<graveflo> In reply to @arathanis "i've been toying with": yea me too. I've decided to start figuring out how to work with the compiler bc I keep running into issues
23:09:20FromDiscord<arathanis> sent a code paste, see https://play.nim-lang.org/#ix=4xWI
23:09:31FromDiscord<graveflo> In reply to @voidwalker "any shorter syntax possible?": I dont see how it can get any shorter. You dont have to state the type if it is implicit. You dont have to supply values if you dont want.
23:09:45FromDiscord<voidwalker> well it's a const, I need to supply values
23:10:06FromDiscord<graveflo> I mean they could be default.. maybe you can have a static function.. im not sure
23:10:35FromDiscord<voidwalker> yeah I noticed I can skip the type definition, it gets both length and type from the array definition
23:10:52FromDiscord<arathanis> i need beef to explain these type shenanigans to me, i am confused now
23:10:53FromDiscord<voidwalker> but other than that, it's a hassle. why can c++ do it an nim not ? "\
23:12:26FromDiscord<arathanis> @voidwalker do you mean w/o an initializer?
23:12:49FromDiscord<voidwalker> I mean without having to specify object type and field names on each element
23:13:04FromDiscord<graveflo> In reply to @arathanis "probably something weird in": Yea that is really odd too LOL. Nim does not like these parameterized expressions with inheritance.
23:13:34FromDiscord<arathanis> In reply to @graveflo "Yea that is really": as soon as its used in the generic the inheritance seems to reverse
23:13:41FromDiscord<arathanis> i was expecting both to be false since the first one was
23:13:45FromDiscord<arathanis> but the second one is true?
23:13:48FromDiscord<arathanis> it has to be a bug
23:14:29FromDiscord<arathanis> In reply to @voidwalker "I mean without having": oh you mean like the c++ `{}` constructor syntax?
23:14:49FromDiscord<voidwalker> I don't know what it's called, but probably that, the { } syntax I linked
23:14:50FromDiscord<arathanis> i guess its called initializer syntax
23:14:56FromDiscord<arathanis> or something like that
23:15:13FromDiscord<arathanis> you could make a macro that does this 😎
23:15:25FromDiscord<arathanis> but no i dont think there is a way for Nim to do it that way, its more explicit.
23:15:27FromDiscord<voidwalker> I couldn't
23:15:35FromDiscord<arathanis> ive always hated that form of initializer in C++
23:15:49FromDiscord<voidwalker> I haven't written the word macro yet in nim, I barely touched templates : P
23:15:58FromDiscord<arathanis> looks like character noise gobbledygook
23:16:11FromDiscord<arathanis> In reply to @voidwalker "I haven't written the": ahh, well it would let you do some facimile of this
23:19:39*xet7 joined #nim
23:23:22FromDiscord<Elegantbeef> Inheritance↵(@arathanis)
23:23:57FromDiscord<voidwalker> well, found the fix, use a tuple instead of an object, and I dont have to do object constructor syntax
23:24:06FromDiscord<Elegantbeef> Also generics do not abide by converters
23:26:08FromDiscord<graveflo> sometimes he speaks in riddles
23:33:34FromDiscord<arathanis> In reply to @Elegantbeef "Inheritance (<@136570191038513152>)": i don't understand how inheritance explains the situation with Bar in that example
23:33:40FromDiscord<arathanis> am I just not seeing it?
23:34:28FromDiscord<arathanis> a `ref Child` is a `ref Parent`, but a `Bar[ref Child]` is not a `Bar[ref Parent]` and the reverse is instead true?
23:36:51FromDiscord<graveflo> I think beef is smart enough to know its not correct. He is just being dismissive. One of the issues is that the type is not `Bar[ref Child]` its `Bar[Bar.T]` which is nonsense. Perhaps related to type resolution in conjunction with "converters" as he mentioned
23:36:54FromDiscord<odexine> In reply to @voidwalker "well, found the fix,": You lose nominal typing in that case, if it matters for you
23:38:58FromDiscord<voidwalker> the name fields or what ? I can have named tuple
23:39:32FromDiscord<odexine> You can have a tuple with no named fields match it
23:39:40FromDiscord<odexine> Even if it’s logically a different type
23:45:55FromDiscord<Elegantbeef> No i just mean inheritance type matching is funny↵(@graveflo)
23:49:32FromDiscord<Elegantbeef> The issue seems to be mainly that some of those types are invalid
23:49:38FromDiscord<Elegantbeef> `Bar[ref Child]` is incorrect
23:50:40FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/AhkSE
23:51:01FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4xWM
23:51:51FromDiscord<graveflo> so constraints on types dont work the same way as constraints on procs?
23:52:05FromDiscord<Elegantbeef> This is in a similar vein of `seq[Child] is not seq[Parent]`
23:52:31FromDiscord<Elegantbeef> It seems that way
23:52:41FromDiscord<graveflo> well that should be the case because they are not refs. If they were refs I would say that should work
23:52:43FromDiscord<Elegantbeef> No clue if this is intended or a bug
23:53:10FromDiscord<graveflo> It makes more sense why this is happening from that.. but now it looks like the change would need to be much more drastic
23:53:49FromDiscord<Elegantbeef> No you do not want to make `seq[Child]` convertible to `seq[Parent]`
23:53:50FromDiscord<Elegantbeef> It works only in that instance
23:53:50FromDiscord<Elegantbeef> Anywhere else it becomes more complicated
23:54:09FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/5ejZq
23:55:11FromDiscord<graveflo> yea you would have to use the methods that work on disambiguating with inheritance. That form doesn't work iirc
23:55:33FromDiscord<graveflo> I think you have to do use `if` but that has always been the case for that type of abstraction
23:56:01FromDiscord<Elegantbeef> I mean if `seq[Child] is seq[Parent]` you have so many 'wrong' assumptions in the type system
23:56:26FromDiscord<Elegantbeef> Generic type parameters do not do conversions for good reason 😄
23:56:58FromDiscord<graveflo> makes sense. not 100% there yet
23:57:46FromDiscord<graveflo> I'll put it this way, help a dummy out. Why would that assumption be bad for ref types of `RootObj`
23:58:00FromDiscord<Elegantbeef> I have some ramblings here https://forum.nim-lang.org/t/10072#66559
23:58:59FromDiscord<graveflo> I can see how it might lead to data loss but you get that anyway in procs and other mechs. Its just something you have to know when using a lang like this. I'll read