<< 19-06-2023 >>

00:10:32*azimut joined #nim
00:26:36*lucasta joined #nim
00:28:01*lucasta quit (Max SendQ exceeded)
00:34:05*greaser|q quit (Changing host)
00:34:05*greaser|q joined #nim
00:41:36*oldpcuser quit (Quit: FreeBSD 15, Slackware 16 and OpenBSD 8 will come with Systemd and GNOME by default. source: myass.com)
00:46:51*oldpcuser joined #nim
00:47:28*oldpcuser quit (Remote host closed the connection)
00:47:53*oldpcuser joined #nim
01:40:04FromDiscord<_alkamist_> What's the difference between untyped as a return for a template vs nothing?
01:41:25NimEventerNew Nimble package! bz2 - Nim module for the bzip2 compression format., see https://codeberg.org/Yepoleb/nim-bz2
01:42:16FromDiscord<Elegantbeef> untyped allows it to have a value, nothing means it should be void afaik
01:45:30FromDiscord<_alkamist_> Ok, I've just been slapping untyped as a return regardless and getting away with it.
01:46:00FromDiscord<_alkamist_> For some reason I thought of it like I'm returning "code"
01:47:57FromDiscord<Elegantbeef> That's kinda how it is with macros atleast
03:17:56*disso-peach quit (Quit: Leaving)
03:32:52*lucasta joined #nim
03:38:46*lucasta quit (Quit: Leaving)
04:24:32*azimut quit (Ping timeout: 240 seconds)
04:44:45*ntat joined #nim
04:45:48FromDiscord<arathanis> whats the main use case difference between using "typed" and "untyped" in a macro? or at all.
04:50:58FromDiscord<Elegantbeef> `typed` is semantically looked up `untyped` is parsed
04:59:33FromDiscord<arathanis> In reply to @Elegantbeef "`typed` is semantically looked": so `typed` goes through syntax and semantic evaluation, but `untyped` only goes through syntax evaluation
05:00:00FromDiscord<arathanis> so untyped is syntactically valid nim, but can be semantically invalid.↵typed is both syntactically and semantically valid nim
05:00:02FromDiscord<Elegantbeef> Yes
06:00:05*rockcavera quit (Remote host closed the connection)
07:03:37FromDiscord<Ras> In reply to @yardanico "i think it's worth": turns out it might be a bug with treeform's `pretty` package instead. When I removed the `print` statements, everything works fine
07:04:18FromDiscord<Ras> as a test, i replaced the `pretty` package with treeform's `print` package (the two do essentially the same thing) and it also works fine
07:04:31FromDiscord<Ras> or it might be that `pretty` somehow triggers the GC bug
07:05:32*derpydoo quit (Ping timeout: 240 seconds)
07:12:31*derpydoo joined #nim
07:28:28NimEventerNew thread by ploxotnuj1: How to make a dll in nim-lang?, see https://forum.nim-lang.org/t/10284
07:35:24*a11e99z0 joined #nim
07:37:49FromDiscord<Ras> is there a global nimscript location that gets called when anything is built? the mold linker readme says that `~/.config/config.nims` should be it, but it doesn't seem to be working: https://github.com/rui314/mold#how-to-use
07:41:43FromDiscord<intellj_gamer> I use the `~/.config/nim/nim.cfg` file, think its in the documentation somewhere
07:42:09FromDiscord<intellj_gamer> Ah, here https://nim-lang.org/docs/nimc.html#compiler-usage-configuration-files
07:42:48FromDiscord<Ras> ah, thanks
07:44:21FromDiscord<intellj_gamer> To mimic the code mold has, put it in `~/.config/nim/config.nims` (Just checked and it seems to work)
07:45:37FromDiscord<Ras> great, thanks
07:48:31*a11e99z0 quit (Quit: Leaving)
08:13:53FromDiscord<Ras> In reply to @Ras "or it might be": @treeform you might want to know this too
08:15:27FromDiscord<Ras> `pretty`, when i use it with my asyncnet code, causes memory issues with `orc` (even double-frees and stuff when compiling with `-d:useMalloc`)
08:15:35FromDiscord<Ras> `pretty` + `refc` is fine
08:15:40FromDiscord<Ras> `print` + `orc` is fine too
08:30:11FromDiscord<ieltan> What's the difference between `system.&=` and `system.add` when appending to string ?
08:30:39FromDiscord<ieltan> (is one faster than the other ?)
08:31:56FromDiscord<ieltan> Nvm, it seems like they are the same
09:08:38*mad_toothbrush joined #nim
09:33:25FromDiscord<thesherwood> Is there a way of defining a proc with a large number of named, optional arguments? I'm trying to create a proc with an interface that is well-suited to styling options.
09:51:48mad_toothbrushWhat is an idiomatic way to check if an element is not in a seq ? I mean something like: `if "red" not in colors:` where colors is a seq[string]. Thanks.
09:53:27FromDiscord<Andreas> In reply to @mad_toothbrush "What is an idiomatic": `"red" system.notin colors` should do https://nim-lang.org/docs/system.html#notin.t%2Cuntyped%2Cuntyped
09:54:15FromDiscord<Ras> `if "red" notin colors:`
09:54:17FromDiscord<Ras> oops
09:54:25FromDiscord<Ras> major lag on my end, sorry Andreas
09:54:25FromDiscord<Andreas> (edit) "https://nim-lang.org/docs/system.html#notin.t%2Cuntyped%2Cuntyped" => "https://nim-lang.org/docs/system.html#notin.t%2Cuntyped%2Cuntyped↵`not colors.contains "red"` should do too"
09:54:52FromDiscord<Andreas> In reply to @Ras "major lag on my": no excuses, took me a while, too..
09:55:03mad_toothbrushPerfect! Thanks @Andreas @Ras!
09:56:38FromDiscord<Ras> sent a long message, see http://ix.io/4yBv
09:57:14om3gaecho var.type.name?
09:57:53FromDiscord<Andreas> In reply to @om3ga "echo var.type.name?": `echo typeof( var )` maybe ?
09:58:09om3gaor this yes
10:01:06*beholders_eye joined #nim
10:17:50mad_toothbrushAnother one: For bare-metal, 'run-from-reset' type microcontroller code, I think I need to use '--os:any --mm:arc -d:useMalloc -d:nimAllocPagesViaMalloc' in addition to other typical cross-compilation specific flags (such as '--cpu:riscv64'). When I do this, I find that my cross compiler specific stuff in nim.cfg (eg 'riscv64.standalone.gcc.linkerexe = "riscv64-unknown-elf-gcc"') gets ignored
10:17:50mad_toothbrushand the host's gcc gets invoked instead. This wasn't happening when I was using '--os:standalone' though. Have I hit a bug ?
10:51:29FromDiscord<demotomohiro> I think `riscv64.standalone.gcc.linkerexe` is used only when `--os:standalone` not used when `--os:any`.↵You probably need to set `riscv64.any.gcc.linkerexe`.
10:56:32*beholders_eye quit (Ping timeout: 258 seconds)
11:04:12mad_toothbrush@demotomohiro: Thank you so much! I completely did not see the obviousness of that! :)
11:04:25mad_toothbrushWorks like a charm.
11:04:33mad_toothbrushNow to sort out all the missing symbols!
11:15:01FromDiscord<odexine> What is the difference between any and standalone again
11:15:32mad_toothbrushI think any is the successor intended to replace standalone.
11:16:02mad_toothbrushI was incorrectly using standalone because I was using one of the slightly dated Nim embedded tutes/blogs floating around.
11:20:42*beholders_eye joined #nim
11:40:27FromDiscord<auxym> yeah my understanding too is that any supersedes standalone, though I'm not 100% clear on the differences. This is the PR that introduced any: https://github.com/nim-lang/Nim/pull/13088
13:04:10mad_toothbrush
13:22:20*azimut joined #nim
13:38:41nisstyrehow come there's no aarch64 distribution of Nim? I tried compiling it myself but not sure where to put everything
13:38:52nisstyreI guess I can look at the x86 one and copy the paths
13:44:31FromDiscord<demotomohiro> Here is prebuilt Nim for aarch64:↵https://github.com/nim-lang/nightlies/releases↵Download the one with '_arm64' prefix.
13:45:05nisstyrethanks
13:46:23FromDiscord<demotomohiro> You can put it anywhere. After unzip it, set PATH like `export PATH=/path/to/nim/bin:$PATH`.
13:47:46nisstyremy issue was where the stdlib goes I guess
13:57:49FromDiscord<demotomohiro> Nim's nightlies release file contains stdlib. Nim automatically use it.↵You don't need to copy it to other place or set path to stdlib.
14:04:21*rockcavera joined #nim
14:19:20*beholders_eye quit (Ping timeout: 260 seconds)
14:34:53FromDiscord<treeform> In reply to @Ras "<@107140179025735680> you might want": That is strange! I don't use globals in pretty (like I did for print). It should work better. Do you have an issue with a repro case I can try?
14:38:04*beholders_eye joined #nim
14:48:46FromDiscord<heysokam> how would you call for `commands.execProcesses(n = processorCount)`, when the process you want to launch is just a shellCmd, like from `execShellCmd`? 🤔
14:49:11FromDiscord<heysokam> (edit) "is" => "are" | "a shellCmd," => "shell commands,"
15:01:32*beholders_eye quit (Ping timeout: 240 seconds)
15:25:07FromDiscord<bostonboston> Does a conversion to a enum not check if you converted to a hole
15:27:20FromDiscord<spotlightkid> sent a code paste, see https://play.nim-lang.org/#ix=4yCo
15:28:12FromDiscord<spotlightkid> Note that with '-c', the whole script goes into the second argument as one string.
15:28:32FromDiscord<spotlightkid> sent a code paste, see https://paste.rs/qEpoi
15:28:57FromDiscord<spotlightkid> sent a code paste, see https://play.nim-lang.org/#ix=4yCs
15:31:01FromDiscord<heysokam> its mean to be platform-agnostic though 🤔
15:31:07FromDiscord<heysokam> (edit) "mean" => "meant"
15:35:25FromDiscord<spotlightkid> then don't use shell
15:37:34FromDiscord<heysokam> In reply to @spotlightkid "then don't use shell": but `execShellCmd` uses a shell, doesn't it?
15:37:45FromDiscord<heysokam> how does that work platform-agnostic?
15:38:04FromDiscord<heysokam> the idea is to be able to run commands on cli in parallel, thats all
15:44:08*azimut quit (Ping timeout: 240 seconds)
15:45:15FromDiscord<spotlightkid> AFAICS `execShellCmd` uses `system` from the C stdlib, which invokes a platform-dependent command processor (`sh` on \nix, `cmd.exe` or `command.com` on windows).
15:45:45*lucasta joined #nim
15:49:32FromDiscord<spotlightkid> I.e. you cant expect `execShellCmd("ls -l")` to work on windows.
16:07:14FromDiscord<heysokam> well, but if the function calls for the correct thing interally, the function itself is platform-independent
16:07:30FromDiscord<heysokam> i thought execShellCmd worked on windows normally
16:14:26FromDiscord<spotlightkid> It does. It just doesn't use the Unix shell. So there wil be differences in the commands you can use.
16:14:42NimEventerNew thread by Steven: MoveWindow(), see https://forum.nim-lang.org/t/10285
16:27:23FromDiscord<heysokam> In reply to @spotlightkid "It does. It just": im going to call for a very specific app that i know exists in all systems. what i want is the shell itself, because i know the specific command do exists
16:27:25FromDiscord<heysokam> (edit) "exists" => "exist"
16:27:47FromDiscord<heysokam> does `sh` work on windows? because i do know it works on linux/mac
16:30:57FromDiscord<mratsim> In reply to @heysokam "does `sh` work on": In git bash
16:31:31FromDiscord<demotomohiro> `sh` works on windows if user installed it somehow.
16:31:42FromDiscord<spotlightkid> If by `app` you mean a binary executable, you don't need the shell to invoke it.↵Jusr pass the path to it as the first param to `execProcess`.
16:31:46FromDiscord<mratsim> In reply to @heysokam "the idea is to": This is a parallel CLI commands runner: https://github.com/mratsim/constantine/blob/master/helpers/pararun.nim
16:47:15FromDiscord<heysokam> In reply to @spotlightkid "If by `app` you": but i don't have the path for some of them. its in `PATH`
16:47:35FromDiscord<heysokam> some i give a full path, but for others its meant to search in path like a shell
16:47:51FromDiscord<heysokam> also, its meant to report in cli
16:48:46FromDiscord<heysokam> In reply to @mratsim "This is a parallel": i don't think i understand what this file is doing
16:49:01FromDiscord<heysokam> i have 0 knowledge in async, so its going over my head very strongly
16:49:05FromDiscord<spotlightkid> AFAICS `pararun` uses `osproc.startProcess` with the `poEvalCommand` option, whch boils down to calling the platform-dependent command processor again.
16:49:57FromDiscord<spotlightkid> Then use the `poUsePath` option, as I've shown above.↵(@heysokam)
16:50:33FromDiscord<spotlightkid> Sorrym that was meant as a reply to "but i don't have the path for some of them. its in PATH"
16:50:36FromDiscord<heysokam> whats different then between execShellCmd and execProcess(poUsePath), if they are both doing that?
17:00:10FromDiscord<demotomohiro> sent a code paste, see https://play.nim-lang.org/#ix=4yCK
17:07:32FromDiscord<mratsim> In reply to @heysokam "i don't think i": It takes a file of commands and enqueue them all for parallel processing.↵↵It uses a semaphore to ensure no more process than the number pf cores are running simultaneously and it buffers each command output so that you don't get garbled lines with 2 processes interleaving their output
17:08:37FromDiscord<mratsim> Say you have "Hello World!" and "Good morning" you can have Hgooellod Wmoorrnlding!" as an output
17:11:18FromDiscord<mratsim> In reply to @spotlightkid "Sorrym that was meant": So just use `nim` instead of `/usr/bin/nim`
17:12:06FromDiscord<mratsim> In reply to @mratsim "Say you have "Hello": In particular execProcesses does garbled output
17:15:29*mad_toothbrush quit (Ping timeout: 240 seconds)
17:21:16*PMunch joined #nim
17:23:25FromDiscord<heysokam> In reply to @mratsim "It takes a file": what i mean is that i cannot use that code if i don't understand it
17:24:37FromDiscord<heysokam> In reply to @mratsim "In particular execProcesses does": what is garbled output?
17:26:45FromDiscord<mratsim> In reply to @heysokam "what is garbled output?": One process outputting "Hello World!" and another outputting "Good morning" and what is printed on your console is a mix of the twos: "Hgooellod Wmoorrnlding!"
17:26:53FromDiscord<mratsim> (edit) "twos:" => "two:"
17:27:43FromDiscord<heysokam> ah i see
17:27:59FromDiscord<mratsim> In reply to @heysokam "what i mean is": It's really the minimal to have usable parallel processes unless your parallel processes never print anything and you cannot overload your CPU because you never spawn more processes than your number of cores.
17:28:23FromDiscord<mratsim> (edit) "minimal" => "minimum"
17:35:49FromDiscord<demotomohiro> In reply to @demotomohiro "Compiling this code prints": It is known issue: https://github.com/nim-lang/Nim/issues/21687#issuecomment-1514203430
17:39:38*Onionhammer5 joined #nim
17:41:08*Onionhammer quit (Ping timeout: 252 seconds)
17:41:08*Onionhammer5 is now known as Onionhammer
17:54:02*adigitoleo quit (Ping timeout: 248 seconds)
17:55:50*adigitoleo joined #nim
17:59:05*mad_toothbrush joined #nim
18:22:37FromDiscord<PunchCake> Whats the best way to do a gui in nim?
18:22:59FromDiscord<PunchCake> Preferably a webview type of gui
18:23:57mad_toothbrushHow do I refer to a linker script defined symbol from within Nim code ?
18:42:02PMunch@PunchCake, well if you want webview then use webview. There are a couple packages for it IIRC, nimble.directory
18:44:27FromDiscord<PunchCake> Which can be used with a js framework
18:44:27FromDiscord<PunchCake> Can you send some↵(<@709044657232936960_=50=4dunch=5b=49=52=43=5d>)
18:46:01FromDiscord<michaelb.eth> is there a way at compile-time to check that a type has a field with a particular name?
18:46:34FromDiscord<michaelb.eth> (edit) "a" => "an object"
18:48:04FromDiscord<jmgomez> `compiles(myObject.field)`
18:49:52FromDiscord<michaelb.eth> what if I don't have an instance, just the typedesc?
18:50:39PMunch@PunchCake, nope, haven't looked into it myself (apart from just getting Electron up and running with Nim at some point). Personally not a big fan of web-based UIs, but I know there are some libraries for it out there.
18:52:06FromDiscord<arathanis> In reply to @michaelb.eth "what if I don't": I think you can just ask about the field on an object
18:53:03FromDiscord<arathanis> https://media.discordapp.net/attachments/371759389889003532/1120426033603170375/image.png
18:53:39FromDiscord<michaelb.eth> thanks
18:54:43FromDiscord<michaelb.eth> for some reason variations of that approach aren't working quite like I want, i.e. in some cases I get the assertion defect I'm expecting, in other cases the compiler fails with a more cryptic error
18:54:59FromDiscord<arathanis> what is your use case, cause this seems like you would want to be using concepts
18:55:34FromDiscord<michaelb.eth> I'll look into concepts when they're fully baked and the documentation is up-to-date
18:55:41FromDiscord<michaelb.eth> until then it's object variants ftw
18:55:53FromDiscord<arathanis> ahh object variants
18:56:02FromDiscord<arathanis> can't you just check which variant it is instead of checking the fields?
18:56:17FromDiscord<michaelb.eth> the variants are user-supplied
18:56:20FromDiscord<michaelb.eth> I'm writing a library
18:56:51FromDiscord<michaelb.eth> with a convention that in the case of two different types, one has an `id` field, and the other has a `name` field
18:57:15FromDiscord<arathanis> ghotcha
18:57:19FromDiscord<arathanis> (edit) "ghotcha" => "gotcha"
18:57:35FromDiscord<michaelb.eth> in any case, with my assertions in a `static:` block, there is a compile-time failure if the assertions fail, so that's good
18:57:49FromDiscord<michaelb.eth> it's just the errors can be cryptic, but oh well
18:58:22FromDiscord<arathanis> sent a code paste, see https://play.nim-lang.org/#ix=4yD3
18:58:39FromDiscord<arathanis> then anything that lets that block compile is consided an ExampleConcept
18:58:46FromDiscord<arathanis> and you otherwise use it as a type
18:59:00FromDiscord<jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=4yD4
18:59:03FromDiscord<michaelb.eth> sure, concepts seem really cool, but isn't the Manual out of step re: "old concetps" vs. "new concepts"? and, are "new concepts" really ready for prime time?
18:59:18FromDiscord<arathanis> In reply to @michaelb.eth "sure, concepts seem really": yes, the current implementation is somewhere between the two
18:59:24FromDiscord<michaelb.eth> In reply to @jmgomez "this may also work": tried it, the `compiles(...)` passes even when the field is missing
18:59:25FromDiscord<arathanis> the basic stuff like above works though
19:00:21FromDiscord<jmgomez> In reply to @michaelb.eth "tried it, the `compiles(...)`": that's odd. Can you show how you are using it?
19:01:27FromDiscord<jmgomez> also another option if you dont really want to use concepts is to just do a macro that checks for the field
19:01:39FromDiscord<arathanis> In reply to @jmgomez "also another option if": i was also going to suggest this as well
19:01:40FromDiscord<michaelb.eth> what's the most up-to-date (and hopefully decent) tutorial/blog-post/etc on "new" concepts? I'd be interested in seeing a compare/contrast with how to use them vs. object variants
19:01:53FromDiscord<arathanis> a macro to be used as a pragma to register the user defined type that verifies what you need
19:02:02FromDiscord<arathanis> can even stitch things into the type
19:02:03FromDiscord<michaelb.eth> In reply to @jmgomez "also another option if": ah yeah, that's a good point
19:03:02FromDiscord<michaelb.eth> sent a code paste, see https://play.nim-lang.org/#ix=4yD7
19:03:43FromDiscord<michaelb.eth> maybe a compiler bug, but another interesting/weird thing is that for `initial` and `name` I couldn't just supply the default value, had to also give them type, else compile-time failure
19:04:32FromDiscord<michaelb.eth> (edit) "give them type," => "specify the types,"
19:05:51*lucasta quit (Quit: Leaving)
19:05:57FromDiscord<jmgomez> how exactly were you using `compiles`?
19:06:55FromDiscord<jmgomez> (edit) removed "exactly"
19:06:56FromDiscord<michaelb.eth> I will answer, but before that, I'll note that if I don't put the assertions in `static:`, the first one will fail if `Dm` doesn't have `id` field, but the second one only fails at runtime
19:07:01FromDiscord<michaelb.eth> which seems weird to me
19:12:11FromDiscord<michaelb.eth> sent a code paste, see https://play.nim-lang.org/#ix=4yD9
19:13:18FromDiscord<jmgomez> Yeah. Try to do `when not compiles(Dm.id): error("error whatever")`
19:16:10FromDiscord<deech4592> sent a code paste, see https://play.nim-lang.org/#ix=4yDb
19:16:11FromDiscord<michaelb.eth> sent a code paste, see https://paste.rs/ewOM2
19:17:18FromDiscord<michaelb.eth> In reply to @michaelb.eth "sure, but here's one": I just relieved that `name` from std/typetriats is probably causing some confusion
19:17:46FromDiscord<michaelb.eth> In reply to @deech4592 "You can also do": nice, I will try that also, thank you!
19:19:14FromDiscord<deech4592> Something like this seems like a good candidate for the stdlib. I've had to roll something like this a few times on my own.
19:19:36FromDiscord<deech4592> (edit) "something like this" => "my own" | "on my own." => "so far."
19:22:05*ntat quit (Ping timeout: 265 seconds)
19:24:31NimEventerNew thread by mantielero: Macro - issue with the identifiers, see https://forum.nim-lang.org/t/10286
19:42:45FromDiscord<ieltan> sent a code paste, see https://play.nim-lang.org/#ix=4yDf
19:43:27*nyeaa492842301 quit (Quit: The Lounge - https://thelounge.chat)
19:43:44FromDiscord<ieltan> (edit) "https://play.nim-lang.org/#ix=4yDf" => "https://play.nim-lang.org/#ix=4yDg"
19:45:11FromDiscord<mratsim> In reply to @michaelb.eth "sure, concepts seem really": new concepts are usable?
19:52:02*cedb quit (Ping timeout: 252 seconds)
19:54:15*cedb joined #nim
19:57:58FromDiscord<demotomohiro> sent a code paste, see https://play.nim-lang.org/#ix=4yDl
19:58:59FromDiscord<demotomohiro> https://nim-lang.org/docs/manual.html#statements-and-expressions-type-casts
19:59:24FromDiscord<demotomohiro> > Type casts are a crude mechanism to interpret the bit pattern of an expression as if it would be of another type. Type casts are only needed for low-level programming and are inherently unsafe.
20:00:02*derpydoo quit (Quit: derpydoo)
20:02:00FromDiscord<demotomohiro> If you are using cast when you are not using C library, you are likely doing something wrong.
20:07:07*mronetwo quit (Read error: Connection reset by peer)
20:07:08*tk quit (Ping timeout: 240 seconds)
20:07:13*oddish quit (Read error: Connection reset by peer)
20:07:16*adigitoleo quit (Read error: Connection reset by peer)
20:07:19*mronetwo joined #nim
20:07:24*oddish joined #nim
20:07:49*tk joined #nim
20:09:40FromDiscord<ieltan> sent a code paste, see https://play.nim-lang.org/#ix=4yDm
20:10:04FromDiscord<ieltan> (edit) "https://play.nim-lang.org/#ix=4yDm" => "https://play.nim-lang.org/#ix=4yDn"
20:11:42FromDiscord<krab4t> how you create a proc that takes any amount of any types? not varargs...
20:11:50FromDiscord<krab4t> t: T its just 1
20:12:31FromDiscord<ieltan> In reply to @ieltan "Thanks, I reflected your": The usecase is to have a table of closures, accepting `Parent` and `Child` as an argument and returning bool after running checks
20:12:43FromDiscord<ieltan> (edit) "and" => "and/or "
20:15:12FromDiscord<ieltan> `t` may be instances of `Parent` having additional fields that i would like to access, I need to convert to the specific `Child` instance to access them but since I want to put that in library code I don't want the user to manually convert the type all the type
20:17:12*mad_toothbrush quit (Ping timeout: 240 seconds)
20:20:13*adigitoleo joined #nim
20:26:49FromDiscord<demotomohiro> How does Nim compiler infer Child from Parent?↵t of Child checks runtime type info.
20:30:13FromDiscord<demotomohiro> sent a code paste, see https://paste.rs/UskdQ
20:33:19FromDiscord<Elegantbeef> Well you can technically `cast[proc(t: Parent)](myClos)` but it's unsafe
20:33:30FromDiscord<Elegantbeef> This is sounding a lot like methods
20:34:04FromDiscord<Elegantbeef> @mratsim\: yes they work, but they're not fully implemented and there are many bugs
20:49:43FromDiscord<voidwalker> can I somehow specify in the .nimble file that my project needs "db_connector" if nim version > 1.6 ?
20:51:23FromDiscord<voidwalker> if I do nimble install db_connector with choosenim stable, I get `Error: Unsatisfied dependency: nim (>= 1.7.3)`
20:51:31FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4yDp
20:55:17*derpydoo joined #nim
20:55:37FromDiscord<voidwalker> Thanks, I think that worked,
20:56:30FromDiscord<ieltan> sent a code paste, see https://play.nim-lang.org/#ix=4yDt
20:58:25FromDiscord<ieltan> pinging @krisp0 because this is mainly for his library so he might figure something out
20:59:16FromDiscord<Elegantbeef> You cannot convert a `proc(c: Child)` to `proc(p: Parent)` safely
21:00:40FromDiscord<ieltan> In reply to @Elegantbeef "You cannot convert a": Is there an alternative approach to my issue then ?
21:01:05FromDiscord<Elegantbeef> Methods/Convert internally
21:02:21FromDiscord<demotomohiro> Yes, methods would be better
21:03:43FromDiscord<ieltan> In reply to @Elegantbeef "Methods/Convert internally": Well, I cannot use methods/dynamic dispatch with closures..
21:03:49FromDiscord<ieltan> unless i can ?
21:05:58FromDiscord<demotomohiro> How about to define methods for each Children types and call them from closures?
21:09:50*nyeaa492842301 joined #nim
21:19:21FromDiscord<bostonboston> Nim seems to be exporting a NimMain symbol in my dll even when specifying `--noMain:on`, is that supposed to happen
21:19:41FromDiscord<Elegantbeef> Yes
21:19:45FromDiscord<bostonboston> (edit) "Nim ... seems" added "compiler"
21:19:58FromDiscord<Elegantbeef> You should always call `NimMain` it calls top level code
21:20:42FromDiscord<bostonboston> So is there something funny I need to be doing when importing my functions from the dll in other languages
21:20:43FromDiscord<arathanis> In reply to @bostonboston "Nim compiler seems to": it initializes Nim's internals: https://nim-lang.org/docs/backends.html#interfacing-backend-code-calling-nim
21:21:03FromDiscord<Elegantbeef> Generally you have a `once: NimMain()` inside your `init` procedure
21:21:07FromDiscord<arathanis> there is a compiler flag to prefix it apparently, if you want to change the name.
21:21:12FromDiscord<arathanis> In reply to @Elegantbeef "Generally you have a": this is exactly how i do it
21:22:08FromDiscord<arathanis> ok beef, you work on the compiler right?
21:22:18FromDiscord<Elegantbeef> "work" is a loose term 😛
21:22:34FromDiscord<Elegantbeef> I do some amount of compiler development when the sun hits me at the right time
21:23:40FromDiscord<arathanis> sent a code paste, see https://play.nim-lang.org/#ix=4yDD
21:23:51FromDiscord<arathanis> (edit) "https://play.nim-lang.org/#ix=4yDD" => "https://play.nim-lang.org/#ix=4yDE"
21:24:00FromDiscord<ieltan> In reply to @demotomohiro "How about to define": Well no, this really should not be up to the user to do this. I was thinking of defining procs for each `Child` types and put them in a object variant but i remembered you cannot share field 😢
21:24:46FromDiscord<arathanis> (edit) "https://play.nim-lang.org/#ix=4yDE" => "https://play.nim-lang.org/#ix=4yDF"
21:25:31FromDiscord<arathanis> its gotta be some quirk of the parser
21:25:38FromDiscord<Elegantbeef> Clearly
21:26:15FromDiscord<Elegantbeef> ieltan explain what you're trying to do
21:26:55FromDiscord<Elegantbeef> I do not use `=>` so I've never ran into this, so no real insight here
21:28:53FromDiscord<bostonboston> Not knowing to run NimMain() once really had me running in circles
21:35:22FromDiscord<krisp0> In reply to @ieltan "pinging <@222794789567987712> because this": Are you trying to implement event handlers that are a bit similar to krognol's discordnim?
21:43:52FromDiscord<ieltan> sent a code paste, see https://play.nim-lang.org/#ix=4yDJ
21:47:47FromDiscord<ieltan> In reply to @krisp0 "Are you trying to": Not aware that it even existed tbh
21:48:44FromDiscord<Elegantbeef> Nice the bridge dropped an important message 😄
21:48:53FromDiscord<Elegantbeef> I've got a possible idea
21:51:16FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/sZeK9
21:51:18FromDiscord<Elegantbeef> Something like this
21:51:37FromDiscord<Elegantbeef> whoops should be `cast[proc(p: Parent)](myProc)`
21:52:57FromDiscord<Elegantbeef> Also those `T` should be `t`
21:53:28FromDiscord<Elegantbeef> You could also write a macro so you could do `toEvent(proc(c: Child) = echo "hmm")`
21:54:24*PMunch quit (Quit: leaving)
22:00:35*greaser|q quit (Remote host closed the connection)
22:03:46*greaser|q joined #nim
22:10:14FromDiscord<ieltan> sent a code paste, see https://play.nim-lang.org/#ix=4yDO
22:10:29FromDiscord<Elegantbeef> Why do we have event kind and inheritance
22:19:58FromDiscord<ieltan> sent a code paste, see https://play.nim-lang.org/#ix=4yDP
22:21:36FromDiscord<Elegantbeef> So `array[EventKind, Table[string, Collector]]`
22:21:45FromDiscord<ieltan> for more details, I used `parseEnum[EventKind]("EVENT_NAME")`
22:21:58FromDiscord<Elegantbeef> What are the strings for?
22:22:03FromDiscord<ieltan> In reply to @Elegantbeef "So `array[EventKind, Table[string, Collector]]`": Ah right
22:22:29FromDiscord<ieltan> it's not gonna move much so an array is appropriate 🙂
22:25:32FromDiscord<ieltan> In reply to @Elegantbeef "What are the strings": a discord payload has a `t` field containing the event name, it might be "MESSAGE_CREATE", in anycase i use `parseEnum[EventKind](t)` to get `MessageCreateEvent`
22:25:48FromDiscord<ieltan> or any other event type
22:25:51FromDiscord<Elegantbeef> Right so what's the string for in the table?
22:32:57FromDiscord<ieltan> sent a code paste, see https://play.nim-lang.org/#ix=4yDQ
22:36:32FromDiscord<ieltan> i was planning on adding more stuff on the comments warning about how the string gets too big and that i might have to use slices
22:43:54*greaser|q quit (Remote host closed the connection)
22:44:10FromDiscord<Elegantbeef> Do not know why you'd use inheritance where variants suffice
22:45:57*greaser|q joined #nim
22:46:58FromDiscord<ieltan> cannot have shared name fields but i'll give it a go later maybe it wont be as bad
22:47:32FromDiscord<Elegantbeef> Could use fungus
22:49:46FromDiscord<ieltan> In reply to @Elegantbeef "*Could use fungus*": Not up to me 😢
22:50:04FromDiscord<Elegantbeef> What?
22:51:13FromDiscord<ieltan> I mean that I don't think adding a dependency for `dimscord` would be worth my contribution unless the maintainer thinks otherwise
22:51:35FromDiscord<Elegantbeef> Well then use a variant with a property
22:51:46*sagax joined #nim
22:52:14FromDiscord<ieltan> Yup
23:39:02*azimut joined #nim
23:53:02FromDiscord<JJ> so i'm reading through the concepts v2 proposal and the first line threw me off:↵> Empower concepts to make generic code type-checkable at declaration time, not only at instantiation time.↵does araq mean runtime? i thought concepts were monomorphized but i may be mistaken.
23:58:14FromDiscord<Elegantbeef> Ensure the concept is constrained, like a trait
23:58:14FromDiscord<Elegantbeef> He means that inside the generic procedure
23:59:01FromDiscord<JJ> hmm, could you elaborate
23:59:42FromDiscord<huantian> it's the thing I always complain about
23:59:45FromDiscord<elegantbeef> Bridge moment