00:02:07 | * | azimut quit (Ping timeout: 240 seconds) |
00:04:30 | * | azimut joined #nim |
00:39:39 | NimEventer | New question by Griffort: Is it possible to globally modify the AST in Nim?, see https://stackoverflow.com/questions/77803775/is-it-possible-to-globally-modify-the-ast-in-nim |
00:42:41 | * | jmdaemon quit (Ping timeout: 252 seconds) |
00:59:00 | FromDiscord | <girvo> In reply to @kiloneie "from what i've seen": Not that well in my experience |
00:59:12 | FromDiscord | <girvo> It'll work in some cases, but crashes were frequent and frustrating |
01:01:59 | FromDiscord | <ca_lobo_14153> can anyone explain why Nim does not get installed in the normal Linux locations, but apparently wants to reside in the ~/.nimble folder in your home directory with ~/.nimble/nim/bin being added to the your path? |
01:02:17 | FromDiscord | <ca_lobo_14153> This strategy confuses me.... |
01:02:40 | FromDiscord | <girvo> Because most systems work that way unless you're installing them through a package manager? |
01:05:12 | FromDiscord | <girvo> You can of course symlink them into /usr/local/bin (or your distros equivalent) if youd like 🙂 |
01:05:25 | FromDiscord | <girvo> I swear there's a `koch` command that does exactly that |
01:52:34 | FromDiscord | <girvo> sent a code paste, see https://paste.rs/BrHqK |
01:53:19 | FromDiscord | <girvo> sent a code paste, see https://paste.rs/MJIMB |
01:55:14 | FromDiscord | <leorize> they're only used for consts |
01:55:40 | FromDiscord | <leorize> N\_LIB\_PRIVATE should hide the symbols none the less |
01:55:41 | FromDiscord | <Elegantbeef> `{.codegendecl.}` is your friend likely |
02:20:40 | FromDiscord | <girvo> In reply to @Elegantbeef "`{.codegendecl.}` is your friend": Yeah I think it's the way to go for this one |
02:20:58 | FromDiscord | <girvo> Probably worth a macro/pragma |
02:22:14 | FromDiscord | <Elegantbeef> Sadly you cannot export pragmas |
02:22:18 | FromDiscord | <Elegantbeef> So would have to be a macro |
02:22:52 | FromDiscord | <Elegantbeef> But a `{.pragma: staticDecl, codegenDecl:"...}` would suffice |
02:23:41 | FromDiscord | <hugop707> In reply to @Elegantbeef "Sadly you cannot export": include enters the chat |
02:25:03 | FromDiscord | <girvo> In reply to @Elegantbeef "So would have to": indeed, thats how I've done it for some other ones |
02:25:56 | FromDiscord | <girvo> etc. |
02:26:01 | FromDiscord | <Elegantbeef> Using include is a toxic action and will result in me not responding to you |
02:26:13 | FromDiscord | <Elegantbeef> That macro will break in 2.0! |
02:26:24 | FromDiscord | <girvo> Oh will it? |
02:26:35 | FromDiscord | <girvo> One day I'll go read the breaking change list |
02:28:02 | FromDiscord | <girvo> sent a code paste, see https://paste.rs/8KIoB |
02:28:32 | FromDiscord | <Elegantbeef> var macros turned into just `typed` iirc |
02:30:28 | FromDiscord | <Elegantbeef> This fixed them to work on var sections with more than one variable and even different pragmas on different variables iirc |
02:30:45 | FromDiscord | <Elegantbeef> https://github.com/nim-lang/Nim/blob/version-2-0/lib/std/decls.nim#L5 my reference for how it's done in 2.0 |
02:31:27 | FromDiscord | <girvo> Ah okay sweet 🙂 |
02:31:31 | FromDiscord | <girvo> Thanks! |
03:11:52 | * | jmdaemon joined #nim |
04:08:27 | termer | Is it possible to overload the assignment operator in Nim |
04:08:50 | termer | suppose I have var thing = MyType() |
04:09:07 | termer | can I make thing = stuff do something custom |
04:11:32 | FromDiscord | <Elegantbeef> Nope |
04:11:39 | FromDiscord | <Elegantbeef> Generally people just make a `:=` or use a \`converter |
04:11:44 | FromDiscord | <Elegantbeef> The last is dirty though |
04:12:03 | termer | Converter could work |
04:12:17 | termer | I'm seeing if I can make Nim dynamic for fun |
04:12:35 | termer | Doing this after rereading the dot overload experimental docs |
04:13:25 | termer | Next, is it possible to have a ref of an unknown type |
04:13:49 | termer | basically a managed void* |
04:13:55 | termer | I've forgotten a lot of stuff |
04:14:16 | FromDiscord | <Elegantbeef> Only if you inherit from `RootObj` |
04:14:33 | termer | That works |
04:14:53 | FromDiscord | <Elegantbeef> https://github.com/beef331/traitor/blob/simpler-traits/traitor.nim#L26-L30 is a nice idiom |
04:17:19 | * | azimut quit (Ping timeout: 240 seconds) |
04:34:28 | * | rockcavera quit (Remote host closed the connection) |
04:47:05 | FromDiscord | <maker_of_mischief> is there a string length reader that doesnt use the bytes so it works with comparing the lengths of unicode strings and normal ones? |
04:47:12 | FromDiscord | <maker_of_mischief> (edit) "reader" => "proc" |
04:48:54 | FromDiscord | <Elegantbeef> `std/unicode` has utf8 supporting code |
04:49:25 | FromDiscord | <Elegantbeef> Remember that `[]` and `runelen` are `O(1)` though |
04:49:38 | FromDiscord | <Elegantbeef> are not `O(1)` |
04:50:10 | FromDiscord | <Elegantbeef> Damn it I'm not equipped for this `runeAt` and `runeLen` are not `O(1)` |
04:50:11 | FromDiscord | <Elegantbeef> There we go |
04:50:17 | FromDiscord | <Elegantbeef> A full sentence that makes sense |
05:25:32 | * | xet7 quit (Remote host closed the connection) |
05:26:35 | FromDiscord | <.bobbbob> Im using prolouge with nim, Im using session keys and have a route that sets the cookie based on a query string, then redirects it to another page that does something depending on that cookie. This works perfectly on firefox, but for some reason on chromium and qtwebengine it works sometimes but very unreliably. anyone have any idea why? |
06:25:33 | FromDiscord | <nnsee> In reply to @ca_lobo_14153 "can anyone explain why": /bin et al should only have binaries managed by your package manager. If you use your package manager to install Nim instead of choosenim, it will more than likely get installed in /use/bin |
06:26:14 | FromDiscord | <nnsee> having your install script or toolchain manager drop binaries into /usr/bin directly is very bad practice |
06:26:52 | FromDiscord | <nnsee> as Girvo said, most userland toolchain managers work this way |
06:27:05 | FromDiscord | <nnsee> (edit) "/use/bin" => "/usr/bin" |
06:27:38 | FromDiscord | <arathanis> sent a code paste, see https://paste.rs/KboQL |
06:28:34 | termer | I did it, I made a dynamic type with JS heuristics |
06:28:45 | termer | this is hilarious |
06:29:29 | termer | you can assign it to anything, there are converters for the types it can hold, there are logic operators, etc |
06:29:50 | FromDiscord | <nnsee> In reply to @nnsee "/bin et al should": for example, expand the file list here: https://archlinux.org/packages/extra/x86_64/nim/ |
06:29:51 | FromDiscord | <Robyn [She/Her]> Burn the witch! |
06:29:56 | termer | even has truthiness |
06:30:18 | FromDiscord | <Robyn [She/Her]> What is the point of that anyway |
06:30:29 | termer | to see if I could do it |
06:30:39 | termer | still needs arbitrary propertied and procs though |
06:30:50 | termer | Not sure how I could do dynamic proc calls |
06:31:19 | termer | would need some sort of macro to wrap procs in a runtime arg type checker |
06:37:42 | FromDiscord | <Robyn [She/Her]> Dot overloads? |
06:38:43 | FromDiscord | <Robyn [She/Her]> In reply to @termer "Not sure how I": Oh wait you might like the `()` overloading |
06:38:58 | termer | I know about that |
06:38:58 | FromDiscord | <Robyn [She/Her]> `Error: the overloaded () operator has to be enabled with {.experimental: "callOperator".}` |
06:39:18 | termer | but the signature would need to be vararg[auto] |
06:39:26 | FromDiscord | <Robyn [She/Her]> Ah |
06:39:35 | termer | then it would need to use a macro to generate a type guard |
06:39:51 | FromDiscord | <Robyn [She/Her]> I like your funny words magic man |
06:40:33 | termer | It seems totally possible to do this, but I think this silliness has gone on too long |
06:43:13 | FromDiscord | <Robyn [She/Her]> Yeah that's fair, what's your code so far, out of curiosity? |
06:43:40 | termer | Not on the computer I'm typing this from |
06:43:52 | FromDiscord | <Robyn [She/Her]> Fair |
06:43:55 | termer | but it's about 270 lines of crap |
06:44:05 | termer | lots and lots of when and case |
06:44:19 | termer | and auto |
06:44:23 | FromDiscord | <nimmy_1> the bot can talk :NAHWHAT: |
06:44:29 | termer | what |
06:45:08 | FromDiscord | <nimmy_1> never mind it |
06:45:30 | termer | One mistake in my code is DynType can hold a ref DynType |
06:45:39 | termer | that shouldn't be supported |
06:46:03 | termer | that was because I wanted to have types that inherit from it to support maplike objects and proc objects |
06:46:11 | termer | but those should be rolled into the type itself |
06:48:23 | FromDiscord | <Robyn [She/Her]> In reply to @nimmy_1 "never mind it": It's a bridge to IRC and Matrix |
06:48:36 | FromDiscord | <Robyn [She/Her]> In reply to @termer "but those should be": Fair |
06:48:45 | FromDiscord | <Robyn [She/Her]> In reply to @termer "One mistake in my": What if it's referencing itself though |
06:48:55 | FromDiscord | <nimmy_1> ic ic |
07:05:39 | * | baalajimaestro joined #nim |
07:40:13 | termer | If it's referencing itself, it shouldn't |
07:40:30 | termer | Just found a compiler bug |
07:45:40 | termer | var val: DynVal = 10 |
07:46:01 | termer | var coolString: DynVal = "COOL" |
07:46:11 | * | advesperacit joined #nim |
07:46:36 | termer | val = val.replace("1", "2") + 10 |
07:46:51 | termer | val &= "lol" |
07:47:12 | termer | val &= 10 & coolString & "lol" |
07:47:15 | termer | echo val |
07:47:27 | termer | This compiles |
07:47:35 | termer | Insane |
07:48:04 | termer | all these converters ruin type safety LOL |
07:48:22 | termer | echo "5" * 10 |
07:48:25 | termer | compiles |
08:11:18 | Amun-Ra | converters are useful for internal use with distinct types |
08:11:48 | Amun-Ra | two much converters and you end up with nim behaving like js… ;) |
08:40:47 | * | redj quit (Remote host closed the connection) |
08:42:09 | * | redj joined #nim |
08:54:27 | * | redj quit (Remote host closed the connection) |
08:55:57 | * | xet7 joined #nim |
08:57:09 | * | redj joined #nim |
09:35:43 | termer | That's the plan |
09:35:47 | termer | and it ended up working like that |
09:36:05 | termer | except I'm hitting some compiler bugs |
10:28:40 | FromDiscord | <bigmanzmanz> Made myself a payload launcher in nim, pretter proud. |
10:28:54 | FromDiscord | <bigmanzmanz> (edit) "pretter" => "prettey" |
10:28:59 | FromDiscord | <bigmanzmanz> (edit) "prettey" => "pretey" |
10:29:04 | FromDiscord | <bigmanzmanz> (edit) "pretey" => "pretty" |
10:29:11 | FromDiscord | <Phil> Out of curiosity, what do you mean by "payload launcher" ? |
10:31:21 | termer | is this malware |
10:31:28 | FromDiscord | <bigmanzmanz> No |
10:32:04 | FromDiscord | <bigmanzmanz> Its a way to distribute code for pentesting |
10:32:42 | FromDiscord | <Phil> But more like "what is the payload" e.g. |
10:32:47 | FromDiscord | <bigmanzmanz> Most malware would be in Golang |
10:33:18 | FromDiscord | <bigmanzmanz> In reply to @isofruit "But more like "what": idk |
10:33:26 | FromDiscord | <bigmanzmanz> Its a payload launcher |
10:33:34 | FromDiscord | <bigmanzmanz> like metasploit |
10:33:40 | FromDiscord | <bigmanzmanz> But less advanced |
10:33:49 | baalajimaestro | Not in nim? |
10:34:00 | FromDiscord | <bigmanzmanz> Its in nim |
10:34:21 | FromDiscord | <bigmanzmanz> Had to make one for my course |
10:43:43 | FromDiscord | <odexine> In reply to @bigmanzmanz "Most malware would be": Why? |
10:44:06 | FromDiscord | <odexine> Just curious |
10:45:27 | termer | Here's for anyone who wants to see my dynamic typing implementation https://git.termer.net/termer/nim-dynval |
10:51:04 | Amun-Ra | is var x: DynVal = 10; x == "10" true? |
10:52:15 | Amun-Ra | dynamic typing combined with weak typing is evil |
10:57:56 | NimEventer | New thread by termer: Dynamic Typing in Nim, see https://forum.nim-lang.org/t/10867 |
10:58:40 | FromDiscord | <Phil> In reply to @Amun-Ra "dynamic typing combined with": "This thing is evil, it is very bad and gives pain to everyone that touches it" |
10:58:48 | FromDiscord | <Phil> "I must publish this and tell the world" |
10:59:16 | FromDiscord | <pengwyns> Is there a way to work around CStringConv warnings? Like, what is the proper way to convert from cstrings? |
10:59:20 | termer | Amun-Ra I added all the funny type coercion you see in JS |
10:59:25 | termer | Not all, but a lot |
10:59:28 | termer | it makes it way funnier |
10:59:31 | FromDiscord | <Phil> Fuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu |
10:59:49 | FromDiscord | <Phil> I work in that shit, I have enough of that pain over there, I don't need it in nim |
10:59:51 | FromDiscord | <Phil> You sadist! |
11:00:03 | Amun-Ra | I have no problem with strong dynamic typing, but weak makes the world worse (see php and js) ;) |
11:00:07 | termer | I hate JS nonsense but my hate for it turned into an obsession |
11:00:19 | termer | and then I see how far I can get making things worse for Nim |
11:00:31 | Amun-Ra | hand up who remembers js/php truthy table ;) |
11:00:34 | termer | the best part is the fact that by simply importing the module, you lose a lot of strong typing |
11:00:45 | termer | I actually remember the truthy table in JS |
11:00:55 | termer | and all the implicit primitive conversions |
11:00:59 | termer | and array conversions |
11:01:18 | Amun-Ra | like this one? https://dorey.github.io/JavaScript-Equality-Table/ |
11:01:19 | termer | In PHP, I don't know it as well but I do know it |
11:01:49 | termer | Amun-Ra I know all those, yes |
11:02:00 | Amun-Ra | :/ |
11:02:01 | termer | there are also more obscure things, like ?? |
11:02:13 | FromDiscord | <pengwyns> Im not sure if i should try to modernize the nimforum codebase or start from scratch. |
11:02:13 | termer | NaN ?? 'lol' won't yield 'lol' |
11:02:22 | termer | but NaN || 'lol' will yield 'lol' |
11:02:41 | termer | don't forget number conversions |
11:03:05 | termer | or that ['5'] * 10 is 50 |
11:03:46 | Amun-Ra | !![]+!![] |
11:03:53 | termer | 2 |
11:04:56 | termer | but try out !!+[] * [''] |
11:05:52 | termer | There are even more fun things, like differences between JS environments |
11:06:07 | termer | typeof setTimeout(() => {}, 0) is 'number' in the browser, but 'object' in Node.js |
11:07:13 | termer | pengwyns What are you trying to do |
11:08:59 | NimEventer | New thread by drkameleon: A custom '=destroy' hook which takes a 'var T' parameter is deprecated, see https://forum.nim-lang.org/t/10868 |
11:10:00 | FromDiscord | <pengwyns> Just trying to get nimforum to build without errors or warnings. |
11:10:23 | FromDiscord | <pengwyns> And with the latest packages instead of specific commits |
11:11:59 | * | jmdaemon quit (Ping timeout: 260 seconds) |
12:21:48 | FromDiscord | <nnsee> In reply to @bigmanzmanz "Made myself a payload": what is a "payload launcher"? how does it "launch" payloads? |
12:42:29 | * | azimut joined #nim |
12:50:19 | FromDiscord | <ambient3332> sent a code paste, see https://paste.rs/lk9uN |
12:51:04 | * | azimut quit (Quit: ZNC - https://znc.in) |
12:51:51 | * | azimut joined #nim |
12:53:17 | FromDiscord | <ambient3332> (edit) "https://paste.rs/rqayZ" => "https://paste.rs/6Ybyw" |
12:53:24 | FromDiscord | <ambient3332> (edit) "https://paste.rs/AkzDp" => "https://paste.rs/IslHi" |
12:58:30 | * | rockcavera joined #nim |
13:02:05 | * | rockcavera quit (Read error: Connection reset by peer) |
13:02:52 | * | rockcavera joined #nim |
13:02:54 | termer | Does anyone (Elegantbeef) know whether I can get information about a proc's signature from a macro? |
13:02:57 | FromDiscord | <odexine> What is the variable size object supposed to be |
13:03:05 | termer | I need to get its arguments and return type |
13:05:49 | FromDiscord | <djazz> What if two procs have same name? 🤔 |
13:06:04 | termer | just need to get one passed into the macro by name |
13:06:09 | termer | https://stackoverflow.com/questions/76841073/how-to-get-all-fields-of-an-object-type-mytype-in-a-macro-from-a-nimnode-ident |
13:06:12 | termer | this looks like it's what I need |
13:06:16 | termer | at least partially |
13:06:27 | termer | actually you're right, it could be overloaded |
13:06:37 | termer | I dunno, not too worried about that |
13:07:40 | FromDiscord | <demotomohiro> @termer iirc, macro parameter type must be typed.↵And call getImpl or other similar name procs in macro module. |
13:08:05 | termer | Thanks |
13:10:51 | FromDiscord | <demotomohiro> In reply to @djazz "What if two procs": https://forum.nim-lang.org/t/8369 |
13:26:58 | * | azimut quit (Remote host closed the connection) |
13:28:28 | * | azimut joined #nim |
13:52:31 | * | azimut quit (Ping timeout: 240 seconds) |
13:53:10 | FromDiscord | <maker_of_mischief> is there a method to make a type in nim where if you access the variable it just returns the number |
13:53:21 | FromDiscord | <maker_of_mischief> instead of neexing to just do var.x or something |
13:53:26 | FromDiscord | <maker_of_mischief> (edit) "neexing" => "neexdng" |
13:53:30 | FromDiscord | <maker_of_mischief> (edit) "neexdng" => "needing" |
13:53:41 | FromDiscord | <khazakar> Enums? |
13:55:32 | FromDiscord | <maker_of_mischief> I mean like I'm trying to make a calculator |
13:55:50 | FromDiscord | <maker_of_mischief> and i want to be able to make a degree type |
13:56:21 | FromDiscord | <Phil> So... echo x.field? |
13:56:36 | FromDiscord | <Phil> Define a `$` and that will work |
13:58:31 | FromDiscord | <maker_of_mischief> sent a code paste, see https://paste.rs/L7Qru |
13:58:47 | FromDiscord | <Phil> Or if you want the assignment to work without the degree, then you can use a converter |
13:59:00 | FromDiscord | <maker_of_mischief> oh wow |
13:59:02 | FromDiscord | <maker_of_mischief> i forgot |
13:59:04 | FromDiscord | <Phil> But note that this will reduce type safety for you because every int may not also be assigned to a Degree variable and it'll be implicitly converted |
13:59:12 | FromDiscord | <maker_of_mischief> i can redifine literally everything using backticks |
13:59:15 | FromDiscord | <maker_of_mischief> i am stupid |
14:00:28 | FromDiscord | <Phil> sent a code paste, see https://paste.rs/UwvLF |
14:00:43 | FromDiscord | <Phil> In reply to @maker_of_mischief "i am stupid": Don't worry, programming for everyone feels that way |
14:01:36 | FromDiscord | <Phil> sent a code paste, see https://paste.rs/KZfId |
14:02:19 | FromDiscord | <Phil> sent a code paste, see https://paste.rs/E7As3 |
14:13:01 | FromDiscord | <nnsee> nim playground is down |
14:17:09 | FromDiscord | <Phil> huh, odd, the harddrive isn't even remotely full |
14:18:19 | FromDiscord | <Phil> Rebooting |
14:48:13 | FromDiscord | <Phil> Yep, its running |
14:48:21 | FromDiscord | <Phil> In reply to @nnsee "nim playground is down": pinging you |
15:03:32 | * | azimut joined #nim |
15:06:32 | * | azimut quit (Remote host closed the connection) |
15:06:59 | * | azimut joined #nim |
15:41:26 | FromDiscord | <srabb> how do i check all of the other channels on element |
15:41:39 | FromDiscord | <srabb> or matrix or whatever you wanna call it |
15:55:23 | FromDiscord | <Phil> By check you mean entering them? |
16:09:11 | FromDiscord | <srabb> yeah |
16:18:37 | FromDiscord | <Phil (he/him)> Hmm, there's a matrix space somewhere, leorize linked it a couple days ago I could go looking for that.↵Other than that, nim channels typically just have the nim-prefix.↵So just look for rooms called "nim".↵E.g. Nim offtopic, Nim Web Development etc. |
16:18:52 | FromDiscord | <leorize> #nim\:envs.net |
16:19:03 | FromDiscord | <Phil (he/him)> The man is faster than I ever could hope to be |
16:19:12 | FromDiscord | <Phil (he/him)> Given this keeps coming up, I'll put it in my notes |
16:19:50 | FromDiscord | <leorize> isn't this one linked pretty much everywhere? |
16:20:05 | FromDiscord | <Phil (he/him)> I struggle to find the link every time |
16:20:22 | FromDiscord | <Phil (he/him)> And it's in none of the room descriptions that I just checked |
16:20:31 | FromDiscord | <leorize> it's in the repo readme |
16:21:04 | FromDiscord | <leorize> on the homepage too |
16:21:12 | FromDiscord | <Phil (he/him)> image.png https://media.discordapp.net/attachments/371759389889003532/1195402107419889734/image.png?ex=65b3dbf7&is=65a166f7&hm=9d4301b168e4b01f0d29f1394b567cf5513017349ab452dd9d6fcc8c7e20a736& |
16:21:14 | FromDiscord | <Phil (he/him)> Ah, there we have it |
16:21:17 | FromDiscord | <Phil (he/him)> Still, best in notes |
16:21:32 | FromDiscord | <leorize> but not in the community tab |
16:21:39 | FromDiscord | <leorize> they should really fix this \:p |
16:29:01 | FromDiscord | <maker_of_mischief> is there a way to made a distinct integer type modify itself upon assignment? |
16:29:45 | FromDiscord | <maker_of_mischief> sent a code paste, see https://play.nim-lang.org/#ix=html> |
16:29:45 | FromDiscord | <Phil> As in, if you assign an integer type to a variable sth should happen? |
16:30:00 | FromDiscord | <Phil> You could encode that into the converter |
16:32:51 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=html> |
16:33:34 | FromDiscord | <maker_of_mischief> wow |
16:33:40 | FromDiscord | <maker_of_mischief> is there documentation for converters? |
16:33:42 | FromDiscord | <Phil> This assumes that x > -360, for larger negative numbers you'll likely need to first make X somehow smaller |
16:34:03 | FromDiscord | <maker_of_mischief> all i see is 4 lines of code on nim-lang |
16:34:06 | FromDiscord | <maker_of_mischief> (edit) "nim-lang" => "nim-lang.org" |
16:34:13 | FromDiscord | <Phil> Yep, in the manual of everything |
16:34:19 | FromDiscord | <Phil> One sec |
16:34:28 | FromDiscord | <Phil> https://nim-lang.org/docs/manual.html#converters |
16:34:39 | FromDiscord | <Phil> Converters really aren't much more than implicitly called procedures |
16:35:05 | FromDiscord | <Phil> Which is why typically they're really dangerous and I'd not recommend them |
16:35:16 | FromDiscord | <Phil> Because seeing thing = -10 turn into 350 is really confusing |
16:36:16 | FromDiscord | <Phil> Basically its magic and magic tends to not be good unless applied very carefully and thoughtfully |
16:36:27 | FromDiscord | <Phil> I'd recommend explicitly calling `toDegree` or every time.↵But if that somehow absolutely is not necessary for you, nim can technically do it. |
16:37:17 | FromDiscord | <maker_of_mischief> thats neat |
16:37:28 | FromDiscord | <maker_of_mischief> nim is the best language |
16:54:21 | * | nazgulsenpai quit (Ping timeout: 256 seconds) |
16:58:45 | * | nazgulsenpai joined #nim |
17:24:53 | FromDiscord | <Robyn [She/Her]> You can end up with JS in Nim, if you do what termer did with them :p |
17:49:09 | FromDiscord | <ezquerra> Is it possible to make a template that generates a function _with some documentation_ that is passed as one of the template arguments? |
17:51:48 | FromDiscord | <ezquerra> sent a code paste, see https://play.nim-lang.org/#ix=html> |
17:52:21 | FromDiscord | <Phil> Via macro, sure, via template - not even sure how to validate that since you can't see the NimNode |
17:53:03 | FromDiscord | <ezquerra> I'm trying to avoid reaching out for a macro unless it is necessary 🙂 |
17:53:39 | FromDiscord | <ezquerra> Not that I would know how to do it with a macro without investigating a bit more 😅 |
18:30:42 | FromDiscord | <gerydev> hey all, what possible reasons can be that when I run nimble build, it gives me this error? `ld: warning: directory not found for option '-L/li` |
18:31:22 | FromDiscord | <gerydev> I'm on mac, and I've a nim.cfg file as well specifying a lib path to nim, like:↵`passL: "-L/opt/homebrew/Cellar/nim/2.0.2/nim/lib/"` |
18:31:36 | FromDiscord | <gerydev> but still gives me headache to figure out what's his problem |
18:32:32 | termer | You should abuse converters until you have multiple layers of them everywhere |
18:32:42 | termer | That way, you don't need to think about types |
18:37:59 | FromDiscord | <leorize> don't put that in \:p↵(@gerydev) |
18:39:08 | FromDiscord | <leorize> add `--listCmd` to your build and post how Nim is invoking the C compiler here |
18:39:37 | termer | can you overload true and false |
18:40:00 | FromDiscord | <leorize> you can, they're just identifiers from system and not keywords |
18:40:14 | termer | I wanna do the funny C preprocessor sabotage where you replace true and false with random calls that have a small chance of not being true or false |
18:41:10 | FromDiscord | <leorize> `template true: untyped` should get you started \:p |
18:41:44 | FromDiscord | <arathanis> When you use `import X except Y` and there are overloads for Y, can you specify a specific one to omit or will it always omit all of them? |
18:42:00 | FromDiscord | <leorize> it will omit all of them |
18:42:03 | FromDiscord | <leorize> you can't select |
18:42:17 | FromDiscord | <arathanis> I figured that was going to be the case. Thanks |
18:58:54 | FromDiscord | <gerydev> In reply to @leorize "add `--listCmd` to your": How?? |
18:59:50 | FromDiscord | <gerydev> In reply to @gerydev "hey all, what possible": Anyone? |
19:00:46 | Amun-Ra | depends on how you build |
19:01:23 | Amun-Ra | if it's nim.cfg just add --listcmd if config.nims switch "listcmd", etc. |
19:01:57 | FromDiscord | <leorize> `nimble build --listcmd` should work |
19:06:53 | FromDiscord | <Robyn [She/Her]> In reply to @ezquerra "I'm trying to avoid": Macro is required |
19:07:37 | FromDiscord | <Robyn [She/Her]> Though, only a small one is needed |
19:13:44 | FromDiscord | <Robyn [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=html> |
19:13:50 | FromDiscord | <Robyn [She/Her]> Keyword is should |
19:15:24 | * | nmz left #nim (Ploop) |
19:33:35 | FromDiscord | <nnsee> finish my paste service, build and deploy on my server, aaaand it segfaults |
19:33:38 | FromDiscord | <nnsee> beautiful |
19:34:08 | FromDiscord | <nnsee> trying to figure out why it doesn't segfault on my local machine |
19:34:38 | FromDiscord | <Robyn [She/Her]> In reply to @nnsee "finish my paste service,": I can test locally too, if the source is public |
19:36:38 | FromDiscord | <nnsee> that's okay, thanks, I'm probably done for tonight and will have a proper look tomorrow. There's no documentation at all on how to set it up right now |
19:38:02 | FromDiscord | <Robyn [She/Her]> Fair enough, good luck :P |
19:38:47 | FromDiscord | <Robyn [She/Her]> Really wanna work on my projects but the code ends up messy and I hate it :/ |
19:39:02 | FromDiscord | <Robyn [She/Her]> Really wish I could make something like Blockly and have drag and drop code blocks |
19:44:27 | FromDiscord | <nnsee> sent a long message, see <!doctype html> |
19:59:36 | termer | nnsee, What's it made using? |
20:00:34 | termer | If you're using Prologue with threads on ORC, it's liable to segfault |
20:00:34 | FromDiscord | <Phil> Prologue, so the server underneath is httpbeast |
20:00:49 | FromDiscord | <Phil> It is? |
20:01:15 | termer | Jester and Prologue both segfault on ORC with threads if you have concurrency going on because of some race condition |
20:01:24 | termer | That was true mid last year anyway |
20:01:54 | termer | Building with release also can increase the chance since things run faster |
20:02:23 | termer | I don't know if this is still the case, but this was true when I last used them |
20:02:34 | FromDiscord | <Phil> Ah, I likely never ran into that because my server is only one thread |
20:02:42 | FromDiscord | <Phil> as in, the vm is limited to one thread |
20:03:07 | FromDiscord | <Robyn [She/Her]> In reply to @nnsee "(... but if you": I do not understand why it won't paste the output on my local machine :p |
20:03:08 | termer | Always test with wrk or bombardier on a machine with multiple threads |
20:03:09 | FromDiscord | <Robyn [She/Her]> Curl hangs |
20:04:52 | termer | l hate to he a downer, but Prologue and Jester both have major issues that prevent them from being good choices |
20:05:30 | termer | Mummy and Gildenstern both perform well and handle common use cases much better |
20:05:50 | FromDiscord | <Robyn [She/Her]> Gildenstern? |
20:06:00 | termer | HappyX is interesting but it released some time after I was benchmarking web frameworkd |
20:06:10 | termer | Gildenstern is very similar to Mummy |
20:06:16 | FromDiscord | <Robyn [She/Her]> GuildenStern, ah |
20:06:39 | termer | There has been a lot of work put into HappyX and I'm really glad to see it |
20:06:58 | termer | it supports multiple HTTP backend, including my favorite MicroAsyncHttpServer |
20:07:03 | FromDiscord | <Robyn [She/Her]> That's fair |
20:07:07 | FromDiscord | <Robyn [She/Her]> MicroAsyncHttpServer?- |
20:07:40 | termer | https://github.com/philip-wernersbach/microasynchttpserver |
20:07:42 | FromDiscord | <Robyn [She/Her]> Oh nice |
20:08:18 | termer | Significantly faster than asynchttpserver and doesn't have the same memory leak problem |
20:08:30 | FromDiscord | <Robyn [She/Her]> Oh neat |
20:08:43 | FromDiscord | <Robyn [She/Her]> Also I thought the mem leak problem was because of asyncdispatch itself |
20:09:15 | termer | something in asyncdispatch and asyncnet, but micro allocates such little memory that it's much less of a problem |
20:09:29 | termer | In general I wouldn't use asyncdispatch for anything |
20:09:49 | termer | Chronos is better but largely undocumented |
20:10:40 | termer | nim-sys is the best in terms of usability and performance, but it depends on Nimworks' CPS library, which suffers from limitations and slow compile times |
20:11:02 | FromDiscord | <Robyn [She/Her]> Fair |
20:11:16 | FromDiscord | <nnsee> In reply to @termer "If you're using Prologue": I guessed it might've been something like that, thanks |
20:11:25 | termer | Try Mummy nnsee |
20:11:44 | FromDiscord | <nnsee> although the question of why it doesn't crash on my own machine still stands |
20:11:46 | FromDiscord | <Robyn [She/Her]> Is chronos a drop-in replacement for asyncdispatch, in most cases? |
20:11:52 | termer | No |
20:12:19 | termer | Well, if it's your own code and you don't rely on any asyncdispatch quirks, then maybe |
20:12:28 | termer | but not for 3rd party libs |
20:12:34 | termer | most don't support chronos at all |
20:13:18 | termer | Chronos has a built in HTTP server with a lot of things, and that actually is very usable |
20:13:22 | termer | Performance sucks though |
20:13:47 | termer | Not as bad as HttpBeast, and definitely not as bad as asynchttpserver |
20:14:05 | termer | but it still is slow compared to basically anything from the Go ecosystem |
20:14:17 | termer | its speed is comparable to Node.js's HTTP module |
20:14:34 | FromDiscord | <Robyn [She/Her]> Unfortunate |
20:14:55 | termer | But it does handle file upload without using up insane amounts or memory and stalling |
20:15:23 | termer | httpbeast is a hunk of garbage that can be DoS'd by simply sending it a bunch of large payloads |
20:15:30 | FromDiscord | <Robyn [She/Her]> Oh damn |
20:15:49 | FromDiscord | <Robyn [She/Her]> So Mummy or GuildenStern are the best equivalents? |
20:16:04 | termer | Also its benchmarks are bullshit because it uses HTTP pipelining which browsers and reverse proxies don't even support |
20:16:13 | termer | Mummy is a good choice for most people |
20:16:35 | FromDiscord | <Robyn [She/Her]> In reply to @termer "Also its benchmarks are": Ah |
20:16:39 | FromDiscord | <Robyn [She/Her]> In reply to @termer "Mummy is a good": air |
20:16:41 | termer | I'd also look into HappyX, although I can't vouch for it much since I only touched a little bit of it |
20:16:41 | FromDiscord | <Robyn [She/Her]> Fair |
20:17:18 | termer | HappyX is very interesting because it seems to be a fullstack framework |
20:17:26 | FromDiscord | <djazz> i have started working on an async module for embedded, Rpi Pico in this case |
20:17:34 | termer | You should use CPS |
20:17:39 | termer | start it off right |
20:18:34 | FromDiscord | <Phil> Personally HappyX would peak my interest because from what I can see I can only conclude Ethosa is on crack |
20:18:46 | FromDiscord | <Phil> In a good way |
20:18:53 | termer | djazz I'm sorry I still haven't had time to try picostdlib |
20:19:35 | termer | HappyX has too much magic for my taste, but it's ambitious, and the author has even made extra tooling for it |
20:19:39 | FromDiscord | <Phil> I mean CPS is mostly useful for task parallelism no? |
20:20:03 | FromDiscord | <Phil> It doesn't epoll so you'd still need to use async if what you're doing is more IO heavy |
20:20:13 | FromDiscord | <Phil> it doesn't epoll afaik |
20:20:18 | termer | yes, CPS is just the way you manage tasks |
20:20:32 | termer | but it can be used in tandem with async to make it nicer |
20:20:51 | termer | Compared to async/await style, it's much more efficient since there are fewer allocations |
20:21:03 | FromDiscord | <Phil> Yeh, I chat with leo & friends about CPS and the statement I heard that typically you don't want to use both |
20:21:05 | termer | And if you're clever, you can reuse the continuation objects |
20:21:16 | FromDiscord | <Phil> I haven't gotten far enough in my journey to conclude that |
20:21:28 | termer | Don't use async/await with CPS yeah lol |
20:21:56 | termer | You know the memory model for closures, right? |
20:22:25 | termer | Think of a continuation like a closure with a switch statement inside of it and an into value saying which part you should execute |
20:22:28 | FromDiscord | <Phil> I'm a webdev, I'm currently branching into multithreading because I want a model of "microservice as a thread", I ain't got no clue of memory models |
20:22:37 | termer | *an int value |
20:22:37 | FromDiscord | <Phil> I watched the talk on atomic weapons by sutter like a week ago |
20:22:52 | FromDiscord | <ezquerra> In reply to @chronos.vitaqua "<@974046326088163438> this should do": Thank you. Can this be used to add a doc comment? (i.e. the equivalent of `## my doc comment`) |
20:23:02 | termer | You should go to the CPS repo and read its intro |
20:23:07 | termer | It's really really good |
20:23:14 | FromDiscord | <Phil> I know that a closure carries its environment around but how to fully mentally model that I do not know since given that it always works out for me its still magic half the time |
20:23:20 | FromDiscord | <Phil> I've already made my way through the tutorial |
20:23:23 | termer | It makes very few assumptions about what you already know, and talks about how it works at a high level |
20:23:33 | termer | oh good |
20:23:33 | FromDiscord | <Phil> I speak very carefully because just because I made it through that doesn't mean I fully understand all the implications |
20:24:22 | FromDiscord | <Phil> I speak mostly from the perspective that I eventually want to set up long running threads with event-loops that support async. |
20:24:24 | termer | Well to compare it to async/await, with that you have to allocate a new Future for each call |
20:24:35 | FromDiscord | <Phil> And likely a second one that will support CPS potentially instead |
20:24:52 | termer | CPS is super simple, which is awesome |
20:25:02 | termer | the core of it works even on the JS and NimVM backends |
20:25:16 | FromDiscord | <djazz> termer: I want to start with something, I'll have a look at cps |
20:25:27 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=html> |
20:25:36 | FromDiscord | <djazz> asyncdispatch doesnt work with pico sdk |
20:25:46 | FromDiscord | <djazz> no <socket.h> |
20:26:03 | FromDiscord | <djazz> (like with a lot of the stdlib) |
20:26:10 | termer | asyncdispatch should be avoided at all costs |
20:26:15 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=html> |
20:26:29 | termer | CPS is perfect for embedded since it has no OS dependencies at all |
20:26:35 | FromDiscord | <Phil> In reply to @termer "asyncdispatch should be avoided": Sure and then you do IO and can either face blocking IO operations or async IO |
20:26:58 | termer | Async doesn't mean you have to use asyncdispatch |
20:27:17 | termer | I'm not arguing against async IO at all, much the opposite |
20:27:18 | FromDiscord | <Robyn [She/Her]> In reply to @ezquerra "Thank you. Can this": It is a doc comment, actually |
20:27:33 | FromDiscord | <Phil> It does if you don't want to wait for async events, as chronos poll() does not have a timeout, nor could I find a proc that checks if there's async work to be done |
20:27:41 | FromDiscord | <Robyn [She/Her]> So yeah you can just use this as a drop-in replacement for where you'd put a comment normally |
20:27:57 | termer | What I can say for certain is that the huge number of allocations that asyncdispatch needs to make will cause huge memory fragmentation problems on a microcontroller |
20:28:31 | * | azimut quit (Ping timeout: 240 seconds) |
20:28:39 | termer | Phil, You're mixing up async IO and asyncdispatch |
20:28:45 | FromDiscord | <djazz> yeah, sucks that it requires dynamic memory |
20:28:59 | FromDiscord | <Phil> No I'm saying for setting up your own while-loop that conditionally polls for async-work, chronos does not provide the tools |
20:29:08 | termer | Oh yeah |
20:29:10 | FromDiscord | <Phil> At least not in any set up I'm familiar with I'll admit |
20:29:23 | termer | Another reason why CPS is perfect for rolling your own |
20:29:29 | termer | it includes no IO or event loop |
20:29:37 | termer | there are impls you can choose to use |
20:29:47 | termer | but it's broken into constituent pieces |
20:30:12 | FromDiscord | <Phil> Yeah and then you're off with sync-io and you'll have one iteration of a CPS block your thread |
20:30:15 | FromDiscord | <gerydev> sent a code paste, see https://play.nim-lang.org/#ix=html> |
20:30:21 | FromDiscord | <Phil> until the IO operation is done |
20:30:36 | termer | I don't think you know what you're talking about here |
20:30:47 | termer | You should read the httpbeast source |
20:30:55 | termer | It doesn't even use asyncdispatch for its event loop |
20:31:03 | FromDiscord | <gerydev> lol the bot is aggressive xd |
20:31:05 | FromDiscord | <Phil> I barely do, but I did chat through this with leorize and co and the conclusion was pretty much that syncio will block the same |
20:31:11 | FromDiscord | <Phil> In reply to @gerydev "lol the bot is": It's a bridge |
20:31:17 | FromDiscord | <Phil> As in, IRC is being bridged to discord |
20:31:23 | FromDiscord | <khazakar> In reply to @gerydev "lol the bot is": Bridge going flamin' hot |
20:31:26 | termer | and in fact its greatest speed advantage is the fact that it cheats and doesn't allocate a Future for the request handler unless you explicitly require it |
20:31:37 | FromDiscord | <gerydev> In reply to @isofruit "As in, IRC is": IRC? |
20:31:45 | termer | Internet Relay Chat |
20:31:48 | termer | old chat protocol |
20:31:57 | FromDiscord | <khazakar> Old but gold |
20:32:05 | FromDiscord | <djazz> Relay for relay chat |
20:32:11 | termer | Phil, Async IO just means IO that you don't need to wait on before doing other work |
20:32:14 | FromDiscord | <gerydev> In reply to @gerydev "I get this, possibly": can I get help with this? |
20:32:46 | FromDiscord | <Phil> I don't use mac, I've never even seen the flag, no clue |
20:32:53 | FromDiscord | <gerydev> 😒 |
20:32:55 | FromDiscord | <gerydev> :/ |
20:32:57 | FromDiscord | <Phil> You wanted an answer |
20:33:00 | FromDiscord | <djazz> termer: I was also thinking wrapping this in a nice Nim way https://www.raspberrypi.com/documentation/pico-sdk/high_level.html#pico_async_context |
20:33:30 | FromDiscord | <djazz> basically IRQ switching |
20:33:34 | termer | You could and provably should do that |
20:33:40 | FromDiscord | <djazz> between task on a single thread |
20:34:04 | FromDiscord | <djazz> (thats how wifi can work while your while true loop is chugging along) |
20:34:06 | FromDiscord | <khazakar> In reply to @termer "asyncdispatch should be avoided": Then where's GH issue about it? 😛 |
20:34:09 | FromDiscord | <Phil> In reply to @gerydev "can I get help": basically leorize is your best bet here because I'm not aware of anyone else right now in chat that knows anything about that flag |
20:35:06 | termer | khazakar, https://github.com/nim-lang/RFCs/issues/295 |
20:35:15 | FromDiscord | <khazakar> In reply to @termer "<@1068255412840845362>, https://github.com/nim-lang": Thx |
20:35:44 | termer | did the RFC link send or was this message truncated for me |
20:35:44 | FromDiscord | <gerydev> In reply to @isofruit "basically leorize is your": it was suggested by another bot.. But the flag is not that important, it doesn't work with only "nimble build" either |
20:36:03 | termer | not lol |
20:36:07 | termer | *bot |
20:36:45 | FromDiscord | <Phil> In reply to @termer "<@180601887916163073>, Async IO just": I'll dive deeper into this once I get to the point of integrating CPS with my multithreading runtime.↵Because I'll definitely want to run an example sooner or later that would use CPS without blocking IO.↵How is still a mystery to me but we'll see |
20:38:57 | termer | I really do recommend you read httpbeast's source if you want to get a feel for a real world application interfacing directly with the OS's async IO API |
20:40:03 | termer | The stdlib selectors module provides an abstraction for various POSIX asyncio APIs without asyncdispatch |
20:40:45 | FromDiscord | <Phil> That's just not where I'm at.↵That might be where I'm going, but interfacing directly with the OS means writing special code for each OS which at this point I will not do and do not plan to. |
20:41:27 | termer | It works for various POSIX OSs, but I'm just saying so that you can have some understanding of how it works |
20:41:34 | termer | not that you want to use it directly |
20:41:40 | termer | it's pretty cumbersome to do so |
20:43:59 | FromDiscord | <khazakar> In reply to @termer "<@1068255412840845362>, https://github.com/nim-lang": Interesting stuff. Link to on-going work: https://github.com/nim-works/cps |
20:44:40 | termer | I just wish it would be added to the compiler |
20:45:35 | FromDiscord | <khazakar> Maybe it will at some point |
20:45:54 | termer | I hope so |
20:46:16 | FromDiscord | <khazakar> So for easy to pickup and quite performant solution for production use, what would you propose? |
20:46:34 | termer | I can actually use Nim for network shit if 1. CPS is added to the compiler and 2. incremental compilation is implemented |
20:46:47 | FromDiscord | <khazakar> Since I will try at some point write at least mockup of.existing react solution, in nim |
20:47:05 | FromDiscord | <khazakar> (edit) "of.existing" => "of existing" | "solution," => "solution at work," |
20:47:12 | termer | Someone started wrapping React, if that's what lib you're referring to |
20:47:45 | FromDiscord | <khazakar> I'd rather not use react, I wanted to replace it using HTMX + leaflet for OSM |
20:48:07 | termer | Nim for JS sucks |
20:48:25 | termer | its bundle sizes are huge, and all the stuff it adds will make it slow |
20:48:25 | FromDiscord | <khazakar> Why? |
20:48:38 | termer | Look at the main bundle for nimforum |
20:48:51 | termer | Open it in your browser and have a look at it |
20:49:10 | termer | No way in hell I'm shipping Nim JS |
20:49:42 | termer | would be interested in Nim for frontend if wasm was more widely supported |
20:49:46 | FromDiscord | <khazakar> It makes JS for me at least more digestable and understandable |
20:50:03 | termer | You should learn JS and understand it |
20:50:14 | termer | it sucks but it's very useful to know |
20:50:38 | termer | I can tell you right now that all the boilerplate and madness that Nim JS spits out will make its execution speed very slow |
20:50:46 | FromDiscord | <Phil> Personally the bundle sizes are less what I'd think about there (that becomes a concern for larger-ish applications) and more about tooling, and JS has a lot of utilities and tooling that are just more finished |
20:50:51 | FromDiscord | <khazakar> I'm more easily picking up at leat some of the JS by writing code in nim and compiling to JS |
20:51:00 | FromDiscord | <khazakar> And comparing in text editor side by side |
20:51:05 | termer | Size is less of an issue than performance |
20:51:11 | FromDiscord | <Phil> First thing that comes to mind would be storybook |
20:51:24 | FromDiscord | <Phil> And not having sth like that is a death sentence to me since I started using it |
20:51:33 | FromDiscord | <djazz> Nim to TypeScript would be better, seems like many have switched to TS |
20:51:34 | FromDiscord | <Phil> Or rather: Having non-trivial integration with it |
20:51:48 | termer | I just use TS with all the big heavy tools |
20:51:51 | FromDiscord | <khazakar> In reply to @isofruit "First thing that comes": Storybook is shady as far as I remember one of TS gurus,Theo |
20:52:00 | termer | TS has a decent type system |
20:52:06 | FromDiscord | <khazakar> Yup |
20:52:13 | FromDiscord | <khazakar> Turing complete one |
20:52:14 | FromDiscord | <Phil> In reply to @khazakar "Storybook is shady as": For? |
20:52:25 | FromDiscord | <Phil> Shady Code? Shade business practices? |
20:52:30 | termer | I just use TS with React and Solid and all is well |
20:52:50 | FromDiscord | <khazakar> In reply to @isofruit "For?": He just mentioned it and not yet releases vid about it |
20:52:50 | FromDiscord | <djazz> termer: was reading the RFC and... what? https://github.com/nim-lang/RFCs/issues/295#issuecomment-771184401 |
20:52:57 | FromDiscord | <djazz> RFC thread |
20:53:05 | termer | I'm not clear on that |
20:53:12 | termer | but there's drama behind this |
20:53:32 | FromDiscord | <Phil> Unless he's about to drop a bomb that Storybook somehow is about to hold their customer's hostage which would actually remotely matter to me, I'd not be willing to invest the minute into that |
20:53:34 | termer | And he is banned from the forums I think, but again, not sure |
20:54:18 | FromDiscord | <djazz> he is active working on cps though |
20:54:23 | termer | Talk to the Ninworks guys and you'll get various levels of cynicism about the state of Nim. Many of their opinions are deserved given the amount of time they've sunk into Nim |
20:54:24 | FromDiscord | <Phil> I mean, can confirm |
20:54:35 | termer | They are also working on Nimskull |
20:54:44 | FromDiscord | <djazz> ah, nimskull |
20:54:51 | termer | which currently is mostly compatible and will use CPS |
20:55:17 | termer | I can't get behind Nimskull because it's too much splintering, but the reasoning behind it is solid |
20:55:21 | FromDiscord | <expert> ts sux↵(@djazz) |
20:55:51 | FromDiscord | <djazz> In reply to @expert "ts sux (<@81390960805675008>)": Do I have the project for u! https://microsoft.github.io/devicescript/ |
20:55:54 | termer | Nim needs its concurrency system ripped out, its compiler code to be improved (allegedly), and a bunch of legacy cruft and experimental features to be pruned |
20:56:08 | FromDiscord | <djazz> agreed |
20:56:22 | FromDiscord | <djazz> let a new stdlib rise |
20:56:26 | termer | Nim defaults alone need to be changed |
20:56:35 | termer | all the stricts checks need to be default |
20:56:46 | termer | Most experimental features need to be removed |
20:57:16 | FromDiscord | <djazz> I enjoy using Nim but using stuff from std leaves me mostly disappointed |
20:57:24 | termer | I haven't worked on the compiler so I can't comment on it personally, but Nimskull guys say it's very hard to contribute to |
20:57:26 | FromDiscord | <djazz> maybe thats why I tried it for embedded |
20:57:52 | termer | Nim's lack of solid core things like networking makes it only suitable for niche things |
20:58:14 | FromDiscord | <Phil> A lot of stuff requires work to be done first↵I am mostly on the periphery but e.g. updating threading lib to pass tsan went pretty smooth |
20:58:17 | termer | Would love to use Nim to write network applications, even tried in 2020 and it was such a horrible time |
20:58:33 | termer | Nim threads are the easiest part of its concurrency to use |
20:58:42 | termer | Nim threads are actually pretty good |
20:59:04 | FromDiscord | <khazakar> When I will learn Nim more,I will definitely touch std/net to at least add support for AF_CAN 😃 |
20:59:36 | termer | std/net is probably pretty good since it's basically a thin wrapper over POSIX APIs |
20:59:45 | FromDiscord | <khazakar> That's most lacking thing for my use case at work |
20:59:50 | FromDiscord | <khazakar> In automotive space 🙂 |
21:00:08 | termer | Could you even use Nim for cars with regulatory requirements? |
21:00:29 | FromDiscord | <khazakar> They still slap C with MISRA docbook |
21:00:39 | termer | Nim has no spec, and I remember reading that having a spec is important for use in vehicles |
21:00:42 | FromDiscord | <djazz> Cars today can already crash during firmware update, I think he's good |
21:01:01 | FromDiscord | <djazz> xD |
21:01:05 | termer | I'm talking from a legal standpoint, not a practical one lol |
21:01:07 | FromDiscord | <khazakar> In reply to @djazz "Cars today can already": They can crash like tesla FSD xD |
21:01:25 | FromDiscord | <djazz> Not like that xD |
21:01:31 | FromDiscord | <khazakar> Going 160 km/h while driver is sleeping |
21:02:29 | FromDiscord | <khazakar> In reply to @termer "Nim has no spec,": Rust got pretty involved when autosar show it's interest in it |
21:02:48 | FromDiscord | <khazakar> But it's mostly stalled,so you get C++ at most |
21:02:58 | termer | C++ is fairly tolerable |
21:03:24 | termer | Would love to use Rust, but then I'd be the only one able to work on most of the shit I'd write in it |
21:03:39 | FromDiscord | <khazakar> Depends which initialization technique you use out of 25 |
21:03:41 | termer | The nice thing about Nim is that the barrier to entry is low for the most psrt |
21:03:43 | termer | part |
21:04:01 | FromDiscord | <khazakar> (edit) "Depends which initialization technique you use out of 25 ... " added "available" |
21:04:12 | FromDiscord | <khazakar> Yup, it is |
21:04:29 | FromDiscord | <khazakar> And it sparked my will to learn and do more |
21:04:34 | FromDiscord | <expert> i would love to contribute but I hate typescript↵(@djazz) |
21:04:40 | FromDiscord | <expert> and microsoft |
21:04:43 | termer | Just use it anyway |
21:04:50 | termer | TypeScript is pretty nice for what it is |
21:04:59 | termer | It makes JS tolerable |
21:05:00 | FromDiscord | <djazz> talking about typescript reminded me of it, i havent tried it tho |
21:05:15 | FromDiscord | <khazakar> Even Prime, TS used, recommends JS + JSDoc |
21:05:23 | FromDiscord | <khazakar> (edit) "used," => "user," |
21:06:01 | FromDiscord | <expert> mostly microsoft I love typescript |
21:06:01 | FromDiscord | <expert> nuh uh |
21:06:02 | FromDiscord | <expert> never using microsoft products |
21:06:20 | FromDiscord | <djazz> github? |
21:06:45 | FromDiscord | <khazakar> In reply to @expert "never using microsoft products": Then stop using GitHub, chatgpt and rip their code from linux kernel |
21:07:17 | termer | I use JS + JSDoc extensively |
21:07:23 | termer | but guess what checks those types |
21:07:38 | FromDiscord | <khazakar> Tsc |
21:07:40 | termer | Our boy TypeScript at it again |
21:07:42 | FromDiscord | <khazakar> I know 😛 |
21:08:19 | termer | Plus, you're probably using TS syntax inside tour JSDoc annotations |
21:08:35 | termer | string[] is not valid JSDoc, for example |
21:08:39 | termer | it is valid TSDoc |
21:08:40 | FromDiscord | <khazakar> I don't write JS by hand |
21:08:54 | FromDiscord | <khazakar> So it does not apply to me |
21:08:58 | FromDiscord | <khazakar> 😃 |
21:09:14 | termer | enjoy |
21:09:41 | FromDiscord | <khazakar> But I probably will learn some simple js to make this mockup working using nim instead of python as backbone |
21:09:58 | FromDiscord | <khazakar> To squeeze more performance out of RPi 3 🙂 |
21:11:48 | termer | would almost certainly be faster than Python |
21:12:18 | FromDiscord | <djazz> i tried nim on pi zero, slow to compile vs python prompt which seemed instant lol |
21:12:20 | FromDiscord | <khazakar> In a project which uses 3 backends at once? Definitely |
21:12:46 | termer | If you're compiling, obviously it's gonna be slow |
21:12:55 | FromDiscord | <khazakar> This shit needs architecture first |
21:13:11 | termer | you should be able to cross compile to ARM Linux from a PC |
21:13:18 | FromDiscord | <khazakar> Not that you get flask, fastapi and sanic running at the same time xD |
21:13:54 | termer | at least it's not Django |
21:14:23 | FromDiscord | <khazakar> I'd rather have one django for whole project than current mess |
21:15:13 | termer | Django is my only Python experience and I hated it |
21:16:56 | FromDiscord | <khazakar> I started as test engineer, and now.I'm working on dumpsterfire python 3-backends-in-1-project + react for one of the elements, which they wanted to shove onto device, which is RPi 3 as lowest denominator |
21:17:02 | FromDiscord | <Phil> Ehhhhhhhhhhhh.↵I mean, I agree that it isn't great. But I'm not sure I'd say I hated it. |
21:17:06 | FromDiscord | <khazakar> (edit) "now.I'm" => "now I'm" |
21:17:30 | FromDiscord | <Phil> Django that is |
21:17:44 | Amun-Ra | I prefer django over flask any time any day |
21:18:08 | FromDiscord | <Phil> Honestly Class Based Views are a head scratcher when you have no clue what you're doing though |
21:18:30 | FromDiscord | <khazakar> If I had a choice,I'd pick falcon |
21:18:31 | FromDiscord | <Phil> Hell, if I had to work in Django they'd still be a headscratcher because who can keep in their head the order of operations in those |
21:21:47 | termer | There was little to no intellisense and I had to constantly be referencing the manual and crossing my fingers whether I'd have runtime errors |
21:22:51 | FromDiscord | <nnsee> I don't actually write software for a living, that's probably why I'm a terrible programmer |
21:33:40 | FromDiscord | <khazakar> You're not terrible, just not touched by professional intricacies |
21:42:52 | FromDiscord | <Robyn [She/Her]> I mean Emscripten exists tbf↵(<@709044657232936960_termer=5b=49=52=43=5d>) |
21:44:01 | FromDiscord | <Robyn [She/Her]> Apparently TS is losing traction, seems to be people talking about how they're moving back to JS after using TS for so long↵(@djazz) |
21:44:40 | FromDiscord | <Robyn [She/Her]> Also What'd be the point of generating something that'd have to be compiled again, imo it'd be better for Nim to emit a d.ts file instead of flat out typescript code |
21:46:02 | FromDiscord | <Robyn [She/Her]> Looks at EE Java↵(@nnsee) |
21:46:08 | FromDiscord | <Robyn [She/Her]> Worse than that? |
21:46:48 | FromDiscord | <Phil> In reply to @Robyn "*Looks at EE Java*": Just don't look at java |
21:46:50 | FromDiscord | <Phil> for anything |
21:46:53 | FromDiscord | <Phil> In any capacity |
21:47:10 | FromDiscord | <Phil> Not even if you want to see an example of being flattened by abstraction layers |
21:47:16 | FromDiscord | <Phil> It just does not end well |
21:48:10 | FromDiscord | <Robyn [She/Her]> Lol |
21:48:14 | FromDiscord | <nnsee> I used to be in that camp, but man... modern Java is kind of comfy though |
21:49:09 | FromDiscord | <nnsee> I do think legacy java applications have left a bad taste in everyone's mouth, though |
21:49:34 | FromDiscord | <Phil> It's just getting flattened by Spring |
21:49:40 | FromDiscord | <Phil> I see Spring and fun goes to die |
21:49:47 | FromDiscord | <nnsee> as a pentester, java projects are the ones I usually dread because the layers and layers of abstraction you have to go through when reading code |
21:50:23 | FromDiscord | <Phil> Exactly that |
21:50:27 | FromDiscord | <Phil> That drives me insane |
21:50:34 | FromDiscord | <Phil> The amount of fucking indirection |
21:51:18 | FromDiscord | <Phil> And then people get smart with injecting lists of beans etc. |
21:55:10 | FromDiscord | <ca_lobo_14153> sent a long message, see <!doctype html> |
22:02:29 | FromDiscord | <khazakar> In reply to @nnsee "I used to be": Yup, check Java 21 |
22:02:49 | FromDiscord | <nnsee> sent a long message, see <!doctype html> |
22:05:08 | FromDiscord | <nnsee> I don't think I've seen toolchain multiplexers install to /usr/local/bin directly, that's new to me |
22:08:39 | FromDiscord | <khazakar> In reply to @nnsee "I don't think I've": Golang in docs suggests installing to /usr/local |
22:12:19 | * | azimut joined #nim |
22:18:06 | * | cnx quit (Ping timeout: 260 seconds) |
22:28:28 | * | cnx joined #nim |
22:39:07 | FromDiscord | <ca_lobo_14153> sent a long message, see <!doctype html> |
22:40:55 | * | azimut quit (Ping timeout: 240 seconds) |
22:47:11 | FromDiscord | <Elegantbeef> Inside Nim packages you can require a nim version |
22:47:17 | FromDiscord | <Elegantbeef> You also can check inside Nim code the version |
23:04:19 | FromDiscord | <ca_lobo_14153> In reply to @Elegantbeef "You also can check": but not for whether it was build with -d:release or debug... unless the "active boot switches: -d:release" indicates this... I can't find any docs on the what the active boot switches means... |
23:04:33 | FromDiscord | <Elegantbeef> What does that matter? |
23:06:21 | FromDiscord | <ca_lobo_14153> I don't know. I haven't done any timings re: release vs debug version.... I assume that it does... but don't have facts to back it up... |
23:07:03 | FromDiscord | <Elegantbeef> Yes debug is slower, but that's the point |
23:07:13 | FromDiscord | <Elegantbeef> It has fewer optimisations to bake the cake quicker |
23:08:06 | FromDiscord | <ca_lobo_14153> goes back to my end user vs Nim Core developer thinking... end users don't care if it's a debug version or no.. they just want to compile their code faster... |
23:08:20 | FromDiscord | <ca_lobo_14153> (edit) "no.." => "not.." |
23:08:27 | FromDiscord | <Elegantbeef> All toolchains ship a release build |
23:08:55 | FromDiscord | <Elegantbeef> The fastest nim compiler is one built with `-d:danger -d:lto --cc:clang` but it's also the most dangerous |
23:09:32 | FromDiscord | <Elegantbeef> You can make it even faster using performance guided optimisations but negligably iirc |
23:09:43 | FromDiscord | <Elegantbeef> @Yardanico knows more about how fast PGO gets you |
23:12:58 | FromDiscord | <Phil> Performance difference between debug and release tends to be somewhere in the 5x to 10x region |
23:12:59 | FromDiscord | <ca_lobo_14153> In reply to @Elegantbeef "All toolchains ship a": The crux of the problem... Nim doesn't have a release build... at least not one that I've been able to discover. |
23:13:07 | FromDiscord | <Elegantbeef> What? |
23:13:10 | FromDiscord | <Phil> What? |
23:13:16 | FromDiscord | <Elegantbeef> `-d:release` is a release build |
23:14:56 | FromDiscord | <ca_lobo_14153> by default Nim builds a debug release and where Choosenim doesn't support a platform/OS (Linux/aarch64 in my case) there is no end user installer script - the install instructions on the download page are incomplete. |
23:15:45 | FromDiscord | <ca_lobo_14153> details above at 1:55pm today in response to Ras... |
23:20:07 | FromDiscord | <Phil> I mean there's not much I can respond to that as it's not my area and not like I have the patience to spend my free time setting up windows and macos vms to figure out installing on them 🤷 |
23:22:20 | FromDiscord | <Phil> Ah, for reference: I do not play much of a role in anything, I am a contributor for minor things on the sides for the most part |
23:28:00 | FromDiscord | <ca_lobo_14153> Totally understand Phil. From my perspective, as an end user, all I want is to be able to download the sources, cd into directory, sh build_all.sh -d:release, sh install_release.sh and end up with a complete working nim enviornment - Nimble included - installed to normal /user/local/bin and releated dictionaries. |
23:28:39 | FromDiscord | <Elegantbeef> Bridge died? |
23:28:45 | FromDiscord | <Phil> Bridge ate your message |
23:28:46 | FromDiscord | <Elegantbeef> Ah it's back |
23:29:00 | FromDiscord | <nasuray> Doesn't the pre built archives have an install script? |
23:29:00 | FromDiscord | <Elegantbeef> If you built using `build_all.sh` it'd have built it as release |
23:29:05 | FromDiscord | <Phil> For reference: https://media.discordapp.net/attachments/371759389889003532/1195509786423341106/image.png?ex=65b44040&is=65a1cb40&hm=445a9f11cec4b4ad98cb2fdac8e3b53859e979796db409d19c30029923b7196c& |
23:29:28 | FromDiscord | <Elegantbeef> If it's not release there is an issue with `build_all.sh` and it needs to be fixed |
23:31:18 | FromDiscord | <Elegantbeef> to the `install.sh` I can only really say you should make the shell script 😄 |
23:33:03 | FromDiscord | <Elegantbeef> Worth noting that even golang does not install to the system and installs in userspace https://go.dev/doc/install/source#install |
23:34:32 | FromDiscord | <Elegantbeef> Though choosenim or similar should support all common modern CPU/OS |
23:34:55 | FromDiscord | <Elegantbeef> That support really needs people with the systems to step up and help, atleast in my view |
23:52:24 | FromDiscord | <Phil (he/him)> Out of curiosity, is logging just inherently memory-leaky business? |
23:56:14 | FromDiscord | <Elegantbeef> Uhh no |
23:56:28 | FromDiscord | <Phil (he/him)> Then I might need to investigate this timezone memory leak stuff that pops every time I forget to turn off logging with chronicles under valgrind |
23:56:58 | FromDiscord | <Elegantbeef> Did you mean general `logging` or `std/logging`? 😄 |
23:57:04 | FromDiscord | <Elegantbeef> Cause generally nothing is leaky |
23:57:09 | FromDiscord | <Phil (he/him)> General logging and chronicles |
23:57:12 | FromDiscord | <Elegantbeef> Only bad code leaks |
23:57:56 | FromDiscord | <Phil (he/him)> Example\: I have a test right now that passes valgrind (after an eternity, I need to cut down the amount what that test does) only with logging disabled |
23:58:05 | FromDiscord | <ca_lobo_14153> sent a long message, see <!doctype html> |
23:58:11 | FromDiscord | <Phil (he/him)> Okay helgrind has been running for 2 minutes now I'm expecting it won't ever finish |
23:58:48 | FromDiscord | <Elegantbeef> `/usr/local` is system wide |
23:59:01 | FromDiscord | <Elegantbeef> If it requires sudo to write to it's generally not userspace |
23:59:20 | FromDiscord | <ca_lobo_14153> In reply to @Elegantbeef "If it requires sudo": Ok, I stand corrected. |