00:12:12 | FromDiscord | <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:02 | FromDiscord | <Elegant Beef> to answer your latter question `proc doSomething(a: enum)` should work |
00:13:23 | FromDiscord | <Elegant Beef> The former question, there is iface for interfaces https://github.com/yglukhov/iface |
00:13:57 | FromDiscord | <Elegant Beef> There is also https://github.com/haxscramper/nimtraits for a PoC trait system |
00:17:58 | FromDiscord | <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:13 | FromDiscord | <Elegant Beef> iface allows you to have a seq of them |
00:19:41 | FromDiscord | <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:33 | FromDiscord | <@bracketmaster-5a708063d73408ce4> nims been around longer, but v-lang seems to have more momentum around it? |
00:53:39 | FromDiscord | <@bracketmaster-5a708063d73408ce4> any insight as to why this could be? |
00:54:03 | FromDiscord | <@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:27 | FromDiscord | <leorize> vlang did have a hype stage that was very successful |
01:00:36 | FromDiscord | <leorize> I'm surprised that it didn't die after release tbh |
01:00:56 | FromDiscord | <@bracketmaster-5a708063d73408ce4> well, its not a bad language... |
01:01:26 | FromDiscord | <@bracketmaster-5a708063d73408ce4> it lived up to its claims |
01:01:34 | FromDiscord | <Elegant Beef> Years after it claimed them |
01:01:59 | FromDiscord | <leorize> on release they added WIP on every single claim |
01:02:41 | FromDiscord | <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:55 | FromDiscord | <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:41 | FromDiscord | <Elegant Beef> Wait until you learn that V can compile infinite lines of code in -3.14s |
02:32:35 | FromDiscord | <Rika> Have you actually tried V? |
02:32:46 | FromDiscord | <Elegant Beef> Me? |
02:32:49 | FromDiscord | <Rika> No |
02:32:57 | FromDiscord | <Rika> You’re just a joker |
02:36:02 | FromDiscord | <Elegant Beef> Well that's life |
02:44:39 | FromDiscord | <deech> What's the difference between `type ORef = ref object ...` and `type O = object ..., ORef = ref O`? |
02:45:14 | FromDiscord | <Elegant Beef> Having a concrete non ref base object |
02:45:54 | FromDiscord | <Elegant Beef> So if you arent using the `O` directly there isnt any reason to declare it |
02:46:03 | FromDiscord | <deech> There seems to be a difference when you do `unsafeAddr` each of the two `ORef`'s. |
02:46:21 | FromDiscord | <Rika> What do you mean? |
02:46:45 | FromDiscord | <Elegant Beef> well `ref` is a pointer so getting it's addr will give you a pointer to a pointer |
02:48:30 | FromDiscord | <Elegant Beef> https://play.nim-lang.org/#ix=3qHS |
02:48:52 | FromDiscord | <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:03 | FromDiscord | <מרוז לוץ> image.jpeg https://media.discordapp.net/attachments/371759389889003532/856732240566419486/image.jpeg |
03:08:04 | FromDiscord | <מרוז לוץ> image.jpeg https://media.discordapp.net/attachments/371759389889003532/856732243737051157/image.jpeg |
03:08:16 | FromDiscord | <מרוז לוץ> sent a long message, see https://paste.rs/Zat |
03:08:17 | FromDiscord | <מרוז לוץ> sent a long message, see http://ix.io/3qHY |
03:08:23 | FromDiscord | <מרוז לוץ> sent a long message, see http://ix.io/3qHZ |
03:08:24 | FromDiscord | <מרוז לוץ> sent a long message, see http://ix.io/3qHZ |
03:11:57 | FromDiscord | <Rika> <@&371760044473319454> lol |
03:12:21 | FromDiscord | <Rika> One of the rooms has a scam bot |
03:15:10 | FromDiscord | <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:57 | FromDiscord | <Avahe> is `table{"someKey"}` syntax not used? I'm getting a warning but it's not very clear |
04:29:09 | FromDiscord | <Elegant Beef> It's not an operator in the `tables` module if that's what you mean |
04:30:02 | FromDiscord | <Avahe> oh woops, meant to say this is a TomlValueRef |
04:30:41 | FromDiscord | <Avahe> https://github.com/NimParsers/parsetoml/blob/master/src/parsetoml.nim#L1861 seems fine to me |
04:31:37 | FromDiscord | <Avahe> sent a code paste, see https://play.nim-lang.org/#ix=3qI8 |
04:31:48 | FromDiscord | <Avahe> with `table{"networks"}` |
04:43:07 | FromDiscord | <codic> In reply to @מרוז לוץ "**Poll**\: Дно BTC по": 100000000 000 0000000000 % |
04:43:10 | FromDiscord | <codic> (edit) "%" => "$" |
04:44:29 | FromDiscord | <codic> why is the `Vote with` in English but the rest in Russian |
04:44:32 | FromDiscord | <codic> and why is your username in hebrew |
04:44:40 | FromDiscord | <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:52 | FromDiscord | <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:28 | FromDiscord | <gogolxdong (liuxiaodong)> How to do UInt256 division? |
07:37:58 | * | lucerne joined #nim |
07:40:58 | FromDiscord | <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:51 | FromDiscord | <elph> (edit) "hello everyone. I want to work on a Nim library that could ... useddeclared" added "be" | "declare" => "declared with " |
07:42:27 | FromDiscord | <Elegant Beef> Would it make any more sense to make it a system library that could be used from any language? |
07:43:15 | FromDiscord | <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:08 | FromDiscord | <elph> @ElegantBeef yes, that's a good point 🙂 and then use it from Python with something like `ctypes` I supporse |
07:44:12 | FromDiscord | <elph> (edit) "supporse" => "suppose" |
07:44:22 | FromDiscord | <Elegant Beef> Yep |
07:44:31 | FromDiscord | <elph> 👍 thanks |
07:45:17 | * | lucerne quit (Remote host closed the connection) |
07:46:25 | * | lucerne joined #nim |
07:47:13 | FromDiscord | <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:39 | FromDiscord | <Elegant Beef> Like this? https://play.nim-lang.org/#ix=3qIJ |
07:49:24 | FromDiscord | <Stuffe> that one has empty entries in the array. let me fiddle with it a bit |
07:49:38 | FromDiscord | <Elegant Beef> Shouldnt there be empties? |
07:49:46 | FromDiscord | <Elegant Beef> you only have 1 `2` in the table |
07:50:03 | FromDiscord | <Stuffe> No empties |
07:50:10 | FromDiscord | <Stuffe> It is just a minimized example |
07:50:56 | FromDiscord | <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:12 | FromDiscord | <Elegant Beef> Ok |
07:51:19 | FromDiscord | <vindaar> you need to split the `tmp` seq into its own `const` variable\: https://play.nim-lang.org/#ix=3qIK |
07:52:53 | FromDiscord | <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:20 | FromDiscord | <vindaar> huh, works with collect. nice |
07:53:32 | FromDiscord | <vindaar> makes sense I guess |
07:53:39 | * | PMunch joined #nim |
07:53:45 | FromDiscord | <Stuffe> @Vindaar @ElegantBeef I'll take the second one. Thanks 🙂 |
07:53:56 | FromDiscord | <Stuffe> Since I don't need the tmp in the run time scope |
07:59:05 | FromDiscord | <Elegant Beef> Better luck next time vindaar 😛 |
07:59:26 | FromDiscord | <vindaar> damn, I'll try harder 😜 |
08:03:20 | * | lucerne quit (Remote host closed the connection) |
08:07:43 | FromDiscord | <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:50 | FromDiscord | <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:46 | FromDiscord | <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:04 | FromDiscord | <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:37 | FromDiscord | <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:14 | FromDiscord | <Araq> I corrected my typo |
08:53:36 | FromDiscord | <Araq> sorry for the confusion, deferredImport is not required afaict |
09:05:29 | * | max22- quit (Ping timeout: 252 seconds) |
09:08:49 | FromDiscord | <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:02 | FromDiscord | <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:30 | FromDiscord | <Araq> well if I don't understand, maybe it's because it lacks an RFC |
09:14:34 | FromDiscord | <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:33 | FromDiscord | <timotheecour> (edit) "could" => "could. RFC on my TODO list." |
09:15:54 | FromDiscord | <Araq> no it would be dismissed because I hope to come up with a better design |
09:16:49 | FromDiscord | <Araq> I can write the spec |
09:17:17 | FromDiscord | <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:26 | FromDiscord | <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:22 | FromDiscord | <Araq> simple to implement doesn't mean "simple to use/understand" |
10:18:50 | FromDiscord | <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:16 | FromDiscord | <timotheecour> i'd be totally ok with `--experimental:deferImport` |
10:19:44 | FromDiscord | <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:04 | FromDiscord | <Araq> and removing experimental features is always hard |
10:24:34 | FromDiscord | <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:17 | FromDiscord | <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:18 | FromDiscord | <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:35 | FromDiscord | <Araq> or if you're willing to update your own code |
10:27:48 | FromDiscord | <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:17 | FromDiscord | <Araq> try to remove --experimental:codeReordering and see how far you get 😛 |
10:29:13 | FromDiscord | <timotheecour> i just removed injectstmt for eg 🙂 |
10:29:54 | FromDiscord | <Araq> you didn't. you removed its documentation |
10:35:15 | FromDiscord | <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:49 | FromDiscord | <Araq> no, please create a PR. |
10:37:47 | FromDiscord | <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:07 | huria4 | I'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:19 | FromDiscord | <zetashift> In reply to @huria4 "I'm using emacs nim": If you turn off syntax highlighting does it still lag? |
11:11:46 | huria4 | Doing "font-lock-mode" to turn off syntax highlighting still lags for a second or two |
11:12:17 | huria4 | I think it's epc server that's the problem. It says it's using 100% of CPU. |
11:15:03 | FromDiscord | <vindaar> are you using nimsuggest? |
11:15:48 | huria4 | I'm not using nimsuggest. It's disabled by default. |
11:20:13 | huria4 | Is there a way I can get syntax highlighting WITHOUT using nim-mode? |
11:20:13 | FromDiscord | <zetashift> mhmhm weird |
11:20:15 | FromDiscord | <zetashift> I never had that |
11:23:21 | * | Arrrrrrrrr joined #nim |
11:23:42 | Arrrrrrrrr | So, is the freenode room dead? |
11:25:25 | * | xet7 joined #nim |
11:30:30 | huria4 | Well 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:19 | FromDiscord | <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:09 | huria4 | Say 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:52 | FromDiscord | <zetashift> 😦 `nim-mode` is sadly in dire need of some sort of rewrite |
11:39:35 | FromDiscord | <zetashift> you could also use nim-mode & nimlsp |
11:40:16 | huria4 | Did you ever finish that tetris game of yours zetashift? |
11:40:21 | huria4 | for godot nim? |
11:51:18 | FromDiscord | <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:14 | FromDiscord | <zetashift> In reply to @huria4 "Did you ever finish": I got further along but I got distracted by Pixie 😛 |
11:54:46 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3qJY |
11:54:48 | FromDiscord | <haxscramper> This is a separate feature |
11:55:54 | FromDiscord | <haxscramper> (edit) "https://play.nim-lang.org/#ix=3qJY" => "https://play.nim-lang.org/#ix=3qJZ" |
11:56:27 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3qK0 |
11:57:14 | FromDiscord | <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:08 | FromDiscord | <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:07 | FromDiscord | <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:35 | FromDiscord | <haxscramper> so there would be a separate `match` statement/macro that would implement eager expansion |
12:02:18 | FromDiscord | <haxscramper> Though I haven't checked that part since october, maybe things changed or I don't remember exact details |
12:03:17 | FromDiscord | <haxscramper> But that would be a question for v2.0 anyway, since `case` works quite well now |
12:03:48 | FromDiscord | <haxscramper> (edit) "v2.0" => "`fusion/matching v2.0`" |
12:04:38 | FromDiscord | <haxscramper> Along with `let` statements, view types |
12:04:47 | FromDiscord | <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:44 | FromDiscord | <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:10 | FromDiscord | <haxscramper> To have your linked idea fixed before un-experimenting case stmt macros |
12:08:30 | FromDiscord | <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:54 | FromDiscord | <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:38 | FromDiscord | <haxscramper> Hmm, maybe to would be better to not have case stmt macros at all, and instead just allow `customCase` to work |
12:14:12 | FromDiscord | <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:32 | FromDiscord | <haxscramper> (edit) "defined`↵seems" => "defined ...`↵seems" |
12:15:42 | FromDiscord | <haxscramper> and `case` being so overloaded with meaning is not good either |
12:17:55 | * | Arrrrrrrrr quit (Quit: Arrrrrrrrr) |
12:23:55 | FromDiscord | <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:45 | FromDiscord | <SimunKaracic (SimunKaracic)> sent a code paste, see https://play.nim-lang.org/#ix=3qKg |
13:25:07 | FromDiscord | <p-i- (Pi)> sent a code paste, see https://play.nim-lang.org/#ix=3qKm |
13:27:06 | FromDiscord | <p-i- (Pi)> Here's the full output\: https://bpa.st/DH7A |
13:28:40 | FromDiscord | <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:06 | FromDiscord | <p-i- (Pi)> But how can I modify the originalcall to use `ld64` not `lld`? |
13:30:16 | FromDiscord | <p-i- (Pi)> Wait, the output is saying I'm already using ld64. Why am I getting this `use-ld=lld`? |
13:30:25 | FromDiscord | <p-i- (Pi)> Is it the likely culprit? |
13:35:22 | FromDiscord | <dom96> @leorize the way code samples are shown from Matrix is pretty bad in Discord :/ |
13:36:09 | FromDiscord | <vindaar> @dom96\: those are not directly matrix messages, but gitter |
13:36:33 | FromDiscord | <dom96> oh, is it a Gitter-only problem? |
13:36:57 | FromDiscord | <vindaar> they look fine on matrix, but the two-way gitter ↦ matrix ↦ discord seems to break them |
13:37:19 | FromDiscord | <vindaar> sent a code paste, see https://play.nim-lang.org/#ix=3qKq |
13:37:42 | FromDiscord | <dom96> maybe we should go back to using the Gitter<->IRC bridge in that case |
13:38:19 | FromDiscord | <vindaar> lets see what [leorize](https://matrix.to/#/@leorize:envs.net) has to say |
13:38:24 | * | jkl joined #nim |
13:39:11 | FromDiscord | <leorize> you got a picture for the code block issue? |
13:39:45 | FromDiscord | <vindaar> image.png https://media.discordapp.net/attachments/371759389889003532/856891210773430312/image.png |
13:40:47 | FromDiscord | <leorize> that's pretty bad, I guess their markup leaked through \:/ |
13:41:40 | FromDiscord | <leorize> the problem is that you can't "unbridge" this channel from gitter↵(@dom96) |
13:41:58 | FromDiscord | <dom96> yeah, we'd have to bridge to some other dummy matrix channel |
13:44:04 | FromDiscord | <leorize> or we can try fixing the discord bridge so it stops spewing markups in code blocks |
13:44:59 | FromDiscord | <Zed the Fish> this telegram chat might as well be deleted as this point |
13:45:00 | FromDiscord | <dom96> sure, do you have the bandwidth/will to do that? 🙂 |
13:45:20 | FromDiscord | <dom96> I'll remove the Telegram bridge tonight |
13:45:29 | FromDiscord | <dom96> actually |
13:45:31 | FromDiscord | <dom96> !tg help |
13:45:34 | FromDiscord | <Telegram Bridge> sent a long message, see http://ix.io/3qsj |
13:45:38 | FromDiscord | <dom96> !tg unbridge |
13:45:40 | FromDiscord | <Telegram Bridge> You do not have the permissions to unbridge that portal. |
13:45:48 | FromDiscord | <dom96> ugh, need to be in matrix |
13:45:52 | * | jkl quit (Remote host closed the connection) |
13:45:57 | FromDiscord | <dom96> yeah, I'll do it tonight |
13:47:26 | FromDiscord | <Dominik Picheta (dom96)> Hmm. Did that work |
13:47:30 | FromDiscord | <dom96> lol nah |
13:47:59 | FromDiscord | <dom96> There we go, kicked the bot from Telegram |
13:49:21 | FromDiscord | <leorize> why are we unbridging telegram btw? |
13:49:58 | FromDiscord | <dom96> Telegram users dislike it pretty much unanimously |
13:53:37 | * | max22- joined #nim |
13:54:58 | FromDiscord | <leorize> remove lto from your command line |
13:55:16 | FromDiscord | <leorize> on osx it's kinda broken pending a PR |
13:56:04 | FromDiscord | <leorize> https://github.com/nim-lang/Nim/pull/15614 |
13:57:03 | FromDiscord | <gerwy> if something has c++ bindings, would it be possible to use nim with it? |
13:57:03 | FromDiscord | <p-i- (Pi)> @leorize\:envs.net Amazing! |
13:57:13 | FromDiscord | <p-i- (Pi)> I think I'm nearly there now. |
13:57:33 | * | vicfred joined #nim |
13:58:16 | PMunch | @gerwy, yup |
13:58:29 | FromDiscord | <gerwy> oh, the same with JS? |
14:00:05 | FromDiscord | <dom96> In reply to @Life Sucks "if something has c++": yes |
14:01:01 | FromDiscord | <gerwy> oh, niceee↵is it hard tho? |
14:01:07 | FromDiscord | <p-i- (Pi)> sent a code paste, see https://play.nim-lang.org/#ix=3qKu |
14:01:25 | FromDiscord | <tomck> sent a code paste, see https://play.nim-lang.org/#ix=3qKv |
14:02:07 | FromDiscord | <dom96> `when defined(windows):` |
14:02:21 | FromDiscord | <Hi02Hi> sent a code paste, see https://play.nim-lang.org/#ix=3qKw |
14:02:31 | FromDiscord | <tomck> @dom96 thanks, what're the names of these defines? are they standard, or am i expected to pass -d:windows? |
14:03:03 | FromDiscord | <leorize> they're named after the --os switch |
14:03:08 | FromDiscord | <tomck> oh i found it, thanks |
14:03:10 | FromDiscord | <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:50 | FromDiscord | <tomck> https://nim-lang.org/docs/nims.html#crossminusplatform↵this looks like a comprehensive list (?) |
14:04:08 | FromDiscord | <tomck> oh i see it's incomplete |
14:04:32 | FromDiscord | <tomck> where would i even find out where these are defined? |
14:06:12 | FromDiscord | <dom96> that is pretty good actually, didn't know this exists |
14:09:12 | FromDiscord | <p-i- (Pi)> sent a code paste, see https://play.nim-lang.org/#ix=3qKC |
14:20:47 | FromDiscord | <leorize> os should be set to osx |
14:21:03 | FromDiscord | <leorize> funny enough macos refers to the very old mac os 9 |
14:57:18 | * | huria4 quit (Ping timeout: 265 seconds) |
15:01:03 | FromDiscord | <shadow.> has anyone tried tcc with nim? |
15:01:17 | FromDiscord | <haxscramper> I use it from time to time |
15:01:51 | FromDiscord | <haxscramper> It works for the most part since nim does generate pretty simple C code |
15:06:08 | FromDiscord | <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:38 | FromDiscord | <leorize> I'll open a bug for the bridge later, this should be fixable |
15:32:59 | FromDiscord | <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:23 | FromDiscord | <skaracic> sent a code paste, see https://play.nim-lang.org/#ix=3qLG |
16:36:27 | * | luis_ quit (Quit: luis_) |
16:51:52 | FromDiscord | <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:46 | FromDiscord | <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:12 | FromDiscord | <hamidb80> hey |
17:50:36 | FromDiscord | <hamidb80> sent a code paste, see https://play.nim-lang.org/#ix=3qLZ |
17:51:24 | FromDiscord | <hamidb80> a wanna iterate over array of functions |
17:51:42 | FromDiscord | <haxscramper> You can do `(a: int, b: int): bool = a < b` since you would have to select an overload |
17:51:54 | FromDiscord | <haxscramper> !eval typeof(`<`) |
17:51:56 | NimBot | Compile failed: /usercode/in.nim(1, 7) Error: expression 'typeof(<)' is of type 'typedesc' and has to be used (or discarded) |
17:52:10 | FromDiscord | <haxscramper> !eval echo typeof(`<`) |
17:52:13 | NimBot | None |
17:52:18 | FromDiscord | <hamidb80> eh |
17:52:26 | FromDiscord | <haxscramper> Overloaded functions do not have a type |
17:52:39 | FromDiscord | <hamidb80> wow, thanks man |
17:52:46 | FromDiscord | <haxscramper> And array elements must have the same type as well |
17:56:37 | FromDiscord | <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:00 | FromDiscord | <ynfle (ynfle)> @\_discord\_745944009918251010\:t2bot.io @hamidb80 the above posted link should work |
17:57:20 | FromDiscord | <haxscramper> No, it is because overloaded procs can't be correctly selected on the identifier alone |
17:57:43 | FromDiscord | <haxscramper> and you just made explicit selection |
17:58:01 | FromDiscord | <hamidb80> sent a code paste, see https://play.nim-lang.org/#ix=3qM3 |
17:58:08 | FromDiscord | <haxscramper> `in` is a name of playground module file |
17:58:21 | FromDiscord | <haxscramper> `in.<` is the same as `os.walkDir` |
17:58:56 | FromDiscord | <haxscramper> A single non-overloaded `<` was declared in the `in.nim` file, so it is possible to unambiguosly select it using `in.<` |
17:59:07 | FromDiscord | <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:08 | FromDiscord | <ynfle (ynfle)> https://play.nim-lang.org/#ix=3qM5 this works |
17:59:29 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3qM6 |
17:59:31 | FromDiscord | <vindaar> yes, because here the first one is still unambiguous |
17:59:37 | FromDiscord | <vindaar> exactly |
17:59:37 | FromDiscord | <ynfle (ynfle)> I doesn't |
17:59:40 | FromDiscord | <ynfle (ynfle)> \it |
18:00:29 | FromDiscord | <haxscramper> https://play.nim-lang.org/#ix=3qM7 |
18:01:19 | FromDiscord | <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:40 | FromDiscord | <ynfle (ynfle)> So how come the example I posted worked? |
18:01:48 | FromDiscord | <haxscramper> IIRC there was an PR for this |
18:02:19 | FromDiscord | <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:19 | FromDiscord | <haxscramper> Less verbose symbol selection |
18:03:19 | FromDiscord | <haxscramper> I think |
18:03:34 | FromDiscord | <haxscramper> At least implementation allowed to have something like `<(int, int)` (roughly speaking) |
18:03:43 | FromDiscord | <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:47 | FromDiscord | <hamidb80> sent a code paste, see https://play.nim-lang.org/#ix=3qM9 |
18:04:11 | FromDiscord | <vindaar> interesting |
18:04:16 | FromDiscord | <hamidb80> (edit) "https://play.nim-lang.org/#ix=3qM9" => "https://play.nim-lang.org/#ix=3qMa" |
18:05:11 | FromDiscord | <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:02 | FromDiscord | <vindaar> ahh, it was that one |
18:06:05 | FromDiscord | <haxscramper> no idea how close to reality this is |
18:07:34 | * | vicfred quit (Ping timeout: 268 seconds) |
18:09:46 | FromDiscord | <haxscramper> I'm always forgetting that nim type overloading selection partially works in both directions. |
18:10:53 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3qMd |
18:11:12 | FromDiscord | <haxscramper> Well, it does not work for this specific example, but you can probably work around this |
18:12:18 | FromDiscord | <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:06 | FromDiscord | <hamidb80> thanks |
18:17:08 | FromDiscord | <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:29 | FromDiscord | <haxscramper> It seems like Nim forum updater is putting messages in the wrong matrix channel |
18:19:50 | FromDiscord | <haxscramper> They appear in `#nim`, but not here (and not on discord) |
18:23:20 | FromDiscord | <p-i- (Pi)> sent a code paste, see https://play.nim-lang.org/#ix=3qMj |
18:25:39 | FromDiscord | <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:30 | FromDiscord | <haxscramper> You can disable all options completely (do it once) and delegate configuration to `config.nims` |
18:26:44 | FromDiscord | <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:16 | FromDiscord | <p-i- (Pi)> I'm trying to leave something actionable for the repo maintainer (as he can't touch nim source) |
18:27:32 | FromDiscord | <p-i- (Pi)> How/where can I disable all options? |
18:28:26 | FromDiscord | <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:48 | FromDiscord | <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:48 | FromDiscord | <haxscramper> Maybe I missed it though |
18:32:49 | FromDiscord | <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:07 | FromDiscord | <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:14 | FromDiscord | <p-i- (Pi)> Does nim automatically use it? |
18:33:20 | FromDiscord | <p-i- (Pi)> ... if the name is the same... |
18:40:30 | * | max22- joined #nim |
18:43:36 | FromDiscord | <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:59 | FromDiscord | <haxscramper> Nim automatically looks up in the current project, parent directory, user `~/.config/nim` (IIRC) |
18:47:53 | FromDiscord | <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:51 | FromDiscord | <Elegant Beef> Perhaps, I still long for a more explainative way of exporting the procedure `implDefaults(T, true)` isnt great |
20:12:01 | FromDiscord | <Elegant Beef> I suppose I could accquote it so you can do `T`, but still not amazing |
20:16:17 | FromDiscord | <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:58 | FromDiscord | <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:54 | FromDiscord | <Bung> a lib only decared a type type `Url = ref object`, how to use its object version ? |
20:49:48 | FromDiscord | <Bung> object version type |
20:50:31 | FromDiscord | <Elegant Beef> `a: Url()[].type` 😀 |
20:50:45 | FromDiscord | <Elegant Beef> Dont know if there is a macro to get base type, but it's not overly difficult |
20:51:47 | FromDiscord | <Bung> um, how to declare it of a type's field. not just variable type |
20:55:07 | FromDiscord | <leorize> `typeof Url()[]` is kinda the way... |
20:55:33 | FromDiscord | <leorize> !eval import typetraits; echo RootRef[] |
20:55:35 | NimBot | Compile failed: /usercode/in.nim(1, 32) Error: type mismatch: got <type RootRef> |
20:56:05 | FromDiscord | <Bung> type A = object↵ url: ? |
20:57:12 | FromDiscord | <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:38 | FromDiscord | <Elegant Beef> Well to go down the macro way https://play.nim-lang.org/#ix=3qNg |
20:59:41 | FromDiscord | <Elegant Beef> But it's really just `typeof(Url()[])` |
21:00:54 | FromDiscord | <Bung> first time know these can be used in type declaration. |
21:01:18 | FromDiscord | <Elegant Beef> Well it's a static expression so it can be typed |
21:03:02 | FromDiscord | <Varriount> sent a long message, see http://ix.io/3qNm |
21:03:21 | FromDiscord | <Elegant Beef> I assume this is in response to the defaults to sugar |
21:03:39 | FromDiscord | <Bung> even object construction is static ? |
21:04:13 | FromDiscord | <leorize> here's yet another macro for getting the base type https://play.nim-lang.org/#ix=3qNn \:P |
21:04:17 | FromDiscord | <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:35 | FromDiscord | <leorize> potentially avoid the `{.requiresInit.}` issue, too |
21:04:41 | FromDiscord | <Varriount> (edit) "http://ix.io/3qNm" => "http://ix.io/3qNo" |
21:05:39 | FromDiscord | <Elegant Beef> Nicer than mine leorize, shame |
21:05:41 | FromDiscord | <Bung> okay, thanks , I get two versions, I choose `typeof(Url()[])` |
21:06:11 | FromDiscord | <Elegant Beef> Way to shame us both |
21:06:18 | FromDiscord | <Bung> hahaha |
21:06:21 | FromDiscord | <Elegant Beef> We just want to invite magic into your world and you closed us out! 😛 |
21:07:33 | FromDiscord | <Bung> I dont like too much magic, I like basic boring code. |
21:08:00 | FromDiscord | <Bung> 😆 |
21:10:07 | FromDiscord | <Elegant Beef> Yet you starred oopsie |
21:10:07 | FromDiscord | <Elegant Beef> Yea i've noticed this |
21:10:07 | FromDiscord | <Elegant Beef> Ah it's not due to constructor suggestion |
21:10:08 | FromDiscord | <leorize> we matrix users can't see discord replies |
21:12:06 | FromDiscord | <Bung> oopsie is kinda usefull |
21:13:07 | FromDiscord | <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:17 | FromDiscord | <leorize> respectfully, that keyword is dumb. |
21:41:06 | FromDiscord | <zetashift> Maybe posting about it on the forum for feedback would be a good way of finding a way? |
21:41:22 | FromDiscord | <zetashift> I still think it's a good addition for fusion |
21:41:47 | FromDiscord | <Elegant Beef> Well ideally it'd use a postfix `` but that's illegal 😛 |
21:41:53 | FromDiscord | <timotheecour> it's not a keyword, it's an API. It can't be added to fusion, it requires compiler support. |
21:42:20 | FromDiscord | <Elegant Beef> We're talking about my `defaults` |
21:42:29 | FromDiscord | <timotheecour> ah ok. |
21:52:43 | FromDiscord | <zetashift> In reply to @Elegant Beef "Well ideally it'd use": I would really like that too :k |
21:54:36 | FromDiscord | <Elegant Beef> Well the options i can think of is keep as is, use acc quoted `T` or alias a bool |
21:54:36 | FromDiscord | <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) |