<< 15-11-2023 >>

00:00:11Amun-Ra:P
00:07:29*void09 quit (Server closed connection)
00:07:45*void09 joined #nim
00:30:18FromDiscord<bostonboston> I use ufcs so liberally depending on how I feel that day
00:31:06FromDiscord<bostonboston> I often use it to trick oop fans into liking the code
02:25:49*krux02 quit (Remote host closed the connection)
02:27:58FromDiscord<xtrayambak> In reply to @Amun-Ra "I managed to finish": Wow, I might use this to create wlroots/libwayland bindings. Cool stuff!
03:09:46*edr quit (Quit: Leaving)
04:05:18FromDiscord<xtrayambak> Why does `discard`'ing an `owned(<...>)` result in this cryptic error? https://media.discordapp.net/attachments/371759389889003532/1174198412556644382/image.png?ex=6566b87d&is=6554437d&hm=4766693aaf2bc096445f1336e0297a6b5ae200ee69d834809d2244ddc8d523fa&
04:05:22FromDiscord<xtrayambak> Perhaps I should file a bug report?
04:15:37FromDiscord<fowl.mouth> https://nim-lang.org/docs/unittest.html#examples this example doesn't compile for me on nim 2.0.0 `/nim/lib/pure/unittest.nim(558, 34) Error: type mismatch: got 'None' for 'on' but expected 'bool'`
04:17:40FromDiscord<fowl.mouth> nvm its fine by itself just not good in my code. I need to sleep
04:27:17FromDiscord<Elegantbeef> Likely you overloaded `on` with an enum
05:49:35FromDiscord<user2m> sent a code paste, see https://play.nim-lang.org/#ix=4Lxw
05:51:49FromDiscord<user2m> Ahh just realized typeof will do this
06:41:34*rockcavera quit (Remote host closed the connection)
07:03:36FromDiscord<Chronos [She/Her]> Didn't posits get mentioned in this server once or twice?
07:04:02FromDiscord<Chronos [She/Her]> I read about them and it seems like they're just more precise and sane floats?
07:08:06FromDiscord<demotomohiro> If I understand correctly, posits are more precise than float when the value is close to 1 but less precise when absolute value is large or close to zero.
07:11:10*advesperacit joined #nim
07:32:58FromDiscord<Chronos [She/Her]> Hm okay
07:47:30FromDiscord<odexine> that is correct
07:47:49FromDiscord<odexine> posits also of course have the caveat of lack ofhardware acceleration
07:47:50FromDiscord<odexine> (edit) "ofhardware" => "of hardware"
08:13:47FromDiscord<Chronos [She/Her]> I thought they were designed to take the FPU into account?
08:27:13FromDiscord<odexine> I don’t think so? I don’t remember
08:28:28FromDiscord<Chronos [She/Her]> Hm
08:50:53NimEventerNew thread by hunterbr: Printout all used functions in a module at built time, see https://forum.nim-lang.org/t/10637
09:35:42*Jjp137 quit (Server closed connection)
09:36:03*Jjp137 joined #nim
10:12:13*ttkap quit (Server closed connection)
11:37:08NimEventerNew thread by rel: Proc/func/method: syntax, see https://forum.nim-lang.org/t/10639
12:37:29*edr joined #nim
12:49:27*via quit (Server closed connection)
12:49:35*via joined #nim
13:04:04FromDiscord<eebahn> In reply to @user2m "How could I write": `$(obj.type)`
13:04:35FromDiscord<eebahn> (edit) "In reply to @user2m "How could I write": `$(obj.type)` ... " added "or `$type(obj)`"
13:16:13*lucasta joined #nim
13:31:39FromDiscord<Chronos [She/Her]> In reply to @NimEventer "New thread by rel:": Why do people come to Nim expecting compiled Python? :P
13:36:23*jmdaemon quit (Ping timeout: 268 seconds)
13:38:22FromDiscord<bostonboston> Hate that syntax
13:39:14FromDiscord<ieltan> In reply to @chronos.vitaqua "Why do people come": because people promoting Nim say it's like compiled Python, tbh i was guilty of this in the past
13:39:20FromDiscord<bostonboston> I think the biggest thing it detracts is that min functions and procedures are conducive to being treated as expressions, and removing the `=` ruins that feel
13:41:04FromDiscord<bostonboston> I read `...: int =` as you are assigning the result of some expression to an int
13:41:28FromDiscord<ieltan> the `->` syntax is already taken in sugar to define function typedesc anyways
13:42:02FromDiscord<ieltan> (edit) "sugar" => "std/sugar"
13:43:14FromDiscord<ieltan> i feel Nim's syntax is already pretty good except for pragmas imo, would be nice if we could use them above procs or below them
13:45:26FromDiscord<bostonboston> I think you can make a macro for that but it'll be it's own form of ugly
14:03:14FromDiscord<odexine> personally i think pragmas are p ugly but so are decorators
14:03:49FromDiscord<bostonboston> Similar to what he said I just think the location of pragmas are ugly
14:05:55FromDiscord<odexine> i dont know where i would put pragmas, i feel like any location would look ugly
15:01:36*lain quit (Ping timeout: 245 seconds)
15:02:56*lain joined #nim
15:08:18Amun-Raieltan: i'd agree nim is like compiled python, what I wouldn't agree nim is compiled python
15:19:31FromDiscord<nervecenter> I usually qualify it: Feels like compiled python, but it still is definitely its own beast and you are not getting dynamic features (except in std/json)
15:19:56FromDiscord<nervecenter> Syntactically is really the key point
15:20:43FromDiscord<nervecenter> Semantically it's more similar to Java
15:21:16FromDiscord<nervecenter> With some Haskell/Lisp referential transparency sprinkled on top
15:21:59FromDiscord<nervecenter> You can do a lot of expression-based programming in Nim which is unique for a native compiled systems language
15:22:13FromDiscord<nervecenter> Most seam to have really leaky abstractions
15:22:18FromDiscord<nervecenter> (edit) "seam" => "seem"
15:23:52*rockcavera joined #nim
15:38:34*lucasta quit (Quit: Leaving)
15:47:06FromDiscord<gcao> sent a code paste, see https://paste.rs/nicLj
15:47:50FromDiscord<gcao> (edit) "https://play.nim-lang.org/#ix=4LzS" => "https://play.nim-lang.org/#ix=4LzR"
15:53:14Amun-Ragcao: what's that -5 for?
15:54:42Amun-Ragcao: https://play.nim-lang.org/#ix=4LzU
15:54:54Amun-Rathere are better ways to do that, btw
15:58:02Amun-Ragcao: mind that on x86 0x12_34_56_78'u32 is layed out in memory as [0x78, 0x56, 0x34, 0x21]
16:01:30FromDiscord<gcao> based on the memory layout I believe the characters start at a.addr - 5
16:02:08FromDiscord<gcao> a is an int64 on my Mac
16:02:54Amun-Raif you do the casts, always use fixed width integer types
16:03:38Amun-Ragiven a = 0x123456'u64 the data starts at a[0].addr and ends at a[2].addr
16:04:02Amun-Rastarts/end - relative to memory address, not the byte value
16:04:20Amun-Rareverse these addresses to start with ^
16:09:23FromDiscord<gcao> sent a code paste, see https://play.nim-lang.org/#ix=4LzZ
16:11:18Amun-Rayes, you get garbage from whatever was in memort before 'a'
16:11:33Amun-Raadd ASAN/UBSAN and your program should fail
16:11:51Amun-Ratake a look: https://play.nim-lang.org/#ix=4LA2
16:13:19Amun-Ralet b = 1'u64, a = 2'u64 and with high probability reading a-5 will result in reading from b (assuming b and a are layed out in memory as in code)
16:13:41FromDiscord<gcao> :ok
16:13:46FromDiscord<gcao> (edit) ":ok" => "👌"
16:18:18FromDiscord<eebahn> In reply to @gcao "hi I'm trying to": `treeform/binny` has support for this
16:24:54FromDiscord<gcao> let me share some background, I'm using float NaN tagging to represent short strings in a 64bit word (0-6 chars). Now I'm trying to recreate the string from the word. How can I do it efficiently?
16:25:38FromDiscord<gcao> sent a code paste, see https://play.nim-lang.org/#ix=4LA8
16:26:50FromDiscord<odexine> using floats for SSO sounds kinda cursed not gonna lie
16:27:10FromDiscord<gcao> what is SSO?
16:27:18FromDiscord<odexine> short string optimisation
16:27:49FromDiscord<odexine> or i guess its not SSO, just string hiding of some sort
16:28:43FromDiscord<odexine> what is "x > 0xFF_FFFF" supposed to do for the algorithm exactly?
16:32:08FromDiscord<gcao> means there are 1s before the last 24 bits. the string is longer than 3
16:33:13Amun-Rathis offsets are all wrong
16:33:21Amun-Rathese
16:35:43FromDiscord<gcao> what's the right way to do it? I don't like to use copyMem if possible, but whatever we use, it has to be fast
16:37:22Amun-Rawrong start address, wrong memory layour, wrong ifs
16:37:29Amun-Ralayout*
16:38:59Amun-Rathat's because you still think the data is layed out in memory differently than it really is
16:40:43Amun-Raand what's missing is reversing the string as the last step
16:43:37Amun-Rayou always start at 0, you change the number of bytes to copy based on the range
16:43:47Amun-Raand you reverse the string as last step
16:44:27FromDiscord<gcao> you are right. let me try to start from 0 and go up and see how it goes
16:44:27Amun-Racopmem(s[0].addr, a[0].addr, xxx) - only xxx changes
16:46:23FromDiscord<gcao> I'll change how the data is written when string is converted to Value, then I can skip the reverse operation.
16:56:35FromDiscord<gcao> now it works. thank you all for the help!
16:58:36Amun-Rano worries
17:08:07FromDiscord<gcao> sent a code paste, see https://play.nim-lang.org/#ix=4LAh
17:09:02FromDiscord<demotomohiro> We no longer need to care about endianess?
17:12:43FromDiscord<demotomohiro> Why do you want to rewrite it with copyMem?↵copyMem requires using addr that is unsafe in Nim.
17:14:26Amun-RaI mention endianness in my 1st example
17:27:25FromDiscord<gcao> as long as the to/from conversions are following the same convention, I assume endianess should not matter ?
17:32:38FromDiscord<demotomohiro> strings or array of 8bits int are same on both big and little endian machine.↵But 2 or larger bits int or float types are different on big and little endian machine.
17:50:55om3gaMay I ask, why elements are in descending order? https://play.nim-lang.org/#ix=4LAp
17:52:45FromDiscord<saint.___.> In reply to @om3ga "May I ask, why": Prob default sort?
17:55:48FromDiscord<demotomohiro> Add more large number like 10000 or more, it is actually not descending order.
18:03:34FromDiscord<demotomohiro> source code tells why: https://github.com/nim-lang/Nim/blob/devel/lib/pure/collections/tables.nim#L2233
18:05:33FromDiscord<demotomohiro> It is hashtable and elements are in random order.
18:07:08NimEventerNew thread by dwhall256: Nim not finding cross-compiler in PATH on Win10, see https://forum.nim-lang.org/t/10641
18:11:40FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4LAC
18:12:57FromDiscord<Chronos [She/Her]> In reply to @ieltan "because people promoting Nim": Fair
18:12:59*om3ga quit (Server closed connection)
18:13:10*om3ga joined #nim
18:13:32FromDiscord<Chronos [She/Her]> In reply to @ieltan "i feel Nim's syntax": Don't think there's a better way to put them sadly
18:37:57FromDiscord<srabb> nim
18:40:03FromDiscord<Chronos [She/Her]> Nim?
18:40:26FromDiscord<srabb> nim
18:44:33FromDiscord<Chronos [She/Her]> Making an API for a bot client is a tad tricky ngl, not sure how I'm supposed to even make it work
18:44:58FromDiscord<Chronos [She/Her]> Oh wait, it's mostly just events
18:45:25FromDiscord<Chronos [She/Her]> Yeah I'd just need to implement that event system I made and have an event handler object lol
18:56:25FromDiscord<demotomohiro> sent a long message, see http://ix.io/4LAL
18:59:34FromDiscord<jviega> The real point is that people are interested because on the surface it looks easy and accessible. But then most people don't have that kind of an experience because of other challenges, ofc
19:21:29FromDiscord<Phil> 😮‍💨 ↵Once again at a point where I kinda wanna use a C macro from nim and assign the output to a nim variable
19:23:05FromDiscord<Phil> Actually is that even possible?
19:34:49FromDiscord<Chronos [She/Her]> In reply to @isofruit "Actually is that even": Sure, if you emit C code :P
19:34:50FromDiscord<Chronos [She/Her]> Probably
19:34:55FromDiscord<Chronos [She/Her]> Maybe a better way to do it but idk
19:45:08*ttkap joined #nim
19:45:17Amun-Rathere isn't except maybe writing own CPP
19:46:54FromDiscord<Phil> Question, csize_t represents the size of an object.↵How exactly? It is the number of bits right?
19:47:14FromDiscord<Chronos [She/Her]> I'd imagine it's the number of bytes
19:47:15FromDiscord<Phil> (edit) "Question, csize_t represents the size of an object.↵How exactly? It is the number of bits ... right?" added "needed to represent one instance of an object"
19:47:19FromDiscord<Chronos [She/Her]> Can't you check it or something?
19:47:45FromDiscord<Phil> SO hands me this nice sentence:↵> This type is used to represent the size of an object. Library functions that take or return sizes expect them to be of type or have the return type of size_t. Further, the most frequently used compiler-based operator sizeof should evaluate to a constant value that is compatible with size_t.↵> ↵> As an implication, size_t is a type guaranteed to hold any array index.
19:48:14FromDiscord<raynei486> In reply to @isofruit "Question, csize_t represents the": it's the max size an object can be
19:48:15Amun-Racsize_t has size large enough to store the largest object of any type
19:48:35FromDiscord<Phil> In reply to @raynei486 "it's the max size": I mean yeah , but in bit? In potatos? In fries?
19:48:40FromDiscord<Phil> In byte?
19:48:44Amun-Rabytes
19:48:54FromDiscord<jviega> sizeof() returns bytes yes.
19:48:57FromDiscord<raynei486> yeah because sizeof(char) == 1
19:48:57FromDiscord<jviega> It works the same in nim
19:49:28FromDiscord<Phil> Check, that's what I was missing.
19:49:40FromDiscord<Phil> I swear, programmers need to get drilled more of specifying the units of their operations!
19:49:53FromDiscord<Phil> (edit) "of" => "on"
19:51:08FromDiscord<Phil> I accusingly point that finger at anyone except for me because I never make mistakes like that (/s) 🧐
19:52:24FromDiscord<Phil> Wait, that can't be right
19:53:31FromDiscord<Phil> `proc gtk_shortcuts_shortcut_get_type(): GType` returns a GType which in owlkettle is defined as `type GType = distinct csize_t`↵For a single Widget that returns the value `94467274703040`↵↵That's `94_467_274_703_040` like terrabyte levels
19:53:58FromDiscord<jviega> Well there's undoubtedly a bug somewhere
19:54:21FromDiscord<Phil> I mean it works correctly, so most likely with the way I wish to print this out
19:54:46FromDiscord<Phil> Because I'd notice if it tried to allocate 94 terrabytes of memory
19:55:00Amun-Rayou should buy more ram
19:55:15FromDiscord<Phil> Nah man, get with the times, downloading RAM is in
19:55:54Amun-Rahmm, in my implementation GType = GSize and GSize is culong
19:56:06FromDiscord<jviega> Probably, though memory is generally virtual till you write to it; if you don't use it and it doesn't page in, who knows, the OS might shrug
19:56:20Amun-Rasame size
19:56:55FromDiscord<Phil> Yeah if I replace it with culong I get the same number
19:57:03FromDiscord<Phil> No wait, different number
19:57:28FromDiscord<Phil> `94_260_531_981_184`↵Still 94 terrabyte
19:57:40Amun-Rawell, that returns type id
19:58:12Amun-RaI think 0x55babd866b80 is magic value
19:59:35Amun-Ragtk_shortcuts_shortcut_get_type does not return any size
20:00:05FromDiscord<Phil> Then.... yeah I dunno
20:00:11Amun-Rayou can use it with g_object_new as 1st arg
20:00:25FromDiscord<Phil> Yeah that was the intention
20:00:27Amun-Raand the first arg of g_object_new is GType object_type
20:00:35FromDiscord<Phil> Not sure why GType is defined as distinct csize_t then
20:00:39FromDiscord<Phil> Though not like it matters too much
20:00:55Amun-Rato be able to hold any value in the system
20:01:23Amun-Rait's distinct because it does not store any value but type IDs
20:01:37Amun-Raany size value*
20:02:26Amun-Rathey could use uint64_t for that too
20:03:45Amun-Raand I fixed my glib2 module: type GType* = distinct GSize
20:03:47Amun-Ra:)
20:42:43*jmdaemon joined #nim
20:54:08FromDiscord<Chronos [She/Her]> Hey y'all, what does Nim fit into? Since C fits into systems programming (and some say so does C), but how about Nim? I would've thought systems programming but I'm being told otherwise (that Nim's goal is just completely general purpose)
20:54:34FromDiscord<Chronos [She/Her]> Like, what is it's niche?
20:56:51FromDiscord<stoneface86> maybe it doesn't have one?
20:57:23FromDiscord<stoneface86> I've always considered it as an alternative for C/C++ but it seems it can do almost anything
20:57:34FromDiscord<Phil> I'd say more that it's "nieche" is the zero cost DSL approach it allows with C/C++ interop
20:57:55FromDiscord<Phil> That is a solution that can be applied to many problems.↵Owlkettle is imo a nicer example for using a DSL to solve a problem
20:58:01FromDiscord<Phil> (edit) "That is a solution that can be applied to many problems.↵Owlkettle is imo a nicer example for using a DSL to solve a problem ... " added "in appdev."
20:58:17FromDiscord<Phil> Meanwhile ormin is a DSL solution for DB interaction
20:58:22FromDiscord<Phil> (edit) "Meanwhile ormin is a DSL solution for DB interaction ... " added "and thus webdev"
20:58:50FromDiscord<Chronos [She/Her]> Hm, y'all alr if I take a screenshot of this and share it? Idk how else to reword it but
20:59:04FromDiscord<Chronos [She/Her]> Showing friends this since talking about languages
20:59:13FromDiscord<Phil> I mean sure
20:59:21FromDiscord<Phil> But I wouldn't call this representative
20:59:36FromDiscord<Phil> Like I for example don't have a fraction of the overview of the areas where it could be valuable
20:59:47FromDiscord<Chronos [She/Her]> Yeah fair
21:00:24FromDiscord<Phil> I have experience in webdev with dabbling in appdev.↵I can tell you it can be used for webdev just fine, doesn't have as good tooling as other languages but you get to compile it as a binary and deploy it much easier than 1 GB spring boot docker image
21:00:32FromDiscord<Phil> (edit) "I have experience in webdev with dabbling in appdev.↵I can tell you it can be used for webdev just fine, doesn't have as good tooling as other languages but you get to compile it as a binary and deploy it much easier than ... 1" added "a"
21:01:25FromDiscord<Phil> The lack of unit-testing possibilities also is a serious PITA for more enterprise-y webdev
21:01:30FromDiscord<Phil> Or rather it's a non-starter
21:02:38FromDiscord<guttural666> what's the technical term for the lhs again? https://media.discordapp.net/attachments/371759389889003532/1174454432679858186/image.png?ex=6567a6ed&is=655531ed&hm=301dd5607da69885bbc0b3f0bcfe3495116512e333a6ac5652dad6714b21b946&
21:02:54FromDiscord<Phil> like syntax?
21:02:58FromDiscord<guttural666> yeah
21:03:03FromDiscord<Phil> tuple unpacking?
21:03:15FromDiscord<raynei486> In reply to @chronos.vitaqua "Like, what is it's": I call it a language oriented language, something comparable to lisp
21:03:18FromDiscord<guttural666> unpacking yes, thanks
21:03:57FromDiscord<raynei486> it can be used for anything with the addition of allowing you to modify the language itself to make it more suitable for a certain purpose
21:05:30FromDiscord<Chronos [She/Her]> Fair
21:05:48FromDiscord<raynei486> tbh though
21:06:01FromDiscord<raynei486> most popular languages these days are general purpose anyways
21:06:09FromDiscord<raynei486> there's nothing really a modern programming language can't do
21:06:38FromDiscord<guttural666> most popular languages are crimes against humanity
21:07:08FromDiscord<raynei486> remember what bjarne said :)
21:07:21FromDiscord<guttural666> what did he say? 😄
21:07:58FromDiscord<raynei486> > There are only two kinds of languages: the ones people complain about and the ones nobody uses
21:08:39FromDiscord<guttural666> Bjarne is a connaisseur of Stockholm Syndrome I see
21:09:19FromDiscord<Phil> C++ leaves a bad taste in my mouth for the OO because I honestly have yet to see an actually good example of OO.
21:10:06FromDiscord<Phil> I feel like it leads to rather inflexible constructs a lot of the time where individual stations of a process are flexible in what they do but the process itself is static.↵And that is more difficult to adapt over time imo.
21:10:32FromDiscord<guttural666> to be fair, I actually gained a bit of a better appreciation for C++ when using it in KDE projects with Qt, Qt does some heavy lifting for you and makes C++ usage more pleasant
21:11:19FromDiscord<guttural666> simplifies a lot of stuff an makes it feel more like a normal C-style language
21:11:23FromDiscord<Phil> I haven't used C++, basically my only association with it is through knowing about it, some playing around with Qt and the fact it supported a wave of OO popularity
21:11:27FromDiscord<raynei486> In reply to @guttural666 "Bjarne is a connaisseur": I think he's a genius in some ways by creating so much from the base of C
21:11:42FromDiscord<raynei486> esoteric rules don't work well when you expand it to 1500 pages
21:13:18FromDiscord<guttural666> lack of compile time reflection is just a hard pass for me
21:13:53FromDiscord<guttural666> having to use stupid build systems, no package manager as well
21:14:40FromDiscord<guttural666> nimble build is the minimum I expect to have a decent day
21:17:20*jmdaemon quit (Ping timeout: 256 seconds)
21:22:52FromDiscord<Elegantbeef> You get git submodules and you'll like it!
21:23:13FromDiscord<guttural666> what?
21:24:42FromDiscord<Elegantbeef> I said "YOU GET GIT SUBMODULES AND YOU'LL LIKE IT"
21:24:59FromDiscord<guttural666> what's the "it"
21:25:05FromDiscord<guttural666> submodules?
21:25:19FromDiscord<Elegantbeef> Yes
21:25:23FromDiscord<guttural666> oh okay 😄
21:25:26*advesperacit quit ()
21:25:52*jmdaemon joined #nim
21:27:39FromDiscord<raynei486> In reply to @guttural666 "having to use stupid": well it does fit the philosophy of "30 slightly different ways to do the same thing" :P
21:29:01FromDiscord<guttural666> build systems do yeah, people are confusing me with their lack of subjects in their sentences today 😛
21:29:42FromDiscord<raynei486> you get pronouns and you'll like it
21:30:18FromDiscord<raynei486> who actually needs nouns
21:30:42FromDiscord<Elegantbeef> Jesus aint use no pronouns 😛
21:33:09FromDiscord<raynei486> "it" can refer to my lunch, the post office, or ice cream
21:33:18FromDiscord<raynei486> if that's not expressive I don't know what is
21:33:24FromDiscord<Elegantbeef> It can refer to anything even a person
21:33:47FromDiscord<raynei486> hmmm
21:33:55FromDiscord<raynei486> oh well yes
21:34:04FromDiscord<raynei486> technically I don't want to admit it though
21:34:23FromDiscord<Elegantbeef> It is a conundrum
21:35:24FromDiscord<raynei486> it is a conundrum
21:41:20FromDiscord<guttural666> @ElegantBeef surely you can help here https://media.discordapp.net/attachments/371759389889003532/1174464172956848269/image.png?ex=6567afff&is=65553aff&hm=b1243a564834cb93196ff574379e71d8740adc9a721d339705f84d8b132d2476&
21:42:08FromDiscord<Elegantbeef> What's the problem?
21:42:29FromDiscord<guttural666> user error
21:42:33FromDiscord<guttural666> all good 😄
21:42:46FromDiscord<Elegantbeef> I see you are endorsing scanf over regex
21:42:58FromDiscord<Elegantbeef> Did my conversion work?! 😄
21:43:00FromDiscord<guttural666> yeah, I'm digging (into) it
21:43:07FromDiscord<Elegantbeef> It?
21:43:12FromDiscord<guttural666> 😄 yeah haha
21:43:37FromDiscord<guttural666> the problem is if I don't know IT exists, I'll just fall back to what I know should exist ^
21:43:44FromDiscord<Elegantbeef> Right
21:44:06FromDiscord<Elegantbeef> One thing I do think the stdlib needs is a nice `skip` proc
21:44:18FromDiscord<Elegantbeef> and a `skipUntil`
21:44:32FromDiscord<guttural666> what would that do and in what context?
21:45:31FromDiscord<Elegantbeef> So you can just do `data.scanf("$[skipUntil(\"Crawl-delay: \")] $i", id)`
21:46:51FromDiscord<Elegantbeef> or alternatively `data.scanf("$[skip({'\0'..'\255'} - {'C'})]rawl-delay: $i", id)`
21:47:13FromDiscord<guttural666> ah okay
21:47:38FromDiscord<guttural666> this does not seem to work somehow, still gives me 0 as a result (bottom) https://media.discordapp.net/attachments/371759389889003532/1174465761893429248/image.png?ex=6567b17a&is=65553c7a&hm=498400864d12b31dbc749369b9ad38f3ed3fe6db911e9a44c9f023f5a027ce84&
21:47:53FromDiscord<Elegantbeef> it does not iterate the string
21:47:56FromDiscord<Elegantbeef> It matches the start
21:48:00FromDiscord<Elegantbeef> hence the skip logic
21:48:04FromDiscord<guttural666> ohhh
21:48:19FromDiscord<guttural666> okay, so I'll read line by line
21:49:05FromDiscord<Elegantbeef> https://nim-lang.org/docs/httpcore.html#parseHeader%2Cstring also isn't this better?
21:50:23FromDiscord<Elegantbeef> Wait is your response a header?
21:50:55FromDiscord<Elegantbeef> Why is your `get` returning a header as the body if so
21:50:56FromDiscord<guttural666> https://www.metal-archives.com/robots.txt
21:56:07FromDiscord<Elegantbeef> I'd suggest parsing the text into a `Table[string, string]` so you can access all fields whenever you want
21:58:45FromDiscord<guttural666> just interested in the crawl delay rn
21:59:45FromDiscord<guttural666> I solved this the cave man way before, but maybe there is a better way https://media.discordapp.net/attachments/371759389889003532/1174468807922815007/image.png?ex=6567b450&is=65553f50&hm=00d1ae30e00a99ebf28cb96aab75f64419410989b5f76a4be7b585e179ff07aa&
22:01:27FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4LBE
22:03:52FromDiscord<guttural666> there we go https://media.discordapp.net/attachments/371759389889003532/1174469841827139715/image.png?ex=6567b546&is=65554046&hm=73169a41c8638a408ac6ec2f168ea6da7ddec7d51c3f7e45ab265e805c80d039&
22:04:07FromDiscord<guttural666> yes 🙂
22:04:17FromDiscord<guttural666> splitLines, perfect
22:04:48FromDiscord<guttural666> even better
22:06:34FromDiscord<guttural666> is this too much inlining? 😄 https://media.discordapp.net/attachments/371759389889003532/1174470524416565288/image.png?ex=6567b5e9&is=655540e9&hm=a5360c3e33b6c94dc59372b36469d876e49286ef1451afd69d772409caf35c58&
22:07:00FromDiscord<guttural666> or is there never too much
22:09:09FromDiscord<guttural666> maybe leaking the client? normally I defer: client.close()
22:10:05FromDiscord<Elegantbeef> Yes that's leaking the client
22:13:27FromDiscord<Elegantbeef> Inlining is an awful thing to do
22:18:07FromDiscord<guttural666> I dunno, depends on how interesting/complex/important things are at that point
22:18:55FromDiscord<guttural666> KDE dev guidelines allow for none I think, unsure about the performance implications for it anyway, probably zero
22:20:01FromDiscord<guttural666> if it's just simple busy work that is easily grasped by the title, I think it's good https://media.discordapp.net/attachments/371759389889003532/1174473911782625380/image.png?ex=6567b911&is=65554411&hm=46296b1a091f656eb39c312036c796ca1f8f7aa09c51909ab93f780d963a470c&
22:20:31FromDiscord<guttural666> signal to noise ratio I think is important
22:21:34FromDiscord<guttural666> basically the same as function chaining in other popular languages like Rust I think has a lot of this ->then this->then that stuff going on
22:23:49FromDiscord<Elegantbeef> It's less of chaining and more of having too much shit on a single line making it hard to grok
22:24:22FromDiscord<guttural666> yeah, too much is nasty, it depends I guess
22:25:02FromDiscord<guttural666> or if you want to handle error cases on certain levels
22:27:14FromDiscord<guttural666> how do I config a nimble or nim.cfg file if I have external dependencies like sqlite?
22:27:37FromDiscord<Elegantbeef> `requires "..."`
22:27:53FromDiscord<guttural666> or is that wholey dependent on say how yay / pacman / Arch handle installations?
22:28:00FromDiscord<Elegantbeef> Nimble/nimcfg do not have any method of fetching raw system libraries
22:28:39FromDiscord<guttural666> okay, but requires just handles things that nim/nimble can know about right?
22:28:42FromDiscord<Elegantbeef> https://nim-lang.org/docs/distros.html there is this library, but I've never used it
22:29:36FromDiscord<guttural666> who wrote all this stuff, this is insane
23:02:21*jmdaemon quit (Ping timeout: 246 seconds)
23:03:38FromDiscord<bostonboston> One of the the more than one less than three core developers
23:10:09*jmdaemon joined #nim
23:14:59FromDiscord<guttural666> a bit nonsensical that this without the else brance is not valid code, since result is default initialized to false https://media.discordapp.net/attachments/371759389889003532/1174487744429432884/image.png?ex=6567c5f3&is=655550f3&hm=8f66960e4310b5bb0d021a4b05884f0a273785a502c0b5367e886a8bba3b97ff&
23:15:22FromDiscord<Elegantbeef> It's a bit nonsensical to write that code
23:15:33FromDiscord<guttural666> how so
23:15:37FromDiscord<Elegantbeef> `proc running(watch: StopWatch): bool = watch.start != default(DateTime)`
23:15:55FromDiscord<guttural666> even better haha
23:15:58FromDiscord<Elegantbeef> It's not nonsensical that it is invalid
23:16:17FromDiscord<Elegantbeef> Expressions have to have a value for every branch or control flow
23:17:23FromDiscord<guttural666> result does have a default value though and it's not a case statement
23:18:34FromDiscord<Elegantbeef> You have an if expression
23:18:40FromDiscord<Elegantbeef> An expression has to have a value in every branch
23:18:46FromDiscord<guttural666> okay
23:18:52FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4LBT
23:19:29FromDiscord<guttural666> would have thought that it just defaults to default(type)
23:19:34FromDiscord<guttural666> on fall through
23:23:14FromDiscord<System64 ~ Flandre Scarlet> In reply to @isofruit "C++ leaves a bad": Nim is what C/C++ should be
23:43:03*mars-man joined #nim
23:46:00*mars-man quit (Client Quit)