00:04:14 | FromDiscord | <TryAngle> sent a code paste, see https://play.nim-lang.org/#ix=3GVB |
00:05:45 | FromDiscord | <TryAngle> sent a code paste, see https://play.nim-lang.org/#ix=3GVD |
00:10:28 | FromDiscord | <TryAngle> hahah |
00:10:33 | FromDiscord | <TryAngle> I made a type |
00:10:56 | FromDiscord | <TryAngle> never mid 😂 ↵(: -> = at end of initializeLog) |
00:11:02 | FromDiscord | <TryAngle> (edit) "mid" => "mind" |
00:17:12 | * | Guest87 quit (Quit: Client closed) |
00:20:17 | * | src quit (Quit: Leaving) |
01:04:33 | * | krux02 quit (Remote host closed the connection) |
01:10:13 | * | noeontheend quit (Ping timeout: 252 seconds) |
01:26:47 | FromDiscord | <Alea> are nimdocs failing to load for anyone else? |
01:32:08 | FromDiscord | <huantian> Is there a way to `.join` the output of a `collect` without setting it to a variable first? |
01:32:36 | FromDiscord | <Elegantbeef> Use `()` to wrap collect then do `.join` |
01:35:00 | FromDiscord | <huantian> ah |
01:37:32 | FromDiscord | <huantian> hmm doesn't seem happy, am I doing this right? https://media.discordapp.net/attachments/371759389889003532/916503451742109696/unknown.png |
01:45:38 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3GWc |
01:45:42 | FromDiscord | <huantian> oh |
01:47:24 | FromDiscord | <huantian> that makes mores sense, thanks |
01:53:43 | FromDiscord | <amadan> In reply to @Alea "are nimdocs failing to": Seems to fail for me also |
02:26:29 | * | neurocyte0132889 quit (Ping timeout: 252 seconds) |
02:44:14 | FromDiscord | <huantian> If I got an IntSet that I know has one element, what's the best way to get that element? |
02:45:30 | FromDiscord | <Elegantbeef> `pop` |
02:46:05 | FromDiscord | <huantian> that's giving me a `type mismatch: got <IntSet>` |
02:46:24 | FromDiscord | <Elegantbeef> Wait you said intset |
02:46:27 | FromDiscord | <Elegantbeef> I was in sets |
02:47:09 | FromDiscord | <Elegantbeef> Seems the best thing to do is iterate over the thing and emit the first value |
02:48:19 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3GWv |
02:50:15 | FromDiscord | <huantian> cool cool!↵Just want to double check, if I want to make a .. slice to a HashSet or IntSet, `.toSeq.toIntSet` is the best way to do it? |
02:50:39 | FromDiscord | <Elegantbeef> Uhh a slice of a intset doesnt make much sense |
02:51:00 | FromDiscord | <huantian> something like `(1..10).toSeq.toIntSet` |
02:51:12 | FromDiscord | <Elegantbeef> Oh if you want a intset of a range |
02:51:25 | FromDiscord | <Elegantbeef> If it's a limited range like that you dont need `intSet` |
02:51:34 | FromDiscord | <Elegantbeef> you can just do `var a = {1..10}` |
02:52:34 | FromDiscord | <huantian> oh nice |
02:52:43 | FromDiscord | <Elegantbeef> But yea that's probably the best way to do it if you do have a set with more than 65k range |
02:53:07 | FromDiscord | <Elegantbeef> Nim's builtin set is limited to `high - low == uint16.high` |
02:54:43 | FromDiscord | <huantian> interesting |
02:55:01 | FromDiscord | <Rika> In reply to @zidsal "What in the uniform": It’s not UFCS, it’s an operator, so it’s special |
03:25:52 | FromDiscord | <Twily> sent a long message, see http://ix.io/3GWG |
03:26:40 | FromDiscord | <Twily> Any ideas why I’m getting this and any way to overcome this? And hack maybe? |
03:27:00 | FromDiscord | <Yardanico> are you using converters by any chance? |
03:27:09 | FromDiscord | <Yardanico> i mean, maybe you have converters or the libraries you use have them |
03:27:16 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3GWH |
03:27:29 | FromDiscord | <Yardanico> beef, won't you need to do `import system/dollars` explicitly? |
03:27:29 | FromDiscord | <Elegantbeef> Converters have a big old bug that they propagate up unexported |
03:27:39 | FromDiscord | <Elegantbeef> probably |
03:28:03 | FromDiscord | <Yardanico> ah nvm you don't need the import apparently |
03:28:27 | FromDiscord | <Twily> Converters? |
03:28:29 | FromDiscord | <Yardanico> yes |
03:28:36 | FromDiscord | <Yardanico> what libraries are you using? |
03:28:48 | FromDiscord | <Yardanico> i mean modules, maybe something like, say, raylib, or sdl2 or something |
03:28:54 | FromDiscord | <Yardanico> they might have some converters that affect your code |
03:29:04 | FromDiscord | <Twily> sent a code paste, see https://play.nim-lang.org/#ix=3GWI |
03:29:13 | FromDiscord | <Twily> types and ipc are internal |
03:29:24 | FromDiscord | <Yardanico> and types and ipc don't import anything else outside of the stdlib? |
03:29:56 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3GWJ |
03:30:32 | FromDiscord | <Twily> sent a code paste, see https://play.nim-lang.org/#ix=3GWK |
03:30:55 | FromDiscord | <Yardanico> oh, is dbus a third-party lib? |
03:31:05 | FromDiscord | <Elegantbeef> https://github.com/zielmicha/nim-dbus/blob/74ec59f1813ae701764426c4ea0f11e092aefbe6/dbus/private/bus.nim#L3 |
03:31:07 | FromDiscord | <Twily> Yep, pretty old one |
03:31:08 | FromDiscord | <Yardanico> https://github.com/zielmicha/nim-dbus/blob/master/dbus/private/bus.nim#L3 yeah |
03:31:10 | FromDiscord | <Elegantbeef> There's the bastard |
03:31:13 | FromDiscord | <Yardanico> :DDD |
03:31:32 | FromDiscord | <Yardanico> so @Twily the issue is |
03:31:38 | FromDiscord | <Yardanico> dbus_bool_t is actually just an alias for uint32 |
03:31:49 | FromDiscord | <Yardanico> so the converter is actually for implicitly converting uint32 into bool |
03:31:54 | FromDiscord | <Yardanico> in this case |
03:32:07 | FromDiscord | <Elegantbeef> And thanks to that afformentioned bug, it fucks everything up |
03:32:08 | FromDiscord | <Yardanico> and since converters propagate too much it changes your code too |
03:32:27 | FromDiscord | <Twily> I don’t get how bools are related here. I’m purely working with `uint32` and `string` |
03:32:46 | FromDiscord | <Elegantbeef> There is a converter to `bool` which comes up and ruins your day |
03:32:58 | FromDiscord | <Yardanico> ah @beef actually dbus_uint32_t = cuint |
03:33:01 | FromDiscord | <Twily> And why didn’t it break before? |
03:33:01 | FromDiscord | <Yardanico> but cuint is an alias for uint32 anyway |
03:33:10 | FromDiscord | <Yardanico> @Twily because you didn't try to $ a uint32 ? |
03:33:14 | FromDiscord | <Yardanico> when having dbus imported |
03:33:25 | FromDiscord | <Elegantbeef> This is a new bug in 1.6 so that's another reason |
03:33:33 | FromDiscord | <Yardanico> a regression, yeah |
03:33:49 | FromDiscord | <Twily> [Yardanico](https://matrix.to/#/%40Tiberium%3Amatrix.org) nope. I actually did use dollar against this type before. I’m compiling the same. Just updated my NixOS and it got newer Nim compiler version. |
03:33:56 | FromDiscord | <Twily> Previously it used to work. |
03:34:03 | FromDiscord | <Yardanico> yeah, it's a regression in 1.6. |
03:34:06 | FromDiscord | <Yardanico> hopefully it gets fixed in 1.6.2 |
03:34:28 | FromDiscord | <Twily> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/916532717385031810): [Yardanico](https://matrix.to/#/%40Tiberium%3Amatrix.org) nope. I actually did use dollar against this type before. I’m compiling the same code. Just updated my NixOS and it got newer Nim compiler version. |
03:34:37 | FromDiscord | <Yardanico> @beef do you remember the issue # ? |
03:36:50 | FromDiscord | <Elegantbeef> Doesnt seem like there is a nim issue comically |
03:36:53 | FromDiscord | <xflywind> https://discord.com/channels/371759389889003530/371759389889003532/908319224739553280 |
03:37:18 | FromDiscord | <Yardanico> @beef i remember seeing an issue like that, maybe my imagination... |
03:37:57 | FromDiscord | <Yardanico> https://github.com/nim-lang/Nim/issues/18986 |
03:38:39 | FromDiscord | <Yardanico> hmmm |
03:40:06 | FromDiscord | <Twily> So as I understand there was no test before that could get caught this and this regression was released? |
03:45:04 | FromDiscord | <Yardanico> yes |
03:45:13 | FromDiscord | <Yardanico> @beef i'll open an issue anyway |
03:48:41 | FromDiscord | <Twily> [Yardanico](https://matrix.to/#/%40_discord_177365113899057152%3At2bot.io) why would you open a new issue if there is already one? |
03:49:00 | FromDiscord | <Yardanico> because it's about a different thing |
03:49:01 | FromDiscord | <Yardanico> i think |
03:49:46 | FromDiscord | <Twily> To me it looks exactly about the same problem. At least looking at the examples and the error message. |
03:50:18 | FromDiscord | <Yardanico> no, for me it looks different - first of all, in pmunch's code it's all in the same file |
03:50:33 | FromDiscord | <Yardanico> and second of all, in his case it's not a regression since the same code fails all the way back to 1.0 |
03:50:38 | FromDiscord | <Yardanico> while your code works on 1.4.8 and older |
03:50:42 | FromDiscord | <Yardanico> https://github.com/nim-lang/Nim/issues/19213 |
03:52:40 | FromDiscord | <Yardanico> i'll try to bisect |
03:53:21 | NimEventer | New thread by Icedquinn: Protobuf essentials, see https://forum.nim-lang.org/t/8675 |
03:57:14 | * | mahlon quit (Ping timeout: 252 seconds) |
04:06:01 | * | supakeen quit (Quit: WeeChat 3.3) |
04:06:30 | * | supakeen joined #nim |
04:17:32 | * | arkurious quit (Quit: Leaving) |
05:30:57 | * | xet7 joined #nim |
05:39:36 | FromDiscord | <Cypheriel> Does Nim have anything similar to Python's ``... |
05:39:51 | FromDiscord | <Cypheriel> like... `print([1, 2, 3, 4])` type stuff |
06:01:58 | FromDiscord | <Rika> No not really |
06:02:09 | FromDiscord | <Rika> Var args accepts sequences |
06:02:32 | FromDiscord | <Yardanico> In reply to @Cypheriel "like... `print(*[1, 2, 3,": in this case you can just use `join` from strutils btw |
06:02:41 | FromDiscord | <Yardanico> echo elems.join(", ") |
06:05:25 | FromDiscord | <Cypheriel> hm... but for things like `zip`, I don't think it works as I'd expect |
06:06:41 | FromDiscord | <Rika> Zip only takes two sequences |
06:06:51 | FromDiscord | <Rika> There are no three or four sequence zip procs |
06:07:04 | FromDiscord | <Cypheriel> ah... then that is unlike Python |
06:07:42 | FromDiscord | <Rika> A more flexible zip can be made but I assume that would need to go to macro level |
06:09:00 | tk | https://github.com/void-linux/void-packages/pull/34106 - Voidlinux now shipping nim 1.6.0 |
06:10:49 | FromDiscord | <Michal58> I'm trying to learn some arraymancer |
06:11:04 | FromDiscord | <Michal58> how do I compare a Tensor to a scalar? |
06:12:06 | FromDiscord | <Michal58> `array == n` nor `array .== n` does not seem to do it |
06:14:19 | FromDiscord | <Yardanico> try asking in #science too |
06:15:37 | NimEventer | New thread by Jorjun_arch: What is programming?, see https://forum.nim-lang.org/t/8676 |
06:19:16 | FromDiscord | <Michal58> Oh, is it `==.` |
07:02:25 | * | mahlon joined #nim |
08:11:17 | * | xet7 quit (Quit: Leaving) |
08:15:44 | FromDiscord | <hugogranstrom> In reply to @Michal58 "Oh, is it `==.`": Yes in arraymancer all "dot" operators are defined in reverse from what you are used to in other languages. we use `+.` instead of `.+` for example. The reason is that we need to put the actual symbol first to get the right operator precedence |
08:16:09 | * | krux02 joined #nim |
08:28:20 | * | krux02 quit (Remote host closed the connection) |
08:57:49 | FromDiscord | <TryAngle> how do I get the pointer of a variable? |
08:58:46 | FromDiscord | <Rika> addr |
09:23:29 | FromDiscord | <TryAngle> In reply to @Rika "addr": thanks |
09:32:26 | FromDiscord | <tbrekalo> are array's stack or heap allocated? |
09:33:59 | FromDiscord | <Elegantbeef> Stack |
09:40:42 | * | tinystoat quit (Remote host closed the connection) |
10:00:17 | FromDiscord | <Yardanico> also, if you can allocate them on the heap, you can by using `ref` |
10:00:29 | FromDiscord | <Yardanico> but then they won't be much different from `seq` |
10:00:37 | FromDiscord | <Yardanico> (edit) "can" => "want to" |
10:02:25 | FromDiscord | <fumamatar> Is there a module like scapy for python, for manipulation of packets or analysis of packets? or do I need to start and write my own? |
10:08:59 | FromDiscord | <leorize> i think there should be libpcap wrappers that you can use |
10:09:09 | FromDiscord | <leorize> nimble.directory is your friend on this one |
10:38:09 | * | xet7 joined #nim |
10:38:43 | FromDiscord | <firasuke> sent a long message, see http://ix.io/3GYn |
10:39:26 | FromDiscord | <Yardanico> the most "complete" auto-complete that we have is vscode + nim plugin that uses nimsuggest |
10:39:31 | FromDiscord | <Yardanico> there is nimpretty but it still has bugs |
10:40:45 | FromDiscord | <Rika> no, there is not "complete" autocomplete that doesnt use nimsuggest. |
10:40:48 | FromDiscord | <firasuke> In reply to @Yardanico "the most "complete" auto-complete": I found vscodium + the nim plugin to be the better ouf of the bunch |
10:40:50 | FromDiscord | <Rika> (edit) "not" => "no" |
10:41:00 | FromDiscord | <firasuke> what runners are you using? |
10:41:08 | FromDiscord | <Rika> theyre all nimsuggest in the end |
10:41:11 | FromDiscord | <firasuke> also for debugging, is GDB the mainstream way? |
10:41:13 | FromDiscord | <Rika> so it doesnt really matter too much |
10:41:17 | FromDiscord | <Yardanico> In reply to @firasuke "what runners are you": i don't use runners :) |
10:41:18 | FromDiscord | <firasuke> In reply to @Rika "theyre all nimsuggest in": I see |
10:41:27 | FromDiscord | <Rika> runner? |
10:41:28 | FromDiscord | <firasuke> In reply to @Yardanico "i don't use runners": Oh, then do you have for tasks |
10:41:36 | FromDiscord | <Rika> does the terminal count |
10:41:38 | FromDiscord | <Yardanico> i don't really use tasks in vscode |
10:41:47 | FromDiscord | <Yardanico> just the shell |
10:41:51 | FromDiscord | <firasuke> In reply to @Rika "does the terminal count": ya well I can manually run it in a terminal |
10:42:05 | FromDiscord | <Yardanico> In reply to @firasuke "also for debugging, is": yeah, with nim-gdb it's usable |
10:42:08 | FromDiscord | <firasuke> I want something out of the box that does that in vscode |
10:42:17 | FromDiscord | <Rika> dunno, i dont use vscode |
10:42:25 | FromDiscord | <firasuke> what do you use then? |
10:42:49 | FromDiscord | <Rika> neovim |
10:42:59 | FromDiscord | <firasuke> I also don't use vscode, but I heard it has the best support for Nim, so I downloaded it lol |
10:43:26 | FromDiscord | <Rika> id argue its neovim with the best support but that depends on what you want most |
10:43:49 | FromDiscord | <hmmm> I use sublimetext with nimline 😋 the nim tooling is inferior but the editor is better :nim1: |
10:44:05 | FromDiscord | <firasuke> In reply to @Rika "id argue its neovim": What plugins are you using with neovim then |
10:44:17 | FromDiscord | <Rika> nim.nvim or whatever its called |
10:44:18 | FromDiscord | <firasuke> native nvim-lsp, nim-lsp, ale, coc, cmp? |
10:44:30 | FromDiscord | <firasuke> In reply to @Rika "nim.nvim or whatever its": doesn't support autocomplete |
10:44:30 | FromDiscord | <Rika> + compe |
10:44:38 | FromDiscord | <Rika> compe + nim.nvim |
10:44:40 | FromDiscord | <firasuke> In reply to @Rika "+ compe": mhmm |
10:45:51 | FromDiscord | <firasuke> shouldn't you be using cmp since compe is deprecated? |
10:45:59 | FromDiscord | <Rika> compe is deprecated? |
10:46:11 | FromDiscord | <Rika> dude i havent changed my config in a while |
10:46:16 | FromDiscord | <Rika> cmp is alpha innit |
10:46:24 | FromDiscord | <firasuke> probably |
10:46:42 | FromDiscord | <Rika> i will switch once it is stable |
10:46:49 | FromDiscord | <firasuke> anyways thanks for the suggestion |
10:46:59 | FromDiscord | <firasuke> I'll see if I can get nim lsp working |
10:47:24 | FromDiscord | <Rika> i have yet to finish migrating my config to lua i just remembered |
10:47:25 | FromDiscord | <Rika> aaaaah |
10:47:41 | FromDiscord | <firasuke> oh btw which nim.vim are you using? zah or alaviss? |
10:48:15 | FromDiscord | <Yardanico> In reply to @firasuke "doesn't support autocomplete": huh? |
10:48:16 | FromDiscord | <Rika> alaviss |
10:48:19 | FromDiscord | <Rika> is the nvim one |
10:48:19 | FromDiscord | <Yardanico> https://github.com/alaviss/nim.nvim does support autocomplete |
10:48:21 | FromDiscord | <Rika> zah is for nim |
10:48:23 | FromDiscord | <Rika> vim |
10:48:27 | FromDiscord | <Rika> wrong -im word |
10:48:35 | FromDiscord | <firasuke> In reply to @Yardanico "https://github.com/alaviss/nim.nvim does support au": https://github.com/zah/nim.vim |
10:48:41 | FromDiscord | <firasuke> he meant this |
10:48:42 | FromDiscord | <Yardanico> that's for vim and it doesn't, yes |
10:48:46 | FromDiscord | <Yardanico> he meant alaviss one |
10:48:56 | FromDiscord | <Rika> yes |
10:48:58 | FromDiscord | <firasuke> 👍 |
10:51:29 | * | xet7 quit (Remote host closed the connection) |
11:21:32 | * | src joined #nim |
11:23:21 | FromDiscord | <tbrekalo> can I somehow store `<` operator as a function? something as `std::less<>` in c++? |
11:31:40 | FromDiscord | <Slava0135> aren't all operators functions |
11:31:44 | FromDiscord | <Rika> Yes, strop it |
11:31:52 | FromDiscord | <Rika> \`<` |
11:31:54 | FromDiscord | <tbrekalo> please elaborate |
11:32:01 | FromDiscord | <tbrekalo> aha; I'll try now; thanks @Rika |
11:32:09 | FromDiscord | <Slava0135> (edit) "aren't all operators ... functions" added "are" |
11:32:21 | FromDiscord | <Rika> Same goes for all other operators |
11:32:32 | FromDiscord | <Rika> Effectively it is an identifier |
11:33:35 | * | tinystoat joined #nim |
11:35:18 | FromDiscord | <tbrekalo> doesn't seem to work |
11:35:40 | FromDiscord | <tbrekalo> i tried something like: `let cmpFn = \`<\`` |
11:36:20 | FromDiscord | <Rika> Well I don’t think it can work like that because it can’t disambiguate what function it needs |
11:36:24 | FromDiscord | <Rika> Since it’s overloaded |
11:36:25 | FromDiscord | <Zoom> sent a code paste, see https://play.nim-lang.org/#ix=3GYv |
11:36:29 | FromDiscord | <Rika> Zoom, that is what they meant |
11:36:31 | FromDiscord | <Zoom> Secondly, you need to specify a type of the variable |
11:36:35 | FromDiscord | <Rika> Yes |
11:36:50 | FromDiscord | <Zoom> Because comparison operators are heavily overloaded |
11:37:09 | FromDiscord | <tbrekalo> how do I make specification for the type? |
11:37:19 | FromDiscord | <Zoom> And don't try to `typeof(`\<`)` \:D |
11:37:28 | FromDiscord | <Zoom> https://github.com/nim-lang/Nim/blob/270964c487e5347c61dade25bec903580483dda5/lib/system/comparisons.nim |
11:38:08 | FromDiscord | <Zoom> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/916654399290499072): And don't try to `typeof(\`\<\`)\` \:D |
11:38:19 | FromDiscord | <tbrekalo> aha; figured it out; `let cmpFn: proc(a: int, b: int): bool = '<'` |
11:38:35 | FromDiscord | <Zoom> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/916654399290499072): And don't try to `typeof(`<`)` \:D |
11:38:37 | FromDiscord | <tbrekalo> i can't put ` inside a code block; backslash was an atempt to escape it |
11:39:05 | FromDiscord | <Zoom> Surround in double graves |
11:42:17 | FromDiscord | <tbrekalo> could you send a code snippet for storing ``<`` as an int comparator? |
11:42:26 | FromDiscord | <tbrekalo> having a hard time getting it right; sorry |
11:46:22 | FromDiscord | <Zoom> sent a code paste, see https://play.nim-lang.org/#ix=3GYy |
11:46:33 | FromDiscord | <tbrekalo> thanks |
11:48:54 | FromDiscord | <Zoom> Error messages are helpful as usual. Complaining about `{.procvar.}` which is not even documented. (#12975) |
11:49:40 | FromDiscord | <Rika> Haha how fun |
11:50:01 | FromDiscord | <Rika> Seriously wish I could help with it but I’m still currently very intimidated by the compiler source |
11:53:29 | FromDiscord | <Zoom> What is fun is that my dumb suggestion is actually the solution provided by Ar@q\: https://github.com/nim-lang/Nim/issues/2172#issuecomment-304609785 |
11:54:54 | FromDiscord | <Rika> That’s frustrating |
11:59:28 | FromDiscord | <evoalg> @Rika I'm already using alaviss/nim.nvim on neovim, but I decided to give "cmp" a go since it was discussed above ... it's asking me to put in "YOUR_LSP_SERVER" ... what should I put in there for nim? |
12:00:15 | FromDiscord | <Rika> In reply to @evoalg "<@!259277943275126785> I'm already using": You don’t use LSP when you use the plugin |
12:00:49 | FromDiscord | <Rika> I am not at my computer right not but you make a bridge for the plugin to the suggestion hook in the Nim plugin |
12:01:18 | FromDiscord | <Rika> I’ll show you how to do it in compe, not sure if it directly translates to in cmp |
12:02:03 | FromDiscord | <Rika> (edit) "not" => "now" |
12:02:30 | FromDiscord | <evoalg> I'd be happy to try compe ... even tho the webpage says it's deprecated |
12:03:36 | FromDiscord | <Rika> It’s deprecated but I say it was done too early |
12:04:00 | FromDiscord | <Rika> Nonetheless later, when I’m home |
12:04:14 | FromDiscord | <evoalg> thank you! |
12:06:01 | * | supakeen quit (Quit: WeeChat 3.3) |
12:06:30 | * | supakeen joined #nim |
12:30:54 | * | jjido joined #nim |
12:31:36 | * | terminalpusher joined #nim |
12:38:56 | FromDiscord | <evoalg> ahh maybe I have to install nimlsp? ... can't do `nimble install nimlsp` as it breaks on my mac |
12:43:41 | FromDiscord | <Rika> You don’t if you’re using Nim.nvim |
12:50:13 | FromDiscord | <evoalg> ok .thx .. going to bed now, nights! |
13:04:49 | * | src quit (Ping timeout: 256 seconds) |
13:10:07 | * | src joined #nim |
13:11:00 | * | terminalpusher quit (Ping timeout: 256 seconds) |
13:36:02 | * | terminalpusher joined #nim |
13:42:10 | * | PMunch joined #nim |
14:03:40 | FromDiscord | <Rika> sent a code paste, see https://paste.rs/ywn |
14:09:27 | NimEventer | New thread by Cblake: TinyCC/tcc vs zig cc compile-times/etc., see https://forum.nim-lang.org/t/8677 |
14:14:25 | FromDiscord | <Rika> nice writeup about compile times |
14:15:33 | FromDiscord | <Schelz> Hi, im trying to make a window with gui using glfw, opengl and imgui and i keep getting the "could not load cimgui.dll" error message, any resolve for this error ? |
14:23:09 | * | arkurious joined #nim |
14:30:27 | FromDiscord | <firasuke> @PMunch Is it possible to use neovim with nimlsp + coc + alaviss/zah? Or is it not recommended? |
14:35:08 | FromDiscord | <Rika> you dont need alaviss if you have lsp |
14:35:13 | FromDiscord | <Rika> same with vice versa |
14:49:43 | PMunch | I use vim + nimlsp + zah |
14:49:55 | PMunch | So neovim + nimlsp + zah should work just fine |
14:50:01 | PMunch | Not sure what coc is though |
14:55:43 | FromDiscord | <Rika> lsp engine |
14:55:57 | FromDiscord | <Rika> rather autocomplete engine |
15:00:43 | PMunch | Ah right |
15:00:50 | PMunch | I thought neovim had LSP built in? |
15:02:17 | FromDiscord | <Rika> it "does" but its still a plugin |
15:02:37 | FromDiscord | <Rika> and thats not the autocomplete engine afaik, only the interface to lsp servers |
15:02:59 | FromDiscord | <firasuke> In reply to @PMunch "I use vim +": how are you getting autocompletion then? what are you using to run nimlsp from within vim? |
15:04:40 | FromDiscord | <firasuke> ale? |
15:07:43 | * | arkurious quit (Ping timeout: 256 seconds) |
15:11:19 | FromDiscord | <firasuke> also imports aren't being autocompleted? and is there something similar to `rustfmt` for Nim? Or are the indentations supposed to do away with such tools? |
15:11:32 | FromDiscord | <Rika> nimpretty |
15:12:34 | FromDiscord | <Rika> imports being autocompleted? what do you mean |
15:12:40 | FromDiscord | <Rika> nimsuggest does not have such a feature |
15:13:05 | FromDiscord | <firasuke> In reply to @Rika "imports being autocompleted? what": as I'm typing `import st` shouldn't I see a list of suggestions? |
15:13:14 | FromDiscord | <Rika> oh that is what you mean |
15:13:29 | FromDiscord | <Rika> i am unsure about such a feature ever existing |
15:13:32 | * | arkurious joined #nim |
15:13:36 | FromDiscord | <Rika> let me test |
15:13:40 | FromDiscord | <firasuke> ok |
15:14:05 | FromDiscord | <firasuke> also, say I wanted to use `.toLower`, would `nimsuggest` import `unicode` on its own? is there such a thing? |
15:14:33 | FromDiscord | <Rika> yup, no autocomplete for importrs |
15:14:37 | FromDiscord | <Rika> no |
15:14:38 | FromDiscord | <Rika> it wont |
15:14:46 | FromDiscord | <firasuke> I see, good to know |
15:14:51 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
15:14:58 | FromDiscord | <Rika> tooling is very poor yes |
15:15:04 | FromDiscord | <firasuke> coming from Rust, I thought I'd be expecting such tools |
15:15:11 | FromDiscord | <firasuke> such a shame though, Nim is very decent |
15:15:18 | FromDiscord | <Rika> rust is probably a few magnitudes larger than us |
15:15:29 | FromDiscord | <firasuke> In reply to @Rika "rust is probably a": ya, figured that one out xD |
15:15:50 | FromDiscord | <Rika> i mean i'd say its hard to expect such a thing given the size |
15:15:58 | FromDiscord | <Rika> but it still sucks i guess |
15:16:23 | FromDiscord | <Rika> and its not just size anyway that is blocking such tool development |
15:17:08 | FromDiscord | <firasuke> In reply to @Rika "and its not just": what other factors are contributing to this then? |
15:19:08 | PMunch | I use prabirshestha/vim-lsp |
15:19:16 | FromDiscord | <firasuke> In reply to @PMunch "I use prabirshestha/vim-lsp": Oh |
15:19:25 | FromDiscord | <Rika> the confusing/intimidating codebase of the compiler i guess, and the lack of documentation for internals |
15:20:10 | FromDiscord | <firasuke> I see |
15:22:09 | FromDiscord | <firasuke> neovim + coc + nimlsp aren't that bad though, they need a bit of polish and it'll be a nice experience overall |
15:22:26 | FromDiscord | <firasuke> https://media.discordapp.net/attachments/371759389889003532/916711049292550184/unknown.png https://media.discordapp.net/attachments/371759389889003532/916711049514852392/unknown.png |
15:23:02 | NimEventer | New Nimble package! paramidib - paramidi with nimib, see https://github.com/pietroppeter/paramidib |
15:25:24 | * | xet7 joined #nim |
15:25:56 | NimEventer | New thread by Icedquinn: Thriftcore - Apache Thrift primitives, see https://forum.nim-lang.org/t/8678 |
15:30:55 | PMunch | New AoC stream is live! https://www.twitch.tv/pmunche |
15:33:10 | * | vicecea quit (Remote host closed the connection) |
15:33:42 | * | vicecea joined #nim |
15:50:05 | * | noeontheend joined #nim |
16:31:06 | FromDiscord | <claude> what does nimpretty do other than wrap long lines, align arguments in parens/brackets etc and maybe enforce camelcase |
16:31:24 | FromDiscord | <Solitude> breaks working code |
16:35:14 | * | neurocyte0132889 joined #nim |
16:35:14 | * | neurocyte0132889 quit (Changing host) |
16:35:15 | * | neurocyte0132889 joined #nim |
16:50:41 | PMunch | Haha :P |
17:05:34 | FromDiscord | <geekrelief> @TryAngle The definition I gave you for `size_t` was technically incorrect. Instead of `uint` we should use `csize_t` https://nim-lang.github.io/Nim/system.html#csize_t |
17:06:08 | FromDiscord | <TryAngle> In reply to @geekrelief "<@!147447489316913152> The definition I": I see thanks |
17:06:36 | FromDiscord | <bananahead> Any way in the standard library to flatten a seq[seq[int]] to seq[int]? Couldn't find anything in the sequtils docs |
17:07:31 | FromDiscord | <Solitude> In reply to @bananahead "Any way in the": https://nim-lang.org/docs/sequtils.html#concat%2Cvarargs%5Bseq%5BT%5D%5D |
17:08:59 | FromDiscord | <bananahead> @Solitude that's concatenating multiple individual sequences into one. I have a seq i just need to flatten mine. |
17:09:10 | FromDiscord | <Solitude> you can pass seq in place of varargs |
17:09:33 | FromDiscord | <TryAngle> It's sadly not Std but I tried Zero Functional for something similar yesterday and it was a joy to use |
17:09:41 | FromDiscord | <Solitude> !eval import sequtils; echo concat @[@[1, 3], @[2]] |
17:09:43 | NimBot | @[1, 3, 2] |
17:11:01 | PMunch | @TryAngle, no shame in using third party libraries |
17:11:25 | FromDiscord | <bananahead> Amazing. Thank you. Maybe I could write a PR to update the docs to show that usecase. |
17:11:35 | FromDiscord | <TryAngle> In reply to @PMunch "<@147447489316913152>, no shame in": Haha dw, he asked for Std |
17:11:49 | FromDiscord | <geekrelief> @TryAngle hmm system doesn't define something for `ssize_t` like it does for `size_t` to `csize_t`. |
17:12:09 | FromDiscord | <bananahead> Because to me it wasn't obvious....(unless I'm not reading the docs right!) |
17:13:14 | FromDiscord | <TryAngle> In reply to @geekrelief "<@!147447489316913152> hmm system doesn't": Hmm isn't using the normal c types ok in almost all cases? I Googled a bit and came to the conclusion that they're almost equal? |
17:13:17 | FromDiscord | <Solitude> In reply to @bananahead "Because to me it": its in manual, but not very obvious https://nim-lang.org/docs/manual.html#types-varargs |
17:14:15 | FromDiscord | <geekrelief> In reply to @TryAngle "Hmm isn't using the": I think for most use cases using uint would be fine, if you use small values. But I'd like to be correct and forget about it. 🙂 |
17:14:40 | FromDiscord | <TryAngle> True, I agree 😂 |
17:14:45 | NimEventer | New post on r/nim by PMunch: Streaming Advent of Code solving, see https://reddit.com/r/nim/comments/r8u75w/streaming_advent_of_code_solving/ |
17:15:07 | FromDiscord | <bananahead> @Solitude sure, but the first thing I did was go to sequtils page and control+f for "flatten". So having it next to concat might be useful. |
17:15:26 | FromDiscord | <geekrelief> I'm updating nimterop to use csize_t, but I guess I'll have to live with ssize_t mapping to int unless I want to add a PR to the compiler. |
17:17:19 | FromDiscord | <geekrelief> So when dealing with memory you should use size_t. I don't know when ssize_t is used |
17:23:05 | * | al1ranger joined #nim |
17:26:14 | * | al1ranger quit (Client Quit) |
17:27:35 | FromDiscord | <codic> Pixie looks very cool |
17:27:47 | FromDiscord | <codic> I may switch to drawing window titlebars in worm with pixie |
17:35:44 | PMunch | worm? |
17:37:24 | * | jjido joined #nim |
17:54:28 | FromDiscord | <retkid> help |
17:54:31 | FromDiscord | <retkid> i have a quantum list |
17:54:45 | FromDiscord | <retkid> (edit) "list" => "sequence" |
17:54:50 | FromDiscord | <retkid> after being observed it changes |
17:55:12 | FromDiscord | <retkid> once i read from it, even using the same function, the output is different? |
17:56:11 | FromDiscord | <retkid> is this expected behavior for a list for 1 million + items |
17:56:31 | FromDiscord | <retkid> (edit) "list for" => "sequence with" |
18:00:24 | FromDiscord | <codic> does anyone have any examples of using pixie to draw to a X11 window? |
18:00:41 | FromDiscord | <codic> PMunch: my window manager <https://github.com/codic12/worm> |
18:01:52 | FromDiscord | <retkid> oh |
18:02:10 | FromDiscord | <retkid> no its not a quantum list it had something to do with clearing a sequence than doing it again |
18:02:13 | PMunch | Oh cool, when did you release that @codic? |
18:05:46 | FromDiscord | <TryAngle> is worm inspired by bspwm? |
18:07:02 | FromDiscord | <codic> In reply to @TryAngle "is worm inspired by": not really, but some aspects are similar, like `wormc` and `bspc` |
18:07:24 | FromDiscord | <codic> PMunch: a while ago, i was also reading your posts about nimscript in your wm and was thinking of maybe implementing that :P |
18:08:31 | PMunch | Nimscript in my WM is still very theoretical :P |
18:08:39 | PMunch | But yeah, the idea is neat |
18:09:16 | PMunch | I still want to create my own properly working WM |
18:09:29 | PMunch | But I'm struggling with the layouting algorithm.. |
18:10:34 | FromDiscord | <codic> I have a floating and tiling layout, for the latter I do simple master-stack tiling: <https://github.com/codic12/worm/blob/main/src/worm.nim#L836> |
18:10:45 | FromDiscord | <codic> That code really needs to be refactored though |
18:11:10 | PMunch | That's the problem |
18:11:20 | PMunch | I have slightly loftier ambitions :P |
18:12:56 | FromDiscord | <dom96> _wonders why he's seeing the style of `int var_name` in more and more code, do people dislike writing `int(var_name)`?_ |
18:13:21 | FromDiscord | <codic> If you're asking about my code I'm personally pretty inconsistent |
18:13:27 | FromDiscord | <dom96> lol, I love how Discord just wrapped that in underscores but fails to render in italics |
18:13:44 | FromDiscord | <codic> I should stick to 1 style |
18:13:44 | FromDiscord | <dom96> In reply to @codic "If you're asking about": yours is the second code I've seen it in today |
18:13:51 | FromDiscord | <dom96> another is https://github.com/nim-lang/nimble/pull/963/files |
18:13:58 | PMunch | I tend to do var_name.int :P |
18:14:07 | FromDiscord | <codic> I like `T x` the best personally but it doesn't work in all contexts |
18:14:16 | FromDiscord | <codic> Eg, `cint a - cint b - cint c` vs `a.cint - b.cint - c.cint` |
18:14:25 | FromDiscord | <codic> .T and T() always work |
18:14:32 | FromDiscord | <codic> so I should refactor my code to always use one of them |
18:14:42 | PMunch | Eh, sometimes you have to do ().T which is annoying |
18:15:01 | PMunch | T() truly is the best technical solution |
18:15:06 | PMunch | But I find it's a bit noisy |
18:15:13 | FromDiscord | <codic> In reply to @PMunch "Eh, sometimes you have": oh yeah that is also fair |
18:15:15 | FromDiscord | <codic> In reply to @PMunch "But I find it's": I agree |
18:15:42 | FromDiscord | <codic> Rn my code is just "use whatever works first in the context and forget about it" |
18:15:46 | PMunch | @codic, I want to basically do packing for my algorithm. Keep windows the same size as they request, but create new windows where there's room for them. |
18:16:00 | FromDiscord | <dom96> ideally we'd have a reliable code formatter to correct all these things for us |
18:16:03 | PMunch | Basically trying to automatically do what everyone does when they post pictures of their WMs :P |
18:16:23 | FromDiscord | <codic> Yeah btw nimpretty is sadly pretty garbage |
18:16:31 | PMunch | Kinda like you do here: https://camo.githubusercontent.com/0278b17611985a6efcbb0d45902ff0d53560deae67008dc2dea9b54589e250d0/68747470733a2f2f692e696d6775722e636f6d2f44366a4b6145372e706e67 |
18:16:33 | PMunch | But automatic |
18:16:36 | FromDiscord | <codic> It makes my code just not compile |
18:16:46 | FromDiscord | <codic> In reply to @PMunch "<@562086061153583122>, I want to": oh that is interesting |
18:17:07 | FromDiscord | <codic> but like, if you have space on both the left and right sides, where would it go? |
18:17:23 | PMunch | Well there would be some precedence rules |
18:17:39 | PMunch | Basically the problem is quite hard in itself |
18:18:08 | FromDiscord | <codic> For example, I have this Nim enum |
18:18:12 | PMunch | And then you add the constraint that you don't want to move stuff around too much and that you want it to always look pretty and it becomes really hard :P |
18:18:22 | FromDiscord | <codic> sent a code paste, see https://play.nim-lang.org/#ix=3H0H |
18:18:23 | FromDiscord | <codic> Nimpretty wrecks it |
18:18:31 | FromDiscord | <codic> sent a code paste, see https://play.nim-lang.org/#ix=3H0I |
18:18:54 | FromDiscord | <dom96> ouch |
18:19:05 | NimEventer | New post on r/nim by IridiumPoint: Is there a way to use a forward declared proc type to avoid having to retype parameters and the return type when declaring actual procedures?, see https://reddit.com/r/nim/comments/r8vj7y/is_there_a_way_to_use_a_forward_declared_proc/ |
18:19:11 | FromDiscord | <dom96> just a bug though, don't think it deserves to be called "garbage" 🙂 |
18:19:30 | FromDiscord | <dom96> as for me, I think I will sadly always disagree with the style nimpretty enforces |
18:25:50 | FromDiscord | <codic> In reply to @dom96 "just a bug though,": Yeah but it does this on several multi-line occasions |
18:25:56 | FromDiscord | <codic> Not just in this one case |
18:26:06 | FromDiscord | <codic> I should probably report a bug but I'm surprised that no one has noticed |
18:26:13 | FromDiscord | <codic> Or maybe they have and it's already reported |
18:32:57 | FromDiscord | <dom96> I think many just aren't using it |
18:39:47 | FromDiscord | <codic> Yeah at this point I just format code by hand |
18:46:33 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
19:04:26 | FromDiscord | <retkid> In reply to @dom96 "ideally we'd have a": Ideally we would try and pick the most efficient and best looking algorithm for every problem |
19:04:59 | * | jjido joined #nim |
19:05:01 | FromDiscord | <retkid> I don’t like code prettifiers |
19:05:08 | * | terminalpusher quit (Remote host closed the connection) |
19:05:29 | FromDiscord | <retkid> I think my code is pretty readable and I don’t like it fucking with my code |
19:18:16 | * | vicfred joined #nim |
19:26:23 | FromDiscord | <whisperdev> I have a question not related to Nim but maybe there are some "indie hackers" here. |
19:27:10 | FromDiscord | <whisperdev> Have anyone of you tried to "scrape data" from Android apps? eg. running the app in the android emulator and then somehow collecting the data from the screen? |
19:29:58 | * | Onionhammer quit (Quit: The Lounge - https://thelounge.chat) |
19:36:17 | * | Onionhammer joined #nim |
19:52:45 | * | src quit (Ping timeout: 256 seconds) |
19:55:07 | FromDiscord | <TryAngle> is it not possible to use two different wrappers for the same library at the same time? |
19:56:09 | FromDiscord | <TryAngle> I am using the nimgl library for gltw but it misses some parts I require so I added them in my own library and now I get conflicting errors when compiling |
19:56:46 | FromDiscord | <Solitude> great story, what errors? |
19:58:27 | * | Onionhammer quit (Ping timeout: 252 seconds) |
20:04:55 | FromDiscord | <TryAngle> In reply to @Solitude "great story, what errors?": https://media.discordapp.net/attachments/371759389889003532/916782136944640030/message.txt |
20:15:47 | FromDiscord | <Solitude> In reply to @TryAngle "": are you importc'ing same functions again? |
20:15:55 | FromDiscord | <TryAngle> sent a code paste, see https://play.nim-lang.org/#ix=3H1l |
20:16:00 | FromDiscord | <Solitude> im guessing your definitions just have wrong signatures |
20:16:18 | FromDiscord | <Solitude> `N_CDECL(NIM_BOOL, glfwInit)(void);` |
20:16:35 | FromDiscord | <Solitude> glfwInit doesnt return bool, it returns cint |
20:19:00 | FromDiscord | <pyautogui> Noob question: Should procs or templates be used for readability split-ups of ugly mega-functions? A lot of the usages of functions in other languages can be replaced with a template in Nim. |
20:19:10 | FromDiscord | <pyautogui> (edit) "template" => "templates" |
20:19:20 | FromDiscord | <pyautogui> (edit) removed "a" |
20:20:19 | FromDiscord | <TryAngle> In reply to @Solitude "`N_CDECL(NIM_BOOL, glfwInit)(void);`": but I'm using glfwInit from nimgl |
20:20:30 | FromDiscord | <TryAngle> those two procs are the only extras I did rn |
20:20:54 | FromDiscord | <TryAngle> and the types I'm using are the wrapped types from nimgl |
20:29:04 | FromDiscord | <huantian> how would one get the first and last values in an OrderedTable? |
20:31:21 | FromDiscord | <enthus1ast> i think the only way is to loop through it |
20:34:29 | * | krux02 joined #nim |
20:36:30 | FromDiscord | <Solitude> In reply to @TryAngle "but I'm using glfwInit": do you need header pragmas there? im guessing they are causing conflicts? |
20:44:59 | FromDiscord | <TryAngle> In reply to @Solitude "do you need header": removing them works again 🤔 ↵what is the difference between including them vs not including them? |
20:45:03 | FromDiscord | <TryAngle> (edit) removed "again" |
20:45:27 | * | PMunch quit (Ping timeout: 256 seconds) |
20:45:27 | * | anddam quit (Ping timeout: 256 seconds) |
20:45:45 | * | anddam joined #nim |
20:45:50 | * | Onionhammer joined #nim |
20:45:51 | * | PMunch joined #nim |
20:46:33 | FromDiscord | <Solitude> nimgl takes liberties with procedure signatures, but at runtime it doesnt matter. but when you include headers which contain correct definitions they start to conflict. |
20:47:34 | FromDiscord | <Solitude> basically, you have to use the same ffi convention as the wrapper |
20:47:41 | FromDiscord | <TryAngle> ah and I included a header that is from a different version of GLFW I suppose? |
20:47:47 | FromDiscord | <Solitude> no |
20:47:55 | FromDiscord | <Solitude> you include headers, nimgl doesnt |
20:49:43 | FromDiscord | <TryAngle> oh thanks |
20:50:10 | FromDiscord | <Solitude> just importc and cdecl your stuff and you will be fine |
20:50:52 | FromDiscord | <TryAngle> ok, seems to work, sadly what I'm doing is using Vulkan so I have to make it run on main windows and not WSL 😔 |
20:50:57 | FromDiscord | <TryAngle> btw when using libraries that have↵when defined(X)↵how can I define X when using that library? |
20:51:33 | FromDiscord | <Solitude> add `-d:X` to nim.cfg if you want it always |
20:52:36 | FromDiscord | <TryAngle> can I also put this into the project.nimble file? |
20:52:42 | FromDiscord | <Solitude> no |
20:53:39 | FromDiscord | <TryAngle> where would I put this file 😂 ?↵Sorry been using nim for only 2 days now |
20:53:50 | FromDiscord | <Solitude> where your source is |
20:54:05 | FromDiscord | <TryAngle> ok I will try that later thaks! |
21:08:07 | * | Onionhammer quit (Ping timeout: 252 seconds) |
21:15:19 | * | [RMS] joined #nim |
21:16:16 | * | [R] quit (Ping timeout: 260 seconds) |
21:24:59 | * | noeontheend quit (Ping timeout: 252 seconds) |
21:36:48 | * | src joined #nim |
21:40:22 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
21:40:46 | * | Onionhammer joined #nim |
22:03:29 | * | Onionhammer quit (Ping timeout: 252 seconds) |
22:06:42 | * | [RMS] is now known as [R] |
22:19:47 | * | neurocyte0132889 quit (Read error: Connection reset by peer) |
22:20:55 | * | neurocyte0132889 joined #nim |
22:20:55 | * | neurocyte0132889 quit (Changing host) |
22:20:56 | * | neurocyte0132889 joined #nim |
22:35:49 | * | Onionhammer joined #nim |
22:52:36 | * | Schnouki joined #nim |
22:53:14 | * | krux02 quit (Remote host closed the connection) |
22:58:07 | * | Onionhammer quit (Ping timeout: 252 seconds) |
23:02:04 | * | audiophile joined #nim |
23:07:12 | FromDiscord | <TryAngle> I have a .lib and a .h file, how would I statically wrap that in a nim project?↵Is there an example somewhere? |
23:08:15 | * | src quit (Ping timeout: 256 seconds) |
23:11:32 | FromDiscord | <el__maco> I just used the --clib:mylib command line parameter |
23:38:55 | * | Onionhammer joined #nim |
23:42:20 | * | lumo_e joined #nim |
23:53:09 | * | vicfred quit (Quit: Leaving) |