00:20:07 | FromDiscord | <konsumlamm> how is the "sharing/moving stuff between thread without deep copying" story with ORC? |
00:33:04 | * | krux02 quit (Remote host closed the connection) |
00:38:27 | * | Tuatarian quit (Ping timeout: 265 seconds) |
00:39:03 | * | wasted_youth2 quit (Read error: Connection reset by peer) |
00:39:22 | * | Tuatarian joined #nim |
00:43:33 | * | wasted_youth2 joined #nim |
00:54:19 | * | tanger_ joined #nim |
00:54:26 | * | tanger_ quit (Client Quit) |
00:57:13 | * | Tanger quit (Ping timeout: 276 seconds) |
01:00:51 | * | krux02 joined #nim |
01:11:57 | * | fputs joined #nim |
01:14:54 | * | Tuatarian quit (Read error: Connection reset by peer) |
01:17:07 | * | krux02 quit (Remote host closed the connection) |
01:18:53 | * | Tuatarian joined #nim |
01:18:56 | * | Tuatarian quit (Client Quit) |
01:23:11 | FromDiscord | <ajusa> Well going off of what people said earlier and https://github.com/nim-lang/Nim/pull/17305, there is code in devel and a blog post incoming that has sharing stuff between threads without deep copying |
01:28:39 | * | njoseph quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.) |
01:28:58 | * | njoseph joined #nim |
01:57:47 | * | andy joined #nim |
01:58:10 | * | andy is now known as Guest87408 |
02:02:45 | * | vicfred quit (Quit: Leaving) |
02:05:15 | * | vicfred joined #nim |
02:14:00 | * | lritter joined #nim |
02:24:11 | FromDiscord | <Gary M> is there a shortcut for MB/GB uint64 representations of bytes? |
02:27:56 | ForumUpdaterBot | New thread by Livingstone1337: Data type mismatch issue, see https://forum.nim-lang.org/t/7627 |
02:30:05 | * | Guest87408 quit (Quit: Connection closed) |
03:38:04 | ForumUpdaterBot | New thread by Livingstone1337: Issues regarding calling an import from python as a routine, see https://forum.nim-lang.org/t/7628 |
03:41:24 | * | jfondren[m] joined #nim |
04:13:02 | * | spiderstew_ joined #nim |
04:14:13 | * | spiderstew quit (Ping timeout: 265 seconds) |
04:16:08 | ForumUpdaterBot | New thread by Halloleo: How can I see all the threads I ahve started or I have contributed to?, see https://forum.nim-lang.org/t/7629 |
04:32:43 | * | vicfred quit (Quit: Leaving) |
04:34:12 | * | vicfred joined #nim |
04:37:42 | saem | Wow, didn't think it would be working during this weekend, only possible with Clyybber's help: https://github.com/nim-lang/Nim/pull/17379 for those that are shy of compiler dev, this is code that analyses proc, func, converter, macro... defs I'd be curious if people find it more/less approachable. |
05:10:33 | FromDiscord | <ElegantBeef> My now more often than i'd like series of "What's the Nim version of this" `typedef void (resus_callback_t)(void);` |
05:10:47 | FromDiscord | <ElegantBeef> just a pointer to a proc right? |
05:10:54 | FromDiscord | <impbox> yeah |
05:11:16 | FromDiscord | <impbox> `type ResultsCallback = proc()` |
05:12:23 | FromDiscord | <ElegantBeef> Ah `{.noconv.}` is needed |
05:12:25 | FromDiscord | <impbox> a type named resus_callback_t that is a function pointer that takes no arguments and no return value |
05:12:49 | FromDiscord | <ElegantBeef> Yea i thought it was a function pointer but i tried just a proc and got an issue so made me doubt myself |
05:12:53 | FromDiscord | <impbox> ahh |
05:13:13 | FromDiscord | <impbox> hmm `noconv` vs `cdecl`, i've mostly used cdecl, wonder how they contrast |
05:13:44 | jfondren[m] | c2nim has impbox's answer, basically. that might be a first stop for your question series |
05:14:18 | FromDiscord | <ElegantBeef> Nah, i'm wrapping the rpi-pico stdlib and converting examples to idiomatic code |
05:15:15 | jfondren[m] | that's fine, but just putting the typedef in a file by itself and running c2nim gives you a good answer to questions like that |
05:15:16 | FromDiscord | <Gary M> `passing 'outDevice.extensionsToEnable' to a sink parameter introduces an implicit copy; if possible, rearrange your program's control flow to prevent it` |
05:15:21 | FromDiscord | <Gary M> how should I approach fixing this |
05:15:27 | FromDiscord | <ElegantBeef> Ah that's what you meant |
05:15:33 | FromDiscord | <ElegantBeef> Yea that works i guess |
05:15:51 | FromDiscord | <Gary M> ` outDevice.extensionsToEnable = outDevice.extensionsToEnable & pds.criteria.requiredExtensions` |
05:17:10 | FromDiscord | <Gary M> would a move() be fine? |
05:24:57 | jfondren[m] | with seq[int], `ns = ns.move & xs` suppresses the `=copy` for the `ns` that'd otherwise be generated. You can check with --expandArc:modulename in a short test |
05:25:09 | jfondren[m] | but `ns &= xs` looks even better, if that works |
05:26:49 | FromDiscord | <Gary M> ah stupid me, I didn't realize `&=` was valid operator 😄 |
05:26:51 | FromDiscord | <Gary M> thanks |
05:33:20 | * | Gustavo6046 quit (Quit: ZNC 1.8.2 - https://znc.in) |
05:33:35 | * | Gustavo6046 joined #nim |
05:36:45 | * | narimiran joined #nim |
05:40:06 | FromDiscord | <Rika> You do you whether &= is preferred over add |
05:40:14 | FromDiscord | <Rika> Most people use add though |
05:40:27 | FromDiscord | <Rika> Probably because they don’t know of the other |
05:45:29 | * | haxscramper joined #nim |
06:17:39 | * | NimBot joined #nim |
06:17:45 | ForumUpdaterBot | New Nimble package! cirru_edn - Extensible data notation based on Cirru syntax, see https://github.com/Cirru/cirru-edn.nim |
06:25:33 | FromDiscord | <gogolxdong> sent a code paste, see https://play.nim-lang.org/#ix=2STV |
06:25:50 | FromDiscord | <gogolxdong> wNim crashed with orc |
06:38:21 | FromDiscord | <Araq> @gogolxdong can you share some code that crashes? |
06:38:44 | FromDiscord | <gogolxdong> sure, wait a second. |
06:45:50 | FromDiscord | <Gary M> is there a way to pass in any arbitrary C compiler for nim c? |
06:47:06 | FromDiscord | <ElegantBeef> You can do `--cc:` |
06:48:35 | FromDiscord | <ElegantBeef> Though only select compilers have entries in the `nim.config` |
06:48:46 | * | haxscram` joined #nim |
06:48:53 | * | haxscram` left #nim (#nim) |
06:50:28 | * | haxscramper quit (Ping timeout: 245 seconds) |
06:50:44 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=2STZ |
06:51:07 | FromDiscord | <haxscramper> And `--clang.exe = "<arbitrary command>"` should work too (I think) |
06:53:04 | FromDiscord | <gogolxdong> https://github.com/gogolxdong/2DeFi |
06:54:09 | jfondren[m] | https://scripter.co/nim-deploying-static-binaries/ has a use of that, for musl builds |
07:01:14 | FromDiscord | <Livingstone> I got an issue with the following code saying that there is a data type mismatch I've tried int conversion but it doesn't seem to work |
07:01:15 | FromDiscord | <Livingstone> proc normalize_dataset(dataset, minmax : seq[float]): seq[float] =↵ for row in dataset:↵ for i in 0..row.len:↵ row[i] = (row[i] - minmax[i][0])/(minmax[i][1] - minmax[i][0]) |
07:02:10 | FromDiscord | <ElegantBeef> minMax is a sequence of floats so `minMax[i]` returns a float whcih you attempt to index with `[0]` |
07:02:37 | FromDiscord | <ElegantBeef> Also post code to https://play.nim-lang.org/ or atleast inside a code block |
07:03:03 | jfondren[m] | you're asking for the .len of row, which is a float |
07:03:31 | jfondren[m] | from the loop, dataset would have to be something like a seq[seq[float]] |
07:04:28 | FromDiscord | <ElegantBeef> What are you attempting to do? is probably the better question |
07:06:05 | FromDiscord | <InventorMatt> sent a code paste, see https://play.nim-lang.org/#ix=2SU4 |
07:06:10 | FromDiscord | <InventorMatt> something like this is what you want? |
07:08:00 | FromDiscord | <Livingstone> I'm trying to rescale a dataset |
07:08:28 | FromDiscord | <Livingstone> In reply to @InventorMatt "<@!263060627793248278> ```nim proc": thanks |
07:09:03 | FromDiscord | <InventorMatt> you can probably also remove the return value as well since this changes it inplace |
07:09:37 | FromDiscord | <Livingstone> oh ok cool thanks I'll give it a go |
07:12:02 | FromDiscord | <Gary M> does nim have a `min(a, b)` and `max(a, b)` |
07:12:26 | jfondren[m] | yes. |
07:13:28 | FromDiscord | <Gary M> !eval echo min(1.0, 3.0) |
07:13:31 | NimBot | 1.0 |
07:13:36 | FromDiscord | <Gary M> Nice. |
07:14:11 | FromDiscord | <ElegantBeef> There is also `math` with other more obscure ops like `floor` `ceil` and the like |
07:14:36 | FromDiscord | <ElegantBeef> I say obscure but mean niche |
07:16:22 | FromDiscord | <Rika> There’s also clamp I believe |
07:16:38 | FromDiscord | <ElegantBeef> clamp is in system |
07:16:58 | FromDiscord | <Rika> I never said it was in math |
07:17:03 | FromDiscord | <ElegantBeef> Ah |
07:20:03 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
07:41:17 | FromDiscord | <Rika> is there a faster way to get durations of time over monotimes? |
07:43:32 | FromDiscord | <ElegantBeef> What do you mean faster? |
07:44:42 | FromDiscord | <Rika> in the literal sense, since i think monotimes is killing me over syscalls? also dont tell me about premature optimization xd https://media.discordapp.net/attachments/371759389889003532/820925454571405312/unknown.png |
07:46:43 | FromDiscord | <ElegantBeef> maybe `times.cpuTime`, both are calling the same function just with different parameters/behaviour? |
07:47:35 | FromDiscord | <Rika> ill look into getting time without syscalls... |
07:54:27 | FromDiscord | <Gary M> is setting a seq to @[] the normal way to clear it? |
07:54:36 | narimiran | setlen |
07:54:48 | FromDiscord | <Gary M> setlen 0 is better? |
07:54:54 | FromDiscord | <ElegantBeef> Yea it doesnt construct a new seq |
07:54:57 | FromDiscord | <Gary M> okay |
08:20:13 | * | fredrikhr joined #nim |
08:23:54 | * | sixtyten quit (Ping timeout: 265 seconds) |
08:32:50 | * | m4r35n357 quit (Quit: Ex-Chat) |
08:34:49 | ForumUpdaterBot | New thread by Nnahito: Can nim long polling?, see https://forum.nim-lang.org/t/7630 |
08:38:10 | * | fbpyr[m] joined #nim |
08:38:16 | * | m4r35n357 joined #nim |
08:42:42 | * | superbia joined #nim |
09:16:12 | * | vicfred quit (Quit: Leaving) |
09:36:42 | liblq-dev | you know it's not like an empty seq allocates any memory anyways |
09:38:20 | * | PMunch joined #nim |
09:43:19 | FromDiscord | <Solitude> with setLen it can reuse already allocated buffer when adding |
09:49:10 | m4r35n357 | Had a lot of fun with generics over the weekend, got stung by "bind once", then found type classes and the "distinct" keyword, which I think is what I wanted (I really need bind many). There was another option in the docs, "Typedesc", but after reading I was none the wiser. I think I will stick with "distinct" unless anyone thinks I might be missing out . . . |
09:50:09 | FromDiscord | <Rika> youre not really explaining what issues youre having |
09:52:56 | m4r35n357 | Rika me? I think I have found the best option but wondered what the use case is for typedesc in generics, and whether type classes/distinct are the best option for "bind many" uses. |
09:53:16 | m4r35n357 | I found the docs impenetrable! |
09:53:43 | m4r35n357 | But I don't have any issues ;) |
09:54:00 | FromDiscord | <Rika> im not understanding what you want too well |
09:56:18 | m4r35n357 | Rika, don't worry, I was just looking for an explanation of why there is more than one option for "bind many" generics, when the one I am using seems fine. nm |
09:56:31 | * | sz0 joined #nim |
10:01:39 | * | Vladar joined #nim |
10:01:41 | FromDiscord | <konsumlamm> what the hell are "bind many" generics? |
10:09:39 | liblq-dev | so imagine you have a `proc a(x, y, z: auto)` |
10:10:00 | liblq-dev | bind many means that the compiler will create a separate generic param for each auto param |
10:10:08 | liblq-dev | so you can do eg. `a(1, 'a', "z")` |
10:22:35 | FromDiscord | <konsumlamm> ah |
10:39:06 | PMunch | How did the developer livestream thingy go by the way? |
10:44:02 | * | tanger__ joined #nim |
10:48:04 | FromDiscord | <Yardanico> which one? |
10:55:50 | * | krux02 joined #nim |
11:00:53 | giaco_ | are there nim libraries that help in writing we client/servers around wsdl/soap schemas? |
11:01:15 | giaco_ | s/help/helps/, s/we/web/ |
11:05:17 | * | superbia quit (Quit: WeeChat 3.1) |
11:07:07 | PMunch | giaco_, depends on what you need really |
11:07:30 | PMunch | I mean there is httpserver/client and xml modules in the standard library |
11:18:48 | * | xet7 joined #nim |
11:19:06 | FromDiscord | <Goel> `bool WindowShouldClose(void); // Check if KEY_ESCAPE pressed or Close icon pressed`↵Raylib manages the window-program closure like this, but i only want it to close if the user press the X and not if he press the Esc key. How do i modify this beheviour since its into the code of Raylib? |
11:20:58 | FromDiscord | <Goel> (edit) "WindowShouldClose(void); //" => "WindowShouldClose(void);↵//" |
11:27:26 | giaco_ | PMunch: I know, but it would be a long way reinventing the wheel. Soap/Wsdl parsers/checkers are a thing, and nim metaprogramming would be a perfect fit to parse xml scheme and generate data model for wsdl |
11:28:59 | PMunch | Doesn't appear like anyone have written a package for it.. Possibly because XML has fallen a bit to the wayside in favour of JSON. |
11:29:38 | giaco_ | yeah, but different standards are build with wsdl, so it is something made to stay |
11:31:08 | giaco_ | unrelated question: I'm testing out "chronicles" lib. Really nice, but it seems to confuse nimsuggests and nimpretty just by importing it. Now my vscode shows tons of errors but project compiles just fine |
11:35:51 | FromDiscord | <no name fits> sent a code paste, see https://play.nim-lang.org/#ix=2SVq |
11:39:27 | FromDiscord | <Rika> wdym? |
11:39:40 | FromDiscord | <Rika> for string processing or on your editor? |
11:39:55 | FromDiscord | <no name fits> For the output, as a string |
11:40:12 | FromDiscord | <no name fits> basically replacing whatever indent \t would do with dots |
11:54:23 | FromDiscord | <Rika> not that i know of |
11:55:07 | * | Vladar quit (Quit: Leaving) |
11:59:26 | ForumUpdaterBot | New thread by Drkameleon: Compiling for arm/arm64, see https://forum.nim-lang.org/t/7631 |
11:59:43 | * | narimiran quit (Ping timeout: 260 seconds) |
12:02:28 | * | Torro joined #nim |
12:05:21 | * | xet7 quit (Quit: Leaving) |
12:06:02 | * | xet7 joined #nim |
12:18:35 | * | rockcavera joined #nim |
12:27:42 | PMunch | giaco_, it is known that nimsuggest and related tools can get confused by some libraries. |
12:27:56 | PMunch | It's unfortunate, and honestly I'm not quite sure what causes it.. |
12:28:32 | giaco_ | not sure why, but I've inverted the order of the imports and now the error is gone |
12:36:10 | PMunch | Please create an issue with nimsuggest if one doesn't already exist |
12:37:30 | giaco_ | if only I were able to replicate it. It has disappearead. I've also restarted whole IDE when I had the problem to exclude any enternal cause, but it came back then. Really puzzled |
12:37:56 | FromDiscord | <Goel> sent a code paste, see https://play.nim-lang.org/#ix=2SVP |
12:38:33 | PMunch | `discard` in this context is basically a nop |
12:38:36 | FromDiscord | <Rika> discard does nothing |
12:38:52 | FromDiscord | <Goel> Define "does nothing" |
12:38:55 | FromDiscord | <Rika> pass in python |
12:39:08 | FromDiscord | <Rika> {} in c |
12:39:24 | PMunch | It can also be used to explicitly discard return values of a function call |
12:40:07 | PMunch | That code looks like it could swap its if statement though and drop the else clause |
12:40:14 | PMunch | But hard to tell without looking at the rest of it |
12:41:59 | FromDiscord | <Goel> That was just a basic example, it has no code attached to it, im trying all the functions available for a Window, like resize, set its borders, title, and all the parameters. But thanks i got it now |
12:45:22 | * | lritter quit (Ping timeout: 260 seconds) |
12:47:48 | PMunch | Yeah typically you'd do something like `if not windowResize(myWindow): echo "Window not ready"` |
12:48:25 | PMunch | Or rather create a small template that would throw an exception with a message and then do something like `windowCheck windowResize(myWindow)` |
12:48:59 | FromDiscord | <Goel> Yes i've read that in some example of Nim, but i still need to get used to write it in that way, for me for now is easier to read in the other way. But with the time i'll use the shorter version |
12:49:20 | PMunch | I mean it's a matter of preference |
12:49:36 | PMunch | The C style of error return code is one way of doing it, exceptions are another |
12:49:50 | PMunch | It all depends on how you want to structure your code |
12:52:19 | FromDiscord | <Goel> Yes the Nim style is much better than C in my opinion |
12:56:36 | FromDiscord | <Goel> `void GetWindowHandle(void)`↵Is it correct to change that in C with this in Nim?↵`addr getWindowHandle()` |
12:57:43 | FromDiscord | <Goel> (edit) "`void GetWindowHandle(void)`↵Is" => "`GetWindowHandle(void)` (The Return is void)↵Is" |
12:57:51 | FromDiscord | <Rika> ?? |
12:58:14 | FromDiscord | <Rika> `void GWS(void)` = `proc GWS: pointer` |
12:58:22 | FromDiscord | <Rika> GWH sorry lmao |
12:58:50 | reversem3 | Can't I change the compiler option in a nim.cfg to not use g++ ? |
12:58:51 | reversem3 | error: invalid argument '-std=gnu++14' not allowed with 'Objective-C' |
12:59:19 | krux02 | reversem3, you can use other compilers as well |
12:59:28 | krux02 | clang is very much supported |
13:02:40 | reversem3 | yeah i tried clang for imgui but still get the same error |
13:04:35 | reversem3 | https://play.nim-lang.org/#ix=2SW1 |
13:05:29 | reversem3 | I see the issue with compiling imgui with osx https://github.com/nimgl/nimgl/issues/64 |
13:06:05 | reversem3 | would I have to change all the compiler options in the private directory? |
13:06:13 | krux02 | reversem3, The nim compiler uses gnu extensions for optimizations. |
13:06:23 | krux02 | But they are only used in generared sources. |
13:06:54 | krux02 | the "std=gnu++14" flag is not supposed to leak out to externally compiled files. |
13:07:24 | krux02 | That sounds in my opinion like a compiler bug |
13:07:51 | reversem3 | bummer |
13:08:02 | krux02 | yea it is. |
13:10:07 | reversem3 | So I found this https://stackoverflow.com/questions/51218905/specifying-std-when-compiling-both-c-and-c-code |
13:10:27 | giaco_ | How do you use object variants, the fact that you can't have shared attributes between different types is always a show stopper to me, but I feel like I'm missing the point |
13:10:30 | reversem3 | is nim trying to compile C and C++ at the sametime ? |
13:11:17 | krux02 | https://github.com/nim-lang/Nim/pull/13695 |
13:14:34 | krux02 | reversem3, nim can compile C and C++ at the same time, but here it is trying to compile C and Objective-C and the same time and link it together |
13:15:19 | krux02 | there is no problem to compile and linke different programming languages together if the interfacing is done right. |
13:15:23 | FromDiscord | <konsumlamm> "attempt to finish off araq" 🤔 |
13:15:43 | reversem3 | so this commit isn't in the devel yet or is? |
13:15:54 | krux02 | it is in devel |
13:15:56 | krux02 | it is merged |
13:16:15 | reversem3 | ok updating now |
13:16:17 | PMunch | giaco_, it is a bit weird, yes. But you can probably hide that with a generic accessor/template |
13:16:43 | PMunch | Maybe.. |
13:16:45 | krux02 | https://github.com/nim-lang/Nim/blob/874ccc8493605b8e227007f1c0fa1a1131b80e23/compiler/extccomp.nim#L89 |
13:17:30 | krux02 | this "cppXsupport" part should not be applied, when a file is compiled with the `compile` directive. |
13:19:19 | reversem3 | so is there an exclude flag ? |
13:19:31 | krux02 | not that I know of. |
13:19:37 | krux02 | It looks like you ar screwed. |
13:19:50 | krux02 | you could revert to a compiler version before that pr got merged. |
13:19:56 | krux02 | and report a bug. |
13:21:25 | reversem3 | you mean the nim compiler or clang ? |
13:30:31 | krux02 | I mean the nim compiler. |
13:30:50 | krux02 | reversem3, I try to rephrase what happened here. |
13:31:35 | krux02 | gcc and clang both support c++ extensions, non standard, that allow to write better optimized code. |
13:32:10 | krux02 | The extensions need to be enabled with a flag, that is "gnu++14" part that you see. |
13:32:31 | krux02 | nim also allows to compile other files that are leter linked to the final executable. |
13:32:52 | krux02 | Tha is what is done in imgui |
13:32:52 | * | abm joined #nim |
13:33:46 | krux02 | now, for some reason, nim tries to add the flags gnu++14 also to the command line to compile the objective-C file for imgui. |
13:33:56 | krux02 | that command line flag is invalid for objective c. |
13:34:13 | krux02 | therefore compilation fails. |
13:34:24 | krux02 | cause, bug in the compiler. |
13:34:36 | krux02 | you can't do anything about it, other than reporting it as a regression. |
13:34:46 | krux02 | this did not happen before the optimization was introduced. |
13:35:12 | reversem3 | ok thanks for the info and looking into it |
13:38:08 | Oddmonger | i was sure :bool (as result value of a proc) was set to true by default . Man… was i wrong :/ |
13:38:28 | krux02 | Oddmonger, how? |
13:38:44 | krux02 | everything is initialized to 0 by default |
13:41:05 | Oddmonger | well it suddendly works when i put result=true at the beginning |
13:41:17 | Oddmonger | it was always returning false otherwise |
13:42:24 | FromDiscord | <Clyybber> In reply to @no name fits "Is there a builtin": replace(" ", '.').replace("\t", '.'.repeat(yourTabWidth)) should work |
13:42:41 | Oddmonger | i thought 0 == true for bool |
13:43:04 | FromDiscord | <Clyybber> you can also use multiReplace((" ", ".",), ("\t", '.'.repeat(yourTabWidth))) if you prefer that |
13:43:05 | FromDiscord | <dk> that would be a first language to do that |
13:43:35 | krux02 | dk, not really |
13:43:50 | krux02 | dk, ever heared bash? |
13:43:51 | FromDiscord | <dk> ? |
13:44:44 | FromDiscord | <dk> my brain doesn't categorize it as a programming lang |
13:44:59 | krux02 | in bash 0 is ok, everything else is error/false |
13:45:08 | krux02 | it is |
13:45:15 | Oddmonger | in C, too |
13:45:25 | FromDiscord | <dk> wait |
13:45:39 | krux02 | yea |
13:45:43 | krux02 | i know |
13:45:51 | krux02 | late to realize? |
13:46:59 | Oddmonger | « usually », 0 is for success, because there one success and so many possible cause of failure |
13:47:14 | FromDiscord | <Clyybber> yeah, but that's not really a bool |
13:47:26 | FromDiscord | <no name fits> In reply to @Clyybber "replace(" ", '.').replace("\t", '.'.repeat(yourTabW": thanks |
13:47:32 | FromDiscord | <Clyybber> it's not really a bool in bash either, it's better to think about as "implicitly converted to bool" |
13:47:38 | FromDiscord | <Rika> In reply to @Clyybber "replace(" ", '.').replace("\t", '.'.repeat(yourTabW": no i dont think so |
13:47:44 | FromDiscord | <Rika> remember tabs size to the content |
13:47:51 | FromDiscord | <Clyybber> oh |
13:47:54 | FromDiscord | <Clyybber> good point |
13:47:56 | Oddmonger | but yes for bool, 1 is true |
13:48:34 | FromDiscord | <Rika> you have to resize `tabwidth` by `linelen mod tabwidth` i believe |
13:48:49 | FromDiscord | <Rika> so `tabwidth - linelen mod tabwidth` i guess |
13:49:15 | FromDiscord | <Rika> then be wary of tabs in the middle of the line, that probably shouldnt count |
13:49:23 | FromDiscord | <Rika> same with spaces in the middle of the line |
14:01:29 | * | Vladar joined #nim |
14:10:12 | Clonkk[m] | Is it possible to call something like ``static: switch("define", "abc")`` in a Nim file (not nimscript) to have a file define a compile time value ? |
14:11:39 | FromDiscord | <Clyybber> I don't think so |
14:13:17 | Clonkk[m] | Even with stuff like https://github.com/beef331/nimscripter ? |
14:14:29 | krux02 | don't think so |
14:14:47 | Clonkk[m] | Okay, thank you. Time for another config file |
14:15:05 | krux02 | the point of a define as a compiler option is, its value is known to the compiler from the very beginning. |
14:15:31 | Clonkk[m] | Hence the static part |
14:16:14 | FromDiscord | <Rika> from the very beginning |
14:16:19 | FromDiscord | <Rika> not while processing a file |
14:16:23 | krux02 | static only means "during compile time" not "at the very beginning" or even "before compilation" |
14:16:47 | Clonkk[m] | Ah I see |
14:17:14 | krux02 | to process static blocks, a lot of modules need to be compiled to bytecode. |
14:17:34 | krux02 | at least system.nim |
14:17:54 | krux02 | and then you say, ah by the way, from the very beginning this should have been true. |
14:18:16 | Clonkk[m] | It would be expensive to make multiple pass |
14:18:26 | Clonkk[m] | I assume ? |
14:18:28 | krux02 | And then the compiler says, "aaarg, FU, if you want things from the beginning tell me from the beginning, not after I've already processed all these files" |
14:19:15 | krux02 | it would not only be multiple pass, it would also invalidat a lot of conpialation. |
14:19:22 | krux02 | it's just bad. |
14:19:29 | Clonkk[m] | I'll just use {.booldefine.} instead of -d: |
14:19:49 | FromDiscord | <Rika> that works |
14:20:24 | krux02 | what is the problem with just ``const abc = true``? |
14:21:26 | Clonkk[m] | ``const abc {.booldefine.} = true`` so you can override it at compile time without chaging code is the idea |
14:22:20 | krux02 | you can't change a const at compile time, that is the point of const. |
14:22:36 | Clonkk[m] | https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-compileminustime-define-pragmas ? |
14:23:39 | krux02 | but that defines the value before compilation as an argument. |
14:23:53 | krux02 | that is not during compilation |
14:25:18 | krux02 | order is important |
14:25:38 | Clonkk[m] | You're right, but It's good enough for what I'm doing |
14:28:01 | FromDiscord | <Rika> then why not a define? |
14:28:42 | Clonkk[m] | The idea is to have a define that changes depending on which file you import (assuming mutually exclusive files) |
14:28:54 | Clonkk[m] | Avoiding multiple config files |
14:30:01 | krux02 | then why don't you put `const abc = true` in module A, and in module B you put `const abc = false` |
14:30:26 | krux02 | then when A and B is mutually exclusive import, `abc` will always be resolved. |
14:31:07 | Clonkk[m] | Because then you have to modify source code to switch from one flag to the other. |
14:31:41 | krux02 | well I don't see your use case. |
14:31:47 | Clonkk[m] | Haha it's a bit specific |
14:32:00 | FromDiscord | <Rika> If you switch it on the compiler it’s going to affect all files |
14:44:30 | * | Q-Master quit (Ping timeout: 256 seconds) |
14:54:25 | FromDiscord | <รєคɭ๓๏שє> @giaco are you here? |
14:54:38 | * | narimiran joined #nim |
14:58:16 | * | Q-Master joined #nim |
14:59:46 | PMunch | sealmove, are you tired of getting pinged from IRC? :P |
15:01:40 | FromDiscord | <Clyybber> ironically you just pinged someone called ed twice lol |
15:01:50 | FromDiscord | <Clyybber> I wonder why the bot does that tho |
15:03:09 | * | Vladar quit (Remote host closed the connection) |
15:06:27 | ForumUpdaterBot | New Nimble package! json2xml - Convert json to xml : JsonNode( comapatible with module json ) To XmlNode (comapatible with module xmltree), see https://github.com/MhedhebiIssam/json2xml |
15:10:25 | * | haxscramper joined #nim |
15:15:33 | PMunch | @Clyybber, wait really? |
15:15:42 | FromDiscord | <Clyybber> yeah haha |
15:16:01 | FromDiscord | <Clyybber> and for some reason you didn't ping sealmove |
15:16:04 | FromDiscord | <Clyybber> this is really weird |
15:16:24 | FromDiscord | <Clyybber> can you try sealmove but with a space between the name and the comma? |
15:16:40 | PMunch | @sealmove |
15:16:49 | PMunch | @รєคɭ๓๏שє |
15:17:20 | FromDiscord | <Clyybber> huh what the heck |
15:17:32 | FromDiscord | <Clyybber> can you try "seamove: something" |
15:17:38 | PMunch | sealmove: something |
15:17:47 | FromDiscord | <Clyybber> ok, something's wrong |
15:18:21 | PMunch | Especially that ed thing.. |
15:18:23 | FromDiscord | <Clyybber> oh, it's because the bot is considering the discord usernames, not the nicks |
15:18:31 | FromDiscord | <Clyybber> but the ed thing I can't explain :D |
15:18:35 | FromDiscord | <Clyybber> @Yardanico any idea? |
15:18:52 | PMunch | But why didn't any of my sealmove pings work then? |
15:19:04 | FromDiscord | <Clyybber> PMunch: Because sealmove is named unicodely |
15:19:19 | FromDiscord | <Yardanico> yeah I check by the discord username not display name |
15:19:32 | FromDiscord | <Clyybber> we should probably switch that if possible |
15:19:36 | FromDiscord | <Yardanico> i'll see |
15:19:43 | FromDiscord | <Clyybber> but last we tried discordnim didn't cache the nicks right? |
15:19:53 | FromDiscord | <Yardanico> yeah something like that |
15:20:18 | PMunch | Where do you see that? |
15:20:23 | FromDiscord | <Clyybber> eh, nimscord I mean |
15:20:35 | FromDiscord | <Clyybber> damn it wrong again; dimscord, right? |
15:21:09 | FromDiscord | <Clyybber> PMunch: See what? |
15:21:54 | PMunch | His nick |
15:22:22 | FromDiscord | <Clyybber> oh, on discord, he's called sealmove here, but discord has a global username, and a server specific nick |
15:22:37 | FromDiscord | <Clyybber> and the bot only uses the global username right now |
15:22:49 | PMunch | Aaah I see |
15:23:01 | FromDiscord | <Yardanico> yeah I'm not entirely sure if that's fixable, i'll check |
15:26:15 | FromDiscord | <Yardanico> yeah it should be I think |
15:26:50 | Prestige | Is the bot open source? |
15:26:55 | FromDiscord | <Clyybber> fixable or not fixable |
15:27:01 | FromDiscord | <Clyybber> Prestige: https://github.com/Yardanico/ircord/ |
15:27:17 | FromDiscord | <Yardanico> @Clyybber fixable :) |
15:27:21 | FromDiscord | <Clyybber> nice! |
15:28:18 | PMunch | I miss disbot though.. |
15:28:44 | FromDiscord | <Clyybber> but ircord is better? |
15:28:51 | FromDiscord | <Clyybber> oh, nevermind |
15:28:53 | FromDiscord | <Yardanico> they're different :) |
15:29:11 | FromDiscord | <Clyybber> yeah, I somehow read that as FromDiscord or something |
15:29:16 | FromDiscord | <Clyybber> I miss disbot too |
15:29:31 | FromDiscord | <Clyybber> ~manual |
15:29:33 | FromDiscord | <Yardanico> trying to compile ircord now, I get an error, not sure if it's a nim regression, will check |
15:29:51 | ForumUpdaterBot | New thread by FabienPRI: Performance comparison of various compilers, see https://forum.nim-lang.org/t/7633 |
15:32:17 | Clonkk[m] | Is it possible to create an alias for a (generic) function without having to rewrite the signature ? |
15:32:59 | Clonkk[m] | At the moment I just do ``var newname = oldprocname`` but I'm wondering if there's a better way |
15:33:49 | FromDiscord | <Yardanico> @Clyybber were there any changes to how generics work in Nim recently? |
15:34:09 | FromDiscord | <Clyybber> yeah |
15:34:17 | FromDiscord | <Clyybber> but afaik only related to mixins/bind |
15:34:23 | FromDiscord | <Yardanico> oh then I found a regression :P |
15:34:32 | FromDiscord | <Clyybber> is it related to mixin/bind? |
15:35:08 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2SWM |
15:35:29 | FromDiscord | <Clyybber> huh |
15:35:32 | FromDiscord | <Yardanico> affects https://github.com/mark-summerfield/diff |
15:35:50 | * | PMunch quit (Quit: leaving) |
15:36:05 | FromDiscord | <Yardanico> @Clyybber will you file an issue or i'll do it myself? |
15:36:15 | FromDiscord | <Clyybber> if you are already at it :D |
15:36:19 | FromDiscord | <Yardanico> not yet :D |
15:36:48 | FromDiscord | <Clyybber> it's yours then :P |
15:38:03 | FromDiscord | <Clyybber> I mean you minimized it and all that, so props should go to you :D |
15:38:09 | FromDiscord | <Yardanico> ah actually wait it might be happening because sets got more new code |
15:38:15 | FromDiscord | <Clyybber> oh |
15:38:31 | FromDiscord | <Yardanico> 1.4.4 doesn't call `len` for a `HashSet` in `items` |
15:38:32 | FromDiscord | <Yardanico> devel does |
15:39:07 | FromDiscord | <Clyybber> ah |
15:39:17 | FromDiscord | <Clyybber> does a bind len in items help? |
15:39:49 | FromDiscord | <Yardanico> doesn't seem so |
15:39:58 | FromDiscord | <Yardanico> I'll make a smaller example without sets |
15:47:32 | FromDiscord | <ajusa> Is anyone interested in adding Nim to https://github.com/benhoyt/countwords↵I started working on it (https://github.com/ajusa/countwords/blob/master/simple.nim) but not sure if mine is correct. Feel free to work off of it if anyone wants to. |
15:48:23 | * | Tuatarian joined #nim |
15:48:36 | * | Vladar joined #nim |
15:48:47 | * | tane joined #nim |
15:50:05 | * | vicfred joined #nim |
15:54:56 | FromDiscord | <Yardanico> ahh @Clyybber I think I got it! |
15:54:59 | FromDiscord | <Yardanico> declaration order :D |
15:55:17 | FromDiscord | <Yardanico> but this worked before, so it's a regression nonetheless |
15:58:26 | FromDiscord | <Yardanico> @Clyybber https://github.com/nim-lang/Nim/issues/17385 |
16:00:05 | * | gollark[m] quit (Quit: Idle for 30+ days) |
16:00:37 | narimiran | and there i was, using nim for few years, having no idea that i could write stuff like `var test = HashSet[T]()` |
16:01:03 | FromDiscord | <Yardanico> XD |
16:01:40 | FromDiscord | <Yardanico> wait actually I think this was always broken? |
16:01:45 | FromDiscord | <Yardanico> it fails even on 0.20.0 |
16:01:58 | FromDiscord | <Yardanico> wat |
16:02:01 | FromDiscord | <Yardanico> ah nvm |
16:02:02 | FromDiscord | <Yardanico> im stupid |
16:02:08 | FromDiscord | <Yardanico> or not |
16:02:18 | narimiran | what a rollercoaster |
16:02:22 | narimiran | are you stupid or not?? |
16:02:27 | FromDiscord | <Yardanico> i'm both |
16:02:29 | narimiran | i don't know anymore |
16:03:39 | FromDiscord | <Yardanico> I don't understand what I'm doing anymore xd |
16:04:24 | narimiran | so, does this work on 1.4.4 or not? |
16:05:58 | FromDiscord | <Yardanico> the code in the issue doesn't work and isn't supposed to work, it's a bad change in sets that's causing this I guess |
16:06:14 | FromDiscord | <Yardanico> but still a regression kind of :P |
16:08:20 | FromDiscord | <Yardanico> i'll run git bisect just in case |
16:08:44 | narimiran | if it is `len` related, maybe #16959 ? |
16:09:01 | narimiran | where's that bot that gives us a link? |
16:09:09 | FromDiscord | <Yardanico> disruptek |
16:09:10 | FromDiscord | <Yardanico> disbot |
16:09:19 | narimiran | https://github.com/nim-lang/Nim/pull/16959 |
16:09:24 | FromDiscord | <Rika> why is the winlean module called winlean |
16:09:25 | FromDiscord | <Yardanico> @narimiran yeah you're probably right |
16:09:53 | FromDiscord | <Yardanico> @Rika probably because of WIN32_LEAN_AND_MEAN |
16:10:45 | FromDiscord | <Yardanico> and I just wanted to improve my ircord... |
16:12:20 | FromDiscord | <Yardanico> yeah @narimiran I bisected |
16:12:22 | FromDiscord | <Yardanico> it's caused by that PR |
16:12:57 | FromDiscord | <Yardanico> it's easily fixed if you change the order of declarations |
16:13:39 | narimiran | will you do it, or me? :) |
16:14:22 | FromDiscord | <Yardanico> please you, I'm not sure if simply changing the order is good (e.g. the order in the docs will change too then) |
16:14:32 | FromDiscord | <Yardanico> i'll go and finally add display names to dimscord instead :P |
16:14:36 | narimiran | ok |
16:14:41 | FromDiscord | <Yardanico> \s/dimscord/ircord |
16:14:46 | FromDiscord | <Rika> is there a full windows module? |
16:15:01 | FromDiscord | <Yardanico> https://github.com/khchen/winim |
16:15:14 | FromDiscord | <Clyybber> @Yardanico haha, so it was just len being after items? |
16:15:15 | FromDiscord | <Rika> okay, so none in the standard |
16:15:34 | FromDiscord | <Yardanico> @Clyybber yes |
16:15:58 | FromDiscord | <Clyybber> and that issue only manifests itself with a module chain, since otherwise you'd be importing len too and it would find it |
16:16:00 | FromDiscord | <Clyybber> haha, nice |
16:16:09 | * | superbia joined #nim |
16:17:14 | FromDiscord | <flywind> or mixin len |
16:17:18 | FromDiscord | <Clyybber> won't fix it |
16:17:27 | FromDiscord | <Yardanico> mixin might, I tried bind |
16:17:31 | FromDiscord | <Yardanico> (edit) "mixin might, I ... tried" added "only" |
16:17:36 | FromDiscord | <Clyybber> I don't think either will |
16:17:51 | FromDiscord | <Clyybber> during declaration, len is not available, because it's declared later |
16:18:05 | FromDiscord | <Clyybber> during instantiation, len is not available either, because it might not be imported |
16:18:07 | FromDiscord | <Yardanico> yeah you're right |
16:18:54 | FromDiscord | <Clyybber> if you want a generic to use stuff from the declaration site the stuff has to be declared once the generic declaration is encountered |
16:18:59 | FromDiscord | <Clyybber> just like for normal procs |
16:36:51 | narimiran | any idea why i386 pipeline is suddenly red everywhere? https://play.nim-lang.org/#ix=2SX8 |
16:47:34 | FromDiscord | <Clyybber> yeah, it's because of the package manager issue AFAIK |
17:08:42 | * | stefantalpalaru_ joined #nim |
17:09:37 | * | vegai11 joined #nim |
17:09:40 | * | koltrast_ joined #nim |
17:10:38 | * | njoseph_ joined #nim |
17:13:21 | * | Torro quit (Quit: bye) |
17:14:02 | * | stefantalpalaru quit (Remote host closed the connection) |
17:14:02 | * | vegai1 quit (Ping timeout: 265 seconds) |
17:14:03 | * | njoseph quit (Ping timeout: 265 seconds) |
17:14:04 | * | koltrast quit (Ping timeout: 265 seconds) |
17:14:07 | * | jess quit (Quit: Reconnecting) |
17:14:10 | * | jess joined #nim |
17:14:12 | * | stefantalpalaru_ is now known as stefantalpalaru |
17:14:15 | * | stefantalpalaru quit (Changing host) |
17:14:15 | * | stefantalpalaru joined #nim |
17:14:51 | * | sixtyten joined #nim |
17:16:21 | * | Cthalupa quit (Ping timeout: 246 seconds) |
17:18:54 | * | Cthalupa joined #nim |
17:26:18 | FromDiscord | <Yardanico> restarting the bridge |
17:26:22 | * | FromDiscord quit (Remote host closed the connection) |
17:27:15 | * | FromDiscord joined #nim |
17:27:27 | FromDiscord | <Yardanico> done |
17:27:30 | Yardanico | @Yardanico hi |
17:27:38 | Prestige | does this ping ed still |
17:27:40 | FromDiscord | <asd> yes |
17:27:43 | Prestige | welp |
17:27:49 | FromDiscord | <asd> but "ping ed" is a valid thing |
17:27:57 | FromDiscord | <asd> "pinged" shouldn't ping |
17:28:00 | FromDiscord | <asd> but "ping ed" should |
17:28:04 | Yardanico | @asd hi |
17:28:20 | Prestige | so we don't need the @? |
17:28:26 | Prestige | asd |
17:29:08 | Yardanico | Prestige: it's one of these - "Nick, msg" at the start of the message, "ping nick", "@nick" |
17:29:13 | Yardanico | Yardanico, hi |
17:29:18 | Prestige | ah, ty |
17:29:19 | Yardanico | actually wait, not the comma |
17:29:21 | Yardanico | it's the colon |
17:29:25 | Yardanico | Yardanico: hi |
17:29:34 | FromDiscord | <Yardanico> asd |
17:29:36 | FromDiscord | <Yardanico> huh |
17:30:00 | FromDiscord | <Yardanico> ohhhhhhhhhhh |
17:30:39 | FromDiscord | <zetashift> Multiple personalities: chatroom edition |
17:37:23 | FromDiscord | <Yardanico> @Prestige I found out why ed is getting pinged |
17:38:30 | Prestige | oh nice |
17:38:42 | FromDiscord | <Yardanico> it's an unlucky chain of events - part of my matching matches on "ping + space + nickname" |
17:38:51 | FromDiscord | <Yardanico> and the problem was that I was parsing zero or more spaces |
17:38:52 | FromDiscord | <Yardanico> not one or more |
17:39:00 | Prestige | haha, nice. Good find |
17:40:15 | FromDiscord | <Yardanico> restarting the bridge again |
17:40:31 | * | FromDiscord quit (Remote host closed the connection) |
17:40:51 | * | FromDiscord joined #nim |
17:41:16 | Yardanico | try now Prestige |
17:41:24 | Prestige | pinged |
17:41:28 | Yardanico | yeah its fine now |
17:41:37 | Prestige | \o/ |
17:41:43 | Yardanico | but "ping someone" will actually ping them if there's a person with that name |
17:41:47 | Yardanico | and apparently I pinged someone |
17:42:13 | Prestige | lol |
17:44:21 | FromDiscord | <clyybber> In reply to @Yardanico "and the problem was": oh ahaha |
18:00:48 | FromDiscord | <haxscramper> Is it possible to disable `.kind` field init safety proving? I have several kinds in the same branch and select a particular one at runtime, but I know it is safe to do so |
18:01:10 | FromDiscord | <haxscramper> I'm talking about disabling `Error: cannot prove that it's safe to initialize with the runtime value for the discriminator 'kind' ` check |
18:01:18 | FromDiscord | <haxscramper> For particular piece of code only |
18:01:47 | FromDiscord | <haxscramper> Or somehow making compiler understand it is a safe init |
18:02:31 | FromDiscord | <Yardanico> @haxscramper I think it's a deeper problem than that, and it's allowed with arc/orc because with destructors it's safe |
18:02:41 | FromDiscord | <Yardanico> if I understand your problem correctly |
18:03:30 | FromDiscord | <Yardanico> https://github.com/nim-lang/RFCs/issues/209 |
18:03:43 | FromDiscord | <Yardanico> https://github.com/nim-lang/Nim/pull/13995 |
18:03:51 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=2SXP |
18:03:55 | FromDiscord | <haxscramper> (edit) "https://play.nim-lang.org/#ix=2SXP" => "https://play.nim-lang.org/#ix=2SXQ" |
18:03:56 | * | j-james[m] quit (*.net *.split) |
18:03:56 | * | Avatarfighter[m] quit (*.net *.split) |
18:03:56 | * | Prestige quit (*.net *.split) |
18:04:03 | FromDiscord | <Yardanico> can't you use object construction syntax? |
18:05:09 | * | j-james[m] joined #nim |
18:05:09 | * | Avatarfighter[m] joined #nim |
18:05:09 | * | Prestige joined #nim |
18:07:55 | * | sekao[m] quit (Ping timeout: 240 seconds) |
18:07:55 | * | zazi[m] quit (Ping timeout: 240 seconds) |
18:07:55 | * | rwiser[m] quit (Ping timeout: 240 seconds) |
18:07:55 | * | Clonkk[m] quit (Ping timeout: 240 seconds) |
18:07:56 | * | ee7[m] quit (Ping timeout: 244 seconds) |
18:07:56 | * | retroedgetech[m] quit (Ping timeout: 244 seconds) |
18:07:57 | * | unclechu quit (Ping timeout: 240 seconds) |
18:07:57 | * | lnxw37d4 quit (Ping timeout: 240 seconds) |
18:07:57 | * | Avahe[m] quit (Ping timeout: 244 seconds) |
18:07:59 | * | vegai11 quit (Ping timeout: 241 seconds) |
18:07:59 | * | Zoom[m] quit (Ping timeout: 241 seconds) |
18:07:59 | * | k0mpjut0r quit (Ping timeout: 241 seconds) |
18:08:04 | * | Benjamin[m]2 quit (Ping timeout: 249 seconds) |
18:08:04 | * | leorize[m] quit (Ping timeout: 249 seconds) |
18:08:08 | * | nxnl[m] quit (Ping timeout: 247 seconds) |
18:08:09 | FromDiscord | <haxscramper> I just want to work around init proving without switching GC |
18:08:10 | * | stisa quit (Ping timeout: 247 seconds) |
18:08:10 | * | antholop[m] quit (Ping timeout: 247 seconds) |
18:08:10 | * | GitterIntegratio quit (Ping timeout: 247 seconds) |
18:08:22 | * | ShalokShalom[m] quit (Ping timeout: 260 seconds) |
18:08:22 | * | drbixx[m] quit (Ping timeout: 260 seconds) |
18:08:26 | * | fbpyr[m] quit (Ping timeout: 264 seconds) |
18:08:27 | * | Avatarfighter[m] quit (Ping timeout: 265 seconds) |
18:08:31 | FromDiscord | <haxscramper> https://play.nim-lang.org/#ix=2SXR it can't prove this too, though examples is a big too simple |
18:08:39 | * | jfondren[m] quit (Ping timeout: 268 seconds) |
18:08:39 | * | Stephen[m]1 quit (Ping timeout: 268 seconds) |
18:08:39 | * | i_use_arch_btw[4 quit (Ping timeout: 268 seconds) |
18:08:40 | * | watzon quit (Ping timeout: 268 seconds) |
18:08:40 | * | vindaar[m] quit (Ping timeout: 268 seconds) |
18:09:01 | * | superbia quit (Quit: WeeChat 3.1) |
18:09:23 | * | MTRNord quit (Ping timeout: 246 seconds) |
18:09:23 | * | liblq-dev quit (Ping timeout: 246 seconds) |
18:09:23 | * | reversem3 quit (Ping timeout: 246 seconds) |
18:09:25 | * | j-james[m] quit (Ping timeout: 265 seconds) |
18:09:26 | * | sunwukong quit (Ping timeout: 240 seconds) |
18:09:41 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=2SXT |
18:09:53 | * | BitPuffin quit (Ping timeout: 268 seconds) |
18:24:18 | ForumUpdaterBot | New thread by Livingstone1337: Issues with indentations and for loops, see https://forum.nim-lang.org/t/7634 |
18:38:06 | * | GitterIntegratio joined #nim |
18:45:05 | * | fputs quit (Quit: WeeChat 3.1) |
18:56:17 | giaco_ | I need to interface with a SOAP service and I'm using gsoap to build bindings automatically from wsdl(s) file(s). It works and next step would be running c2nim, but I have zero experience with it. With gsoap I have many options for generating both C or C++ code, but I'm now sure which way to go to make it easier to wirk with nim. What do you suggest? |
18:56:42 | giaco_ | s/now/not |
18:56:52 | giaco_ | s/wirk/work |
19:12:12 | * | NimBot joined #nim |
19:12:17 | * | ddevault_ is now known as ddevault |
19:12:55 | * | Kaivo joined #nim |
19:14:16 | FromDiscord | <zidsal> I've enabled `--experimental:strictFuncs` in my project and one of my func's now fails to compile as it think's it has side effects. This is due to the following line ` let columnName = columnNode["name"].str` now columnName itself is readonly in the rest of my code. Should this be flagged up as a side effect? is there a way for me to tell the compiler that this is readonly and no side effects are being introduced? |
19:28:51 | * | BitPuffin joined #nim |
19:28:51 | * | j-james[m] joined #nim |
19:28:51 | * | watzon joined #nim |
19:28:52 | * | antholop[m] joined #nim |
19:28:53 | * | Avahe[m] joined #nim |
19:28:53 | * | k0mpjut0r joined #nim |
19:28:53 | * | MTRNord joined #nim |
19:28:53 | * | i_use_arch_btw[m joined #nim |
19:28:53 | * | reversem3 joined #nim |
19:28:53 | * | Avatarfighter[m] joined #nim |
19:28:53 | * | lnxw37d4 joined #nim |
19:28:53 | * | liblq-dev joined #nim |
19:28:53 | * | stisa joined #nim |
19:28:54 | * | leorize[m] joined #nim |
19:28:54 | * | Benjamin[m]2 joined #nim |
19:28:54 | * | vindaar[m] joined #nim |
19:28:54 | * | sunwukong joined #nim |
19:28:54 | * | fbpyr[m] joined #nim |
19:28:54 | * | unclechu joined #nim |
19:28:54 | * | jfondren[m] joined #nim |
19:28:58 | * | Zoom[m] joined #nim |
19:28:58 | * | rwiser[m] joined #nim |
19:28:58 | * | drbixx[m] joined #nim |
19:28:58 | * | sekao[m] joined #nim |
19:28:59 | * | ee7[m] joined #nim |
19:28:59 | * | retroedgetech[m] joined #nim |
19:28:59 | * | zazi[m] joined #nim |
19:29:00 | * | Stephen[m]2 joined #nim |
19:29:00 | * | Clonkk[m] joined #nim |
19:29:00 | * | nxnl[m] joined #nim |
19:29:01 | * | vegai1 joined #nim |
19:29:30 | * | ShalokShalom[m] joined #nim |
19:31:39 | * | ddevault_ joined #nim |
19:31:50 | * | kali___ quit (Ping timeout: 264 seconds) |
19:31:50 | * | ddevault quit (Ping timeout: 264 seconds) |
19:32:26 | * | m4r35n357 quit (Ping timeout: 264 seconds) |
19:32:27 | * | joast quit (Ping timeout: 264 seconds) |
19:32:53 | FromDiscord | <haxscramper> You have `columnName` assignment inside of the function definition? |
19:33:25 | * | ddevault_ is now known as ddevault |
19:33:44 | * | kali___ joined #nim |
19:37:19 | * | icebattle joined #nim |
19:38:04 | FromDiscord | <zetashift> In reply to @giaco_ "I need to interface": I'm not entirely sure what you want? You want to bind to gsoap? If c2nim is a bit too spartan for you, you could try out `nimterop` which is easier to use, and afaik has more examples |
19:41:21 | * | m4r35n357 joined #nim |
19:51:10 | FromDiscord | <gollark> I'm running an instance of nimforum for reasons, is there a way to embed external images? |
19:52:16 | FromDiscord | <Yardanico> of course, since it's running RST |
19:52:26 | FromDiscord | <zidsal> @haxscramper yes that's correct, columnName is passed into an instance of a new object but its not a ref object so I am kind of confused on where it thinks the side effect is |
19:52:46 | FromDiscord | <Yardanico> In reply to @gollark "I'm running an instance": there's a quick cheatsheet https://forum.nim-lang.org/about/rst (it even exists on your instance), but you should look into RST |
19:54:06 | FromDiscord | <gollark> Ah, that seems to work, it was being weird since the message didn't contain anything but the image I think. |
19:54:25 | FromDiscord | <haxscramper> In reply to @zidsal "<@!608382355454951435> yes that's correct,": Yes, it does sound pretty strange. String funcs should only change anything if you had `proc(arg: ref T) = mutate(arg)`, which is not the case. Maybe `[]` operator mutates something, (or `.str`, though i suppose it is a field). |
19:55:15 | FromDiscord | <haxscramper> Is `columnNode` a ref table? IIRC `[]` access does not mutate anything, but this is the only idea I have. If you could share the code it would be possible to say more of course |
19:57:39 | * | waleee-cl joined #nim |
19:59:34 | FromDiscord | <zidsal> @haxscramper columnNode is a JsonNode which is ref object of JsonNodeObj I've stripped down my code to a very small example https://play.nim-lang.org/#ix=2SYs its a shame the playground doesn't let you pass in flags like use arc or strictFuncs |
19:59:56 | FromDiscord | <Yardanico> you can enable strictFuncs with {.experimental: "strictFuncs".} though |
20:00:22 | FromDiscord | <zidsal> ah perfect let me strip this down some more then |
20:00:32 | FromDiscord | <Yardanico> also @zidsal it works for me with strictFuncs ? |
20:00:43 | FromDiscord | <Yardanico> what nim version are you on? |
20:01:03 | FromDiscord | <zidsal> 1.4.2 let me put this in a standalone nimfile and see what happens |
20:01:09 | FromDiscord | <Yardanico> ah nvm you need it in the command line yeah |
20:01:13 | FromDiscord | <Yardanico> or at the top of the file |
20:01:31 | FromDiscord | <Yardanico> actually no, just at command line works |
20:02:59 | FromDiscord | <zidsal> thats weird when I chuck that ina standalone nim file, it fails for me |
20:03:33 | FromDiscord | <Yardanico> yeah i meant that experimental:strictFuncs needs to be in command line |
20:03:38 | FromDiscord | <zidsal> ah gotcha |
20:04:01 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2SYu |
20:04:55 | FromDiscord | <Valor> didnt go to the nim meetup, was there anything important that happened |
20:05:05 | FromDiscord | <zidsal> interestingly the `[]` operator isn't marked as side effect free, but if you disable the strict check's it passes |
20:05:17 | FromDiscord | <Yardanico> @zidsal it doesn't have to be marked as side-effect free |
20:05:53 | FromDiscord | <zidsal> oh I thought any side effect free can only call side effect free functions? is this ignored because it's inline or have I missunderstood |
20:06:08 | FromDiscord | <Yardanico> nonono, "marked" |
20:06:35 | FromDiscord | <Yardanico> if you're calling some proc (which is not annotated in any way) from a func or a proc {.noSideEffect.}, nim will check if it's side-effect free anyway |
20:06:39 | FromDiscord | <Yardanico> because that's what it's all about |
20:06:49 | FromDiscord | <Yardanico> /home/dian/Things/Nim/lib/pure/json.nim(482, 6) Error: '[]' can have side effects↵an object reachable from 'node' is potentially mutated↵/home/dian/Things/Nim/lib/pure/json.nim(489, 16) the mutation is here |
20:07:36 | FromDiscord | <zidsal> oh, I didn't realise it went that far, I wonder why it think's thats a mutation as the table is not a ref object, wouldn't nim make a copy of the value anyway when I store it in my let columnName |
20:07:50 | FromDiscord | <Yardanico> I think it happens due to the fact that in `result = node.fields[name]` node.fields[name] returns a `var JsonNode` |
20:08:08 | FromDiscord | <Yardanico> lemme minimize the example |
20:12:11 | FromDiscord | <haxscramper> In reply to @バロザード "didnt go to the": It was mostly about the current state of IC, and saem also talked about his work on semcheck/nimsuggest |
20:12:25 | FromDiscord | <Valor> i have no idea what either of those things are lol |
20:12:38 | FromDiscord | <haxscramper> IC is incremental compilation |
20:13:09 | FromDiscord | <Valor> oh |
20:13:14 | FromDiscord | <Valor> why is that important? |
20:14:08 | FromDiscord | <haxscramper> There are many reasons. First and most obvious one is "faster compilation", but it also implemented in a way that would allow external tooling to use information that nim compiler has |
20:14:54 | FromDiscord | <Valor> oh thats coool |
20:14:54 | FromDiscord | <Valor> would it be releated to wasm? |
20:15:19 | * | kali___ is now known as kaliy |
20:15:44 | FromDiscord | <haxscramper> No. Well, you won't benefit from it directly, except for faster compilation, but it enables better tooling support for some scenarios |
20:16:30 | FromDiscord | <haxscramper> So it is mostly a compiler implementation detail. I think. |
20:16:51 | FromDiscord | <Valor> ah k |
20:17:01 | FromDiscord | <Valor> whats semcheck/nimsuggest |
20:17:40 | * | vicfred_ quit (Quit: Leaving) |
20:18:00 | FromDiscord | <haxscramper> semcheck and nimsuggest |
20:18:23 | FromDiscord | <haxscramper> latter one is completion that you are using (if you are using any completion in vscode (or whichever editor you are using)) |
20:18:36 | FromDiscord | <haxscramper> semcheck is a really internal compiler detail |
20:18:48 | FromDiscord | <haxscramper> (edit) "a really" => "an" |
20:19:10 | FromDiscord | <Valor> ah |
20:19:16 | FromDiscord | <Valor> so nimsuggest is like rust analyzer |
20:27:35 | FromDiscord | <Yardanico> @zidsal sorry for stealing your issue - https://github.com/nim-lang/Nim/issues/17387 |
20:27:41 | FromDiscord | <Yardanico> you can watch it to get notified when it gets fixed |
20:28:07 | FromDiscord | <zidsal> no problem yard 😛 |
20:28:29 | FromDiscord | <zidsal> glad it's a bug |
20:28:49 | FromDiscord | <Yardanico> for now you can do something like this: |
20:29:42 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2SYy |
20:30:15 | FromDiscord | <Yardanico> you only have to write it for that line, for others it's not necessary |
20:30:28 | FromDiscord | <zidsal> perfect thanks yard |
20:30:42 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2SYA |
20:40:19 | * | ddevault quit (Ping timeout: 256 seconds) |
20:42:01 | * | ddevault joined #nim |
20:42:22 | * | xet7 quit (Quit: Leaving) |
20:56:45 | * | kaliy quit (*.net *.split) |
20:56:45 | * | Vladar quit (*.net *.split) |
20:56:45 | * | dddddd quit (*.net *.split) |
20:56:45 | * | teiresias quit (*.net *.split) |
20:56:46 | * | blueberrypie quit (*.net *.split) |
20:57:02 | * | fredsted quit (*.net *.split) |
20:57:02 | * | federico3 quit (*.net *.split) |
20:57:02 | * | shashlick quit (*.net *.split) |
20:57:16 | * | kaliy joined #nim |
20:57:16 | * | Vladar joined #nim |
20:57:16 | * | dddddd joined #nim |
20:57:16 | * | teiresias joined #nim |
20:57:16 | * | fredsted joined #nim |
20:57:16 | * | blueberrypie joined #nim |
20:57:16 | * | federico3 joined #nim |
20:57:16 | * | shashlick joined #nim |
20:57:18 | * | haxscram` joined #nim |
20:57:18 | * | haxscram` quit (Remote host closed the connection) |
20:58:52 | * | haxscramper quit (Ping timeout: 265 seconds) |
21:00:21 | * | narimiran quit (Ping timeout: 246 seconds) |
21:04:24 | FromDiscord | <gollark> Does anyone know where the code of ForumUpdaterBot is? I want to bidirectionally bridge certain nimforum threads (on a selfhosted instance) to IRC and thought its code might be a good base. |
21:04:54 | * | sixtyten quit (Quit: Leaving) |
21:05:05 | FromDiscord | <gollark> Duckduckgoing it just shows IRC logs mentioning it. |
21:14:02 | FromDiscord | <zetashift> In reply to @gollark "Does anyone know where": this maybe: https://github.com/Yardanico/nimeventer ? |
21:15:07 | FromDiscord | <gollark> Seems like it, thanks. |
21:38:07 | * | shashlick quit (Ping timeout: 256 seconds) |
21:38:26 | * | shashlick joined #nim |
21:46:22 | * | nisstyre quit (Quit: WeeChat 2.9) |
21:47:48 | * | blueberrypie quit (Read error: Connection reset by peer) |
21:48:01 | * | blueberrypie joined #nim |
21:51:50 | FromDiscord | <ElegantBeef> @treeform Your benchmarking in that raytracer forum post is just beautiful, make a guest blog post on how to benchmark Nim 😛 |
21:52:21 | FromDiscord | <Yardanico> not all people have access to vtune, so it would be better to use something more platform-agnostic though :) |
21:52:29 | FromDiscord | <treeform> In reply to @ElegantBeef "<@!107140179025735680> Your benchmarking in": thanks, you think it can be adopted into a blog post? |
21:52:38 | FromDiscord | <ElegantBeef> With a bit more explanation probably |
21:52:47 | FromDiscord | <treeform> @Yardanico runs everywhere? |
21:53:00 | FromDiscord | <Yardanico> In reply to @treeform "<@!177365113899057152> runs everywhere?": but on non-intel the feature set is extremely limited |
21:53:44 | FromDiscord | <dom96> https://nim-lang.org/blog/2017/10/02/documenting-profiling-and-debugging-nim-code.html#profiling-your-code 😉 |
21:53:48 | FromDiscord | <treeform> I tried making my own profiler: https://github.com/treeform/proffy but its not ready yet. |
21:53:53 | FromDiscord | <treeform> Can you live with vtune till then? |
21:54:03 | FromDiscord | <dom96> (edit) removed "😉" |
21:54:20 | FromDiscord | <dom96> You can use valgrind for profiling. I do like the style of your post though treeform |
21:54:27 | FromDiscord | <Yardanico> I just meant that there are vtune alternatives if you would want to make a proper post |
21:54:34 | FromDiscord | <Yardanico> but yeah a blog post like that would be good |
21:54:37 | FromDiscord | <ElegantBeef> The snarky condescension reads well 😛 |
21:54:58 | FromDiscord | <Yardanico> that was actually kind of a typo :P |
21:55:42 | FromDiscord | <treeform> I use vTune and AMD's prof. But AMD prof just kind of sucks its missing tons of features of vTune. |
21:56:00 | FromDiscord | <treeform> I also use the Nsight but that's GPU only. |
21:56:19 | FromDiscord | <Yardanico> @treeform yeah I just mean there are profilers based on `perf` and `valgrind` and many otherws |
21:56:20 | FromDiscord | <Yardanico> (edit) "otherws" => "others" |
21:56:27 | FromDiscord | <treeform> The callgrind/linux tools just don't work for me on windows. |
21:56:59 | FromDiscord | <treeform> @Yardanico can you recommend me one that is good? |
21:58:10 | FromDiscord | <ElegantBeef> We really need to get the message out to use `-d:danger -d:lto --:gc:arc` for speed tests 😄 |
21:58:58 | FromDiscord | <ElegantBeef> I think my clippy idea is the best, when compiling any program have clippy in the cli saying "Are you going for speed, consider trying these options" 😛 |
21:58:59 | FromDiscord | <treeform> and `--passC:"-march=native"` ? |
21:59:03 | FromDiscord | <Yardanico> @treeform oh, forgot that you're on linux :( |
21:59:10 | FromDiscord | <ElegantBeef> He's on windows |
21:59:17 | FromDiscord | <Yardanico> yeah I meant to say windows |
21:59:29 | FromDiscord | <Yardanico> @treeform well that'd be a bit cheating since that's not usually used in benchmarks |
21:59:31 | FromDiscord | <ElegantBeef> One of the few nim programmers that uses windows |
21:59:35 | FromDiscord | <Yardanico> (by other languages like C/C++) |
21:59:47 | FromDiscord | <zidsal> I'm on windows too (due to lazyness) |
21:59:54 | FromDiscord | <ElegantBeef> Could also do PDO or whatever it's called |
22:00:00 | FromDiscord | <ElegantBeef> But yea again cheating |
22:00:15 | FromDiscord | <Yardanico> PGO |
22:00:24 | FromDiscord | <treeform> In reply to @ElegantBeef "One of the few": Some one has to suffer for everyone else benefit of multi platform support. |
22:00:31 | FromDiscord | <Yardanico> same goes for LTO too |
22:00:39 | FromDiscord | <Yardanico> in benchmarks C/C++ don't usually use it |
22:00:41 | FromDiscord | <Yardanico> idk why though |
22:00:49 | FromDiscord | <Yardanico> LTO is totally free |
22:00:54 | FromDiscord | <Yardanico> just a bit longer compile times |
22:01:05 | FromDiscord | <ElegantBeef> Treeform you know that's what we appreciates about you (A letterkenney reference no one will get here) |
22:01:18 | FromDiscord | <Yardanico> for benchmarks PGO is real cheating since it'll optimize the code based on the runtime profile data |
22:01:27 | FromDiscord | <Yardanico> but for real apps PGO is really good |
22:01:33 | FromDiscord | <Yardanico> if you have good test cases that is |
22:02:19 | FromDiscord | <ElegantBeef> How do you envision proffy working, drop a pragma on a procedure and it outputs it's performance usage when it's called? |
22:02:46 | FromDiscord | <treeform> When I make websites that run on linux, I use linux. When I make games for mostly windows people I run windows. |
22:02:55 | FromDiscord | <Yardanico> "## Frame based instrumentation profiler for games." is that still true for proffy? |
22:03:08 | FromDiscord | <Yardanico> it's for games specifically or just a general profiler? |
22:03:30 | FromDiscord | <treeform> In reply to @ElegantBeef "How do you envision": Yeah some thing like that. I was just doing enter section / exist section. |
22:03:57 | FromDiscord | <treeform> In reply to @Yardanico "it's for games specifically": Its very early and I kind of stopped and never released the project. |
22:04:15 | * | nisstyre joined #nim |
22:04:22 | FromDiscord | <ElegantBeef> Yea i might contribute to it if i figure out what needs to be done, these raspberry pi pico bindings are being prickish at points 😄 |
22:04:33 | FromDiscord | <treeform> There are two profile modes you can have statistical (where you sample the stack frame at very N ns) and instrumented (where programmers measure what they want to measure) |
22:04:40 | FromDiscord | <treeform> There are advantages of both. |
22:04:55 | FromDiscord | <treeform> And I almost feel like they can be combined. But not sure... |
22:05:15 | FromDiscord | <ElegantBeef> The cool thing would be feeding the trace to another program to get those fancy graphs |
22:05:27 | FromDiscord | <zidsal> flame graphs are nice for that kind of stuff |
22:05:59 | FromDiscord | <ElegantBeef> After using Unity's it's just annoying i prefer a hierarchical view |
22:06:16 | FromDiscord | <ElegantBeef> Though Unity's includes all functions |
22:07:32 | FromDiscord | <treeform> https://media.discordapp.net/attachments/371759389889003532/821142594541191179/unknown.png |
22:07:37 | FromDiscord | <treeform> this is what I had |
22:07:49 | FromDiscord | <Yardanico> earthsea leaked |
22:07:59 | FromDiscord | <ElegantBeef> That's a flame graph alright 😄 |
22:08:04 | FromDiscord | <sealmove> what's the way to go to circumvent that the discriminator of an object variant must be an ordinal? |
22:08:09 | FromDiscord | <treeform> yep |
22:08:15 | FromDiscord | <sealmove> for example if you want to discriminate on a string |
22:08:16 | FromDiscord | <Yardanico> @sealmove there's no way, it must be an ordinal |
22:08:30 | FromDiscord | <sealmove> yeah, I mean, common alternatives for modelling this situation |
22:08:36 | FromDiscord | <Yardanico> use an enum |
22:08:41 | FromDiscord | <ElegantBeef> you could use the hash of the string, though not very ergonomic 😄 |
22:09:03 | FromDiscord | <sealmove> :o +1 for hash of string |
22:09:27 | FromDiscord | <ElegantBeef> I mean i'd not suggest it, it's just an enum with extra steps |
22:12:28 | FromDiscord | <sealmove> true |
22:14:14 | FromDiscord | <sealmove> sent a code paste, see https://paste.rs/WFV |
22:15:00 | FromDiscord | <ElegantBeef> How is that better than just `type myEnum = enum First, Second` |
22:15:01 | FromDiscord | <sealmove> sent a code paste, see https://play.nim-lang.org/#ix=2SZ3 |
22:15:35 | FromDiscord | <ElegantBeef> unless the names are just placeholder |
22:16:17 | FromDiscord | <Yardanico> on the topic of profilers |
22:16:18 | FromDiscord | <sealmove> yeah if you want to parse the specific string. for `parseEnum` to work |
22:16:19 | FromDiscord | <Yardanico> found https://github.com/google/orbit |
22:18:21 | FromDiscord | <treeform> I think I tried it. Some thing was off. |
22:18:34 | FromDiscord | <treeform> The screenshot looks great though. |
22:19:50 | FromDiscord | <Yardanico> ill try to build it on linux now |
22:21:29 | FromDiscord | <Yardanico> maybe I won't - https://github.com/google/orbit/issues/1746 |
22:21:33 | FromDiscord | <Yardanico> don't want to rebuild LLVM just for it |
22:21:41 | FromDiscord | <Yardanico> (edit) "rebuild" => "build" |
22:21:42 | FromDiscord | <treeform> they did not ship an exe, I found it hard to build on windows |
22:21:46 | FromDiscord | <treeform> so I gave up |
22:21:50 | FromDiscord | <treeform> that's what happend |
22:29:34 | FromDiscord | <sealmove> sent a code paste, see https://paste.rs/Sy2 |
22:34:20 | FromDiscord | <Yardanico> 11k stars soon |
22:34:22 | FromDiscord | <Yardanico> 10972 rn |
22:37:45 | * | Tuatarian quit (Quit: Quit) |
22:46:11 | * | tane quit (Quit: Leaving) |
23:15:03 | * | krux02 quit (Remote host closed the connection) |