<< 04-12-2021 >>

00:04:14FromDiscord<TryAngle> sent a code paste, see https://play.nim-lang.org/#ix=3GVB
00:05:45FromDiscord<TryAngle> sent a code paste, see https://play.nim-lang.org/#ix=3GVD
00:10:28FromDiscord<TryAngle> hahah
00:10:33FromDiscord<TryAngle> I made a type
00:10:56FromDiscord<TryAngle> never mid 😂 ↵(: -> = at end of initializeLog)
00:11:02FromDiscord<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:47FromDiscord<Alea> are nimdocs failing to load for anyone else?
01:32:08FromDiscord<huantian> Is there a way to `.join` the output of a `collect` without setting it to a variable first?
01:32:36FromDiscord<Elegantbeef> Use `()` to wrap collect then do `.join`
01:35:00FromDiscord<huantian> ah
01:37:32FromDiscord<huantian> hmm doesn't seem happy, am I doing this right? https://media.discordapp.net/attachments/371759389889003532/916503451742109696/unknown.png
01:45:38FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3GWc
01:45:42FromDiscord<huantian> oh
01:47:24FromDiscord<huantian> that makes mores sense, thanks
01:53:43FromDiscord<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:14FromDiscord<huantian> If I got an IntSet that I know has one element, what's the best way to get that element?
02:45:30FromDiscord<Elegantbeef> `pop`
02:46:05FromDiscord<huantian> that's giving me a `type mismatch: got <IntSet>`
02:46:24FromDiscord<Elegantbeef> Wait you said intset
02:46:27FromDiscord<Elegantbeef> I was in sets
02:47:09FromDiscord<Elegantbeef> Seems the best thing to do is iterate over the thing and emit the first value
02:48:19FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3GWv
02:50:15FromDiscord<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:39FromDiscord<Elegantbeef> Uhh a slice of a intset doesnt make much sense
02:51:00FromDiscord<huantian> something like `(1..10).toSeq.toIntSet`
02:51:12FromDiscord<Elegantbeef> Oh if you want a intset of a range
02:51:25FromDiscord<Elegantbeef> If it's a limited range like that you dont need `intSet`
02:51:34FromDiscord<Elegantbeef> you can just do `var a = {1..10}`
02:52:34FromDiscord<huantian> oh nice
02:52:43FromDiscord<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:07FromDiscord<Elegantbeef> Nim's builtin set is limited to `high - low == uint16.high`
02:54:43FromDiscord<huantian> interesting
02:55:01FromDiscord<Rika> In reply to @zidsal "What in the uniform": It’s not UFCS, it’s an operator, so it’s special
03:25:52FromDiscord<Twily> sent a long message, see http://ix.io/3GWG
03:26:40FromDiscord<Twily> Any ideas why I’m getting this and any way to overcome this? And hack maybe?
03:27:00FromDiscord<Yardanico> are you using converters by any chance?
03:27:09FromDiscord<Yardanico> i mean, maybe you have converters or the libraries you use have them
03:27:16FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3GWH
03:27:29FromDiscord<Yardanico> beef, won't you need to do `import system/dollars` explicitly?
03:27:29FromDiscord<Elegantbeef> Converters have a big old bug that they propagate up unexported
03:27:39FromDiscord<Elegantbeef> probably
03:28:03FromDiscord<Yardanico> ah nvm you don't need the import apparently
03:28:27FromDiscord<Twily> Converters?
03:28:29FromDiscord<Yardanico> yes
03:28:36FromDiscord<Yardanico> what libraries are you using?
03:28:48FromDiscord<Yardanico> i mean modules, maybe something like, say, raylib, or sdl2 or something
03:28:54FromDiscord<Yardanico> they might have some converters that affect your code
03:29:04FromDiscord<Twily> sent a code paste, see https://play.nim-lang.org/#ix=3GWI
03:29:13FromDiscord<Twily> types and ipc are internal
03:29:24FromDiscord<Yardanico> and types and ipc don't import anything else outside of the stdlib?
03:29:56FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3GWJ
03:30:32FromDiscord<Twily> sent a code paste, see https://play.nim-lang.org/#ix=3GWK
03:30:55FromDiscord<Yardanico> oh, is dbus a third-party lib?
03:31:05FromDiscord<Elegantbeef> https://github.com/zielmicha/nim-dbus/blob/74ec59f1813ae701764426c4ea0f11e092aefbe6/dbus/private/bus.nim#L3
03:31:07FromDiscord<Twily> Yep, pretty old one
03:31:08FromDiscord<Yardanico> https://github.com/zielmicha/nim-dbus/blob/master/dbus/private/bus.nim#L3 yeah
03:31:10FromDiscord<Elegantbeef> There's the bastard
03:31:13FromDiscord<Yardanico> :DDD
03:31:32FromDiscord<Yardanico> so @Twily the issue is
03:31:38FromDiscord<Yardanico> dbus_bool_t is actually just an alias for uint32
03:31:49FromDiscord<Yardanico> so the converter is actually for implicitly converting uint32 into bool
03:31:54FromDiscord<Yardanico> in this case
03:32:07FromDiscord<Elegantbeef> And thanks to that afformentioned bug, it fucks everything up
03:32:08FromDiscord<Yardanico> and since converters propagate too much it changes your code too
03:32:27FromDiscord<Twily> I don’t get how bools are related here. I’m purely working with `uint32` and `string`
03:32:46FromDiscord<Elegantbeef> There is a converter to `bool` which comes up and ruins your day
03:32:58FromDiscord<Yardanico> ah @beef actually dbus_uint32_t = cuint
03:33:01FromDiscord<Twily> And why didn’t it break before?
03:33:01FromDiscord<Yardanico> but cuint is an alias for uint32 anyway
03:33:10FromDiscord<Yardanico> @Twily because you didn't try to $ a uint32 ?
03:33:14FromDiscord<Yardanico> when having dbus imported
03:33:25FromDiscord<Elegantbeef> This is a new bug in 1.6 so that's another reason
03:33:33FromDiscord<Yardanico> a regression, yeah
03:33:49FromDiscord<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:56FromDiscord<Twily> Previously it used to work.
03:34:03FromDiscord<Yardanico> yeah, it's a regression in 1.6.
03:34:06FromDiscord<Yardanico> hopefully it gets fixed in 1.6.2
03:34:28FromDiscord<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:37FromDiscord<Yardanico> @beef do you remember the issue # ?
03:36:50FromDiscord<Elegantbeef> Doesnt seem like there is a nim issue comically
03:36:53FromDiscord<xflywind> https://discord.com/channels/371759389889003530/371759389889003532/908319224739553280
03:37:18FromDiscord<Yardanico> @beef i remember seeing an issue like that, maybe my imagination...
03:37:57FromDiscord<Yardanico> https://github.com/nim-lang/Nim/issues/18986
03:38:39FromDiscord<Yardanico> hmmm
03:40:06FromDiscord<Twily> So as I understand there was no test before that could get caught this and this regression was released?
03:45:04FromDiscord<Yardanico> yes
03:45:13FromDiscord<Yardanico> @beef i'll open an issue anyway
03:48:41FromDiscord<Twily> [Yardanico](https://matrix.to/#/%40_discord_177365113899057152%3At2bot.io) why would you open a new issue if there is already one?
03:49:00FromDiscord<Yardanico> because it's about a different thing
03:49:01FromDiscord<Yardanico> i think
03:49:46FromDiscord<Twily> To me it looks exactly about the same problem. At least looking at the examples and the error message.
03:50:18FromDiscord<Yardanico> no, for me it looks different - first of all, in pmunch's code it's all in the same file
03:50:33FromDiscord<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:38FromDiscord<Yardanico> while your code works on 1.4.8 and older
03:50:42FromDiscord<Yardanico> https://github.com/nim-lang/Nim/issues/19213
03:52:40FromDiscord<Yardanico> i'll try to bisect
03:53:21NimEventerNew 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:36FromDiscord<Cypheriel> Does Nim have anything similar to Python's ``...
05:39:51FromDiscord<Cypheriel> like... `print([1, 2, 3, 4])` type stuff
06:01:58FromDiscord<Rika> No not really
06:02:09FromDiscord<Rika> Var args accepts sequences
06:02:32FromDiscord<Yardanico> In reply to @Cypheriel "like... `print(*[1, 2, 3,": in this case you can just use `join` from strutils btw
06:02:41FromDiscord<Yardanico> echo elems.join(", ")
06:05:25FromDiscord<Cypheriel> hm... but for things like `zip`, I don't think it works as I'd expect
06:06:41FromDiscord<Rika> Zip only takes two sequences
06:06:51FromDiscord<Rika> There are no three or four sequence zip procs
06:07:04FromDiscord<Cypheriel> ah... then that is unlike Python
06:07:42FromDiscord<Rika> A more flexible zip can be made but I assume that would need to go to macro level
06:09:00tkhttps://github.com/void-linux/void-packages/pull/34106 - Voidlinux now shipping nim 1.6.0
06:10:49FromDiscord<Michal58> I'm trying to learn some arraymancer
06:11:04FromDiscord<Michal58> how do I compare a Tensor to a scalar?
06:12:06FromDiscord<Michal58> `array == n` nor `array .== n` does not seem to do it
06:14:19FromDiscord<Yardanico> try asking in #science too
06:15:37NimEventerNew thread by Jorjun_arch: What is programming?, see https://forum.nim-lang.org/t/8676
06:19:16FromDiscord<Michal58> Oh, is it `==.`
07:02:25*mahlon joined #nim
08:11:17*xet7 quit (Quit: Leaving)
08:15:44FromDiscord<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:49FromDiscord<TryAngle> how do I get the pointer of a variable?
08:58:46FromDiscord<Rika> addr
09:23:29FromDiscord<TryAngle> In reply to @Rika "addr": thanks
09:32:26FromDiscord<tbrekalo> are array's stack or heap allocated?
09:33:59FromDiscord<Elegantbeef> Stack
09:40:42*tinystoat quit (Remote host closed the connection)
10:00:17FromDiscord<Yardanico> also, if you can allocate them on the heap, you can by using `ref`
10:00:29FromDiscord<Yardanico> but then they won't be much different from `seq`
10:00:37FromDiscord<Yardanico> (edit) "can" => "want to"
10:02:25FromDiscord<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:59FromDiscord<leorize> i think there should be libpcap wrappers that you can use
10:09:09FromDiscord<leorize> nimble.directory is your friend on this one
10:38:09*xet7 joined #nim
10:38:43FromDiscord<firasuke> sent a long message, see http://ix.io/3GYn
10:39:26FromDiscord<Yardanico> the most "complete" auto-complete that we have is vscode + nim plugin that uses nimsuggest
10:39:31FromDiscord<Yardanico> there is nimpretty but it still has bugs
10:40:45FromDiscord<Rika> no, there is not "complete" autocomplete that doesnt use nimsuggest.
10:40:48FromDiscord<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:50FromDiscord<Rika> (edit) "not" => "no"
10:41:00FromDiscord<firasuke> what runners are you using?
10:41:08FromDiscord<Rika> theyre all nimsuggest in the end
10:41:11FromDiscord<firasuke> also for debugging, is GDB the mainstream way?
10:41:13FromDiscord<Rika> so it doesnt really matter too much
10:41:17FromDiscord<Yardanico> In reply to @firasuke "what runners are you": i don't use runners :)
10:41:18FromDiscord<firasuke> In reply to @Rika "theyre all nimsuggest in": I see
10:41:27FromDiscord<Rika> runner?
10:41:28FromDiscord<firasuke> In reply to @Yardanico "i don't use runners": Oh, then do you have for tasks
10:41:36FromDiscord<Rika> does the terminal count
10:41:38FromDiscord<Yardanico> i don't really use tasks in vscode
10:41:47FromDiscord<Yardanico> just the shell
10:41:51FromDiscord<firasuke> In reply to @Rika "does the terminal count": ya well I can manually run it in a terminal
10:42:05FromDiscord<Yardanico> In reply to @firasuke "also for debugging, is": yeah, with nim-gdb it's usable
10:42:08FromDiscord<firasuke> I want something out of the box that does that in vscode
10:42:17FromDiscord<Rika> dunno, i dont use vscode
10:42:25FromDiscord<firasuke> what do you use then?
10:42:49FromDiscord<Rika> neovim
10:42:59FromDiscord<firasuke> I also don't use vscode, but I heard it has the best support for Nim, so I downloaded it lol
10:43:26FromDiscord<Rika> id argue its neovim with the best support but that depends on what you want most
10:43:49FromDiscord<hmmm> I use sublimetext with nimline 😋 the nim tooling is inferior but the editor is better :nim1:
10:44:05FromDiscord<firasuke> In reply to @Rika "id argue its neovim": What plugins are you using with neovim then
10:44:17FromDiscord<Rika> nim.nvim or whatever its called
10:44:18FromDiscord<firasuke> native nvim-lsp, nim-lsp, ale, coc, cmp?
10:44:30FromDiscord<firasuke> In reply to @Rika "nim.nvim or whatever its": doesn't support autocomplete
10:44:30FromDiscord<Rika> + compe
10:44:38FromDiscord<Rika> compe + nim.nvim
10:44:40FromDiscord<firasuke> In reply to @Rika "+ compe": mhmm
10:45:51FromDiscord<firasuke> shouldn't you be using cmp since compe is deprecated?
10:45:59FromDiscord<Rika> compe is deprecated?
10:46:11FromDiscord<Rika> dude i havent changed my config in a while
10:46:16FromDiscord<Rika> cmp is alpha innit
10:46:24FromDiscord<firasuke> probably
10:46:42FromDiscord<Rika> i will switch once it is stable
10:46:49FromDiscord<firasuke> anyways thanks for the suggestion
10:46:59FromDiscord<firasuke> I'll see if I can get nim lsp working
10:47:24FromDiscord<Rika> i have yet to finish migrating my config to lua i just remembered
10:47:25FromDiscord<Rika> aaaaah
10:47:41FromDiscord<firasuke> oh btw which nim.vim are you using? zah or alaviss?
10:48:15FromDiscord<Yardanico> In reply to @firasuke "doesn't support autocomplete": huh?
10:48:16FromDiscord<Rika> alaviss
10:48:19FromDiscord<Rika> is the nvim one
10:48:19FromDiscord<Yardanico> https://github.com/alaviss/nim.nvim does support autocomplete
10:48:21FromDiscord<Rika> zah is for nim
10:48:23FromDiscord<Rika> vim
10:48:27FromDiscord<Rika> wrong -im word
10:48:35FromDiscord<firasuke> In reply to @Yardanico "https://github.com/alaviss/nim.nvim does support au": https://github.com/zah/nim.vim
10:48:41FromDiscord<firasuke> he meant this
10:48:42FromDiscord<Yardanico> that's for vim and it doesn't, yes
10:48:46FromDiscord<Yardanico> he meant alaviss one
10:48:56FromDiscord<Rika> yes
10:48:58FromDiscord<firasuke> 👍
10:51:29*xet7 quit (Remote host closed the connection)
11:21:32*src joined #nim
11:23:21FromDiscord<tbrekalo> can I somehow store `<` operator as a function? something as `std::less<>` in c++?
11:31:40FromDiscord<Slava0135> aren't all operators functions
11:31:44FromDiscord<Rika> Yes, strop it
11:31:52FromDiscord<Rika> \`<`
11:31:54FromDiscord<tbrekalo> please elaborate
11:32:01FromDiscord<tbrekalo> aha; I'll try now; thanks @Rika
11:32:09FromDiscord<Slava0135> (edit) "aren't all operators ... functions" added "are"
11:32:21FromDiscord<Rika> Same goes for all other operators
11:32:32FromDiscord<Rika> Effectively it is an identifier
11:33:35*tinystoat joined #nim
11:35:18FromDiscord<tbrekalo> doesn't seem to work
11:35:40FromDiscord<tbrekalo> i tried something like: `let cmpFn = \`<\``
11:36:20FromDiscord<Rika> Well I don’t think it can work like that because it can’t disambiguate what function it needs
11:36:24FromDiscord<Rika> Since it’s overloaded
11:36:25FromDiscord<Zoom> sent a code paste, see https://play.nim-lang.org/#ix=3GYv
11:36:29FromDiscord<Rika> Zoom, that is what they meant
11:36:31FromDiscord<Zoom> Secondly, you need to specify a type of the variable
11:36:35FromDiscord<Rika> Yes
11:36:50FromDiscord<Zoom> Because comparison operators are heavily overloaded
11:37:09FromDiscord<tbrekalo> how do I make specification for the type?
11:37:19FromDiscord<Zoom> And don't try to `typeof(`\<`)` \:D
11:37:28FromDiscord<Zoom> https://github.com/nim-lang/Nim/blob/270964c487e5347c61dade25bec903580483dda5/lib/system/comparisons.nim
11:38:08FromDiscord<Zoom> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/916654399290499072): And don't try to `typeof(\`\<\`)\` \:D
11:38:19FromDiscord<tbrekalo> aha; figured it out; `let cmpFn: proc(a: int, b: int): bool = '<'`
11:38:35FromDiscord<Zoom> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/916654399290499072): And don't try to `typeof(`<`)` \:D
11:38:37FromDiscord<tbrekalo> i can't put ` inside a code block; backslash was an atempt to escape it
11:39:05FromDiscord<Zoom> Surround in double graves
11:42:17FromDiscord<tbrekalo> could you send a code snippet for storing ``<`` as an int comparator?
11:42:26FromDiscord<tbrekalo> having a hard time getting it right; sorry
11:46:22FromDiscord<Zoom> sent a code paste, see https://play.nim-lang.org/#ix=3GYy
11:46:33FromDiscord<tbrekalo> thanks
11:48:54FromDiscord<Zoom> Error messages are helpful as usual. Complaining about `{.procvar.}` which is not even documented. (#12975)
11:49:40FromDiscord<Rika> Haha how fun
11:50:01FromDiscord<Rika> Seriously wish I could help with it but I’m still currently very intimidated by the compiler source
11:53:29FromDiscord<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:54FromDiscord<Rika> That’s frustrating
11:59:28FromDiscord<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:15FromDiscord<Rika> In reply to @evoalg "<@!259277943275126785> I'm already using": You don’t use LSP when you use the plugin
12:00:49FromDiscord<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:18FromDiscord<Rika> I’ll show you how to do it in compe, not sure if it directly translates to in cmp
12:02:03FromDiscord<Rika> (edit) "not" => "now"
12:02:30FromDiscord<evoalg> I'd be happy to try compe ... even tho the webpage says it's deprecated
12:03:36FromDiscord<Rika> It’s deprecated but I say it was done too early
12:04:00FromDiscord<Rika> Nonetheless later, when I’m home
12:04:14FromDiscord<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:56FromDiscord<evoalg> ahh maybe I have to install nimlsp? ... can't do `nimble install nimlsp` as it breaks on my mac
12:43:41FromDiscord<Rika> You don’t if you’re using Nim.nvim
12:50:13FromDiscord<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:40FromDiscord<Rika> sent a code paste, see https://paste.rs/ywn
14:09:27NimEventerNew thread by Cblake: TinyCC/tcc vs zig cc compile-times/etc., see https://forum.nim-lang.org/t/8677
14:14:25FromDiscord<Rika> nice writeup about compile times
14:15:33FromDiscord<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:27FromDiscord<firasuke> @PMunch Is it possible to use neovim with nimlsp + coc + alaviss/zah? Or is it not recommended?
14:35:08FromDiscord<Rika> you dont need alaviss if you have lsp
14:35:13FromDiscord<Rika> same with vice versa
14:49:43PMunchI use vim + nimlsp + zah
14:49:55PMunchSo neovim + nimlsp + zah should work just fine
14:50:01PMunchNot sure what coc is though
14:55:43FromDiscord<Rika> lsp engine
14:55:57FromDiscord<Rika> rather autocomplete engine
15:00:43PMunchAh right
15:00:50PMunchI thought neovim had LSP built in?
15:02:17FromDiscord<Rika> it "does" but its still a plugin
15:02:37FromDiscord<Rika> and thats not the autocomplete engine afaik, only the interface to lsp servers
15:02:59FromDiscord<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:40FromDiscord<firasuke> ale?
15:07:43*arkurious quit (Ping timeout: 256 seconds)
15:11:19FromDiscord<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:32FromDiscord<Rika> nimpretty
15:12:34FromDiscord<Rika> imports being autocompleted? what do you mean
15:12:40FromDiscord<Rika> nimsuggest does not have such a feature
15:13:05FromDiscord<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:14FromDiscord<Rika> oh that is what you mean
15:13:29FromDiscord<Rika> i am unsure about such a feature ever existing
15:13:32*arkurious joined #nim
15:13:36FromDiscord<Rika> let me test
15:13:40FromDiscord<firasuke> ok
15:14:05FromDiscord<firasuke> also, say I wanted to use `.toLower`, would `nimsuggest` import `unicode` on its own? is there such a thing?
15:14:33FromDiscord<Rika> yup, no autocomplete for importrs
15:14:37FromDiscord<Rika> no
15:14:38FromDiscord<Rika> it wont
15:14:46FromDiscord<firasuke> I see, good to know
15:14:51*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
15:14:58FromDiscord<Rika> tooling is very poor yes
15:15:04FromDiscord<firasuke> coming from Rust, I thought I'd be expecting such tools
15:15:11FromDiscord<firasuke> such a shame though, Nim is very decent
15:15:18FromDiscord<Rika> rust is probably a few magnitudes larger than us
15:15:29FromDiscord<firasuke> In reply to @Rika "rust is probably a": ya, figured that one out xD
15:15:50FromDiscord<Rika> i mean i'd say its hard to expect such a thing given the size
15:15:58FromDiscord<Rika> but it still sucks i guess
15:16:23FromDiscord<Rika> and its not just size anyway that is blocking such tool development
15:17:08FromDiscord<firasuke> In reply to @Rika "and its not just": what other factors are contributing to this then?
15:19:08PMunchI use prabirshestha/vim-lsp
15:19:16FromDiscord<firasuke> In reply to @PMunch "I use prabirshestha/vim-lsp": Oh
15:19:25FromDiscord<Rika> the confusing/intimidating codebase of the compiler i guess, and the lack of documentation for internals
15:20:10FromDiscord<firasuke> I see
15:22:09FromDiscord<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:26FromDiscord<firasuke> https://media.discordapp.net/attachments/371759389889003532/916711049292550184/unknown.png https://media.discordapp.net/attachments/371759389889003532/916711049514852392/unknown.png
15:23:02NimEventerNew Nimble package! paramidib - paramidi with nimib, see https://github.com/pietroppeter/paramidib
15:25:24*xet7 joined #nim
15:25:56NimEventerNew thread by Icedquinn: Thriftcore - Apache Thrift primitives, see https://forum.nim-lang.org/t/8678
15:30:55PMunchNew 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:06FromDiscord<claude> what does nimpretty do other than wrap long lines, align arguments in parens/brackets etc and maybe enforce camelcase
16:31:24FromDiscord<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:41PMunchHaha :P
17:05:34FromDiscord<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:08FromDiscord<TryAngle> In reply to @geekrelief "<@!147447489316913152> The definition I": I see thanks
17:06:36FromDiscord<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:31FromDiscord<Solitude> In reply to @bananahead "Any way in the": https://nim-lang.org/docs/sequtils.html#concat%2Cvarargs%5Bseq%5BT%5D%5D
17:08:59FromDiscord<bananahead> @Solitude that's concatenating multiple individual sequences into one. I have a seq i just need to flatten mine.
17:09:10FromDiscord<Solitude> you can pass seq in place of varargs
17:09:33FromDiscord<TryAngle> It's sadly not Std but I tried Zero Functional for something similar yesterday and it was a joy to use
17:09:41FromDiscord<Solitude> !eval import sequtils; echo concat @[@[1, 3], @[2]]
17:09:43NimBot@[1, 3, 2]
17:11:01PMunch@TryAngle, no shame in using third party libraries
17:11:25FromDiscord<bananahead> Amazing. Thank you. Maybe I could write a PR to update the docs to show that usecase.
17:11:35FromDiscord<TryAngle> In reply to @PMunch "<@147447489316913152>, no shame in": Haha dw, he asked for Std
17:11:49FromDiscord<geekrelief> @TryAngle hmm system doesn't define something for `ssize_t` like it does for `size_t` to `csize_t`.
17:12:09FromDiscord<bananahead> Because to me it wasn't obvious....(unless I'm not reading the docs right!)
17:13:14FromDiscord<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:17FromDiscord<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:15FromDiscord<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:40FromDiscord<TryAngle> True, I agree 😂
17:14:45NimEventerNew 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:07FromDiscord<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:26FromDiscord<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:19FromDiscord<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:35FromDiscord<codic> Pixie looks very cool
17:27:47FromDiscord<codic> I may switch to drawing window titlebars in worm with pixie
17:35:44PMunchworm?
17:37:24*jjido joined #nim
17:54:28FromDiscord<retkid> help
17:54:31FromDiscord<retkid> i have a quantum list
17:54:45FromDiscord<retkid> (edit) "list" => "sequence"
17:54:50FromDiscord<retkid> after being observed it changes
17:55:12FromDiscord<retkid> once i read from it, even using the same function, the output is different?
17:56:11FromDiscord<retkid> is this expected behavior for a list for 1 million + items
17:56:31FromDiscord<retkid> (edit) "list for" => "sequence with"
18:00:24FromDiscord<codic> does anyone have any examples of using pixie to draw to a X11 window?
18:00:41FromDiscord<codic> PMunch: my window manager <https://github.com/codic12/worm>
18:01:52FromDiscord<retkid> oh
18:02:10FromDiscord<retkid> no its not a quantum list it had something to do with clearing a sequence than doing it again
18:02:13PMunchOh cool, when did you release that @codic?
18:05:46FromDiscord<TryAngle> is worm inspired by bspwm?
18:07:02FromDiscord<codic> In reply to @TryAngle "is worm inspired by": not really, but some aspects are similar, like `wormc` and `bspc`
18:07:24FromDiscord<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:31PMunchNimscript in my WM is still very theoretical :P
18:08:39PMunchBut yeah, the idea is neat
18:09:16PMunchI still want to create my own properly working WM
18:09:29PMunchBut I'm struggling with the layouting algorithm..
18:10:34FromDiscord<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:45FromDiscord<codic> That code really needs to be refactored though
18:11:10PMunchThat's the problem
18:11:20PMunchI have slightly loftier ambitions :P
18:12:56FromDiscord<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:21FromDiscord<codic> If you're asking about my code I'm personally pretty inconsistent
18:13:27FromDiscord<dom96> lol, I love how Discord just wrapped that in underscores but fails to render in italics
18:13:44FromDiscord<codic> I should stick to 1 style
18:13:44FromDiscord<dom96> In reply to @codic "If you're asking about": yours is the second code I've seen it in today
18:13:51FromDiscord<dom96> another is https://github.com/nim-lang/nimble/pull/963/files
18:13:58PMunchI tend to do var_name.int :P
18:14:07FromDiscord<codic> I like `T x` the best personally but it doesn't work in all contexts
18:14:16FromDiscord<codic> Eg, `cint a - cint b - cint c` vs `a.cint - b.cint - c.cint`
18:14:25FromDiscord<codic> .T and T() always work
18:14:32FromDiscord<codic> so I should refactor my code to always use one of them
18:14:42PMunchEh, sometimes you have to do ().T which is annoying
18:15:01PMunchT() truly is the best technical solution
18:15:06PMunchBut I find it's a bit noisy
18:15:13FromDiscord<codic> In reply to @PMunch "Eh, sometimes you have": oh yeah that is also fair
18:15:15FromDiscord<codic> In reply to @PMunch "But I find it's": I agree
18:15:42FromDiscord<codic> Rn my code is just "use whatever works first in the context and forget about it"
18:15:46PMunch@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:00FromDiscord<dom96> ideally we'd have a reliable code formatter to correct all these things for us
18:16:03PMunchBasically trying to automatically do what everyone does when they post pictures of their WMs :P
18:16:23FromDiscord<codic> Yeah btw nimpretty is sadly pretty garbage
18:16:31PMunchKinda like you do here: https://camo.githubusercontent.com/0278b17611985a6efcbb0d45902ff0d53560deae67008dc2dea9b54589e250d0/68747470733a2f2f692e696d6775722e636f6d2f44366a4b6145372e706e67
18:16:33PMunchBut automatic
18:16:36FromDiscord<codic> It makes my code just not compile
18:16:46FromDiscord<codic> In reply to @PMunch "<@562086061153583122>, I want to": oh that is interesting
18:17:07FromDiscord<codic> but like, if you have space on both the left and right sides, where would it go?
18:17:23PMunchWell there would be some precedence rules
18:17:39PMunchBasically the problem is quite hard in itself
18:18:08FromDiscord<codic> For example, I have this Nim enum
18:18:12PMunchAnd 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:22FromDiscord<codic> sent a code paste, see https://play.nim-lang.org/#ix=3H0H
18:18:23FromDiscord<codic> Nimpretty wrecks it
18:18:31FromDiscord<codic> sent a code paste, see https://play.nim-lang.org/#ix=3H0I
18:18:54FromDiscord<dom96> ouch
18:19:05NimEventerNew 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:11FromDiscord<dom96> just a bug though, don't think it deserves to be called "garbage" 🙂
18:19:30FromDiscord<dom96> as for me, I think I will sadly always disagree with the style nimpretty enforces
18:25:50FromDiscord<codic> In reply to @dom96 "just a bug though,": Yeah but it does this on several multi-line occasions
18:25:56FromDiscord<codic> Not just in this one case
18:26:06FromDiscord<codic> I should probably report a bug but I'm surprised that no one has noticed
18:26:13FromDiscord<codic> Or maybe they have and it's already reported
18:32:57FromDiscord<dom96> I think many just aren't using it
18:39:47FromDiscord<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:26FromDiscord<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:01FromDiscord<retkid> I don’t like code prettifiers
19:05:08*terminalpusher quit (Remote host closed the connection)
19:05:29FromDiscord<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:23FromDiscord<whisperdev> I have a question not related to Nim but maybe there are some "indie hackers" here.
19:27:10FromDiscord<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:07FromDiscord<TryAngle> is it not possible to use two different wrappers for the same library at the same time?
19:56:09FromDiscord<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:46FromDiscord<Solitude> great story, what errors?
19:58:27*Onionhammer quit (Ping timeout: 252 seconds)
20:04:55FromDiscord<TryAngle> In reply to @Solitude "great story, what errors?": https://media.discordapp.net/attachments/371759389889003532/916782136944640030/message.txt
20:15:47FromDiscord<Solitude> In reply to @TryAngle "": are you importc'ing same functions again?
20:15:55FromDiscord<TryAngle> sent a code paste, see https://play.nim-lang.org/#ix=3H1l
20:16:00FromDiscord<Solitude> im guessing your definitions just have wrong signatures
20:16:18FromDiscord<Solitude> `N_CDECL(NIM_BOOL, glfwInit)(void);`
20:16:35FromDiscord<Solitude> glfwInit doesnt return bool, it returns cint
20:19:00FromDiscord<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:10FromDiscord<pyautogui> (edit) "template" => "templates"
20:19:20FromDiscord<pyautogui> (edit) removed "a"
20:20:19FromDiscord<TryAngle> In reply to @Solitude "`N_CDECL(NIM_BOOL, glfwInit)(void);`": but I'm using glfwInit from nimgl
20:20:30FromDiscord<TryAngle> those two procs are the only extras I did rn
20:20:54FromDiscord<TryAngle> and the types I'm using are the wrapped types from nimgl
20:29:04FromDiscord<huantian> how would one get the first and last values in an OrderedTable?
20:31:21FromDiscord<enthus1ast> i think the only way is to loop through it
20:34:29*krux02 joined #nim
20:36:30FromDiscord<Solitude> In reply to @TryAngle "but I'm using glfwInit": do you need header pragmas there? im guessing they are causing conflicts?
20:44:59FromDiscord<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:03FromDiscord<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:33FromDiscord<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:34FromDiscord<Solitude> basically, you have to use the same ffi convention as the wrapper
20:47:41FromDiscord<TryAngle> ah and I included a header that is from a different version of GLFW I suppose?
20:47:47FromDiscord<Solitude> no
20:47:55FromDiscord<Solitude> you include headers, nimgl doesnt
20:49:43FromDiscord<TryAngle> oh thanks
20:50:10FromDiscord<Solitude> just importc and cdecl your stuff and you will be fine
20:50:52FromDiscord<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:57FromDiscord<TryAngle> btw when using libraries that have↵when defined(X)↵how can I define X when using that library?
20:51:33FromDiscord<Solitude> add `-d:X` to nim.cfg if you want it always
20:52:36FromDiscord<TryAngle> can I also put this into the project.nimble file?
20:52:42FromDiscord<Solitude> no
20:53:39FromDiscord<TryAngle> where would I put this file 😂 ?↵Sorry been using nim for only 2 days now
20:53:50FromDiscord<Solitude> where your source is
20:54:05FromDiscord<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:12FromDiscord<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:32FromDiscord<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)