00:00:11 | Amun-Ra | :P |
00:07:29 | * | void09 quit (Server closed connection) |
00:07:45 | * | void09 joined #nim |
00:30:18 | FromDiscord | <bostonboston> I use ufcs so liberally depending on how I feel that day |
00:31:06 | FromDiscord | <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:58 | FromDiscord | <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:18 | FromDiscord | <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:22 | FromDiscord | <xtrayambak> Perhaps I should file a bug report? |
04:15:37 | FromDiscord | <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:40 | FromDiscord | <fowl.mouth> nvm its fine by itself just not good in my code. I need to sleep |
04:27:17 | FromDiscord | <Elegantbeef> Likely you overloaded `on` with an enum |
05:49:35 | FromDiscord | <user2m> sent a code paste, see https://play.nim-lang.org/#ix=4Lxw |
05:51:49 | FromDiscord | <user2m> Ahh just realized typeof will do this |
06:41:34 | * | rockcavera quit (Remote host closed the connection) |
07:03:36 | FromDiscord | <Chronos [She/Her]> Didn't posits get mentioned in this server once or twice? |
07:04:02 | FromDiscord | <Chronos [She/Her]> I read about them and it seems like they're just more precise and sane floats? |
07:08:06 | FromDiscord | <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:58 | FromDiscord | <Chronos [She/Her]> Hm okay |
07:47:30 | FromDiscord | <odexine> that is correct |
07:47:49 | FromDiscord | <odexine> posits also of course have the caveat of lack ofhardware acceleration |
07:47:50 | FromDiscord | <odexine> (edit) "ofhardware" => "of hardware" |
08:13:47 | FromDiscord | <Chronos [She/Her]> I thought they were designed to take the FPU into account? |
08:27:13 | FromDiscord | <odexine> I don’t think so? I don’t remember |
08:28:28 | FromDiscord | <Chronos [She/Her]> Hm |
08:50:53 | NimEventer | New 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:08 | NimEventer | New 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:04 | FromDiscord | <eebahn> In reply to @user2m "How could I write": `$(obj.type)` |
13:04:35 | FromDiscord | <eebahn> (edit) "In reply to @user2m "How could I write": `$(obj.type)` ... " added "or `$type(obj)`" |
13:16:13 | * | lucasta joined #nim |
13:31:39 | FromDiscord | <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:22 | FromDiscord | <bostonboston> Hate that syntax |
13:39:14 | FromDiscord | <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:20 | FromDiscord | <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:04 | FromDiscord | <bostonboston> I read `...: int =` as you are assigning the result of some expression to an int |
13:41:28 | FromDiscord | <ieltan> the `->` syntax is already taken in sugar to define function typedesc anyways |
13:42:02 | FromDiscord | <ieltan> (edit) "sugar" => "std/sugar" |
13:43:14 | FromDiscord | <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:26 | FromDiscord | <bostonboston> I think you can make a macro for that but it'll be it's own form of ugly |
14:03:14 | FromDiscord | <odexine> personally i think pragmas are p ugly but so are decorators |
14:03:49 | FromDiscord | <bostonboston> Similar to what he said I just think the location of pragmas are ugly |
14:05:55 | FromDiscord | <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:18 | Amun-Ra | ieltan: i'd agree nim is like compiled python, what I wouldn't agree nim is compiled python |
15:19:31 | FromDiscord | <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:56 | FromDiscord | <nervecenter> Syntactically is really the key point |
15:20:43 | FromDiscord | <nervecenter> Semantically it's more similar to Java |
15:21:16 | FromDiscord | <nervecenter> With some Haskell/Lisp referential transparency sprinkled on top |
15:21:59 | FromDiscord | <nervecenter> You can do a lot of expression-based programming in Nim which is unique for a native compiled systems language |
15:22:13 | FromDiscord | <nervecenter> Most seam to have really leaky abstractions |
15:22:18 | FromDiscord | <nervecenter> (edit) "seam" => "seem" |
15:23:52 | * | rockcavera joined #nim |
15:38:34 | * | lucasta quit (Quit: Leaving) |
15:47:06 | FromDiscord | <gcao> sent a code paste, see https://paste.rs/nicLj |
15:47:50 | FromDiscord | <gcao> (edit) "https://play.nim-lang.org/#ix=4LzS" => "https://play.nim-lang.org/#ix=4LzR" |
15:53:14 | Amun-Ra | gcao: what's that -5 for? |
15:54:42 | Amun-Ra | gcao: https://play.nim-lang.org/#ix=4LzU |
15:54:54 | Amun-Ra | there are better ways to do that, btw |
15:58:02 | Amun-Ra | gcao: mind that on x86 0x12_34_56_78'u32 is layed out in memory as [0x78, 0x56, 0x34, 0x21] |
16:01:30 | FromDiscord | <gcao> based on the memory layout I believe the characters start at a.addr - 5 |
16:02:08 | FromDiscord | <gcao> a is an int64 on my Mac |
16:02:54 | Amun-Ra | if you do the casts, always use fixed width integer types |
16:03:38 | Amun-Ra | given a = 0x123456'u64 the data starts at a[0].addr and ends at a[2].addr |
16:04:02 | Amun-Ra | starts/end - relative to memory address, not the byte value |
16:04:20 | Amun-Ra | reverse these addresses to start with ^ |
16:09:23 | FromDiscord | <gcao> sent a code paste, see https://play.nim-lang.org/#ix=4LzZ |
16:11:18 | Amun-Ra | yes, you get garbage from whatever was in memort before 'a' |
16:11:33 | Amun-Ra | add ASAN/UBSAN and your program should fail |
16:11:51 | Amun-Ra | take a look: https://play.nim-lang.org/#ix=4LA2 |
16:13:19 | Amun-Ra | let 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:41 | FromDiscord | <gcao> :ok |
16:13:46 | FromDiscord | <gcao> (edit) ":ok" => "👌" |
16:18:18 | FromDiscord | <eebahn> In reply to @gcao "hi I'm trying to": `treeform/binny` has support for this |
16:24:54 | FromDiscord | <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:38 | FromDiscord | <gcao> sent a code paste, see https://play.nim-lang.org/#ix=4LA8 |
16:26:50 | FromDiscord | <odexine> using floats for SSO sounds kinda cursed not gonna lie |
16:27:10 | FromDiscord | <gcao> what is SSO? |
16:27:18 | FromDiscord | <odexine> short string optimisation |
16:27:49 | FromDiscord | <odexine> or i guess its not SSO, just string hiding of some sort |
16:28:43 | FromDiscord | <odexine> what is "x > 0xFF_FFFF" supposed to do for the algorithm exactly? |
16:32:08 | FromDiscord | <gcao> means there are 1s before the last 24 bits. the string is longer than 3 |
16:33:13 | Amun-Ra | this offsets are all wrong |
16:33:21 | Amun-Ra | these |
16:35:43 | FromDiscord | <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:22 | Amun-Ra | wrong start address, wrong memory layour, wrong ifs |
16:37:29 | Amun-Ra | layout* |
16:38:59 | Amun-Ra | that's because you still think the data is layed out in memory differently than it really is |
16:40:43 | Amun-Ra | and what's missing is reversing the string as the last step |
16:43:37 | Amun-Ra | you always start at 0, you change the number of bytes to copy based on the range |
16:43:47 | Amun-Ra | and you reverse the string as last step |
16:44:27 | FromDiscord | <gcao> you are right. let me try to start from 0 and go up and see how it goes |
16:44:27 | Amun-Ra | copmem(s[0].addr, a[0].addr, xxx) - only xxx changes |
16:46:23 | FromDiscord | <gcao> I'll change how the data is written when string is converted to Value, then I can skip the reverse operation. |
16:56:35 | FromDiscord | <gcao> now it works. thank you all for the help! |
16:58:36 | Amun-Ra | no worries |
17:08:07 | FromDiscord | <gcao> sent a code paste, see https://play.nim-lang.org/#ix=4LAh |
17:09:02 | FromDiscord | <demotomohiro> We no longer need to care about endianess? |
17:12:43 | FromDiscord | <demotomohiro> Why do you want to rewrite it with copyMem?↵copyMem requires using addr that is unsafe in Nim. |
17:14:26 | Amun-Ra | I mention endianness in my 1st example |
17:27:25 | FromDiscord | <gcao> as long as the to/from conversions are following the same convention, I assume endianess should not matter ? |
17:32:38 | FromDiscord | <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:55 | om3ga | May I ask, why elements are in descending order? https://play.nim-lang.org/#ix=4LAp |
17:52:45 | FromDiscord | <saint.___.> In reply to @om3ga "May I ask, why": Prob default sort? |
17:55:48 | FromDiscord | <demotomohiro> Add more large number like 10000 or more, it is actually not descending order. |
18:03:34 | FromDiscord | <demotomohiro> source code tells why: https://github.com/nim-lang/Nim/blob/devel/lib/pure/collections/tables.nim#L2233 |
18:05:33 | FromDiscord | <demotomohiro> It is hashtable and elements are in random order. |
18:07:08 | NimEventer | New thread by dwhall256: Nim not finding cross-compiler in PATH on Win10, see https://forum.nim-lang.org/t/10641 |
18:11:40 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4LAC |
18:12:57 | FromDiscord | <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:32 | FromDiscord | <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:57 | FromDiscord | <srabb> nim |
18:40:03 | FromDiscord | <Chronos [She/Her]> Nim? |
18:40:26 | FromDiscord | <srabb> nim |
18:44:33 | FromDiscord | <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:58 | FromDiscord | <Chronos [She/Her]> Oh wait, it's mostly just events |
18:45:25 | FromDiscord | <Chronos [She/Her]> Yeah I'd just need to implement that event system I made and have an event handler object lol |
18:56:25 | FromDiscord | <demotomohiro> sent a long message, see http://ix.io/4LAL |
18:59:34 | FromDiscord | <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:29 | FromDiscord | <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:05 | FromDiscord | <Phil> Actually is that even possible? |
19:34:49 | FromDiscord | <Chronos [She/Her]> In reply to @isofruit "Actually is that even": Sure, if you emit C code :P |
19:34:50 | FromDiscord | <Chronos [She/Her]> Probably |
19:34:55 | FromDiscord | <Chronos [She/Her]> Maybe a better way to do it but idk |
19:45:08 | * | ttkap joined #nim |
19:45:17 | Amun-Ra | there isn't except maybe writing own CPP |
19:46:54 | FromDiscord | <Phil> Question, csize_t represents the size of an object.↵How exactly? It is the number of bits right? |
19:47:14 | FromDiscord | <Chronos [She/Her]> I'd imagine it's the number of bytes |
19:47:15 | FromDiscord | <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:19 | FromDiscord | <Chronos [She/Her]> Can't you check it or something? |
19:47:45 | FromDiscord | <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:14 | FromDiscord | <raynei486> In reply to @isofruit "Question, csize_t represents the": it's the max size an object can be |
19:48:15 | Amun-Ra | csize_t has size large enough to store the largest object of any type |
19:48:35 | FromDiscord | <Phil> In reply to @raynei486 "it's the max size": I mean yeah , but in bit? In potatos? In fries? |
19:48:40 | FromDiscord | <Phil> In byte? |
19:48:44 | Amun-Ra | bytes |
19:48:54 | FromDiscord | <jviega> sizeof() returns bytes yes. |
19:48:57 | FromDiscord | <raynei486> yeah because sizeof(char) == 1 |
19:48:57 | FromDiscord | <jviega> It works the same in nim |
19:49:28 | FromDiscord | <Phil> Check, that's what I was missing. |
19:49:40 | FromDiscord | <Phil> I swear, programmers need to get drilled more of specifying the units of their operations! |
19:49:53 | FromDiscord | <Phil> (edit) "of" => "on" |
19:51:08 | FromDiscord | <Phil> I accusingly point that finger at anyone except for me because I never make mistakes like that (/s) 🧐 |
19:52:24 | FromDiscord | <Phil> Wait, that can't be right |
19:53:31 | FromDiscord | <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:58 | FromDiscord | <jviega> Well there's undoubtedly a bug somewhere |
19:54:21 | FromDiscord | <Phil> I mean it works correctly, so most likely with the way I wish to print this out |
19:54:46 | FromDiscord | <Phil> Because I'd notice if it tried to allocate 94 terrabytes of memory |
19:55:00 | Amun-Ra | you should buy more ram |
19:55:15 | FromDiscord | <Phil> Nah man, get with the times, downloading RAM is in |
19:55:54 | Amun-Ra | hmm, in my implementation GType = GSize and GSize is culong |
19:56:06 | FromDiscord | <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:20 | Amun-Ra | same size |
19:56:55 | FromDiscord | <Phil> Yeah if I replace it with culong I get the same number |
19:57:03 | FromDiscord | <Phil> No wait, different number |
19:57:28 | FromDiscord | <Phil> `94_260_531_981_184`↵Still 94 terrabyte |
19:57:40 | Amun-Ra | well, that returns type id |
19:58:12 | Amun-Ra | I think 0x55babd866b80 is magic value |
19:59:35 | Amun-Ra | gtk_shortcuts_shortcut_get_type does not return any size |
20:00:05 | FromDiscord | <Phil> Then.... yeah I dunno |
20:00:11 | Amun-Ra | you can use it with g_object_new as 1st arg |
20:00:25 | FromDiscord | <Phil> Yeah that was the intention |
20:00:27 | Amun-Ra | and the first arg of g_object_new is GType object_type |
20:00:35 | FromDiscord | <Phil> Not sure why GType is defined as distinct csize_t then |
20:00:39 | FromDiscord | <Phil> Though not like it matters too much |
20:00:55 | Amun-Ra | to be able to hold any value in the system |
20:01:23 | Amun-Ra | it's distinct because it does not store any value but type IDs |
20:01:37 | Amun-Ra | any size value* |
20:02:26 | Amun-Ra | they could use uint64_t for that too |
20:03:45 | Amun-Ra | and I fixed my glib2 module: type GType* = distinct GSize |
20:03:47 | Amun-Ra | :) |
20:42:43 | * | jmdaemon joined #nim |
20:54:08 | FromDiscord | <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:34 | FromDiscord | <Chronos [She/Her]> Like, what is it's niche? |
20:56:51 | FromDiscord | <stoneface86> maybe it doesn't have one? |
20:57:23 | FromDiscord | <stoneface86> I've always considered it as an alternative for C/C++ but it seems it can do almost anything |
20:57:34 | FromDiscord | <Phil> I'd say more that it's "nieche" is the zero cost DSL approach it allows with C/C++ interop |
20:57:55 | FromDiscord | <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:01 | FromDiscord | <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:17 | FromDiscord | <Phil> Meanwhile ormin is a DSL solution for DB interaction |
20:58:22 | FromDiscord | <Phil> (edit) "Meanwhile ormin is a DSL solution for DB interaction ... " added "and thus webdev" |
20:58:50 | FromDiscord | <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:04 | FromDiscord | <Chronos [She/Her]> Showing friends this since talking about languages |
20:59:13 | FromDiscord | <Phil> I mean sure |
20:59:21 | FromDiscord | <Phil> But I wouldn't call this representative |
20:59:36 | FromDiscord | <Phil> Like I for example don't have a fraction of the overview of the areas where it could be valuable |
20:59:47 | FromDiscord | <Chronos [She/Her]> Yeah fair |
21:00:24 | FromDiscord | <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:32 | FromDiscord | <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:25 | FromDiscord | <Phil> The lack of unit-testing possibilities also is a serious PITA for more enterprise-y webdev |
21:01:30 | FromDiscord | <Phil> Or rather it's a non-starter |
21:02:38 | FromDiscord | <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:54 | FromDiscord | <Phil> like syntax? |
21:02:58 | FromDiscord | <guttural666> yeah |
21:03:03 | FromDiscord | <Phil> tuple unpacking? |
21:03:15 | FromDiscord | <raynei486> In reply to @chronos.vitaqua "Like, what is it's": I call it a language oriented language, something comparable to lisp |
21:03:18 | FromDiscord | <guttural666> unpacking yes, thanks |
21:03:57 | FromDiscord | <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:30 | FromDiscord | <Chronos [She/Her]> Fair |
21:05:48 | FromDiscord | <raynei486> tbh though |
21:06:01 | FromDiscord | <raynei486> most popular languages these days are general purpose anyways |
21:06:09 | FromDiscord | <raynei486> there's nothing really a modern programming language can't do |
21:06:38 | FromDiscord | <guttural666> most popular languages are crimes against humanity |
21:07:08 | FromDiscord | <raynei486> remember what bjarne said :) |
21:07:21 | FromDiscord | <guttural666> what did he say? 😄 |
21:07:58 | FromDiscord | <raynei486> > There are only two kinds of languages: the ones people complain about and the ones nobody uses |
21:08:39 | FromDiscord | <guttural666> Bjarne is a connaisseur of Stockholm Syndrome I see |
21:09:19 | FromDiscord | <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:06 | FromDiscord | <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:32 | FromDiscord | <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:19 | FromDiscord | <guttural666> simplifies a lot of stuff an makes it feel more like a normal C-style language |
21:11:23 | FromDiscord | <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:27 | FromDiscord | <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:42 | FromDiscord | <raynei486> esoteric rules don't work well when you expand it to 1500 pages |
21:13:18 | FromDiscord | <guttural666> lack of compile time reflection is just a hard pass for me |
21:13:53 | FromDiscord | <guttural666> having to use stupid build systems, no package manager as well |
21:14:40 | FromDiscord | <guttural666> nimble build is the minimum I expect to have a decent day |
21:17:20 | * | jmdaemon quit (Ping timeout: 256 seconds) |
21:22:52 | FromDiscord | <Elegantbeef> You get git submodules and you'll like it! |
21:23:13 | FromDiscord | <guttural666> what? |
21:24:42 | FromDiscord | <Elegantbeef> I said "YOU GET GIT SUBMODULES AND YOU'LL LIKE IT" |
21:24:59 | FromDiscord | <guttural666> what's the "it" |
21:25:05 | FromDiscord | <guttural666> submodules? |
21:25:19 | FromDiscord | <Elegantbeef> Yes |
21:25:23 | FromDiscord | <guttural666> oh okay 😄 |
21:25:26 | * | advesperacit quit () |
21:25:52 | * | jmdaemon joined #nim |
21:27:39 | FromDiscord | <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:01 | FromDiscord | <guttural666> build systems do yeah, people are confusing me with their lack of subjects in their sentences today 😛 |
21:29:42 | FromDiscord | <raynei486> you get pronouns and you'll like it |
21:30:18 | FromDiscord | <raynei486> who actually needs nouns |
21:30:42 | FromDiscord | <Elegantbeef> Jesus aint use no pronouns 😛 |
21:33:09 | FromDiscord | <raynei486> "it" can refer to my lunch, the post office, or ice cream |
21:33:18 | FromDiscord | <raynei486> if that's not expressive I don't know what is |
21:33:24 | FromDiscord | <Elegantbeef> It can refer to anything even a person |
21:33:47 | FromDiscord | <raynei486> hmmm |
21:33:55 | FromDiscord | <raynei486> oh well yes |
21:34:04 | FromDiscord | <raynei486> technically I don't want to admit it though |
21:34:23 | FromDiscord | <Elegantbeef> It is a conundrum |
21:35:24 | FromDiscord | <raynei486> it is a conundrum |
21:41:20 | FromDiscord | <guttural666> @ElegantBeef surely you can help here https://media.discordapp.net/attachments/371759389889003532/1174464172956848269/image.png?ex=6567afff&is=65553aff&hm=b1243a564834cb93196ff574379e71d8740adc9a721d339705f84d8b132d2476& |
21:42:08 | FromDiscord | <Elegantbeef> What's the problem? |
21:42:29 | FromDiscord | <guttural666> user error |
21:42:33 | FromDiscord | <guttural666> all good 😄 |
21:42:46 | FromDiscord | <Elegantbeef> I see you are endorsing scanf over regex |
21:42:58 | FromDiscord | <Elegantbeef> Did my conversion work?! 😄 |
21:43:00 | FromDiscord | <guttural666> yeah, I'm digging (into) it |
21:43:07 | FromDiscord | <Elegantbeef> It? |
21:43:12 | FromDiscord | <guttural666> 😄 yeah haha |
21:43:37 | FromDiscord | <guttural666> the problem is if I don't know IT exists, I'll just fall back to what I know should exist ^ |
21:43:44 | FromDiscord | <Elegantbeef> Right |
21:44:06 | FromDiscord | <Elegantbeef> One thing I do think the stdlib needs is a nice `skip` proc |
21:44:18 | FromDiscord | <Elegantbeef> and a `skipUntil` |
21:44:32 | FromDiscord | <guttural666> what would that do and in what context? |
21:45:31 | FromDiscord | <Elegantbeef> So you can just do `data.scanf("$[skipUntil(\"Crawl-delay: \")] $i", id)` |
21:46:51 | FromDiscord | <Elegantbeef> or alternatively `data.scanf("$[skip({'\0'..'\255'} - {'C'})]rawl-delay: $i", id)` |
21:47:13 | FromDiscord | <guttural666> ah okay |
21:47:38 | FromDiscord | <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:53 | FromDiscord | <Elegantbeef> it does not iterate the string |
21:47:56 | FromDiscord | <Elegantbeef> It matches the start |
21:48:00 | FromDiscord | <Elegantbeef> hence the skip logic |
21:48:04 | FromDiscord | <guttural666> ohhh |
21:48:19 | FromDiscord | <guttural666> okay, so I'll read line by line |
21:49:05 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/httpcore.html#parseHeader%2Cstring also isn't this better? |
21:50:23 | FromDiscord | <Elegantbeef> Wait is your response a header? |
21:50:55 | FromDiscord | <Elegantbeef> Why is your `get` returning a header as the body if so |
21:50:56 | FromDiscord | <guttural666> https://www.metal-archives.com/robots.txt |
21:56:07 | FromDiscord | <Elegantbeef> I'd suggest parsing the text into a `Table[string, string]` so you can access all fields whenever you want |
21:58:45 | FromDiscord | <guttural666> just interested in the crawl delay rn |
21:59:45 | FromDiscord | <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:27 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4LBE |
22:03:52 | FromDiscord | <guttural666> there we go https://media.discordapp.net/attachments/371759389889003532/1174469841827139715/image.png?ex=6567b546&is=65554046&hm=73169a41c8638a408ac6ec2f168ea6da7ddec7d51c3f7e45ab265e805c80d039& |
22:04:07 | FromDiscord | <guttural666> yes 🙂 |
22:04:17 | FromDiscord | <guttural666> splitLines, perfect |
22:04:48 | FromDiscord | <guttural666> even better |
22:06:34 | FromDiscord | <guttural666> is this too much inlining? 😄 https://media.discordapp.net/attachments/371759389889003532/1174470524416565288/image.png?ex=6567b5e9&is=655540e9&hm=a5360c3e33b6c94dc59372b36469d876e49286ef1451afd69d772409caf35c58& |
22:07:00 | FromDiscord | <guttural666> or is there never too much |
22:09:09 | FromDiscord | <guttural666> maybe leaking the client? normally I defer: client.close() |
22:10:05 | FromDiscord | <Elegantbeef> Yes that's leaking the client |
22:13:27 | FromDiscord | <Elegantbeef> Inlining is an awful thing to do |
22:18:07 | FromDiscord | <guttural666> I dunno, depends on how interesting/complex/important things are at that point |
22:18:55 | FromDiscord | <guttural666> KDE dev guidelines allow for none I think, unsure about the performance implications for it anyway, probably zero |
22:20:01 | FromDiscord | <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:31 | FromDiscord | <guttural666> signal to noise ratio I think is important |
22:21:34 | FromDiscord | <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:49 | FromDiscord | <Elegantbeef> It's less of chaining and more of having too much shit on a single line making it hard to grok |
22:24:22 | FromDiscord | <guttural666> yeah, too much is nasty, it depends I guess |
22:25:02 | FromDiscord | <guttural666> or if you want to handle error cases on certain levels |
22:27:14 | FromDiscord | <guttural666> how do I config a nimble or nim.cfg file if I have external dependencies like sqlite? |
22:27:37 | FromDiscord | <Elegantbeef> `requires "..."` |
22:27:53 | FromDiscord | <guttural666> or is that wholey dependent on say how yay / pacman / Arch handle installations? |
22:28:00 | FromDiscord | <Elegantbeef> Nimble/nimcfg do not have any method of fetching raw system libraries |
22:28:39 | FromDiscord | <guttural666> okay, but requires just handles things that nim/nimble can know about right? |
22:28:42 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/distros.html there is this library, but I've never used it |
22:29:36 | FromDiscord | <guttural666> who wrote all this stuff, this is insane |
23:02:21 | * | jmdaemon quit (Ping timeout: 246 seconds) |
23:03:38 | FromDiscord | <bostonboston> One of the the more than one less than three core developers |
23:10:09 | * | jmdaemon joined #nim |
23:14:59 | FromDiscord | <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:22 | FromDiscord | <Elegantbeef> It's a bit nonsensical to write that code |
23:15:33 | FromDiscord | <guttural666> how so |
23:15:37 | FromDiscord | <Elegantbeef> `proc running(watch: StopWatch): bool = watch.start != default(DateTime)` |
23:15:55 | FromDiscord | <guttural666> even better haha |
23:15:58 | FromDiscord | <Elegantbeef> It's not nonsensical that it is invalid |
23:16:17 | FromDiscord | <Elegantbeef> Expressions have to have a value for every branch or control flow |
23:17:23 | FromDiscord | <guttural666> result does have a default value though and it's not a case statement |
23:18:34 | FromDiscord | <Elegantbeef> You have an if expression |
23:18:40 | FromDiscord | <Elegantbeef> An expression has to have a value in every branch |
23:18:46 | FromDiscord | <guttural666> okay |
23:18:52 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4LBT |
23:19:29 | FromDiscord | <guttural666> would have thought that it just defaults to default(type) |
23:19:34 | FromDiscord | <guttural666> on fall through |
23:23:14 | FromDiscord | <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) |