<< 22-06-2021 >>

00:12:12FromDiscord<Zamak> Hello, I just picked up nim so pardon my ignorance. I'm looking for a way to have a sequence of agreed-upon function calls. IE Trait/Interface/Base-class in other languages. Would the most nim-ly way to go about this be to create a type and have methods of all the functions I wish to override? What would the other ways look like to implement this? Also, is there such thing as a generic enum or at least a way to define a function that will t
00:13:02FromDiscord<Elegant Beef> to answer your latter question `proc doSomething(a: enum)` should work
00:13:23FromDiscord<Elegant Beef> The former question, there is iface for interfaces https://github.com/yglukhov/iface
00:13:57FromDiscord<Elegant Beef> There is also https://github.com/haxscramper/nimtraits for a PoC trait system
00:17:58FromDiscord<Zamak> Thanks, these look promising. I was looking into concepts, but figured they wouldn't work because I can't have a seq of them. Do you know if I can do that with either of these libraries?
00:18:13FromDiscord<Elegant Beef> iface allows you to have a seq of them
00:19:41FromDiscord<Elegant Beef> I do have a version of interfaces based on new concepts but i havent done much with them
00:23:17*jkl quit (Ping timeout: 268 seconds)
00:46:33*Gustavo6046 quit (Quit: ZNC 1.8.2 - https://znc.in)
00:49:07*Gustavo6046 joined #nim
00:53:33FromDiscord<@bracketmaster-5a708063d73408ce4> nims been around longer, but v-lang seems to have more momentum around it?
00:53:39FromDiscord<@bracketmaster-5a708063d73408ce4> any insight as to why this could be?
00:54:03FromDiscord<@bracketmaster-5a708063d73408ce4> also, don't think v-lang has and commercial user ATM AFAIK
00:54:49*Gustavo6046_ joined #nim
00:55:26*Gustavo6046 quit (Ping timeout: 252 seconds)
00:57:36*Gustavo6046_ is now known as Gustavo6046
01:00:27FromDiscord<leorize> vlang did have a hype stage that was very successful
01:00:36FromDiscord<leorize> I'm surprised that it didn't die after release tbh
01:00:56FromDiscord<@bracketmaster-5a708063d73408ce4> well, its not a bad language...
01:01:26FromDiscord<@bracketmaster-5a708063d73408ce4> it lived up to its claims
01:01:34FromDiscord<Elegant Beef> Years after it claimed them
01:01:59FromDiscord<leorize> on release they added WIP on every single claim
01:02:41FromDiscord<Elegant Beef> I can deadlift 400kg, I'm only like 70kg, did I lie or will I ever eventually be able to? 😛
01:37:00*jkl joined #nim
02:02:42*arkurious quit (Quit: Leaving)
02:23:55FromDiscord<exithead> I've been looking for a new language to learn for a while and narrowed it down to Nim or v. Chose Nim and haven't regretted yet.
02:26:41FromDiscord<Elegant Beef> Wait until you learn that V can compile infinite lines of code in -3.14s
02:32:35FromDiscord<Rika> Have you actually tried V?
02:32:46FromDiscord<Elegant Beef> Me?
02:32:49FromDiscord<Rika> No
02:32:57FromDiscord<Rika> You’re just a joker
02:36:02FromDiscord<Elegant Beef> Well that's life
02:44:39FromDiscord<deech> What's the difference between `type ORef = ref object ...` and `type O = object ..., ORef = ref O`?
02:45:14FromDiscord<Elegant Beef> Having a concrete non ref base object
02:45:54FromDiscord<Elegant Beef> So if you arent using the `O` directly there isnt any reason to declare it
02:46:03FromDiscord<deech> There seems to be a difference when you do `unsafeAddr` each of the two `ORef`'s.
02:46:21FromDiscord<Rika> What do you mean?
02:46:45FromDiscord<Elegant Beef> well `ref` is a pointer so getting it's addr will give you a pointer to a pointer
02:48:30FromDiscord<Elegant Beef> https://play.nim-lang.org/#ix=3qHS
02:48:52FromDiscord<Elegant Beef> That'll show the difference between the addr of the struct and the addr of the ref
03:00:28*fputs quit (Quit: Leaving)
03:08:03FromDiscord<מרוז לוץ> image.jpeg https://media.discordapp.net/attachments/371759389889003532/856732240566419486/image.jpeg
03:08:04FromDiscord<מרוז לוץ> image.jpeg https://media.discordapp.net/attachments/371759389889003532/856732243737051157/image.jpeg
03:08:16FromDiscord<מרוז לוץ> sent a long message, see https://paste.rs/Zat
03:08:17FromDiscord<מרוז לוץ> sent a long message, see http://ix.io/3qHY
03:08:23FromDiscord<מרוז לוץ> sent a long message, see http://ix.io/3qHZ
03:08:24FromDiscord<מרוז לוץ> sent a long message, see http://ix.io/3qHZ
03:11:57FromDiscord<Rika> <@&371760044473319454> lol
03:12:21FromDiscord<Rika> One of the rooms has a scam bot
03:15:10FromDiscord<Hugo Ribeiro> We have bots to save us 😂
03:17:10*Gustavo6046 quit (Ping timeout: 252 seconds)
03:21:46*Gustavo6046 joined #nim
04:06:02*supakeen quit (Quit: WeeChat 3.2)
04:06:36*supakeen joined #nim
04:06:40*rockcavera quit (Remote host closed the connection)
04:07:12*lucerne joined #nim
04:25:57FromDiscord<Avahe> is `table{"someKey"}` syntax not used? I'm getting a warning but it's not very clear
04:29:09FromDiscord<Elegant Beef> It's not an operator in the `tables` module if that's what you mean
04:30:02FromDiscord<Avahe> oh woops, meant to say this is a TomlValueRef
04:30:41FromDiscord<Avahe> https://github.com/NimParsers/parsetoml/blob/master/src/parsetoml.nim#L1861 seems fine to me
04:31:37FromDiscord<Avahe> sent a code paste, see https://play.nim-lang.org/#ix=3qI8
04:31:48FromDiscord<Avahe> with `table{"networks"}`
04:43:07FromDiscord<codic> In reply to @מרוז לוץ "**Poll**\: Дно BTC по": 100000000 000 0000000000 %
04:43:10FromDiscord<codic> (edit) "%" => "$"
04:44:29FromDiscord<codic> why is the `Vote with` in English but the rest in Russian
04:44:32FromDiscord<codic> and why is your username in hebrew
04:44:40FromDiscord<codic> weird scam bot
05:12:41*lucerne quit (Remote host closed the connection)
05:13:48*lucerne joined #nim
05:29:42*jkl quit (Ping timeout: 264 seconds)
05:30:52FromDiscord<hamidb80> In reply to @Elegant Beef "I can deadlift 400kg,": both
06:25:20*Gustavo6046 quit (Remote host closed the connection)
06:27:48*Gustavo6046 joined #nim
06:33:27*max22- joined #nim
06:34:25*Gustavo6046 quit (Ping timeout: 268 seconds)
06:42:34*lucerne quit (Remote host closed the connection)
06:57:54*Gustavo6046 joined #nim
07:14:01*Epsilon quit (Remote host closed the connection)
07:14:06*Epsilon- joined #nim
07:27:28FromDiscord<gogolxdong (liuxiaodong)> How to do UInt256 division?
07:37:58*lucerne joined #nim
07:40:58FromDiscord<elph> hello everyone. I want to work on a Nim library that could used (obviously) from Nim, but also from Python. I've been quite happy using the `nimpy`'s `{.exportpy.}` method. My question is what would be the best method: a Nim "only" lib and then just a separate lib just re-declaring everything with `{.exportpy.}`? Or is there no major downside to have methods declare `{.exportpy.}` by default?
07:41:51FromDiscord<elph> (edit) "hello everyone. I want to work on a Nim library that could ... useddeclared" added "be" | "declare" => "declared with "
07:42:27FromDiscord<Elegant Beef> Would it make any more sense to make it a system library that could be used from any language?
07:43:15FromDiscord<Elegant Beef> Yes you'd have to make bindings, but if it's a library that's useful it'd be the most reusable possible \:D
07:44:08FromDiscord<elph> @ElegantBeef yes, that's a good point 🙂 and then use it from Python with something like `ctypes` I supporse
07:44:12FromDiscord<elph> (edit) "supporse" => "suppose"
07:44:22FromDiscord<Elegant Beef> Yep
07:44:31FromDiscord<elph> 👍 thanks
07:45:17*lucerne quit (Remote host closed the connection)
07:46:25*lucerne joined #nim
07:47:13FromDiscord<Stuffe> Does anyone know how to compute an array at compile time based on a const table? Here is an example of what I am trying to do: https://play.nim-lang.org/#ix=3qIH
07:48:39FromDiscord<Elegant Beef> Like this? https://play.nim-lang.org/#ix=3qIJ
07:49:24FromDiscord<Stuffe> that one has empty entries in the array. let me fiddle with it a bit
07:49:38FromDiscord<Elegant Beef> Shouldnt there be empties?
07:49:46FromDiscord<Elegant Beef> you only have 1 `2` in the table
07:50:03FromDiscord<Stuffe> No empties
07:50:10FromDiscord<Stuffe> It is just a minimized example
07:50:56FromDiscord<Stuffe> I have a table with 100 structs, but all over the place I need a list of the structs that meets a certain condition
07:51:12FromDiscord<Elegant Beef> Ok
07:51:19FromDiscord<vindaar> you need to split the `tmp` seq into its own `const` variable\: https://play.nim-lang.org/#ix=3qIK
07:52:53FromDiscord<Elegant Beef> Or if you want it all blocked together https://play.nim-lang.org/#ix=3qIN
07:53:11*SebastianM joined #nim
07:53:20FromDiscord<vindaar> huh, works with collect. nice
07:53:32FromDiscord<vindaar> makes sense I guess
07:53:39*PMunch joined #nim
07:53:45FromDiscord<Stuffe> @Vindaar @ElegantBeef I'll take the second one. Thanks 🙂
07:53:56FromDiscord<Stuffe> Since I don't need the tmp in the run time scope
07:59:05FromDiscord<Elegant Beef> Better luck next time vindaar 😛
07:59:26FromDiscord<vindaar> damn, I'll try harder 😜
08:03:20*lucerne quit (Remote host closed the connection)
08:07:43FromDiscord<Varriount> Araq/@Araq: Is this suppose to be "doesn't need to be done with deferredImport", or "does need to be done with deferredImport"?↵https://github.com/nim-lang/Nim/pull/18251#issuecomment-860404870
08:19:50FromDiscord<Varriount> Araq / @Araq : Is this suppose to be "doesn't need to be done with deferredImport", or "does need to be done with deferredImport"?↵https://github.com/nim-lang/Nim/pull/18251#issuecomment-860404870
08:20:54*SebastianM quit (Quit: SebastianM)
08:22:46FromDiscord<Varriount> I believe adding deferredImport would be a mistake. It wouldn't be used often enough to be memorable (or possibly even discoverable), and people new to the language would expect `import` to do the right thing automatically.
08:47:04FromDiscord<timotheecour> Then don't use it if you don't understand it. I have real use cases for it that are hard to achieve without this feature.
08:48:37FromDiscord<timotheecour> (edit) "Then don't use it if you don't understand it. I have real use cases for it that are hard to achieve without this feature. ... " added "Same goes with the other modules; no-ones's forcing you to use those APIs, but they're here for a reason."
08:51:17*Vladar joined #nim
08:53:14FromDiscord<Araq> I corrected my typo
08:53:36FromDiscord<Araq> sorry for the confusion, deferredImport is not required afaict
09:05:29*max22- quit (Ping timeout: 252 seconds)
09:08:49FromDiscord<timotheecour> @Araq I think there's a misunderstanding regarding this PR; it allows registering root modules that should be compiled, as done in other languages eg:↵`dmd main.d mylib.d`, or `clang main.cpp mylib.cpp`, and can be thought of extending the `{.compiles: mylib.c.}` to also consider nim files (but reusing module graph so each module is compiled just once); it's equivalent to adding `import mylib` at the end of the main module
09:10:02FromDiscord<timotheecour> I even remember you were discussing something related recently, mentioning that having to rely on a main module import a dependency is fragile; this solves that problem.
09:10:17*max22- joined #nim
09:12:30FromDiscord<Araq> well if I don't understand, maybe it's because it lacks an RFC
09:14:34FromDiscord<timotheecour> well i can write an RFC but it shouldn't be dismissed just because it's not as well explained as it could
09:15:12*lucerne joined #nim
09:15:33FromDiscord<timotheecour> (edit) "could" => "could. RFC on my TODO list."
09:15:54FromDiscord<Araq> no it would be dismissed because I hope to come up with a better design
09:16:49FromDiscord<Araq> I can write the spec
09:17:17FromDiscord<timotheecour> if you come up with a better design, the better design wins, no problem. But note that the PR is actually extremely simple, and it does solve a real, problem, i've used this successfully to write compiler extensions for eg.
09:18:26FromDiscord<timotheecour> (edit) "eg." => "eg, avoiding having to do large refactorings, cyclic issues, and allowing to recompile a single module once (last part needs more explanation)."
09:36:28*lucerne quit (Read error: Connection reset by peer)
09:49:43*max22- quit (Ping timeout: 244 seconds)
10:00:38*max22- joined #nim
10:01:35*elph joined #nim
10:12:22FromDiscord<Araq> simple to implement doesn't mean "simple to use/understand"
10:18:50FromDiscord<dom96> if this is blocking you @timotheecour, any chance we could accept it behind a feature flag? or maybe @timotheecour can maintain a fork for a bit until this is fixed in a way that's acceptable?
10:19:16FromDiscord<timotheecour> i'd be totally ok with `--experimental:deferImport`
10:19:44FromDiscord<Araq> he is doing that but the features only get enough exposure when they land in standard Nim, I think.
10:23:18*max22- quit (Ping timeout: 268 seconds)
10:24:04FromDiscord<Araq> and removing experimental features is always hard
10:24:34FromDiscord<dom96> why is that? isn't it just a case of removing any code that's inside a `if experimental(blah):` branch?
10:26:16*Torro joined #nim
10:27:17FromDiscord<Araq> the longer an experimental switch is alive the more it gets used and then your dependencies might use it if you don't use it yourself
10:27:18FromDiscord<timotheecour> separate branch won't solve anything (i might as well use my private branch) because it'd have to be constantly rebased (conflicts, etc); `--experimental:deferImport` would not have such issue. Useless experimental features that no-one use are easy to remove.
10:27:35FromDiscord<Araq> or if you're willing to update your own code
10:27:48FromDiscord<clyybber> In reply to @timotheecour "<@413679055897100289> I think there's": well than add `import mylib` to the end of the module, this cannot block you then
10:28:17FromDiscord<Araq> try to remove --experimental:codeReordering and see how far you get 😛
10:29:13FromDiscord<timotheecour> i just removed injectstmt for eg 🙂
10:29:54FromDiscord<Araq> you didn't. you removed its documentation
10:35:15FromDiscord<haxscramper> Btw, on the topic of experimental switches - is there anything blocking case stmt macros to be enabled by default? So far I've encountered zero complaints with pattern matching that were caused by bugs in this feature
10:36:49FromDiscord<Araq> no, please create a PR.
10:37:47FromDiscord<Araq> and I suspected it to cause no trouble btw. As it's a very localized feature.
10:41:04*xet7 quit (Quit: Leaving)
10:57:41*huria4 joined #nim
10:58:07huria4I'm using emacs nim mode and it has a tendency to lag for a second or two when typing. What's going on, this doesn't happen in any other mode.
10:58:54*max22- joined #nim
11:09:19FromDiscord<zetashift> In reply to @huria4 "I'm using emacs nim": If you turn off syntax highlighting does it still lag?
11:11:46huria4Doing "font-lock-mode" to turn off syntax highlighting still lags for a second or two
11:12:17huria4I think it's epc server that's the problem. It says it's using 100% of CPU.
11:15:03FromDiscord<vindaar> are you using nimsuggest?
11:15:48huria4I'm not using nimsuggest. It's disabled by default.
11:20:13huria4Is there a way I can get syntax highlighting WITHOUT using nim-mode?
11:20:13FromDiscord<zetashift> mhmhm weird
11:20:15FromDiscord<zetashift> I never had that
11:23:21*Arrrrrrrrr joined #nim
11:23:42ArrrrrrrrrSo, is the freenode room dead?
11:25:25*xet7 joined #nim
11:30:30huria4Well I think I found the culprit. epc. I commented it out and it seems to have stopped lagging. I get an eldoc error, but that can be ignored for now.
11:31:09*xet7 quit (Remote host closed the connection)
11:31:19FromDiscord<haxscramper> In reply to @Arrrrrrrrr "So, is the freenode": Someone bridged freenode room to libera chat IIRC
11:32:24*xet7 joined #nim
11:33:09huria4Say zetashift, I disabled eldoc and epc and it seems that nim mode is working fine now. Weird how this happened like it did.
11:37:52FromDiscord<zetashift> 😦 `nim-mode` is sadly in dire need of some sort of rewrite
11:39:35FromDiscord<zetashift> you could also use nim-mode & nimlsp
11:40:16huria4Did you ever finish that tetris game of yours zetashift?
11:40:21huria4for godot nim?
11:51:18FromDiscord<timotheecour> In reply to @Araq "and I suspected it": `caseStmtMacros` still has design issues, and they're conceptually easy to fix, but should be fixed before turning the feature non-experimental, see the thread in https://github.com/nim-lang/RFCs/issues/332#issuecomment-778433560 which is not yet resolved. In particular, the design should allow custom names, just like forLoopMacros, and so that for eg you can write custom case stmt for string
11:52:14FromDiscord<zetashift> In reply to @huria4 "Did you ever finish": I got further along but I got distracted by Pixie 😛
11:54:46FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3qJY
11:54:48FromDiscord<haxscramper> This is a separate feature
11:55:54FromDiscord<haxscramper> (edit) "https://play.nim-lang.org/#ix=3qJY" => "https://play.nim-lang.org/#ix=3qJZ"
11:56:27FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3qK0
11:57:14FromDiscord<haxscramper> But still, yes it would be nice-to-have etc, but how does it relate to current `case` implementation, it looks more like an RFC to "allow macros to use `of` branches
11:58:11*max22- quit (Ping timeout: 252 seconds)
12:00:08FromDiscord<zetashift> [Elegant Beef](https://matrix.to/#/@beef331:matrix.org)\: re\: your `defaults` macro in `constructor` actually really like that yes! Maybe worthy addition for `fusion` or `sugar`?
12:01:07FromDiscord<haxscramper> There is a problem of using `case` inside of generics when casing over generic type - https://github.com/nim-lang/fusion/pull/33#issuecomment-716140197 which can be solved by introducing `match` macro that in turn uses your proposed feature @timotheecour
12:01:35FromDiscord<haxscramper> so there would be a separate `match` statement/macro that would implement eager expansion
12:02:18FromDiscord<haxscramper> Though I haven't checked that part since october, maybe things changed or I don't remember exact details
12:03:17FromDiscord<haxscramper> But that would be a question for v2.0 anyway, since `case` works quite well now
12:03:48FromDiscord<haxscramper> (edit) "v2.0" => "`fusion/matching v2.0`"
12:04:38FromDiscord<haxscramper> Along with `let` statements, view types
12:04:47FromDiscord<haxscramper> In reply to @haxscramper "And then going through": This
12:05:16*elph quit (Quit: Connection closed for inactivity)
12:06:02*supakeen quit (Quit: WeeChat 3.2)
12:06:37*supakeen joined #nim
12:06:44FromDiscord<haxscramper> Well, anyway that is my general opinion, maybe I missed something, since you certainly have better understanding of how things work internally, maybe it is really necessary
12:07:10FromDiscord<haxscramper> To have your linked idea fixed before un-experimenting case stmt macros
12:08:30FromDiscord<timotheecour> the implicit call to a user defined macro is a misfeature that causes issues when you have 2 different caseStmtMacros defined (or the builtin one and a custom one operating on string | ordinals). That issue should be resolved before making the feature not experimental.
12:08:54FromDiscord<timotheecour> (edit) "the implicit call to a user defined macro is a misfeature that causes issues when you have 2 different caseStmtMacros defined (or the builtin one and a custom one operating on string | ordinals). That issue should be resolved before making the feature not experimental. ... " added "And it's not necessarily hard to fix."
12:13:38FromDiscord<haxscramper> Hmm, maybe to would be better to not have case stmt macros at all, and instead just allow `customCase` to work
12:14:12FromDiscord<haxscramper> Because ↵`> implicit call to a user defined macro is a misfeature that causes issues when you have 2 different caseStmtMacros defined`↵seems to be unfixable
12:14:32FromDiscord<haxscramper> (edit) "defined`↵seems" => "defined ...`↵seems"
12:15:42FromDiscord<haxscramper> and `case` being so overloaded with meaning is not good either
12:17:55*Arrrrrrrrr quit (Quit: Arrrrrrrrr)
12:23:55FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3qK6
12:33:18*arkurious joined #nim
12:36:09*luis_ joined #nim
12:37:53*rockcavera joined #nim
12:37:53*rockcavera quit (Changing host)
12:37:53*rockcavera joined #nim
12:42:42*SebastianM joined #nim
13:03:48*SebastianM quit (Quit: Bye)
13:12:45FromDiscord<SimunKaracic (SimunKaracic)> sent a code paste, see https://play.nim-lang.org/#ix=3qKg
13:25:07FromDiscord<p-i- (Pi)> sent a code paste, see https://play.nim-lang.org/#ix=3qKm
13:27:06FromDiscord<p-i- (Pi)> Here's the full output\: https://bpa.st/DH7A
13:28:40FromDiscord<p-i- (Pi)> Flags created are `-lm -ldl -fuse-ld=lld -flto -s`↵https://lists.llvm.org/pipermail/cfe-dev/2019-March/061666.html advises to use `ld64` not `lld`↵And I suspect this may be the issue.
13:29:06FromDiscord<p-i- (Pi)> But how can I modify the originalcall to use `ld64` not `lld`?
13:30:16FromDiscord<p-i- (Pi)> Wait, the output is saying I'm already using ld64. Why am I getting this `use-ld=lld`?
13:30:25FromDiscord<p-i- (Pi)> Is it the likely culprit?
13:35:22FromDiscord<dom96> @leorize the way code samples are shown from Matrix is pretty bad in Discord :/
13:36:09FromDiscord<vindaar> @dom96\: those are not directly matrix messages, but gitter
13:36:33FromDiscord<dom96> oh, is it a Gitter-only problem?
13:36:57FromDiscord<vindaar> they look fine on matrix, but the two-way gitter ↦ matrix ↦ discord seems to break them
13:37:19FromDiscord<vindaar> sent a code paste, see https://play.nim-lang.org/#ix=3qKq
13:37:42FromDiscord<dom96> maybe we should go back to using the Gitter<->IRC bridge in that case
13:38:19FromDiscord<vindaar> lets see what [leorize](https://matrix.to/#/@leorize:envs.net) has to say
13:38:24*jkl joined #nim
13:39:11FromDiscord<leorize> you got a picture for the code block issue?
13:39:45FromDiscord<vindaar> image.png https://media.discordapp.net/attachments/371759389889003532/856891210773430312/image.png
13:40:47FromDiscord<leorize> that's pretty bad, I guess their markup leaked through \:/
13:41:40FromDiscord<leorize> the problem is that you can't "unbridge" this channel from gitter↵(@dom96)
13:41:58FromDiscord<dom96> yeah, we'd have to bridge to some other dummy matrix channel
13:44:04FromDiscord<leorize> or we can try fixing the discord bridge so it stops spewing markups in code blocks
13:44:59FromDiscord<Zed the Fish> this telegram chat might as well be deleted as this point
13:45:00FromDiscord<dom96> sure, do you have the bandwidth/will to do that? 🙂
13:45:20FromDiscord<dom96> I'll remove the Telegram bridge tonight
13:45:29FromDiscord<dom96> actually
13:45:31FromDiscord<dom96> !tg help
13:45:34FromDiscord<Telegram Bridge> sent a long message, see http://ix.io/3qsj
13:45:38FromDiscord<dom96> !tg unbridge
13:45:40FromDiscord<Telegram Bridge> You do not have the permissions to unbridge that portal.
13:45:48FromDiscord<dom96> ugh, need to be in matrix
13:45:52*jkl quit (Remote host closed the connection)
13:45:57FromDiscord<dom96> yeah, I'll do it tonight
13:47:26FromDiscord<Dominik Picheta (dom96)> Hmm. Did that work
13:47:30FromDiscord<dom96> lol nah
13:47:59FromDiscord<dom96> There we go, kicked the bot from Telegram
13:49:21FromDiscord<leorize> why are we unbridging telegram btw?
13:49:58FromDiscord<dom96> Telegram users dislike it pretty much unanimously
13:53:37*max22- joined #nim
13:54:58FromDiscord<leorize> remove lto from your command line
13:55:16FromDiscord<leorize> on osx it's kinda broken pending a PR
13:56:04FromDiscord<leorize> https://github.com/nim-lang/Nim/pull/15614
13:57:03FromDiscord<gerwy> if something has c++ bindings, would it be possible to use nim with it?
13:57:03FromDiscord<p-i- (Pi)> @leorize\:envs.net Amazing!
13:57:13FromDiscord<p-i- (Pi)> I think I'm nearly there now.
13:57:33*vicfred joined #nim
13:58:16PMunch@gerwy, yup
13:58:29FromDiscord<gerwy> oh, the same with JS?
14:00:05FromDiscord<dom96> In reply to @Life Sucks "if something has c++": yes
14:01:01FromDiscord<gerwy> oh, niceee↵is it hard tho?
14:01:07FromDiscord<p-i- (Pi)> sent a code paste, see https://play.nim-lang.org/#ix=3qKu
14:01:25FromDiscord<tomck> sent a code paste, see https://play.nim-lang.org/#ix=3qKv
14:02:07FromDiscord<dom96> `when defined(windows):`
14:02:21FromDiscord<Hi02Hi> sent a code paste, see https://play.nim-lang.org/#ix=3qKw
14:02:31FromDiscord<tomck> @dom96 thanks, what're the names of these defines? are they standard, or am i expected to pass -d:windows?
14:03:03FromDiscord<leorize> they're named after the --os switch
14:03:08FromDiscord<tomck> oh i found it, thanks
14:03:10FromDiscord<dom96> they get defined for you by the compiler, we don't really have a single listing of them so a bit of mess to clean up here if you'd be up for helping 🙂
14:03:50FromDiscord<tomck> https://nim-lang.org/docs/nims.html#crossminusplatform↵this looks like a comprehensive list (?)
14:04:08FromDiscord<tomck> oh i see it's incomplete
14:04:32FromDiscord<tomck> where would i even find out where these are defined?
14:06:12FromDiscord<dom96> that is pretty good actually, didn't know this exists
14:09:12FromDiscord<p-i- (Pi)> sent a code paste, see https://play.nim-lang.org/#ix=3qKC
14:20:47FromDiscord<leorize> os should be set to osx
14:21:03FromDiscord<leorize> funny enough macos refers to the very old mac os 9
14:57:18*huria4 quit (Ping timeout: 265 seconds)
15:01:03FromDiscord<shadow.> has anyone tried tcc with nim?
15:01:17FromDiscord<haxscramper> I use it from time to time
15:01:51FromDiscord<haxscramper> It works for the most part since nim does generate pretty simple C code
15:06:08FromDiscord<dom96> In reply to @dom96 "sure, do you have": Leorize or anyone else? Otherwise I think we’ll go back to the old solution
15:15:35*huria4 joined #nim
15:16:20*huria4 quit (Client Quit)
15:17:50*luis_ quit (Ping timeout: 252 seconds)
15:18:08*luis_ joined #nim
15:28:38FromDiscord<leorize> I'll open a bug for the bridge later, this should be fixable
15:32:59FromDiscord<p-i- (Pi)> So, I got it all working, thanks to that tip @leorize\:envs.net↵[juancarlospaco/faster-than-requests#156](https://github.com/juancarlospaco/faster-than-requests/issues/156)↵🙏 🚀
15:36:12*luis_ quit (Quit: luis_)
15:36:39*luis_ joined #nim
15:38:16*stkrdknmibalz quit (Quit: WeeChat 3.0.1)
15:42:59*fputs joined #nim
15:48:54*Torro quit (Quit: leaving)
16:34:32*Schnouki quit (Ping timeout: 268 seconds)
16:36:23FromDiscord<skaracic> sent a code paste, see https://play.nim-lang.org/#ix=3qLG
16:36:27*luis_ quit (Quit: luis_)
16:51:52FromDiscord<dom96> In reply to @skaracic "Posting again with proper": Thanks for reposting 🙂↵↵The `poEvalCommand` means your command is passed to the shell: i.e. a shell is used to run it. If you want to run it directly remove that flag and make sure to pass a full path to the `arecord` command (you can get it using `findExe`)
16:53:46FromDiscord<skaracic> Aaaaah, I tried using it without `poEvalCommand` but it would fail because I would call it with `arecord` instead od the full path. ↵Makes sense, should have read the docs more carefully.↵↵Thanks for the help!
17:50:12FromDiscord<hamidb80> hey
17:50:36FromDiscord<hamidb80> sent a code paste, see https://play.nim-lang.org/#ix=3qLZ
17:51:24FromDiscord<hamidb80> a wanna iterate over array of functions
17:51:42FromDiscord<haxscramper> You can do `(a: int, b: int): bool = a < b` since you would have to select an overload
17:51:54FromDiscord<haxscramper> !eval typeof(`<`)
17:51:56NimBotCompile failed: /usercode/in.nim(1, 7) Error: expression 'typeof(<)' is of type 'typedesc' and has to be used (or discarded)
17:52:10FromDiscord<haxscramper> !eval echo typeof(`<`)
17:52:13NimBotNone
17:52:18FromDiscord<hamidb80> eh
17:52:26FromDiscord<haxscramper> Overloaded functions do not have a type
17:52:39FromDiscord<hamidb80> wow, thanks man
17:52:46FromDiscord<haxscramper> And array elements must have the same type as well
17:56:37FromDiscord<ynfle (ynfle)> @\_discord\_608382355454951435\:t2bot.io @haxscramper it's because it's implementend with compiler magic see https://play.nim-lang.org/#ix=3qM1
17:57:00FromDiscord<ynfle (ynfle)> @\_discord\_745944009918251010\:t2bot.io @hamidb80 the above posted link should work
17:57:20FromDiscord<haxscramper> No, it is because overloaded procs can't be correctly selected on the identifier alone
17:57:43FromDiscord<haxscramper> and you just made explicit selection
17:58:01FromDiscord<hamidb80> sent a code paste, see https://play.nim-lang.org/#ix=3qM3
17:58:08FromDiscord<haxscramper> `in` is a name of playground module file
17:58:21FromDiscord<haxscramper> `in.<` is the same as `os.walkDir`
17:58:56FromDiscord<haxscramper> A single non-overloaded `<` was declared in the `in.nim` file, so it is possible to unambiguosly select it using `in.<`
17:59:07FromDiscord<vindaar> not really helpful, but one should be able to extract the correct symbol for the purpose from the possible symbol choices in a macro and put those into an array 😅 (without defining a custom overload)
17:59:08FromDiscord<ynfle (ynfle)> https://play.nim-lang.org/#ix=3qM5 this works
17:59:29FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3qM6
17:59:31FromDiscord<vindaar> yes, because here the first one is still unambiguous
17:59:37FromDiscord<vindaar> exactly
17:59:37FromDiscord<ynfle (ynfle)> I doesn't
17:59:40FromDiscord<ynfle (ynfle)> \it
18:00:29FromDiscord<haxscramper> https://play.nim-lang.org/#ix=3qM7
18:01:19FromDiscord<haxscramper> `/usercode/in.nim(9, 18) Error: type mismatch: got <None> but expected 'None'`
18:01:35*max22- quit (Ping timeout: 244 seconds)
18:01:40FromDiscord<ynfle (ynfle)> So how come the example I posted worked?
18:01:48FromDiscord<haxscramper> IIRC there was an PR for this
18:02:19FromDiscord<vindaar> how would that work "generically" (bad word here) here though? You'd have to know in advance what the correct symbol is
18:03:19FromDiscord<haxscramper> Less verbose symbol selection
18:03:19FromDiscord<haxscramper> I think
18:03:34FromDiscord<haxscramper> At least implementation allowed to have something like `<(int, int)` (roughly speaking)
18:03:43FromDiscord<vindaar> because the type of an array or seq can be auto determined from the first element in it. In your initial example there was only one symbol for the first element. Thus the second one could be inferred to be the `int` one
18:03:47FromDiscord<hamidb80> sent a code paste, see https://play.nim-lang.org/#ix=3qM9
18:04:11FromDiscord<vindaar> interesting
18:04:16FromDiscord<hamidb80> (edit) "https://play.nim-lang.org/#ix=3qM9" => "https://play.nim-lang.org/#ix=3qMa"
18:05:11FromDiscord<haxscramper> https://github.com/nim-lang/Nim/pull/11992> passing any symbol in scope (generic/proc/macro/template/iterator/module/etc) to any routine (proc/iterator/macro/etc). This works even if the symbol is overloaded, or if it's a template/macro with all optional params
18:06:02FromDiscord<vindaar> ahh, it was that one
18:06:05FromDiscord<haxscramper> no idea how close to reality this is
18:07:34*vicfred quit (Ping timeout: 268 seconds)
18:09:46FromDiscord<haxscramper> I'm always forgetting that nim type overloading selection partially works in both directions.
18:10:53FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3qMd
18:11:12FromDiscord<haxscramper> Well, it does not work for this specific example, but you can probably work around this
18:12:18FromDiscord<haxscramper> hamidb80#2337\: `<` is an especially complicated as it is implemented via `template`, but it should work better for regular non`-system` and non-`Magic` procs
18:16:06FromDiscord<hamidb80> thanks
18:17:08FromDiscord<vindaar> yeah, `>` and friends are a bit special. I've noticed that recently myself. If you try to get a selection of overloaded symbols for them in a typed macro, most overloads simply don't appear. That's why for these I have this great "maybe add types" proc in my code now\:↵https://github.com/SciNim/Datamancer/blob/master/src/datamancer/formula.nim#L582-L590
18:19:29FromDiscord<haxscramper> It seems like Nim forum updater is putting messages in the wrong matrix channel
18:19:50FromDiscord<haxscramper> They appear in `#nim`, but not here (and not on discord)
18:23:20FromDiscord<p-i- (Pi)> sent a code paste, see https://play.nim-lang.org/#ix=3qMj
18:25:39FromDiscord<haxscramper> I don't think so. `std/nimscript` has a `switch` flag that enables an option, but IIRC there is no revese operation
18:26:30FromDiscord<haxscramper> You can disable all options completely (do it once) and delegate configuration to `config.nims`
18:26:44FromDiscord<p-i- (Pi)> This seems to overwrite my foo.nim.cfg here\:↵https://github.com/juancarlospaco/faster-than-requests/blob/master/faster_than_requests/faster_than_requests.nim.cfg
18:27:16FromDiscord<p-i- (Pi)> I'm trying to leave something actionable for the repo maintainer (as he can't touch nim source)
18:27:32FromDiscord<p-i- (Pi)> How/where can I disable all options?
18:28:26FromDiscord<p-i- (Pi)> I guess he intended to do this (as that .cfg file is a dup of these hardcoded values), but his code is failing to do so
18:32:48FromDiscord<haxscramper> I don't think there is an option to "disable all options". The best you can is `--skip<XXX>Cfg:on` switches (`Parent`, `Project` etc), but it seems there is no `--configFile:/path/`
18:32:48FromDiscord<haxscramper> Maybe I missed it though
18:32:49FromDiscord<haxscramper> I don't think there is an option to "disable all options". The best you can do is `--skip<XXX>Cfg:on` switches (`Parent`, `Project` etc), but it seems there is no `--configFile:/path/`
18:33:07FromDiscord<p-i- (Pi)> His project has a faster\_than\_requests.nim.cfg and a faster\_than\_requests.nim.cfg↵.. which doesn't reference the .cfg anywhere.↵Do you have any idea how he is expecting to execute that .cfg file?
18:33:14FromDiscord<p-i- (Pi)> Does nim automatically use it?
18:33:20FromDiscord<p-i- (Pi)> ... if the name is the same...
18:40:30*max22- joined #nim
18:43:36FromDiscord<p-i- (Pi)> And no you didn't miss... I just searched the repo for `configFile` & nothing.
18:45:46*stkrdknmibalz joined #nim
18:46:59FromDiscord<haxscramper> Nim automatically looks up in the current project, parent directory, user `~/.config/nim` (IIRC)
18:47:53FromDiscord<haxscramper> In that order. `skipProjCfg` probably refers to the `.cfg` or `config.nims` file in the root of the current project (if any)
19:06:14*Guest65 joined #nim
19:07:57*Guest65 quit (Client Quit)
19:18:58*vicfred joined #nim
19:19:16*Vladar quit (Ping timeout: 265 seconds)
19:19:40*Vladar joined #nim
19:22:49*Lord_Nightmare quit (Quit: ZNC - http://znc.in)
19:27:47*Lord_Nightmare joined #nim
19:38:08*Lord_Nightmare is now known as Lord_Nightmare2
19:38:10*Lord_Nightmare2 is now known as Lord_Nightmare
19:57:39*supakeen quit (Remote host closed the connection)
19:58:03*supakeen joined #nim
20:09:51FromDiscord<Elegant Beef> Perhaps, I still long for a more explainative way of exporting the procedure `implDefaults(T, true)` isnt great
20:12:01FromDiscord<Elegant Beef> I suppose I could accquote it so you can do `T`, but still not amazing
20:16:17FromDiscord<Elegant Beef> Suppose i could alias a bool and expose that as `Exported`
20:19:19*SebastianM joined #nim
20:19:36*SebastianM quit (Client Quit)
20:19:58FromDiscord<deech> TIL you can do object field assignment with tuple destructuring: `(obj.a,obj.b,obj.c) = (1,"hello world", true)`
20:30:40*Vladar quit (Quit: Leaving)
20:30:57*xet7 quit (Quit: Leaving)
20:32:48*xet7 joined #nim
20:48:54FromDiscord<Bung> a lib only decared a type type `Url = ref object`, how to use its object version ?
20:49:48FromDiscord<Bung> object version type
20:50:31FromDiscord<Elegant Beef> `a: Url()[].type` 😀
20:50:45FromDiscord<Elegant Beef> Dont know if there is a macro to get base type, but it's not overly difficult
20:51:47FromDiscord<Bung> um, how to declare it of a type's field. not just variable type
20:55:07FromDiscord<leorize> `typeof Url()[]` is kinda the way...
20:55:33FromDiscord<leorize> !eval import typetraits; echo RootRef[]
20:55:35NimBotCompile failed: /usercode/in.nim(1, 32) Error: type mismatch: got <type RootRef>
20:56:05FromDiscord<Bung> type A = object↵ url: ?
20:57:12FromDiscord<Bung> I've seen araq said there's no need declared ref and obj versions in the future, dont know what's the process.
20:58:38FromDiscord<Elegant Beef> Well to go down the macro way https://play.nim-lang.org/#ix=3qNg
20:59:41FromDiscord<Elegant Beef> But it's really just `typeof(Url()[])`
21:00:54FromDiscord<Bung> first time know these can be used in type declaration.
21:01:18FromDiscord<Elegant Beef> Well it's a static expression so it can be typed
21:03:02FromDiscord<Varriount> sent a long message, see http://ix.io/3qNm
21:03:21FromDiscord<Elegant Beef> I assume this is in response to the defaults to sugar
21:03:39FromDiscord<Bung> even object construction is static ?
21:04:13FromDiscord<leorize> here's yet another macro for getting the base type https://play.nim-lang.org/#ix=3qNn \:P
21:04:17FromDiscord<Elegant Beef> Well it's a static expression so it can be typed, the actual object construction doesnt particularly matter for this case it's the same as doing like `type(100)`
21:04:35FromDiscord<leorize> potentially avoid the `{.requiresInit.}` issue, too
21:04:41FromDiscord<Varriount> (edit) "http://ix.io/3qNm" => "http://ix.io/3qNo"
21:05:39FromDiscord<Elegant Beef> Nicer than mine leorize, shame
21:05:41FromDiscord<Bung> okay, thanks , I get two versions, I choose `typeof(Url()[])`
21:06:11FromDiscord<Elegant Beef> Way to shame us both
21:06:18FromDiscord<Bung> hahaha
21:06:21FromDiscord<Elegant Beef> We just want to invite magic into your world and you closed us out! 😛
21:07:33FromDiscord<Bung> I dont like too much magic, I like basic boring code.
21:08:00FromDiscord<Bung> 😆
21:10:07FromDiscord<Elegant Beef> Yet you starred oopsie
21:10:07FromDiscord<Elegant Beef> Yea i've noticed this
21:10:07FromDiscord<Elegant Beef> Ah it's not due to constructor suggestion
21:10:08FromDiscord<leorize> we matrix users can't see discord replies
21:12:06FromDiscord<Bung> oopsie is kinda usefull
21:13:07FromDiscord<Varriount> Elegant Beef: I was replying to timotheecour regarding adding a `deferredImport` keyword to the language.↵> Then don't use it if you don't understand it. I have real use cases for it that are hard to achieve without this feature. Same goes with the other modules; no-ones's forcing you to use those APIs, but they're here for a reason.
21:19:41*xet7 quit (Remote host closed the connection)
21:23:31*xet7 joined #nim
21:24:17FromDiscord<leorize> respectfully, that keyword is dumb.
21:41:06FromDiscord<zetashift> Maybe posting about it on the forum for feedback would be a good way of finding a way?
21:41:22FromDiscord<zetashift> I still think it's a good addition for fusion
21:41:47FromDiscord<Elegant Beef> Well ideally it'd use a postfix `` but that's illegal 😛
21:41:53FromDiscord<timotheecour> it's not a keyword, it's an API. It can't be added to fusion, it requires compiler support.
21:42:20FromDiscord<Elegant Beef> We're talking about my `defaults`
21:42:29FromDiscord<timotheecour> ah ok.
21:52:43FromDiscord<zetashift> In reply to @Elegant Beef "Well ideally it'd use": I would really like that too :k
21:54:36FromDiscord<Elegant Beef> Well the options i can think of is keep as is, use acc quoted `T` or alias a bool
21:54:36FromDiscord<Elegant Beef> or make the `implExportedDefaults(T)` 😛
22:10:37*fputs quit (Remote host closed the connection)
22:14:19*max22- quit (Quit: Leaving)
23:11:49*luis_ joined #nim
23:13:55*rockcavera quit (Read error: Connection reset by peer)
23:14:17*asd quit (Ping timeout: 272 seconds)
23:17:00*rockcavera joined #nim
23:17:00*rockcavera quit (Changing host)
23:17:00*rockcavera joined #nim
23:52:38*luis_ quit (Ping timeout: 252 seconds)