00:00:56 | * | sleepyqt quit (Ping timeout: 256 seconds) |
00:12:40 | * | lritter quit (Quit: Leaving) |
00:21:52 | * | couven92 quit (Quit: Client Disconnecting) |
00:22:50 | FromDiscord | <KingDarBoja> Oh, new release D: |
00:24:08 | FromDiscord | <exelotl> "The Nim compiler now supports the --asm command option for easier inspection of the produced assembler code" oh this one is very cool |
00:24:37 | FromDiscord | <exelotl> very excited to try this on the GBA |
00:49:20 | * | dwdv quit (Ping timeout: 256 seconds) |
00:49:58 | * | krux02_ quit (Remote host closed the connection) |
00:50:19 | * | jegfish quit (Quit: Leaving) |
00:50:23 | * | euantor quit (Ping timeout: 272 seconds) |
00:52:21 | * | waleee-cl quit (Read error: Connection reset by peer) |
00:53:30 | * | euantor joined #nim |
00:54:05 | * | waleee-cl joined #nim |
00:59:12 | * | euantor quit (Ping timeout: 260 seconds) |
01:00:20 | * | euantor joined #nim |
01:07:34 | * | matlock quit (Ping timeout: 256 seconds) |
01:11:12 | * | matlock joined #nim |
01:23:57 | * | chemist69 quit (Ping timeout: 272 seconds) |
01:25:15 | * | chemist69 joined #nim |
01:32:06 | FromDiscord | <Varriount> How does that work? I thought the compiler shelled out to GCC/Clang/VCC |
01:48:50 | * | voltist joined #nim |
01:54:25 | FromDiscord | <KingDarBoja> I just discovered the options module few days ago and saw a possible equivalent to Python usage of `none` while setting default parameters on a proc |
01:58:20 | voltist | Does anybody have an experience with using NumericalNim to solve systems of ODEs? |
02:00:29 | * | companion_cube joined #nim |
02:00:49 | FromDiscord | <treeform> @Varriount, I think it passes --asm equivalent to the compilers. So they output the asm code. |
02:01:25 | FromDiscord | <treeform> I think its `-S` for gcc... |
02:08:26 | FromDiscord | <KingDarBoja> But I see that If I do something like this: https://play.nim-lang.org/#ix=2gyD |
02:08:45 | FromDiscord | <KingDarBoja> It looks like I must pass an Option(2) instead of a common int 🤔 |
02:09:30 | FromDiscord | <KingDarBoja> What I want to do is set default proc parameters to some Python equivalent to None |
02:16:16 | FromDiscord | <treeform> @KingDarBoja Nim way of doing that would be some thing like this: |
02:16:17 | FromDiscord | <treeform> https://play.nim-lang.org/#ix=2gyG |
02:16:30 | FromDiscord | <treeform> I think that is much more clear what is going on. |
02:16:43 | FromDiscord | <Rika> if you want to use the options still, you need to wrap it in a some() |
02:17:09 | FromDiscord | <Rika> though the options module is more suited for return types rather than parameters/arguments |
02:17:13 | FromDiscord | <treeform> @KingDarBoja another nim way of doing that is https://play.nim-lang.org/#ix=2gyH |
02:17:50 | FromDiscord | <treeform> I don't use options in my code, I think code is more clear without them... |
02:18:46 | FromDiscord | <Rika> it only really works when used as a return type, as ive said... |
02:19:14 | * | companion_cube left #nim ("WeeChat 2.3") |
02:19:20 | FromDiscord | <treeform> voltist, i have not used NumericalNim, but I find that nim is so fast at numeral kind of problems with just simple for loops and seqs... like insanely fast with -d:danger... |
02:22:02 | voltist | @treeform So just compute each step? |
02:35:43 | * | muffindrake quit (Ping timeout: 252 seconds) |
02:37:56 | * | muffindrake joined #nim |
02:45:09 | FromDiscord | <KingDarBoja> Jumm overload proc |
02:46:37 | FromDiscord | <KingDarBoja> That is a big problem to me as the source code (in Python) make use of default parameter as None for a class "__init__" function |
02:47:33 | Yardanico | ? |
02:50:29 | FromDiscord | <KingDarBoja> Give me a second |
02:51:38 | FromDiscord | <KingDarBoja> https://github.com/graphql-python/graphql-core/blob/master/src/graphql/error/graphql_error.py#L83 This init function (on Python). Any suggestion to how it would be translated (at least the function parameters) into Nim? Ignore the typings like Optional or Union |
02:59:38 | FromDiscord | <companion_cube> does inim work? or is there some sort of playground? |
02:59:44 | FromDiscord | <Rika> one moment, ill convert it @KingDarBoja |
02:59:52 | FromDiscord | <Rika> @companion_cube play.nim-lang.org |
02:59:56 | Yardanico | weill inim in itself is a workaround |
03:00:01 | Yardanico | :P |
03:00:06 | FromDiscord | <companion_cube> ah, thank you. |
03:00:18 | Yardanico | @Rika tbh inim is not similar to playground |
03:00:20 | FromDiscord | <KingDarBoja> Feel free to ignore the source parameter |
03:00:27 | Yardanico | it's supposed to imitate a "repl" |
03:00:34 | Yardanico | there's also "nim secret" which is called this way for a reason |
03:02:12 | FromDiscord | <Rika> @KingDarBoja okay so for things like this, if you think all parameters are "independently optional", that is to say, any parameters dont come as a bundle, then i think the options module is sufficient |
03:04:25 | FromDiscord | <companion_cube> I didn't find a a to do `a[2..]` to get "all elements starting from 2" |
03:04:26 | FromDiscord | <Rika> Yardanico: he asked if there was a playground |
03:04:33 | Yardanico | oh |
03:04:38 | FromDiscord | <Rika> you use `a[2..^1]` |
03:04:46 | FromDiscord | <Rika> ^1 meaning "the last element" |
03:04:52 | FromDiscord | <companion_cube> hu, interesting |
03:05:06 | FromDiscord | <Rika> `^2` means the 2nd last, and so on |
03:05:19 | FromDiscord | <KingDarBoja> So I can just write "myParam: Option(MyType)" on my initType proc? |
03:05:29 | FromDiscord | <Rika> brackets |
03:05:35 | FromDiscord | <Rika> Option[MyType] |
03:05:41 | FromDiscord | <KingDarBoja> Oops |
03:05:41 | FromDiscord | <Rika> i dont see why not |
03:06:01 | FromDiscord | <Rika> but you need to pass it like this: "some(myTypeInstance)" or "none(MyType)" |
03:06:56 | Yardanico | the thing is just that when you do translating from a dynamic language like Python to a static language like Nim the code wouldn't really look that cood :P |
03:07:24 | FromDiscord | <Rika> you really need to rethink the whole code yeah |
03:08:17 | FromDiscord | <KingDarBoja> Yeah, I have seen that issue with the string | char problem I had few days ago, but solved using a custom proc + option module |
03:09:02 | FromDiscord | <KingDarBoja> I was going to ask, while writing a humble example of what you said (Rika), about something I probably asked before... |
03:09:47 | FromDiscord | <KingDarBoja> The Union types aren't allowed at proc params ? like the "nodes" parameter on the python code I shared before? |
03:10:05 | FromDiscord | <KingDarBoja> Please spare me if I asked before |
03:10:06 | FromDiscord | <Rika> "int or string"? |
03:10:07 | Yardanico | they are, but "sum" types just implicitly create different procedure instantiations |
03:10:14 | FromDiscord | <Rika> yeah |
03:10:29 | FromDiscord | <Rika> and then you might need to do stuff like `when param is string:` |
03:10:32 | Yardanico | well I mean there's no difference in proc(a: int | string) = when a is int: stuff else: another stuff |
03:10:40 | Yardanico | and proc (a: int) and proc (a:string) |
03:11:03 | FromDiscord | <Rika> mhm |
03:11:14 | FromDiscord | <KingDarBoja> I see.. I do prefer going the lazy way and keep if possible as one type. |
03:11:34 | FromDiscord | <KingDarBoja> Like it MUST be a int 😆 |
03:12:32 | FromDiscord | <KingDarBoja> But those "Union types" aren't allowed on the type definition, right? |
03:12:48 | Yardanico | no |
03:12:51 | Yardanico | you can use object variants instead |
03:13:00 | FromDiscord | <KingDarBoja> Ah, that's what I thought |
03:14:04 | FromDiscord | <KingDarBoja> Yeah, I think I discussed that question due to the limitation of using the same variable with different type (int, string for value) inside the case kind |
03:14:21 | FromDiscord | <KingDarBoja> And someone pointed me to a GitHub issue regarding that. |
03:14:43 | Yardanico | well yeah, just name them differently |
03:16:07 | FromDiscord | <KingDarBoja> Writing all answers on a txt so I don't get lost again |
03:24:27 | * | chemist69 quit (Ping timeout: 260 seconds) |
03:25:21 | * | chemist69 joined #nim |
03:28:08 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
03:30:41 | * | opal quit (Remote host closed the connection) |
03:31:15 | * | opal joined #nim |
03:33:10 | FromDiscord | <KingDarBoja> Ugh, wanted to make an example of what Rika said and ended with errors |
03:33:10 | FromDiscord | <KingDarBoja> https://play.nim-lang.org/#ix=2gz9 |
03:33:31 | FromDiscord | <KingDarBoja> This -> but you need to pass it like this: "some(myTypeInstance)" or "none(MyType)" |
03:34:17 | Yardanico | uhh |
03:34:20 | Yardanico | uhhhh |
03:34:47 | Yardanico | I don't think "or" types work with "Option" |
03:34:56 | FromDiscord | <KingDarBoja> I am feeling the struggle with that |
03:38:14 | Yardanico | you should understand that "or" types don't magically make your code dynamic |
03:40:07 | Yardanico | https://play.nim-lang.org/#ix=2gzc |
03:41:46 | FromDiscord | <KingDarBoja> Impressive Yardanico |
03:42:05 | FromDiscord | <KingDarBoja> And I see what Rika meant wit the some downside :/ |
03:45:55 | FromDiscord | <KingDarBoja> But thinking about it, that is fine as long as the init call is used internally 😄 |
03:46:56 | * | disruptek quit (Quit: Bye) |
03:46:56 | * | disbot quit (Quit: Bye) |
03:47:02 | FromDiscord | <companion_cube> in <https://nim-lang.org/docs/manual.html#types-object-variants> it seems like nim doesn't know how to do pattern matching correctly? :((( |
03:47:21 | Yardanico | wdym exactly? |
03:47:24 | FromDiscord | <companion_cube> it only checks that one uses the right fields for the discriminator, at runtime, not at compile time |
03:47:41 | FromDiscord | <Rika> huh? |
03:47:43 | FromDiscord | <companion_cube> I wrote a `case` where the `nkIf` branch uses `strVal` |
03:47:47 | FromDiscord | <companion_cube> no compile error |
03:48:09 | FromDiscord | <Rika> huh? |
03:48:17 | FromDiscord | <Rika> can you playground it |
03:48:26 | Yardanico | @companion_cube well there's https://github.com/alehander92/gara |
03:49:13 | FromDiscord | <companion_cube> https://play.nim-lang.org/#ix=2gzdhttps://play.nim-lang.org/#ix=2gzd |
03:49:33 | Yardanico | https://play.nim-lang.org/#ix=2gzd * |
03:49:41 | FromDiscord | <companion_cube> https://play.nim-lang.org/#ix=2gzd |
03:49:52 | FromDiscord | <Rika> i see |
03:50:03 | FromDiscord | <companion_cube> this is quite disappointing |
03:50:10 | Yardanico | well that's doesn't mean there's no "pattern matching" |
03:50:28 | Yardanico | it just means that compiler doesn't check for accessing invalid branches of a case object |
03:50:33 | FromDiscord | <companion_cube> that's not better than C, if you want |
03:50:53 | * | disbot joined #nim |
03:51:55 | * | disruptek joined #nim |
03:52:29 | FromDiscord | <Rika> can it be added though |
03:52:33 | * | rnrwashere joined #nim |
03:52:34 | Yardanico | just write a macro |
03:52:34 | FromDiscord | <Rika> i dont know much about the compiler |
03:54:45 | shashlick | leorize: you around? |
03:55:07 | FromDiscord | <companion_cube> wdym a macro? how would a macro add type safety? |
03:55:27 | Yardanico | it can statically check if you're trying to access an incorrect field inside of a "case" branch |
03:55:35 | FromDiscord | <companion_cube> that's the compiler's job… |
03:55:44 | Yardanico | not really, a macro is enough :) |
03:56:04 | FromDiscord | <companion_cube> the paragraph above claims this is "like a sum type in other languages", when, not really :/ |
03:56:52 | FromDiscord | <Rika> its like one |
03:56:57 | FromDiscord | <Rika> its not exactly one |
03:57:01 | FromDiscord | <Rika> its just like it |
03:57:44 | FromDiscord | <companion_cube> it's more like a C struct with tag + union, really |
03:58:19 | Yardanico | well that's what it is in C backend :P |
03:58:53 | FromDiscord | <companion_cube> it's just sad that there is no typechecking |
03:59:12 | FromDiscord | <companion_cube> (a bit like `not nil` not being the default, I guess… every language has some baggage) |
04:06:02 | * | supakeen quit (Quit: WeeChat 1.9.1) |
04:06:42 | * | supakeen joined #nim |
04:07:14 | zedeus | nil is useful |
04:08:26 | * | FromDiscord <KingDarBoja> nil is the future |
04:08:38 | FromDiscord | <Rika> what |
04:08:48 | Yardanico | yes |
04:09:51 | FromDiscord | <Rika> what x2 |
04:09:53 | FromDiscord | <companion_cube> yeah, it should just be opt-in, not opt-out |
04:10:06 | FromDiscord | <Rika> why is nil the future what |
04:10:13 | FromDiscord | <Rika> im still heavily confused |
04:11:53 | FromDiscord | <KingDarBoja> I was trying to make it like a compliment for the phrase "Nil is useful" |
04:13:46 | FromDiscord | <Rika> i dont see how it is |
04:33:31 | disruptek | !rfc author:alehander92 |
04:33:32 | disbot | https://github.com/nim-lang/RFCs/pull/169 -- 3Nilable and non-nilable types 7& 2 more... |
04:37:26 | voltist | Woah I knew Nim is fast, but I never thought it was THIS fast! My implementation of a state-of-the-art neuron model runs 100x faster than real life |
04:37:34 | Yardanico | lol |
04:39:51 | FromDiscord | <Rika> doesnt it literally say as fast as C |
04:40:35 | voltist | I haven't seen it in those exact words, but yeah maybe |
04:42:12 | Yardanico | jesus https://github.com/oakes/vim_cubed has 1.9k stars already :P |
04:43:19 | voltist | Haha! Lots of traffic from Reddit I presume? |
04:43:22 | leorize | that's like 1/9 of nim |
04:43:24 | leorize | damn |
04:43:29 | leorize | and it's like several days old? |
04:43:31 | Yardanico | leorize: well github stars are a very stupid thing |
04:43:42 | Yardanico | *cough* https://github.com/vlang/v *cough* |
04:44:01 | leorize | shashlick: o/ |
04:44:27 | shashlick | Hey so the same question on variable importc |
04:44:33 | FromDiscord | <Rika> `V's backend has just been replaced on April 1` is this a joke or legit because i cannot tell lmao |
04:45:05 | shashlick | If you are importing from a dynlib, the var doesn't exist right |
04:45:16 | Yardanico | @Rika it's not a joke |
04:45:23 | FromDiscord | <Rika> omg hahahaha |
04:45:41 | Yardanico | they finally made a "somewhat" proper AST in the compiler |
04:45:47 | Yardanico | v 0.1 didn't have AST at all |
04:48:38 | Yardanico | even Zig author mentioned that "hype" thing with V in his article https://andrewkelley.me/post/why-donating-to-musl-libc-project.html |
04:49:07 | * | rnrwashere quit (Remote host closed the connection) |
04:49:09 | voltist | Lol who would have guessed that 720 million floating point numbers in memory would make my computer hang |
04:51:00 | leorize | shashlick: the var exists, after it's imported from the dynlib :P |
04:51:11 | leorize | I'm not too sure what you meant to be honest |
04:59:06 | FromDiscord | <Rika> can anyone link me the article on building nim code w/ musl |
04:59:14 | FromDiscord | <Rika> i dont seem to recall who made it or the link |
04:59:56 | Yardanico | https://github.com/kaushalmodi/hello_musl |
05:00:07 | Yardanico | that's not for cross-compiling though, for cross-compiling it's harder |
05:00:17 | FromDiscord | <Rika> darn |
05:00:38 | FromDiscord | <Rika> anything for cross? |
05:00:52 | Yardanico | well, I only know if you want to cross-compile for linux buth for another architecture |
05:01:01 | Yardanico | then there's https://github.com/richfelker/musl-cross-make/ |
05:01:50 | Yardanico | it basically builds a gcc toolchain (with musl) for the target you want |
05:02:10 | FromDiscord | <Rika> this is complicated |
05:02:14 | Yardanico | what do you want to do? |
05:02:15 | FromDiscord | <Rika> ill look into it |
05:02:17 | Yardanico | it's actually quite easy |
05:02:22 | FromDiscord | <Rika> no no im just reading up on it |
05:02:37 | FromDiscord | <Rika> i have no use for it yet but it seems like itll be useful some other time |
05:02:44 | * | Pixeye joined #nim |
05:02:59 | Yardanico | also, extracted from my project |
05:02:59 | Yardanico | https://gist.github.com/Yardanico/45881fe24222329a0117194fc97ec4eb |
05:08:07 | Yardanico | it's basically for cross-compiling a musl + libressl (for https or other crypto stuff) statically linked binary, based on hello_musl for libressl |
05:09:38 | FromDiscord | <Rika> is there a nim module for emulating inheritance (in a nicer way) with variant objects |
05:10:01 | FromDiscord | <Rika> because right now with a variant object im not a fan of making a super large proc with a case statement for separating the types |
05:10:50 | Yardanico | use inheritance then? :P |
05:10:54 | Yardanico | ref objects and methods |
05:11:15 | FromDiscord | <Rika> okay, already am, was wondering if i could convert to variants |
05:11:19 | FromDiscord | <Rika> next question |
05:12:12 | FromDiscord | <Rika> if i store a subtype (lets say YoungPerson of type Person) in a seq[Person], how do i get the "original type" of the object |
05:12:17 | FromDiscord | <Rika> or is it unchanged? |
05:12:36 | FromDiscord | <KingDarBoja> That cube is a whole new level |
05:12:54 | FromDiscord | <Rika> like if i store an instance into the seq[ParentType], can i still call the methods associated with the subtype? |
05:13:05 | FromDiscord | <Rika> am i making sense |
05:13:06 | shashlick | Use dockcross for cross compiling |
05:13:12 | shashlick | Much easier |
05:13:24 | Yardanico | does it support stuff like musl or libressl? |
05:13:29 | Yardanico | to make statically linked binaries |
05:14:04 | Yardanico | oh I see they have predefined images |
05:14:31 | Yardanico | but almost no with "musl" and static linking only for win |
05:15:21 | shashlick | I thought they had musl also |
05:17:05 | FromDiscord | <Rika> did i make sense? |
05:17:11 | FromDiscord | <Rika> or am i spouting nonsense |
05:17:31 | Yardanico | i don't know because I almost never used inheritance in nim :P |
05:17:53 | FromDiscord | <Rika> i have to because im doing a port... |
05:18:37 | FromGitter | <sealmove> Rika, object variants has nothing to do with inheritance |
05:19:49 | Araq | sure they do, both are a way of introducing runtime polymorphism |
05:20:04 | Yardanico | @sealmove his question is "like if i store an instance into the seq[ParentType], can i still call the methods associated with the subtype?" |
05:21:44 | FromGitter | <sealmove> yes but, that's not inheritance. It's a sum type which means "either this or that", not "either the parent or child or grandchild" |
05:23:48 | FromDiscord | <Rika> i wasnt asking anything about inheritance this time |
05:23:57 | FromDiscord | <Rika> i was just stating it as the name of the uh feature? |
05:24:12 | FromGitter | <sealmove> I don't think object variants is true runtime polymorphism. It's manual, but you get the type safety |
05:25:09 | FromGitter | <sealmove> rika if you define them as methods instead of procs then the correct one depending on the actual type of the object will be called |
05:25:46 | FromGitter | <sealmove> and of course you have to use `X = object of Y` |
05:27:48 | FromDiscord | <Rika> yeah okay thanks, for some reason i was thinking i'd have to figure out what to cast the instance back to |
05:29:58 | FromDiscord | <Rika> how do i make a table that's filled on compile time but accessible on run time |
05:30:05 | Yardanico | it's easy :P |
05:30:22 | FromDiscord | <Rika> uh |
05:30:23 | FromDiscord | <Rika> ?? |
05:30:38 | FromGitter | <sealmove> With macros? |
05:30:59 | FromDiscord | <Rika> do i really have to make a macro for it ;; |
05:31:04 | Yardanico | no lol |
05:31:04 | Yardanico | https://play.nim-lang.org/#ix=2gzA |
05:31:24 | FromDiscord | <Rika> noice |
05:31:31 | Yardanico | newTable wouldn't work though, only initTable |
05:31:34 | Yardanico | TableRef vs Table |
05:31:36 | Yardanico | (ref object vs object) |
05:31:53 | Yardanico | you can't make a const TableRef |
05:31:55 | FromGitter | <sealmove> Rika: if you have to fill in hundreds of entries and you don't wanna type the assignments, then you would generate them with macros |
05:32:23 | * | silvernode joined #nim |
05:33:54 | FromDiscord | <Rika> i dont need a ref table so i'm good |
05:34:04 | FromDiscord | <Rika> i only have 10 assignments... |
05:34:23 | FromDiscord | <Rika> i dont need to make a macro for this ;; |
05:47:44 | FromGitter | <sealmove> sure, if they are only 10 |
05:48:00 | * | silvernode quit (Ping timeout: 265 seconds) |
05:59:00 | voltist | Is there an easy way in Nim to map the values of a tuple to variables of the same name? |
06:00:00 | FromDiscord | <Rika> its macro time, it looks like |
06:00:49 | * | solitudesf joined #nim |
06:00:57 | voltist | Yeah |
06:01:05 | FromGitter | <sealmove> voltist example? |
06:02:48 | FromDiscord | <Rika> sealmove: map a `tuple[a: int, b: int]` into variables `a, b`... WAIT A MINUTE |
06:02:51 | FromDiscord | <Rika> voltist |
06:03:02 | FromDiscord | <Rika> i think i know how, but it requires you to write the names in order |
06:03:14 | FromDiscord | <Rika> you can do `let (a, b) = theTuple` |
06:03:17 | voltist | Yeah like that |
06:03:38 | voltist | Hmm maybe? That wouldn't work for any given tuple though |
06:04:29 | voltist | I mean it doesn't matter much now because I've thought of a better way of doing things |
06:04:59 | FromDiscord | <Rika> oh ok |
06:05:08 | voltist | Thanks for the help though |
06:05:13 | FromDiscord | <Rika> if you want it to conform to any tuple youll need a macro |
06:05:23 | FromDiscord | <Rika> but yeah okay i wont continue w/ the topic lmao |
06:06:19 | FromDiscord | <KingDarBoja> Just tried to do something like "extensions: Option[Table[string, string]] = none(Table[string, string])" on the initMyCustomType parameter and got an error |
06:06:34 | FromDiscord | <KingDarBoja> "Error: cannot instantiate: 'Table[A, B]'; Maybe generic arguments are missing?" :/ |
06:06:59 | FromDiscord | <Rika> that sounds like a bug |
06:09:41 | * | silvernode joined #nim |
06:10:21 | voltist | Is there a way to have a proc be a property of an object? |
06:11:08 | FromDiscord | <Rika> uh, make the first argument of the object type |
06:11:22 | FromDiscord | <Rika> like `proc something(self: ObjectType)` |
06:11:39 | FromDiscord | <Rika> then you can call it like this `objectInstance.something`, no need for parentheses even |
06:11:56 | FromDiscord | <KingDarBoja> A bug? Yikes! |
06:12:03 | FromDiscord | <Rika> if you want, you can have constant properties this way too, make it a template |
06:13:24 | voltist | Nah what I mean is to have an object contain a proc. Like to be able to go `objectInstance.myProperty = something` where something is a proc |
06:14:32 | voltist | So that `objectInstance.myProperty(a)` is equal to `something(a)` |
06:14:43 | voltist | *equivalent |
06:14:55 | FromDiscord | <Rika> have a field `myProperty: proc()` and replace the proc signature with the intended one |
06:15:15 | FromDiscord | <Rika> (proc signature -> the `proc()` part) |
06:15:53 | voltist | Ah Ok got it |
06:15:54 | voltist | Thanks |
06:15:56 | FromDiscord | <KingDarBoja> So pretty much doomed trying to use Option with table 😢 I am using the latest version btw |
06:16:01 | FromDiscord | <KingDarBoja> (1.2.0) |
06:19:04 | silvernode | Good morning/night everyone |
06:19:21 | silvernode | I hope everyone is in good health. |
06:19:28 | voltist | Not quite either of those two for me |
06:19:48 | FromDiscord | <KingDarBoja> It is 1 AM here |
06:19:55 | FromDiscord | <KingDarBoja> So good morning mate |
06:20:31 | silvernode | it is 23:20 here in AZ, sitting in the parking lot at work using th wifi and working on Space Nim as usual. |
06:20:50 | FromGitter | <sealmove> Space Nim? what is it? |
06:21:16 | silvernode | I was off work for 4 days and oddly enough never commited one thing to my game in that time. Funny how that works. |
06:21:32 | nekits | I dont need sleep, I need answers silvernode |
06:21:37 | silvernode | Space Nim is my first project in Nim, it's a text based space trading game |
06:22:46 | silvernode | nekits: answers huh? |
06:23:14 | nekits | I need more info on this game |
06:24:00 | FromDiscord | <Rika> silvernode: are you calling the humanoids in the game `nimmers` |
06:24:02 | FromDiscord | <Rika> heh |
06:25:04 | silvernode | nekits: Well, I have been trying to commit myself to making a text based game for years but always start it and never finish. So this time I am not allowing myself to give up. It is going to be a single player game that is focused on trading and exploration. Very simple concepts, nothing too ambitious. |
06:25:25 | silvernode | Rika, there are no plans for NPCs at this time |
06:25:40 | FromDiscord | <Rika> who are you trading with then??? |
06:25:41 | silvernode | Just stations, items and a player |
06:25:51 | silvernode | Rika, space stations |
06:26:25 | silvernode | https://github.com/silvernode/space-nim/blob/planning/design.md |
06:27:09 | nekits | heh, Dave. |
06:27:19 | silvernode | I have some code already but decided I should really focus on what I really need/want in the game so I started a new branch called 'planning' which contains a design doc that is incomplete. |
06:28:04 | silvernode | About to push another commit in a second for the stations section. |
06:28:14 | silvernode | I have been working on this little by ittle every night before work |
06:28:42 | FromGitter | <sealmove> hey silvernode, have you heard about CRC cards? |
06:29:13 | silvernode | sealmove, CRC cards? Nope |
06:29:39 | FromGitter | <sealmove> I used them recently for a game and it's a surprisingly useful method |
06:29:45 | FromGitter | <sealmove> https://echeung.me/crcmaker/ |
06:30:11 | silvernode | sealmove, I will check out that link and see what CRC cards even are. |
06:30:17 | FromGitter | <sealmove> example (sorry for long link): https://echeung.me/crcmaker/?share=W3sibmFtZSI6IlVzZXIiLCJzdXBlcmNsYXNzZXMiOiIiLCJzdWJjbGFzc2VzIjoiSGVybyIsInR5cGUiOjMsInJlc3BvbnNpYmlsaXRpZXMiOlsiTW92ZSIsIlNldCBPZmZlbnNpdmUgSXRlbSIsIlNldCBEZWZlbnNpdmUgSXRlbSIsIlNldCBTcGVsbCIsIkF0dGFjayIsIkNhc3QgU3BlbGwiLCJDb25zdW1lIiwiUnVuIEF3YXkiLCJFeGl0IEdhbWUiXSwiY29sbGFib3JhdG9ycyI6WyIiXX0seyJuYW1lIjoiR3JpZCIsI |
06:30:17 | FromGitter | ... nN1cGVyY2xhc3NlcyI6IiIsInN1YmNsYXNzZXMiOiIiLCJ0eXBlIjoxLCJyZXNwb25zaWJpbGl0aWVzIjpbIlBsYWNlIEhlcm8iXSwiY29sbGFib3JhdG9ycyI6WyJIZXJvIl19LHsibmFtZSI6IlRlcnJhaW4iLCJzdXBlcmNsYXNzZXMiOiJHcmlkIiwic3ViY2xhc3NlcyI6IiIsInR5cGUiOjIsInJlc3BvbnNpYmlsaXRpZXMiOlsiIl0sImNvbGxhYm9yYXRvcnMiOlsiIl19LHsibmFtZSI6Ik1vdW50YWluIiwic3VwZXJjbGFzc2VzIjoiVGVycmFpbiIsInN1YmNsYXN ... [https://gitter.im/nim-lang/Nim?at=5e8829780073445dc5626a4e] |
06:30:39 | silvernode | just pushed another commit to the design doc |
06:31:59 | silvernode | interesting, but in making a new card, I don't know what a superclass is. |
06:43:51 | FromGitter | <sealmove> It's whatever you want it to be ;P |
06:44:00 | FromGitter | <sealmove> Define your own rules |
06:54:42 | * | rockcavera quit (Remote host closed the connection) |
06:59:23 | voltist | I just got a phishing email pretending to be Github |
06:59:36 | Yardanico | wow |
07:00:00 | * | gmpreussner quit (Quit: kthxbye) |
07:00:13 | * | silvernode quit (Ping timeout: 264 seconds) |
07:00:47 | voltist | I'm going to slowloris the fake website, which might work because it would be cheaply hosted |
07:01:55 | voltist | One would imagine anyway |
07:03:36 | voltist | Little effect, must not be a threaded server |
07:04:50 | * | gmpreussner joined #nim |
07:14:18 | * | narimiran joined #nim |
07:14:18 | * | narimiran quit (Client Quit) |
07:15:20 | FromDiscord | <Rika> does nim still recommend mutimethods |
07:18:03 | Zevv | wow, 12 yours on the HN frontpage without *any* case-style whining. This is a major milestone people! |
07:41:55 | * | kenran joined #nim |
07:42:33 | * | vegai claps |
07:42:45 | vegai | that was my go-to whinge as well before I dove deeper |
07:42:50 | vegai | a classic |
07:43:10 | vegai | I still do think that things would be better without it, but oh well :) |
07:52:28 | * | hax-scramper quit (Read error: Connection reset by peer) |
07:52:42 | * | hax-scramper joined #nim |
07:59:27 | * | hax-scramper quit (Ping timeout: 260 seconds) |
07:59:46 | * | hax-scramper joined #nim |
08:06:25 | Araq | vegai, fwiw the compiler uses --styleCheck:error |
08:06:59 | Araq | to keep contributors from introducing snake_case behind my back |
08:07:06 | Yardanico | xdd |
08:08:21 | Araq | it saved me about 4 seconds this year and only took a full day to develop. But "cost benefit" analysis is unheard of in the entire programming industry so nobody notices. |
08:09:18 | * | Vladar joined #nim |
08:09:24 | Araq | And here I am claiming it's a success story. ;-) |
08:17:23 | * | tane joined #nim |
08:23:50 | * | kenran quit (Ping timeout: 258 seconds) |
08:25:57 | voltist | This is a bit of a stupid question but: how does one create a reference to something in Nim? As in, so if you change the reference you change the variable it refers to |
08:27:18 | FromDiscord | <Rika> voltist: `let someVar: ref SomeType = new SomeType; someVar[] = # set contents here` |
08:27:35 | FromDiscord | <Rika> like that? |
08:28:24 | voltist | Maybe, lets see |
08:30:03 | voltist | That seems like it would only work with 'new SomeType'. What if I have an existing object of type 'SomeType' that I want to refer to? |
08:30:37 | FromDiscord | <Rika> `let someVar: ref SomeType = new SomeType; someVar[] = theExistingObject` |
08:31:34 | voltist | Ah I see! |
08:32:06 | voltist | And then modifying someVar would change theExistingObject? |
08:32:50 | FromDiscord | <Rika> yeah |
08:32:57 | FromDiscord | <Rika> you have to modify it like this though |
08:33:09 | FromDiscord | <Rika> "someVar[].someField = someValue" |
08:33:16 | FromDiscord | <Rika> because you have to do dereferencing |
08:33:24 | FromDiscord | <Rika> [] will dereference the reference |
08:33:33 | voltist | Ok |
08:34:39 | Yardanico | @Rika not really though |
08:34:43 | Yardanico | there's auto dereference |
08:34:47 | Yardanico | https://play.nim-lang.org/#ix=2gAp |
08:34:49 | voltist | "type mismatch: got <SomeType> but expected 'ref SomeType'". Thoughts on this? |
08:34:57 | Yardanico | voltist: read my snippet |
08:35:05 | Yardanico | also see https://nim-lang.org/docs/manual.html#types-reference-and-pointer-types |
08:36:05 | solitudesf | you dont have to use `[]` when accessing fields, nim has implicit dereferncing |
08:36:35 | solitudesf | ah, but i cant read that fast |
08:40:36 | Araq | auto-deref needs to be reworked :-) |
08:41:05 | Araq | new rule shall be: x.f() can work as x[].f() |
08:41:28 | Araq | anything going further than that is known to cause way too much trouble |
08:41:51 | voltist | Araq: Is that rule not already the case? I have just tested something similar and it seemed to work |
08:43:43 | voltist | Oh wait I'm using implicitDeref |
08:50:49 | * | sleepyqt joined #nim |
08:51:19 | Araq | voltist, the current rule for implicitDeref is more "powerful", too powerful. |
08:52:00 | voltist | Ah, I see |
08:53:24 | axion | Araq: Did you see the huge bug krux reported for me the other day? |
09:06:45 | supakeen | Good morning, I've been playing with asynchttpserver and pasted the example code in a test file but I end up with a SIGSEGV: https://bpaste.net/raw/XEMA my nim version is 1.2.0, what am I missing :) The example comes from here: https://nim-lang.org/docs/asynchttpserver.html |
09:11:21 | Yardanico | uh-oh |
09:11:45 | * | gangstacat quit (Quit: Ĝis!) |
09:11:47 | Yardanico | it's a regression |
09:11:57 | Yardanico | by https://github.com/nim-lang/Nim/pull/13846/ |
09:11:57 | disbot | ➥ fix asynchttpserver content-length header |
09:12:06 | Yardanico | i wonder how CI didn't catch it, it's really bad |
09:12:15 | Yardanico | I mean the implications of this :P |
09:12:26 | supakeen | Ah, are the examples in the documentation ran by the CI? |
09:12:38 | Yardanico | most are by now, yes |
09:12:41 | Yardanico | not all |
09:13:14 | supakeen | Shall I report this an issue? |
09:13:30 | Yardanico | yeah, you can, and please also mention https://github.com/nim-lang/Nim/pull/13846/ |
09:13:31 | disbot | ➥ fix asynchttpserver content-length header |
09:13:35 | supakeen | I will. |
09:13:56 | Yardanico | it's the cause of this issue |
09:16:11 | supakeen | https://github.com/nim-lang/Nim/issues/13866 here you go. |
09:16:14 | disbot | ➥ asynchttpserver documentation example causes SIGSEGV ; snippet at 12https://play.nim-lang.org/#ix=2gAG |
09:16:25 | supakeen | Where do I need to look at how the documentation examples are run by the CI? |
09:16:38 | supakeen | Perhaps a nice saturday project to add it. |
09:18:04 | Yardanico | it's really sad that this regression got into 1.2.0, guess we'll have 1.2.2 soon anyway :P |
09:18:18 | supakeen | Hey, I release software as well, there's never a clean .0 :) |
09:20:30 | supakeen | Yardanico: If I understand correctly the content-length should be moved inside the header if. |
09:21:04 | Yardanico | supakeen: not really, if you do that then Content-Length header won't be added if there's no custom "headers" provided |
09:21:10 | Yardanico | since by default "headers" var is "nil" |
09:21:15 | Yardanico | I'm trying to figure out a good way to fix it too |
09:21:22 | supakeen | Ah let me check out the code so I have some more context then and I'll grab some coffee. |
09:21:30 | supakeen | I went off the PR diff. |
09:22:09 | Yardanico | yeah, the PR is incorrect since if "headers" is not provided it's "nil" |
09:22:20 | Yardanico | the check is not fully correct I mean |
09:25:42 | Yardanico | I showed one of the ways to fix it in https://github.com/nim-lang/Nim/issues/13866#issuecomment-609001843 |
09:25:44 | disbot | ➥ asynchttpserver documentation example causes SIGSEGV ; snippet at 12https://play.nim-lang.org/#ix=2gAG |
09:25:49 | * | dwdv joined #nim |
09:30:53 | Yardanico | Araq: is the first fix in https://github.com/nim-lang/Nim/issues/13866#issuecomment-609001843 good enough or not? the issue seems kinda important because right now on 1.2.0 asynchttpserver just doesn't work at all :D |
09:30:54 | disbot | ➥ asynchttpserver documentation example causes SIGSEGV ; snippet at 12https://play.nim-lang.org/#ix=2gAG |
09:31:27 | Yardanico | well, I mean it will work if user always provides his own "headers", but not if there's no user-provided "headers" so it's "nil" |
09:31:31 | supakeen | I think I have a slightly better way, Content-Length should not be added if it was supplied in the custom headers otherwise we always add it (old situation). |
09:32:23 | Yardanico | supakeen: well that's what my code does, or maybe I understood you incorrectly? |
09:32:34 | supakeen | By the way, what is the implicit change in that PR for `msg.add content.len` vs `msg.addInt content.len`. |
09:33:17 | Yardanico | it's deprecated |
09:33:37 | Yardanico | "addInt" was deprecated since 0.20 |
09:33:45 | Yardanico | I mean "add" |
09:33:50 | Yardanico | for adding an int to string |
09:34:34 | Yardanico | dom96: are you there maybe? https://github.com/nim-lang/Nim/issues/13866 |
09:34:35 | disbot | ➥ asynchttpserver documentation example causes SIGSEGV ; snippet at 12https://play.nim-lang.org/#ix=2gAG |
09:39:36 | dom96 | replied |
09:39:51 | supakeen | dom96: I think we replied at the same time, I added an isNil to the conditional. |
09:39:56 | supakeen | Want me to PR that? |
09:40:14 | dom96 | yes please |
09:40:23 | dom96 | If you could write a test that would be awesome as well |
09:40:33 | Yardanico | supakeen: but in your case wouldn't it fail if "headers" would be nil? |
09:40:44 | Yardanico | if headers == nil then content-length wouldn't be added |
09:41:09 | supakeen | Ah correct. |
09:41:49 | Yardanico | supakeen: I replied with a fixed snippet |
09:42:52 | supakeen | Ah yes! |
09:43:05 | Yardanico | make a PR then :) |
09:43:16 | Yardanico | guess you could add tests a bit later since this is a pretty bad regression |
09:44:34 | supakeen | Created the PR here: https://github.com/nim-lang/Nim/pull/13867 going to take a look at the testing setup now. |
09:44:36 | disbot | ➥ Add isNil check to custom Content-Length. |
09:45:21 | * | krux02 joined #nim |
09:47:33 | Zevv | disruptek: how do I *unsubscribe* from a disbot channel? |
09:53:24 | * | gangstacat joined #nim |
09:55:18 | * | andinus joined #nim |
09:58:21 | * | WilhelmVonWeiner joined #nim |
10:00:07 | voltist | Calling Python from Nim feels... dirty |
10:00:14 | Yardanico | with nimpy? |
10:00:27 | FromGitter | <deech> I'm a Windows noob, I'm trying to get a Nim executable to link with `foo.lib`, can I just pass in `{.passL: -lfoo .}` like I do on Unix? |
10:01:14 | voltist | Yardanico: Yeah |
10:01:18 | Yardanico | why though? |
10:01:20 | Yardanico | looks very nice for me |
10:01:46 | Yardanico | I mean it's the best way to do it probably |
10:02:01 | Yardanico | python is not static typing so you have to explicitly convert the types |
10:02:31 | voltist | Yeah nimpy is good at what it does, but the actual act of calling Python from Nim makes me uncomfortable |
10:02:39 | voltist | The sentiment |
10:02:43 | Yardanico | don't do it then :P |
10:03:15 | voltist | I wish I had the option |
10:03:27 | voltist | But I need a fully featured graphing library |
10:03:32 | supakeen | Are you using a specific Python library? Ah. |
10:03:33 | Yardanico | for plotting? |
10:04:03 | voltist | Yeah matplotlib. It has support for this specific type of plot I need |
10:04:07 | Yardanico | what about https://github.com/Vindaar/ggplotnim |
10:04:37 | Yardanico | https://github.com/Vindaar/ggplotnim/blob/master/recipes.org for examples |
10:04:37 | supakeen | How I've done such stuff in the past is have my $X code output some data so I can write a separate Python script to turn it into plots. |
10:04:44 | supakeen | Instead of calling into Python directly. |
10:04:59 | supakeen | But that might not apply to your case. |
10:05:20 | voltist | ggplotnim calls R though right? |
10:05:28 | Yardanico | no? |
10:05:35 | Yardanico | it's pure nim |
10:05:49 | voltist | Oh it's not a wrapper but a port, I get it |
10:07:18 | voltist | Hmmm I could use it |
10:08:46 | * | natrys joined #nim |
10:11:33 | voltist | Nim would have such good potential for scientific computing if it had a more fully-featured plotting library. But, I suppose the way you get to that point is by using it so... |
10:11:44 | voltist | I better try |
10:12:29 | FromDiscord | <Rika> `<voltist> Nim would have such good potential for scientific computing if it had a more fully-featured plotting library. But, I suppose the way you get to that point is by using it so... ` i'm the kind of fucker to use turtle to plot my shit lmaooooo |
10:24:03 | FromGitter | <Vindaar> @voltist: if there's something missing from ggplotnim, just let me know and I'll make it a priority to implement! |
10:24:10 | FromGitter | <Vindaar> And I think you missed this: |
10:24:57 | FromGitter | <Vindaar> https://gist.github.com/Vindaar/9c32c0676ffddec9078e4c0917861fcd |
10:26:25 | supakeen | Is there away to run a specific subtest, currently I am doing `./koch tests cat stdlib` but I'd like to run one subtest of stdlib :) |
10:27:14 | voltist | Vindaar: Woah, that's just what I'm looking for! Missed it? Was it mentioned earlier? |
10:27:48 | FromGitter | <Vindaar> @voltist: when you talked about such plots the other day I only saw about 2 hours later and made this. I think by that time you had left irc |
10:28:58 | voltist | Ah yeah my ZNC doesn't work for some reason so I can't see these things. Thanks so much! |
10:29:11 | FromGitter | <Vindaar> note though that the way I create the DF in this gist is not quite the way you would do it on the current master branch of `ggplotnim` |
10:29:59 | FromGitter | <Vindaar> as in there's no "newDataFrame" (you'd just write `var df: DataFrame`) and you don't have to write `toColumn` when assigning a `seq` |
10:30:14 | voltist | OK, I'll remember that |
10:30:41 | FromGitter | <Vindaar> unless I forget something right now it should work. But I should probably have merged the arraymancer backend this weekend anyways, so then it should all work |
10:31:53 | Araq | supakeen, testament r <single_test> |
10:32:35 | voltist | Vindaar: Cool. If I get this working, its definitely going into this computational neuroscience library I'm working on |
10:33:08 | FromGitter | <Vindaar> @voltist: awesome! It should work and if it doesn't I'll help you get it working. ⏎ Is the library open source? |
10:35:25 | voltist | It will be soon. I went on a little tangent from my research project yesterday to make a more accurate model and realized that I could turn it into it's own library, so I haven't been going for long. |
10:35:45 | voltist | Good progress so far though |
10:35:55 | FromGitter | <Vindaar> that's good to hear |
10:38:12 | voltist | It means that something more general-use will come out of my project, as well as the paper about a specific nervous system |
10:39:38 | FromDiscord | <Recruit_main707> is arc default gc in nim 1.2¿ |
10:39:47 | FromGitter | <Vindaar> great to hear of other people using Nim for scientific research! |
10:41:11 | supakeen | Araq: Thank you. |
10:41:24 | Yardanico | @Recruit_main707 no |
10:41:31 | supakeen | It's a load of fun figuring out how to setup these asynchttpserver testcases :) |
10:41:37 | Yardanico | it still has bugs |
10:41:58 | Yardanico | but people should test their code with --gc:arc and report issues :) |
10:42:04 | * | PMunch joined #nim |
10:45:26 | * | solitudesf quit (Read error: Connection reset by peer) |
10:45:35 | * | solitudesf joined #nim |
10:45:45 | supakeen | PASS: tests/stdlib/tasynchttpserver C ( 2.19 sec) |
10:45:49 | supakeen | Ooh, getting there! |
10:50:03 | * | Zectbumo quit (Remote host closed the connection) |
10:52:36 | PMunch | Async in ARC? |
10:52:45 | Yardanico | i think it still leaks |
10:53:11 | Yardanico | ah, PMunch, supakeen is just making tests for asynchttpserver so regressions like https://github.com/nim-lang/Nim/issues/13866 don't happen |
10:53:12 | disbot | ➥ asynchttpserver documentation example causes SIGSEGV ; snippet at 12https://play.nim-lang.org/#ix=2gAG |
10:53:33 | supakeen | And learning a bunch about async in Nim while at it, I need to solve one more thing and I'll have a pretty clean setup. |
10:53:42 | PMunch | Aaah right |
10:54:36 | PMunch | Hmm, that reminds me. I should continue my multitasking article series |
10:55:46 | supakeen | I'm currently mostly setting up something that "run a server, add this callback, perform request, kill server, return resolved request". |
10:56:54 | supakeen | so one could do `let response = testServerWith(callback, request); doAssert(response.status == Http200)` and such. |
10:57:17 | supakeen | Add an await in there. |
10:58:06 | PMunch | Ah right |
10:58:27 | FromDiscord | <flywind> Our team has written an article regarding a new streaming mode of asynchronous non blocking io for nim for Nim. |
10:59:04 | FromDiscord | <flywind> https://dev.to/xflywind/a-new-streaming-mode-of-asynchronous-non-blocking-io-for-nim-3dno |
10:59:57 | voltist | Vindaar: Well I'm not off to a good start with "undeclared identifier: 'newDataFrame'" |
11:00:12 | voltist | Despite having imported ggplotnim and arraymancer |
11:00:15 | FromGitter | <Vindaar> @voltist: that's what I mentioned above |
11:00:35 | voltist | Aww snap I forgot about that |
11:01:11 | Yardanico | @flywind will netkit get english translations? :) |
11:01:30 | Yardanico | I see both source code comments and readme are in Chinese rn |
11:02:15 | FromGitter | <Vindaar> give me 5 minutes and I'll fix the gist for current master |
11:02:36 | FromDiscord | <flywind> It's not finished.Maybe have english version later. |
11:02:39 | FromDiscord | <flywind> https://github.com/iocrate/org/blob/master/README_en.md |
11:02:44 | supakeen | Going through this it might be nice to have a `waitForAll[seq[T]](futs: seq[Future[T]]): seq[T]` and waitForOne or such but perhaps that's my Python leaking through. |
11:07:00 | voltist | V1ndaar: "Error: unhandled exception: Not implemented! nnkCallStrLit [Exception]" |
11:09:22 | FromGitter | <Vindaar> @voltist: yep that's another thing I forgot about :) |
11:09:54 | FromGitter | <Vindaar> but there's actually a problem on `master`, due to a bug that's present when using `xmin` and `xmax`, which I've fixed on the new branch |
11:10:22 | FromDiscord | <Chiqqum_Ngbata> What's the website that has nim code runner? |
11:10:28 | * | josch557 joined #nim |
11:10:43 | FromDiscord | <Recruit_main707> playground right? |
11:10:43 | FromDiscord | <Chiqqum_Ngbata> Scratch that |
11:11:16 | FromGitter | <Vindaar> so I'd suggest: try to checkout the `arraymancerBackend` branch of ggplotnim with the gist as it is. It should work fine I hope. ⏎ If not or you don't want to do that, I'd suggest you give me a little bit of time to finish the PRs and then it'll work for sure |
11:12:43 | * | opal quit (Ping timeout: 240 seconds) |
11:13:27 | voltist | OK I'll try that first one |
11:13:46 | lbart | FYI, Nim 1.2.0 is available on FreeBSD https://svnweb.freebsd.org/ports?view=revision&revision=530639 |
11:15:30 | FromDiscord | <Chiqqum_Ngbata> What am I doing wrong here (genericParams()) https://play.nim-lang.org/#ix=2gBj |
11:15:51 | voltist | V1andaar: arraymancerBackend gives me this error "Error: cannot open file: ../playground/arraymancer_backend" |
11:15:52 | FromDiscord | <Chiqqum_Ngbata> This was working in 1.1 IIRC |
11:16:50 | FromGitter | <Vindaar> @voltist: that's weird. The file should be present |
11:17:07 | voltist | Let me try something else |
11:19:00 | voltist | Nope still got that problem |
11:20:16 | voltist | V1ndaar: The file is present in the source but obviously nimble isn't installing it or something? |
11:20:25 | FromGitter | <Vindaar> ohhh |
11:20:26 | FromGitter | <Vindaar> yes |
11:20:42 | FromDiscord | <Rika> @Chiqqum_Ngbata internal errors are compiler bugs from what ive heard |
11:20:53 | FromGitter | <Vindaar> for it to work you'll have to clone the repository and use `nimble develop`. Otherwise it won't be installed, since `playground` is not considered a `src` directory |
11:21:44 | voltist | Ey, that worked |
11:22:07 | * | opal joined #nim |
11:22:20 | FromGitter | <Vindaar> :) |
11:22:27 | voltist | Does that mean I have to change those things back to how it was in the Gist? |
11:24:40 | FromGitter | <Vindaar> yes |
11:25:07 | voltist | V1ndaar: OK. I did that, but yet an another error presents: https://pastebin.com/0WB9kcXa |
11:26:29 | FromGitter | <Vindaar> @voltist: ah, indeed. I haven't commited the import of `strformat` in column.nim |
11:27:01 | voltist | Ah ok I can fix that real quick on my end |
11:27:13 | FromGitter | <Vindaar> ok, just pushed that line |
11:28:44 | vegai | Araq: ah, cool |
11:28:59 | vegai | (styleCheck:error is cool, that is) |
11:29:29 | FromDiscord | <Chiqqum_Ngbata> Wonder if genericParams() is supposed to work with typedesc |
11:30:23 | voltist | V1ndaar: Well that helped, in the sense that we are now getting a different error: https://pastebin.com/4BR5QFzP |
11:31:19 | FromGitter | <Vindaar> @voltist: ah damn. That's because the arraymancer backend depends on a new version of `ginger`, which isn't merged either yet: ⏎ https://github.com/Vindaar/ginger/pull/15 |
11:31:21 | disbot | ➥ Viewport, GraphObject are ref, less cairo calls ; snippet at 12https://play.nim-lang.org/#ix=2gBn |
11:31:49 | FromGitter | <Vindaar> sorry for the inconvenience :) |
11:32:41 | supakeen | Is there a nice way to cancel a future? |
11:34:01 | voltist | V1ndaar: Nah all good. I was going to say "Ok I'll just install your fork of Ginger", but of course that wouldn't work would it ;) |
11:34:33 | voltist | I can checkout the branch though |
11:34:34 | FromGitter | <Vindaar> for ginger it should work, since it's just a normal change in the main file |
11:35:21 | FromGitter | <Vindaar> so: `nimble install "ginger@#moreRefLessCairoCalls"` should work |
11:36:06 | voltist | Yay it worked |
11:36:08 | PMunch | supakeen, don't think so |
11:36:12 | FromGitter | <Vindaar> sweet! |
11:38:14 | voltist | V1ndaar: "Error: unhandled exception: Either `guessType` failed to determine the type due to multiple base types in the column or the data is really `VNull` [ValueError]" |
11:38:26 | FromDiscord | <Chiqqum_Ngbata> Found an old version of genericParams() that works in case anyone else needs it https://play.nim-lang.org/#ix=2gBp |
11:38:41 | voltist | Could this be because one column is made from an int seq? |
11:39:56 | FromGitter | <Vindaar> @voltist: hm, what's the output of the column type when you print the DF you want to plot? |
11:40:27 | FromGitter | <Vindaar> This is partly a leftover from the default backend DF, which didn't have typed columns so I had to guess the type by looking at a few elements |
11:41:52 | * | derka joined #nim |
11:42:27 | voltist | V1ndaar: Oh no, its a mistake on my part. There were no rows because I had incorrectly changed the parameters of the simulation |
11:42:57 | FromGitter | <Vindaar> ok! |
11:47:56 | voltist | V1ndaar: Hmmm, it seems that the DF only has one row, no matter how long the seqs are |
11:49:06 | PMunch | hmm, I had the idea to use tree edit distance (Zhang Shasha) to layout windows in my WM. But I'm afraid that checking all possible trees would be expensive.. Does anyone know of an algorithm to generate increasingly long edit scripts so I can stop when I have a valid one instead? |
11:50:18 | FromGitter | <Vindaar> @voltist: Hmm, that is.. weird? So you only see single row if you print it? |
11:51:06 | voltist | Yeah I'll link a paste |
11:51:14 | FromGitter | <Vindaar> ok, thanks |
11:53:05 | voltist | Oh wait no, error on my part again. This is what is actually causing the problem: "Error: unhandled exception: Cannot evaluate a formula of kind fkVector without a data frame as input! [ValueError]" |
11:54:14 | FromGitter | <Vindaar> Hm, that could be a bug or due to usage |
11:55:22 | voltist | Oh and it specifies this as well: "arraymancer_backend.nim(2102) evaluate" |
11:56:15 | FromGitter | <Vindaar> yep, that's the proc that tries to evaluate the formula. But if I don't see the context in which that formula is created it's hard t say whether it's a bug or not |
11:56:29 | FromGitter | <Vindaar> A formula is just something that''s created with the `f{}` macro |
11:57:43 | voltist | Here is that last bit: https://pastebin.com/J7GKcn1p Pretty similar to how you had it but with the axes the right way round and stripped down a bit |
11:58:16 | FromGitter | <Vindaar> ah! |
12:00:22 | FromGitter | <Vindaar> I think that's just a bug. The problem is that a formula as `f{c"neurons" + 1.0}` essentially means "loop over column "neurons" and add 1 for each element". But apparently the evaluation is broken right now. I'll check it out |
12:01:04 | voltist | Why do you think it wasn't broken with the formula you had in there? |
12:01:51 | FromGitter | <Vindaar> I don't quite know yet. Need to see what goes wrong |
12:02:58 | voltist | It seems to work if I go with a single neuron and replace the formulas with 1.0 and -1.0 |
12:03:23 | voltist | And then I get another error |
12:04:27 | FromGitter | <Vindaar> oh, I get it |
12:04:36 | FromGitter | <Vindaar> it's just a regression from a "fix" I did yesterday |
12:04:45 | FromGitter | <Vindaar> the gist doesn't work at all anymore. Sorry, I'll push a fix |
12:05:08 | voltist | Ok |
12:05:40 | voltist | I'll give that one last shot (and whatever this new error is) and then I'll log off for the night |
12:06:02 | * | supakeen quit (Quit: WeeChat 1.9.1) |
12:06:44 | * | supakeen joined #nim |
12:08:03 | FromGitter | <Vindaar> yeah, no worries |
12:08:52 | livcd | PMunch: you disappeared :D! |
12:09:38 | PMunch | Huh? |
12:09:42 | PMunch | I'm here! |
12:11:37 | livcd | PMunch: I wanted to talk to you about parsetoml and arc. Did you try it yourself? |
12:11:52 | PMunch | Ah, no |
12:14:43 | supakeen | I have a feeling I totally fubarred my test idea due to unfamiliarity with Nim's futures/asyncawait; here is a reduced example with genericness removed: https://bpaste.net/MP5Q the testcase works but pretty is different. |
12:15:02 | FromGitter | <Vindaar> @voltist: ok, I need to think about properly, otherwise I risk breaking other stuff |
12:15:13 | supakeen | Any pointers on how to make this more Nimlike? :) |
12:15:49 | PMunch | Aha, undeclared identifier deepCopy |
12:16:48 | voltist | V1ndaar: All good, I'll leave you to it then. Talk tomorrow maybe. Thanks for all this help! |
12:17:28 | * | voltist quit (Quit: Leaving) |
12:20:46 | * | Guest19241 quit (Ping timeout: 265 seconds) |
12:21:50 | * | dadada joined #nim |
12:22:14 | * | dadada is now known as Guest44825 |
12:23:53 | FromGitter | <Vindaar> @voltist: yeah, just ping me (but use @Vindaar please) |
12:23:58 | FromGitter | <Vindaar> and you're welcome! |
12:24:06 | PMunch | supakeen, this fixes your issue: http://ix.io/2gBD/nim |
12:25:04 | PMunch | I think it's actually a bug in asynchttpserver, line 103 should have a nil check on it. |
12:28:46 | supakeen | PMunch: I've created the PR for that: https://github.com/nim-lang/Nim/pull/13867 |
12:28:48 | disbot | ➥ Add isNil check to custom Content-Length. |
12:28:59 | supakeen | Currently looking at adding testcases to asynchttpserver in general so the CI can catch regressions like that. |
12:32:44 | * | couven92 joined #nim |
13:00:45 | * | couven92 quit (Read error: Connection reset by peer) |
13:01:15 | * | couven92 joined #nim |
13:04:57 | FromDiscord | <++x;> Nim has finally became a bit more popular, you guys did an amazing job. |
13:06:08 | FromDiscord | <++x;> Now goodbye people |
13:10:29 | FromGitter | <zetashift> ...goodbye? |
13:13:10 | FromGitter | <alehander92> i am tryyying |
13:13:14 | FromGitter | <alehander92> to rebase my custom branch |
13:13:26 | FromGitter | <alehander92> which was based on 1.0.6 to 1.2.0 but i have many new conflicts |
13:13:44 | FromGitter | <alehander92> is 1.2.0 supposed to be like linearly continued from 1.0.6 ? |
13:14:00 | FromGitter | <alehander92> like, i shouldnt get conflicts between commits in those 2 tags |
13:14:05 | FromGitter | <alehander92> or am i getting it wrong? |
13:14:33 | * | liblq-dev joined #nim |
13:15:36 | liblq-dev | so I guess incremental compilation didn't make it to 1.2.0? |
13:15:44 | liblq-dev | can't see it in the changelog |
13:16:05 | FromGitter | <alehander92> oh no, so probably |
13:16:11 | FromGitter | <alehander92> 1) 2.0 is based on 1.0 not on 1.0. |
13:16:13 | FromGitter | <alehander92> 1) 0.6 |
13:16:25 | FromGitter | <alehander92> makes sense, i should try to make my patch a single commit |
13:21:58 | disruptek | IC is immature. |
13:24:30 | Zevv | "Nim might be great. But how can a great language get traction if nobody big is behind it?" |
13:24:34 | disruptek | 1.2 is a devel-side release w/o LTS. |
13:25:52 | * | josch557 quit (Ping timeout: 260 seconds) |
13:27:36 | FromDiscord | <clyybber> Zevv: Oh, that HN comment :/ |
13:28:37 | FromDiscord | <clyybber> I think its fine to get big in hobbyist space only. Like python did. First get people to love you, then to vote for you |
13:28:50 | Zevv | right. who was behind python or ruby? |
13:33:42 | FromDiscord | <clyybber> Or research space |
13:34:28 | FromDiscord | <clyybber> Like at status or in bioinformatics |
13:48:37 | * | Vladar quit (Quit: Leaving) |
13:51:43 | FromGitter | <deech> Re-ask in case someone in the morning/afternoon crowd knows: how I do I link in a `.lib` static archive on Windows with `passL`? Ideally I'd like to set the path in an env variable (`PATH` doesn't seem to work) instead of a fully qualified path to the linker. |
13:52:45 | Araq | .passL: "foo.lib" |
13:52:52 | * | Vladar joined #nim |
13:53:57 | FromGitter | <deech> And do you know the env variable? |
13:55:05 | * | livcd quit (Ping timeout: 272 seconds) |
13:55:13 | * | livcd joined #nim |
14:01:11 | * | rockcavera joined #nim |
14:01:21 | Araq | const e = getEnv("badIdea"); .passL: e |
14:13:53 | FromGitter | <alehander92> has someone used wiggle ? |
14:17:04 | FromGitter | <alehander92> ahhh ok https://stackoverflow.com/questions/16190387/when-applying-a-patch-is-there-any-way-to-resolve-conflicts |
14:17:10 | FromGitter | <alehander92> so git am -3 is what one does |
14:17:17 | FromDiscord | <joey> I'm trying to use the "-d:nimHasLibFFI" but it doesn't seem to be working (using prebuilt nim 1.2 binary) |
14:17:19 | FromGitter | <alehander92> i wonder if people maintain their own patches of nim do this |
14:17:22 | FromGitter | <alehander92> who * |
14:17:28 | FromDiscord | <joey> ./nim-1.2.0/bin/nim c -d:nimHasLibFFI test.nim |
14:17:38 | FromDiscord | <joey> /home/joey/tmp/2020-04-04/test.nim(4, 3) Error: cannot 'importc' variable at compile time; c_printf |
14:17:38 | FromGitter | <alehander92> joey oh yeah, are you installing the libffi package |
14:17:51 | FromGitter | <alehander92> no, i think you should compile the compiler itself |
14:17:51 | disruptek | ~stream |
14:17:53 | disbot | stream: 11https://twitch.tv/disruptek (live video/audio) and mumble://uberalles.mumbl.io/ (live voice chat) -- disruptek |
14:17:54 | FromGitter | <alehander92> first with that option |
14:18:13 | FromDiscord | <joey> Ah, the compiler has to be compiled with that? |
14:18:16 | FromDiscord | <joey> Thanks, I'll try |
14:18:18 | FromGitter | <alehander92> oh disruptek you're back here |
14:18:36 | FromGitter | <alehander92> joey yes, because in order to do the vm ffi, this has to be compiled in the vm itself i think |
14:19:25 | FromGitter | <alehander92> look at this comments https://github.com/nim-lang/Nim/pull/13091 |
14:19:27 | disbot | ➥ enable testing -d:nimHasLibFFI mode |
14:25:27 | * | ehmry[m] is now known as ehmry |
14:27:34 | liblq-dev | TIL about `@` for strings |
14:27:56 | FromGitter | <alehander92> what does it do |
14:33:03 | liblq-dev | convert a string to a seq[char] |
14:33:37 | FromGitter | <sealmove> guys, have you seen an error that looks like "could not import: X509_check_host" when trying to install a package with nimble |
14:33:38 | FromGitter | <sealmove> ? |
14:37:17 | FromGitter | <alehander92> hmm |
14:41:06 | liblq-dev | I think sequtils needs a `find` with a callback and similarly `findIt`, I have to loop through a sequence right now to find the first thing that fulfills a given predicate |
14:41:18 | liblq-dev | or does it already exist in the stdlib somewhere? |
14:41:34 | FromGitter | <alehander92> if its not in sequtils |
14:41:36 | FromGitter | <alehander92> it should be there |
14:42:00 | FromGitter | <alehander92> i am not entirely sure tho where is the difference with `algorithm` |
14:42:35 | FromDiscord | <joey> thank alehander92, it worked! |
14:42:58 | FromGitter | <alehander92> no problem, thank @timotheecour for the comments, i also used them |
14:43:54 | disruptek | i have a codegen bug in nim devel against nimph tests. it's arc only. |
14:44:14 | disruptek | FAILED: nim c --gc:arc -r tests/tpackage.nim |
14:50:02 | liblq-dev | what is cpuRelax() useful for? |
14:51:37 | FromDiscord | <Generic> isn't it for spinloops? |
14:55:15 | liblq-dev | what's a spinloop? |
15:02:51 | FromDiscord | <Recruit_main707> why am i getting this error? https://play.nim-lang.org/#ix=2gCo |
15:08:26 | shashlick | @alehander92: 1.2.0 is branched off from devel, like 1.0.0 was |
15:08:57 | shashlick | 1.0.6 was built on 1.0.0 branch, not off of devel |
15:10:12 | * | PMunch quit (Quit: leaving) |
15:10:36 | FromDiscord | <Recruit_main707> what does 'export' is |
15:10:37 | FromDiscord | <Recruit_main707> only allowed at top level mean? |
15:11:06 | disruptek | shashlick: what do you mean by "how did nimph find the package"? |
15:11:36 | * | couven92 quit (Read error: Connection reset by peer) |
15:11:46 | liblq-dev | @Recruit_main707 exactly as it sounds, you can't use `export` in scopes deeper than the global scope. |
15:12:04 | * | couven92 joined #nim |
15:12:39 | FromDiscord | <Recruit_main707> it seems like a library error then... |
15:16:07 | FromDiscord | <Generic> liblq-dev: when you have a loop which does nothing but wait for a memory location to be set to a certain value |
15:16:28 | FromDiscord | <Generic> see https://www.felixcloutier.com/x86/pause for the instruction cpuRelax compiles to |
15:18:08 | liblq-dev | makes sense |
15:18:39 | shashlick | disruptek: back on a laptop, re-reading the issue |
15:18:46 | shashlick | basically asking how did user point to the package |
15:19:37 | disruptek | i dunno, they installed it with nimble i think. |
15:20:18 | shashlick | how did nimph know to look for packages in ~/.nimble/bin? |
15:20:24 | shashlick | did they set a nimble dir or do you look there |
15:20:37 | disruptek | nimph looks at whatever your nimble dir is set to. |
15:20:59 | FromGitter | <alehander92> shashlick yeahh sorry] |
15:21:00 | disruptek | actually, it looks at all your nimble dirs. |
15:21:17 | shashlick | then why don't you use $nimbleDir which was recently added |
15:21:19 | shashlick | why reduce it to $nim |
15:21:34 | shashlick | and what made you think that $nim = ~/.nimble/bin? where did that come from |
15:21:41 | disruptek | i do, if nimph is built with a compiler that supports it. |
15:22:26 | shashlick | so 1.0.6 has it right? wasn't it backported? |
15:22:51 | disruptek | i don't think so. i'm using the compiler's path substitution. if it's supported, i can improve it. |
15:23:02 | FromDiscord | <clyybber> lqdev: a spinloop is waiting for a lock or something similar using this: `while not lock.isAvailable: discard` |
15:25:13 | shashlick | wait, i'm still trying to understand what the issue is here |
15:26:16 | disruptek | the issue is that choosenim puts a shim to the nim binary in place A, which nim then uses as $nim. |
15:26:55 | disruptek | it's a choosenim bug. |
15:27:07 | shashlick | i've used choosenim for 3 years now and use $nim for nimterop every day |
15:27:52 | disruptek | can you reproduce the issue? |
15:28:29 | shashlick | https://github.com/nimterop/nimterop/blob/master/config.nims#L15 |
15:28:34 | * | vesper quit (Ping timeout: 240 seconds) |
15:28:47 | shashlick | https://github.com/nimterop/nimterop/blob/master/nimterop/ast2.nim#L5 |
15:29:09 | shashlick | setting $nim with choosenim works just fine - I can import the compiler files - $nim doesn't get substituted for $HOME/.nimble/bin |
15:29:38 | shashlick | the question is why you reduce $HOME/.nimble/pkgs/xyz to $nim/pkgs |
15:30:02 | disruptek | i use whatever the compiler's path substitution provides. |
15:30:26 | disruptek | if $nim == $HOME/.nimble/pkgs then I say $nim/xyz |
15:30:53 | shashlick | where do you get $nim from |
15:31:00 | disruptek | omg dude. |
15:31:01 | * | Trustable joined #nim |
15:31:06 | disruptek | look at the code i linked to in the issue. |
15:31:25 | disruptek | there's no bug in nimph here. |
15:31:56 | shashlick | fine, I'll just stop caring |
15:32:14 | disruptek | why? because you don't understand it? |
15:32:43 | disruptek | you don't even use nimph, right? |
15:33:13 | disruptek | and i guess kungtotte doesn't use choosenim anymore. so it only matters to you because... i dunno. |
15:33:53 | shashlick | i care about nim, choosenim, nimble and nimph - if you don't want to answer questions about code you wrote then that's up to you |
15:34:40 | disruptek | i don't know how to answer the question except to tell you that i use the compiler's code and as i've explained several times in the issue, nimph is doing exactly what it's supposed to do. |
15:34:53 | disruptek | it shortens paths by using substitutions when appropriate. |
15:35:14 | shashlick | ok then i'll figure it out myself where the issue is, no thanks |
15:35:18 | disruptek | the order in which it tests these substitutions for suitability is defined in the code i linked. |
15:35:42 | disruptek | there's no issue. |
15:36:22 | * | silvernode joined #nim |
15:44:27 | FromGitter | <eliezedeck> Hey guys, how can I fail a `FutureStream` and cause an exception to be raised to the `await`? |
15:44:48 | * | NimBot joined #nim |
15:52:23 | * | companion_cube joined #nim |
16:00:34 | FromGitter | <alehander92> hm, good question |
16:02:25 | * | livcd quit (Changing host) |
16:02:25 | * | livcd joined #nim |
16:02:25 | disruptek | https://www.dropbox.com/s/mxje14sn8xschlg/map.svg?dl=0 |
16:02:35 | disruptek | s/svg/png/ to maybe help you crash less. |
16:05:00 | * | jegfish joined #nim |
16:06:02 | Araq | eliezedeck: future's have a 'fail' proc |
16:10:54 | * | silvernode quit (Ping timeout: 240 seconds) |
16:14:34 | FromGitter | <zah> one simple idea for the tables module: have a helper that allows me to make an efficient deletion loop. It takes a block in which I mark slots for deletion. when the block completes, the table is potentially resized/rehashed |
16:15:26 | FromGitter | <eliezedeck> @Araq yes, I've already seen that, but what if I want to inform any arbitrary reader of the `FutureStream` of an error/exception, just like with `Future`? I think that is a legitimate use case |
16:16:10 | Araq | zah: interesting |
16:20:29 | * | dddddd joined #nim |
16:21:44 | companion_cube | Araq: so yesterday I realized that nim doesn't typecheck the proper usage of tagged enums (or whatever the exact name for this is), any reason why not? |
16:22:47 | * | solitudesf- joined #nim |
16:23:17 | FromDiscord | <mratsim> but it does? |
16:23:37 | Araq | companion_cube: and when did you stop beating your wife? ;-) |
16:23:42 | yumaikas | zah: That sounds like a nifty idea |
16:23:46 | FromDiscord | <mratsim> you have a runtime error if you access the wrong field |
16:24:04 | companion_cube | Araq: that doesn't help :p |
16:24:30 | Araq | questions that imply wrong assumptions are mean |
16:25:20 | * | solitudesf quit (Ping timeout: 265 seconds) |
16:25:50 | companion_cube | hm ok, didn't mean to be mean. I was just kind of disappointed |
16:26:42 | yumaikas | Araq: I'm kinda with companion_cube here, what's the wrong assumption? |
16:27:07 | companion_cube | https://nim-lang.org/docs/tut2.html#object-oriented-programming-object-variants <--- I thought that the fields would only be accessible in the corresponding branch of a `case` |
16:27:15 | * | solitudesf- is now known as solitudesf |
16:27:20 | companion_cube | but you can access the "wrong" fields, and it's a runtime error, not a compile-time one |
16:27:20 | Araq | yumaikas: the wrong assumption is that runtime checks to ensure safety are not "really safety" |
16:27:49 | yumaikas | Ah |
16:27:51 | companion_cube | I'm not talking about safety but well-typedness here |
16:28:11 | companion_cube | it's like accessing a non-existing field of an object would fail at runtime |
16:28:33 | yumaikas | It does mean that there are some runtime costs to unions, I suppose, but runtime checks could be later turned into comptime checks if someone was interested enough to do so |
16:29:02 | Araq | it's like an "index out of bounds" |
16:29:37 | companion_cube | right now it is, but I was excited about nim having sum types, is all :/ |
16:29:50 | companion_cube | (hence my question "why not have that" basically) |
16:29:57 | FromDiscord | <clyybber> Eh, so you complain about being able to do something? |
16:30:04 | FromDiscord | <clyybber> I guess we could optionally enable a warning |
16:30:06 | FromDiscord | <mratsim> how can you check at compile-time if the value are known at runtime only? |
16:30:10 | Araq | companion_cube: 1. there is a warning for it and with DrNim it'll be statically checked |
16:30:30 | yumaikas | What is DrNim? |
16:30:37 | FromDiscord | <clyybber> A static prover |
16:30:37 | FromDiscord | <mratsim> Nim + Z3 SMT solver |
16:30:39 | FromDiscord | <clyybber> using z3 |
16:30:45 | companion_cube | I didn't get a warning when I tried… |
16:31:06 | companion_cube | mratsim: you check in each branch of a case that only the fields for this case are accessed |
16:31:18 | Araq | 2. usually there is little difference between memory safety and type safety. |
16:31:20 | companion_cube | it's not as hard as index out of bound |
16:31:58 | FromDiscord | <mratsim> if you have "proc foo(myVariant: SumType) = myVariant.intField = 0 |
16:31:58 | FromDiscord | <clyybber> we do that check already, and optimize the runtime checks away if possible AFAIK |
16:32:15 | FromDiscord | <clyybber> @mratsim He wants it to be disallowed |
16:32:23 | FromDiscord | <mratsim> ah |
16:32:25 | FromDiscord | <mratsim> ok I see |
16:32:29 | companion_cube | tbh yeah, that's a weird thing to do |
16:32:42 | companion_cube | (I come from ML languages, so…) |
16:33:43 | companion_cube | I don't even think this should be disallowed if there's a runtime check, I just want a compile error if I do something that will 100% give a runtime error, like `case x.tag of A: use x.bField` |
16:34:11 | Araq | companion_cube: I agree that ML's design is better but Nim followed Ada's design |
16:34:13 | FromDiscord | <clyybber> You will get one. |
16:34:21 | FromDiscord | <clyybber> Actually let me test first |
16:34:33 | yumaikas | So no type punning on unions in Nim? |
16:34:44 | Araq | which has the benefit that the enum aspect is distinct from the sum type aspect |
16:34:53 | companion_cube | clyybber: I didn't get one, maybe I missed sth |
16:35:01 | Araq | which is a better fit for systems programming (IMO anyway) |
16:35:05 | companion_cube | Araq: yeah accessing the tag is useful |
16:35:22 | Araq | and makes certain patterns easier to express when it comes to serialization |
16:35:27 | companion_cube | but Zig, for example, has a similar syntax/design but typechecks |
16:35:39 | FromDiscord | <mratsim> Rust as well AFAIK |
16:35:43 | companion_cube | yes, indeed |
16:35:53 | Araq | Zig has the benefit of not being 10 years old |
16:35:59 | companion_cube | oh I'm not questioning the design itself, just what I perceive to be a missing typecheck in the compiler |
16:36:21 | companion_cube | kotlin does it, too, btw |
16:36:36 | Araq | I know, Nim is a strange outlier |
16:36:52 | companion_cube | in some ways nim seems really similar to D |
16:37:02 | companion_cube | (with different choices when it comes to syntax, obviously) |
16:37:05 | FromDiscord | <clyybber> companion_cube: Nevermind, it doesn't |
16:37:16 | companion_cube | clyybber: yeah I was also surprised :) |
16:37:25 | Araq | but *shrug* we're getting there and in the mean time you can still write perfectly good code |
16:37:41 | FromDiscord | <clyybber> companion_cube: We do the same analysis in object construction |
16:37:44 | companion_cube | 👍 sure |
16:37:53 | FromDiscord | <clyybber> So it warns you there |
16:38:07 | companion_cube | if you use a tag and fields that mismatch? |
16:38:12 | FromDiscord | <clyybber> Yeah |
16:38:28 | FromDiscord | <clyybber> For the assignment case it may come naturally with z3 |
16:39:01 | FromDiscord | <clyybber> Because we would collect the fact that e.kind is 1 in the respective branch |
16:41:00 | companion_cube | indeed it fails at construction |
16:42:33 | * | lritter joined #nim |
16:45:34 | Araq | there is warning[ProveObjectFields]:on or similar |
16:55:39 | companion_cube | bootstrapped in pascal… you're a Wirth fan? :) |
17:02:58 | * | silvernode joined #nim |
17:07:37 | FromDiscord | <KingDarBoja> Anyone has issues with VSCode nim extension not reporting errors unless you save another file? |
17:08:00 | FromDiscord | <Varriount> @KingDarBoja I've had it do that when using find/replace |
17:08:13 | FromDiscord | <Varriount> Although, in that case I've just had to re-save the current file. |
17:09:04 | FromDiscord | <KingDarBoja> Resaving the current file takes away the error lint |
17:09:23 | FromDiscord | <KingDarBoja> I have to save another file in order to trigger the lint which is very weird |
17:12:53 | * | sleepyqt quit (Ping timeout: 265 seconds) |
17:14:15 | FromDiscord | <clyybber> companion_cube: bootstrapped in nim now |
17:15:48 | companion_cube | yeah, I saw that in some docs |
17:16:17 | leorize | if you go back far enough in nim-lang/Nim commit history, you'll find the original pascal-based compiler |
17:18:15 | FromDiscord | <mratsim> @companion_cube, lots of Modula 2 and Oberon inspiration in Nim |
17:18:21 | FromDiscord | <Varriount> @KingDarBoja Could it be interference from another extension? |
17:18:56 | FromDiscord | <KingDarBoja> Jummm, this is the only Nim extension I have installed, but worth checking for other extensions |
17:19:22 | FromDiscord | <Varriount> @KingDarBoja You might also check the debug console |
17:21:12 | * | waleee-cl joined #nim |
17:21:30 | disruptek | Araq: seems like drnim requires --threads:on in its nim.cfg. |
17:21:37 | disruptek | <-- linux |
17:25:31 | * | couven92 quit (Read error: Connection reset by peer) |
17:25:55 | * | couven92 joined #nim |
17:29:48 | * | silvernode quit (Ping timeout: 265 seconds) |
17:52:35 | FromGitter | <alehander92> companion_cube is this about rust-like enums? |
17:52:57 | companion_cube | alehander92: yeah, sum types, in a way |
17:53:26 | companion_cube | sum types go hand in hand with pattern matching/exhaustiveness checking/… |
17:54:03 | leorize | !repo gara |
17:54:05 | disbot | https://github.com/alehander92/gara -- 9gara: 11 15 63⭐ 5🍴 |
17:54:09 | leorize | !repo patty |
17:54:10 | disbot | https://github.com/andreaferretti/patty -- 9patty: 11A pattern matching library for Nim 15 173⭐ 10🍴 |
17:54:29 | leorize | companion_cube: ^ one of them provides sum types, one of them provides pattern matching :) |
17:55:54 | Araq | companion_cube: I suppose I used to be |
17:57:31 | FromDiscord | <KingDarBoja> Ummm how to check a child object is empty (nil?) ? |
17:57:51 | FromDiscord | <Varriount> if isNil(object) |
17:58:11 | FromDiscord | <KingDarBoja> That only seems to work for the parent object, not the child one |
17:58:18 | FromDiscord | <KingDarBoja> Wait a minute and I will bring an example |
18:00:28 | FromGitter | <eliezedeck> > Hey guys, how can I fail a `FutureStream` and cause an exception to be raised to the `await`? ⏎ ⏎ Anyone? |
18:04:41 | FromDiscord | <KingDarBoja> https://play.nim-lang.org/#ix=2gDh the if part |
18:05:48 | * | couven92 quit (Read error: Connection reset by peer) |
18:06:14 | * | couven92 joined #nim |
18:06:41 | liblq-dev | @KingDarBoja regular objects cannot be nil |
18:06:46 | liblq-dev | only ref objects |
18:10:53 | FromDiscord | <KingDarBoja> https://nim-lang.org/docs/system.html#isNil%2Cref.T Ah, that what it means... |
18:13:08 | FromDiscord | <KingDarBoja> Thank you liblq-dev |
18:13:45 | liblq-dev | yeah, you probably want an Option if you want this object to be optional. see the `options` module |
18:17:14 | liblq-dev | is there a way of specifying command line params on the nim playground? |
18:17:44 | * | sleepyqt joined #nim |
18:30:04 | * | vesper11 joined #nim |
18:30:13 | * | Pix_ joined #nim |
18:30:33 | * | vesper11 quit (Read error: Connection reset by peer) |
18:33:49 | * | Pixeye quit (Ping timeout: 264 seconds) |
18:37:47 | leorize | liblq-dev: no |
18:38:12 | leorize | well you can write your nim file so that it calls the compiler to compile itself again with all the flags you want :P |
18:38:46 | liblq-dev | but that's hacky and not really feasible for bug reports |
18:39:40 | liblq-dev | imo, if the first line begins with `#! nim` or something, it should be interpreted as command line parameters |
18:40:00 | leorize | or you can just have a field for that :P |
18:40:13 | leorize | https://github.com/nim-lang/Nim/blob/devel/lib/system/repr_v2.nim <- any how the implementations are all in here |
18:40:19 | leorize | so should be simple to add uint support |
18:41:17 | * | silvernode joined #nim |
18:46:00 | * | kenran joined #nim |
18:50:14 | * | vesper11 joined #nim |
18:56:03 | * | opal quit (Ping timeout: 240 seconds) |
18:56:17 | FromDiscord | <mratsim> @liblq-dev, I've fixed your issue with Weave by the way |
18:57:42 | FromDiscord | <mratsim> it was due to Nim sets not being able to hold "-1" and somehow at the beginning of June there was a corner case where it worked |
18:57:52 | FromDiscord | <mratsim> and after some patch it was fully disabled |
18:58:17 | FromDiscord | <mratsim> (https://github.com/mratsim/weave/issues/106) |
18:58:18 | disbot | ➥ Nim sets don't support negative ID in thief ID checks |
18:59:03 | FromDiscord | <KingDarBoja> liblq-dev: Yeah, using that right now 🙂 |
18:59:18 | * | opal joined #nim |
18:59:59 | FromDiscord | <clyybber> @mratsim Can you report it upstream? Seems like a bug to me |
19:00:24 | FromDiscord | <mratsim> well it was a bug that was fixed and I was relying on the bug |
19:00:59 | FromDiscord | <clyybber> oh |
19:01:00 | FromDiscord | <mratsim> I was doing "ascertain: req.thiefID in {myWorker().left, myWorker().right}" and thiefID could be negative |
19:01:16 | FromDiscord | <clyybber> and now thiefID can't be negative anymore? |
19:01:22 | FromDiscord | <clyybber> I thought you just changed the if condition |
19:01:27 | FromDiscord | <clyybber> To an or |
19:02:04 | FromDiscord | <mratsim> It's a sanity check, I just changed the check to "ascertain: req.thiefID == myWorker().left or req.thiefID == myWorker().right" |
19:02:07 | * | gangstacat quit (Ping timeout: 265 seconds) |
19:02:57 | FromDiscord | <mratsim> the bug was that somehow you could construct a set with negative int in the past I guess |
19:03:24 | leorize | !issue set variable |
19:03:26 | disbot | https://github.com/nim-lang/Nim/issues/13764 -- 3set[T] construction is not typechecked for variables 7& 29 more... |
19:03:26 | FromDiscord | <mratsim> but only in one specific situation because I tried with naive {-1, 1} in old Nim version and the compiler refused |
19:03:42 | Araq | I remember seeing a bugfix for that |
19:04:12 | FromDiscord | <clyybber> but seq[int16] should still allow -1 right? |
19:04:20 | leorize | still no fixes for this problem in set construction |
19:04:52 | FromDiscord | <mratsim> well that one is strange, int16 should have -32768..32767 range but currently it has 0..65535 |
19:08:09 | Araq | ah |
19:17:03 | * | kenran quit (Ping timeout: 260 seconds) |
19:18:24 | * | gangstacat joined #nim |
19:21:26 | FromDiscord | <mratsim> Weave 0.4.0 released. Finally I can target a stable Nim version |
19:23:45 | Zevv | congrats mratsim! |
19:24:03 | liblq-dev | @mratsim, yeah, I saw that in my e-mail box in the morning :) |
19:24:05 | liblq-dev | thanks for the fix |
19:24:16 | * | ryukoposting joined #nim |
19:24:50 | ryukoposting | new PR for the SDL2 bindings https://github.com/nim-lang/sdl2/pull/122 |
19:24:52 | disbot | ➥ Add Audio Streams API, docs, example ; snippet at 12https://play.nim-lang.org/#ix=2gFd |
19:25:53 | solitudesf | ryukoposting, thats cool, but where is new video |
19:36:08 | ryukoposting | lmao |
19:36:47 | ryukoposting | I want to make videos about my new project (which uses a toooooon of macros) |
19:37:12 | ryukoposting | however, due to the rapture, I am currently living out of my parents' basement so the audio would be awful |
19:37:51 | ryukoposting | and I gave my nice mic to my mother, since she's a teacher and needs it more than I do right now, so the audio would be even worse |
19:39:27 | dom96 | ryukoposting, nice, merged |
19:40:22 | rayman22201 | sigh. No Nim async experiments for me today. I have catch up on day job work that I didn't get finished during the week. |
19:41:07 | dom96 | rayman22201, work on a weekend? Keep that work-life balance in mind |
19:41:11 | ryukoposting | now that I basement dwell, suddenly I have more free time |
19:43:49 | rayman22201 | Thanks dom96. I try not to make it a habit, but sometimes I can't help it. |
19:44:18 | FromDiscord | <KingDarBoja> That's terrible, watch out as dom96 said |
19:48:51 | * | Zectbumo joined #nim |
20:02:00 | * | josch557 joined #nim |
20:11:55 | * | Vladar quit (Quit: Leaving) |
20:12:54 | * | mjsir911 quit (Quit: Goodbye, World!) |
20:13:31 | FromGitter | <alehander92> companion_cube |
20:13:35 | FromGitter | <alehander92> patty and gara |
20:13:39 | FromGitter | <alehander92> were supposed to merge eventually |
20:13:47 | FromGitter | <alehander92> so in theory we can have this based on macros |
20:13:56 | FromGitter | <alehander92> 1) exhaustive checking if i recall correctly |
20:14:03 | FromGitter | <alehander92> with a bit more work |
20:14:12 | FromGitter | <alehander92> its not really limited by the language |
20:15:30 | * | mjsir911 joined #nim |
20:30:34 | * | andinus quit (Quit: ERC (IRC client for Emacs 26.3)) |
20:35:12 | disruptek | shashlick: maybe you could explain to me your code that causes nimph to produce extra output in 1.2 and less in 1.0.6? |
20:36:37 | shashlick | What are you seeing |
20:37:27 | disruptek | well, i've tried to explain it many times. |
20:37:49 | disruptek | 👭cloning https://github.com/nitely/nim-unicodeplus... |
20:37:49 | disruptek | Hint: used config file '/home/adavidoff/git/Nim/config/nim.cfg' [Conf] |
20:37:49 | disruptek | Hint: used config file '/home/adavidoff/git/Nim/config/config.nims' [Conf] |
20:37:49 | disruptek | Hint: used config file '/home/adavidoff/git/memrecall/nim.cfg' [Conf] |
20:37:49 | disruptek | Hint: used config file '/home/adavidoff/git/memrecall/deps/pkgs/nimterop-#master/nim.cfg' [Conf] |
20:37:52 | disruptek | Hint: used config file '/home/adavidoff/git/memrecall/deps/pkgs/nimterop-#master/config.nims' [Conf] |
20:38:18 | disruptek | to reproduce, try using nimph on 1.2 versus a version built with 1.0.6. |
20:41:18 | shashlick | What did you run - you bootstrapping nimph? |
20:41:25 | shashlick | Or installing a package |
20:42:03 | disruptek | i'm trying to build memrecall. |
20:42:17 | disruptek | it depends on rapid. rapid depends on glfw, nimterop-wrapped. |
20:43:12 | shashlick | Ok |
20:43:33 | shashlick | You referring to the cfg vs nims order of loading? |
20:43:46 | disruptek | no idea. |
20:44:33 | shashlick | Ok so is the issue that you are seeing more hints or that it doesn't with at all |
20:44:39 | shashlick | Work |
20:45:05 | disruptek | well, i have two problems right now. |
20:45:13 | disruptek | but, i remembered that you care about nimph. |
20:47:35 | disruptek | ~stream |
20:47:36 | disbot | stream: 11https://twitch.tv/disruptek (live video/audio) and mumble://uberalles.mumbl.io/ (live voice chat) -- disruptek |
20:48:05 | shashlick | Not able to join the stream right now but give me something specific |
20:48:31 | disruptek | nimble build wants to install [email protected] though i only require 0.7.2 and i have 0.8.0. |
20:48:35 | shashlick | I know nimterop needs more work to make nimph more reliable |
20:48:37 | disruptek | just trying to build nimterop. |
20:49:16 | disruptek | i guess nimph cannot build nimterop anymore. |
20:49:53 | shashlick | What changed? |
20:50:16 | disruptek | nimterop requirements? |
20:51:14 | disruptek | lemme try rolling it inside the nimph localdeps. |
20:52:08 | * | Zectbumo quit (Remote host closed the connection) |
20:52:12 | disruptek | nimble dump is super slow right now. feels almost hung. took 14.2s just to execute `nimph path nimterop`. |
20:52:57 | shashlick | I've been neck deep in getting ast2 working |
20:53:05 | disruptek | yeah, i cannot build nimterop, even an old version. due to needing latest unicodedb. |
20:53:23 | shashlick | Yes regex has made many upstream changes |
20:53:30 | shashlick | Added a new segmentation package |
20:53:56 | shashlick | I was thinking of moving back to pcre but it doesn't work at compile time |
20:54:04 | disruptek | i can build it just fine with nim, but not nimble. |
20:54:10 | disruptek | i usually just `nimble build`. |
20:54:54 | disruptek | maybe nimble is the one producing extra output? |
20:55:12 | disruptek | hmm, no. |
20:57:03 | shashlick | I just ran the bootstrap yesterday and it worked |
20:57:12 | shashlick | What are you running - can you gist |
21:01:45 | * | couven92 quit (Read error: Connection reset by peer) |
21:02:09 | * | couven92 joined #nim |
21:03:12 | * | moerm joined #nim |
21:03:22 | moerm | Hello everyone |
21:08:53 | FromDiscord | <KingDarBoja> Hi |
21:10:15 | * | couven92 quit (Read error: Connection reset by peer) |
21:10:40 | * | couven92 joined #nim |
21:12:50 | * | josch557 quit (Remote host closed the connection) |
21:12:51 | * | silvernode quit (Ping timeout: 250 seconds) |
21:24:34 | FromDiscord | <Rika> Hello |
21:29:39 | FromDiscord | <exelotl> Would it be considered good form to do this? https://hastebin.com/raw/eqigusabob.nim |
21:30:20 | FromDiscord | <exelotl> essentially building 2 or more implementations into 1 function, to reduce clutter in the docs. |
21:32:02 | FromDiscord | <Rika> i dont see why not |
21:36:03 | shashlick | disruptek: where can I find memrecall |
21:36:13 | disruptek | !repo memrecall |
21:36:13 | disbot | https://github.com/liquid600pgm/memrecall -- 9memrecall: 11This future is war. Go back in time to fix it all. 15 17⭐ 1🍴 |
21:37:58 | * | voltist joined #nim |
21:38:18 | shashlick | oki cloned it, set NIMBLE_DIR and ran nimph doctor |
21:38:37 | disruptek | why would you set NIMBLE_DIR? |
21:39:10 | shashlick | for localdeps? |
21:39:14 | * | solitudesf quit (Ping timeout: 256 seconds) |
21:39:21 | disruptek | do i have to do that now? |
21:39:43 | shashlick | no i'm just telling nimph to |
21:39:53 | shashlick | unable to resolve requirement `nimYAML**` |
21:39:56 | disruptek | i don't do that. does it help? |
21:40:08 | shashlick | ok i'll get rid of nimble_dir |
21:40:08 | disruptek | yeah, it's nice that the compiler is case-sensitive but nimble isn't. |
21:40:10 | disruptek | lovely, huh. |
21:41:29 | disruptek | i use localdeps via nim.cfg. i --clearNimblePath and --nimblePath="$config/deps/pkgs/" and then i `mkdir deps` and `nimph doctor`. |
21:42:31 | shashlick | ok cool - how do I deal with this nimYAML thing |
21:43:56 | disruptek | i dunno, i couldn't get past nimterop. |
21:44:07 | disruptek | probably a pr to memrecall or something. |
21:44:18 | disruptek | i am batting .500 on such PRs. |
21:44:24 | disruptek | i think people think they are obnoxious. |
21:44:37 | disruptek | i think people's misuse of capitalization is obnoxious. |
21:45:07 | moerm | - afk - |
21:45:53 | dwdv | When asked about what should be removed for v2: "<4raq> remove proc vs iterator overloading". Why's the overloading regarded as a bad thing? |
21:46:02 | * | natrys quit (Ping timeout: 256 seconds) |
21:46:22 | dwdv | What would the alternative look like? |
21:48:05 | disruptek | they wouldn't share the same "namespace" |
21:48:52 | leorize | dwdv: currently an iterator can overload a proc, and vice versa :) |
21:50:48 | * | sleepyqt quit (Ping timeout: 265 seconds) |
21:50:52 | dwdv | Sure, sure, what would foo.split look like afterwards? Would we need to put foo.iter.split or something similar? |
21:51:52 | FromDiscord | <Rika> ~~toSeq(foo.split)~~ |
21:52:46 | * | Zectbumo joined #nim |
21:52:58 | dwdv | Alright, or the other way around. Shame toSeq is one of the UFCS exceptions. |
21:53:02 | Araq | it was only an example I remembered, it makes much sense, consider that typeof(x) grew a special mode to distinguish between iters and procs |
21:56:10 | FromDiscord | <Rika> id like that toSeq be ufcs-able before this overloading removal is done |
21:56:29 | * | arecaceae quit (Remote host closed the connection) |
21:56:48 | * | arecaceae joined #nim |
22:05:07 | shashlick | disruptek: i need some steps to reproduce some issue - not sure what to try here so any step 1 this step 2 that will be useful |
22:06:39 | * | josch557 joined #nim |
22:07:45 | disruptek | if you made the nim.cfg, you can issue the following: |
22:07:55 | disruptek | cd `nimph path nimterop` |
22:08:09 | disruptek | then attempt to build nimterop with `nimble build` or `nimph build`. |
22:11:30 | shashlick | how does nimterop get there in the first place |
22:12:07 | disruptek | i issued a `nimph clone nimterop`. i also tried updating it to HEAD. |
22:12:19 | shashlick | ok |
22:19:30 | FromDiscord | <Rika> is countIt new in 1.2 sequtils? |
22:20:05 | FromDiscord | <Rika> new thought... how do i access old version docs |
22:21:34 | shashlick | disruptek: I can fix that choosenim issue - are you good with a PR for that in nimph? |
22:21:46 | disruptek | to do what? |
22:22:00 | disruptek | it's a choosenim bug. |
22:22:08 | shashlick | did you see my comment on the issue |
22:22:16 | disruptek | nope. |
22:22:35 | shashlick | see what you think |
22:22:53 | Araq | https://nim-lang.org/1.0.6/manual.html Rika, like so, replace 'docs' with the version number |
22:23:48 | FromDiscord | <Rika> haha, thanks, it would prolly help if you added a selector in future docs versions like what python did |
22:23:49 | disruptek | shashlick: that PR has to be made against the compiler, as that's where the "bug" is, if you consider it a bug. |
22:25:00 | shashlick | well, if findExe("nim") finds the shim/symlink, it should simply find the real location within choosenim |
22:25:03 | disruptek | i guess you could deprecate $nim and tell people to use $choosenim instead or something. |
22:25:17 | shashlick | its not a nim issue nor nimph issue |
22:25:25 | disruptek | so we agree. |
22:25:35 | shashlick | but given choosenim exists and uses symlinks/shims, it is good to handle that case |
22:25:52 | shashlick | why can't nimph be aware of choosenim |
22:25:53 | disruptek | there's lots of bad software i don't work around. that's why i had to write nimph. |
22:26:25 | shashlick | well, if you want to improve the situation, you have to build on what's already in use and improve as you go |
22:26:27 | disruptek | what exactly should nim do with a nim.cfg that says $nim in it? |
22:26:33 | kungtotte | choosenim is also the officially recommended installation method. |
22:26:34 | disruptek | how does that have anything at all to do with nimph? |
22:26:49 | shashlick | and i think the community deserves nimph to work well regardless of how nim was installed |
22:26:50 | disruptek | no one is recommending that anyone use nimph. |
22:27:08 | disruptek | what exactly should nim do with a nim.cfg that says $nim in it? |
22:27:30 | shashlick | it works just fine regardless of whether you use choosenim or not |
22:27:46 | shashlick | it only breaks because you compile in the compiler code into nimph and override getPrefixDir |
22:28:12 | disruptek | how do you figure? $nim doesn't work when it appears in a .cfg and you use choosenim. |
22:28:13 | shashlick | and you have to override it no doubt, but findExe("nim") isn't always going to work |
22:28:16 | disruptek | am i wrong about that? |
22:28:19 | Araq | if it helps, I'm willing to "fix" it in the compiler, whatever that means |
22:28:24 | shashlick | no it works fine |
22:28:40 | shashlick | i tested it - using $nim is handed correctly by nim since th binary is nim.exe |
22:28:54 | shashlick | whereas in your case, the binary is nimph so you need to find the real nim |
22:29:04 | shashlick | compiler is not broken |
22:29:08 | disruptek | wait, what? |
22:29:13 | disruptek | maybe i don't understand the problem after all. |
22:29:37 | disruptek | when i ask the compiler what $nim means, what does it say? |
22:29:51 | leorize | it says, you gotta be the compiler :) |
22:29:53 | shashlick | https://github.com/disruptek/nimph/blob/master/src/nimph/config.nim#L106 |
22:30:03 | moerm | Araq Hello ;) - A propos fixing in the compiler: I *really* need a clean way to pass compiler args for *only* a given C file along with .compile - but *not* for the Nim file itself |
22:30:19 | shashlick | $nim in compiler is where the exe is and it works correctly irrespective of whether it is a shim or symlink |
22:30:33 | disruptek | blame leorize. |
22:30:42 | disruptek | the one line someone contributed is a bug. |
22:30:47 | disruptek | i told you. |
22:31:08 | leorize | the other way is to hardcode the path to the compiler that compiled nimph :P |
22:31:14 | FromDiscord | <exelotl> lol I've been using bootstrap recently and the version selector in their docs is completely broken |
22:31:17 | disruptek | yes, and that's what i did. |
22:31:23 | shashlick | that won't work since the compiler in use can change |
22:31:29 | leorize | and I hate it :) |
22:31:38 | FromDiscord | <exelotl> I expected better from "the world's most popular" frontend library |
22:31:44 | disruptek | look, i want this software to be correct. |
22:31:53 | disruptek | it's on you to convince me what that means. |
22:32:01 | shashlick | i'll submit a PR, please see if you like it |
22:32:04 | moerm | I tried push ... passC ... compile ... pop. didn't do what I needed. The *whole* project was compiled with those args |
22:32:11 | disruptek | as far as i'm concerned, it's correct now. |
22:32:18 | leorize | you can be as correct as you want, but it has to work |
22:32:28 | disruptek | not for people that want to use choosenim. |
22:32:36 | disruptek | this is not a democracy. |
22:32:53 | disruptek | if you want to use software that plays games with the path, you should expect shenanigans. |
22:32:56 | shashlick | come one be realistic, don't restrict your software with such conditions |
22:33:01 | disruptek | what conditions? |
22:33:09 | disruptek | i don't believe that choosenim is doing the right thing. |
22:33:13 | disruptek | it's not correct. |
22:33:22 | shashlick | why is it wrong |
22:33:31 | Araq | moerm: ok |
22:33:48 | disruptek | well, i'm not sure i understand the problem anymore, honestly. |
22:34:15 | Araq | how about this: .compile: ("file.c", "file.o", "more options here") |
22:34:25 | moerm | Araq Thanks a bunch! |
22:34:40 | disruptek | i provide a prefix directory based upon the location of the compiler executable to a config object in memory. that is then later used to compute $nim. |
22:34:48 | disruptek | is there a better way to compute $nim? |
22:35:01 | moerm | Araq yeah that should do it. Great, that will make my life (well, my builds) a lot easier |
22:35:07 | disruptek | we could use the config.library iirc. |
22:35:14 | leorize | nope, the compiler should provide it |
22:35:26 | disruptek | so we should run the compiler? |
22:35:30 | leorize | actually I lied, there's a better way, is to ask the compiler using a small hack |
22:35:36 | leorize | yea |
22:35:49 | Araq | moerm: ah hmm the tuple is already used for wildcard .compile |
22:35:54 | disruptek | we can `nim dump` i guess. |
22:36:03 | moerm | Araq ?? |
22:36:20 | Araq | will come up with something but I should sleep. good night |
22:36:27 | disruptek | peace |
22:36:39 | moerm | Araq Thx, sleep well and a nice weekend ;) |
22:36:58 | disruptek | how is it that the compiler knows where its libs are but i cannot? |
22:36:59 | Araq | leorize: the compiler should be aware of Nim shims and ignore them |
22:37:28 | Araq | disruptek: the compiler uses relative addressing and nimph is not in $nim/bin |
22:38:04 | disruptek | the shim is a shell script? |
22:38:06 | leorize | nim dump seems to be the way to go, since the only thing you needed was the path to system libs |
22:38:23 | leorize | nim dump --skipUserCfg:on --skipProjCfg:on --skipParentCfg:on |
22:38:27 | moerm | Hey guys, let the man fall into his bed! |
22:38:28 | shashlick | well the same issue will occur if nim is installed to /usr/bin and libs to /usr/lib |
22:38:44 | Araq | disruptek: maybe on Unix. on Windows it's a fake nim.exe iirc |
22:39:14 | shashlick | you cannot assume that findExe("nim").parentDir().parentDir() = $nim |
22:39:29 | disruptek | so we need this code added into the compiler so that the config can do proper pathSubs for tooling. |
22:39:35 | shashlick | this is like findExe("gcc") might not be the gcc used by nim since it could be hard coded in nim.cfg |
22:39:40 | disruptek | it's silly to suggest that all tools should implement this themselves. |
22:40:03 | shashlick | that I agree, but using $nim works fine (outside the /usr/bin use case) |
22:40:13 | shashlick | this is an issue because you are compiling in the code |
22:40:24 | shashlick | and that is a valid use case no doubt |
22:40:29 | disruptek | yes, it's an issue that we need to work around for all tooling. |
22:40:31 | leorize | this is why I just never import the compiler |
22:40:37 | disruptek | silly. |
22:40:40 | leorize | it's not designed to be used outside of the compiler |
22:40:47 | shashlick | frankly i'm loving importing the compiler |
22:40:48 | disruptek | the compiler is the most powerful nim program ever made. |
22:40:52 | shashlick | i'd prefer if it were a lib though |
22:41:04 | shashlick | shared by all the tools that use it |
22:41:13 | shashlick | nimgrep, nimsuggest, nim itself |
22:41:14 | shashlick | libnim |
22:41:18 | disruptek | nimph is 540,000 lines of nim. |
22:41:27 | leorize | shashlick: well it's technically a lib :p |
22:41:33 | shashlick | compile the lib once and use it in many places |
22:41:42 | disruptek | i think he means dynlib. |
22:41:51 | leorize | nim shared library story is not a nice one :P |
22:41:59 | disruptek | not on unix. |
22:42:09 | moerm | I'll go too. Have a nice weekend everyone |
22:42:13 | disruptek | cya |
22:42:16 | * | moerm quit (Quit: Leaving) |
22:42:22 | disruptek | i'm not really clear on how we solve this, though. |
22:42:22 | shashlick | anyway, that's a dream, don't want to distract here |
22:42:46 | shashlick | i think for the near term, we can detect and use choosenim's path |
22:42:51 | leorize | I'd say call `nim dump` then parse the output to get the list of system search path that you're looking for |
22:42:55 | shashlick | longer term, $nim could be more resilient |
22:43:11 | Araq | disruptek: listen to leorize please |
22:43:20 | disruptek | yes, i am inclined to do it that way. |
22:43:28 | disruptek | it will be choosenim-proof. |
22:43:30 | shashlick | how does nim handle /usr installs today? how does it know to find lib in /usr/lib |
22:43:41 | leorize | shashlick: hardcoded |
22:43:55 | leorize | grep for /usr/lib/nim |
22:43:58 | shashlick | but you cannot just run compiler once and cache it cause it can be changed |
22:44:08 | shashlick | so for every time that nimph needs $nim, it will have to run nim |
22:44:22 | disruptek | yes, that's just once per execution, though. |
22:44:50 | shashlick | well, once everytime you actually need $nim, could be omitted if not needed in that particular run |
22:45:10 | shashlick | not sure if that makes sense tho, don't know nimph details |
22:45:26 | disruptek | no, because to setup the config correctly, we need to know the lib paths. |
22:45:41 | disruptek | nimph has complete knowledge of the env. |
22:45:49 | leorize | `nim dump` and you got all the paths :P |
22:45:58 | leorize | we should add more things into `nim dump` |
22:46:06 | disruptek | yes, but the order is brittle. |
22:46:07 | * | Trustable quit (Remote host closed the connection) |
22:46:15 | Araq | there is also a json mode for 'nim dump' |
22:46:29 | leorize | the json mode requires a .nim file, for whatever the reason |
22:46:33 | Araq | forgot how to enable it though |
22:46:40 | Araq | great... |
22:46:44 | * | liblq-dev quit (Quit: WeeChat 2.7.1) |
22:46:52 | Araq | good night |
22:46:58 | leorize | g'night |
22:47:10 | dom96 | why do you need these paths? |
22:47:10 | disruptek | you can pass it /dev/null |
22:47:16 | disruptek | nimph has complete knowledge of the env. |
22:47:52 | disruptek | it nicely provides the prefixdir for me. 🥳 |
22:48:34 | leorize | we just need a small patch to let it run without requiring a project file passed |
22:48:35 | disruptek | that will be a neat new feature to play with. |
22:48:51 | leorize | lol it doesn't even need the path |
22:48:59 | leorize | you can pass in whatever, it doesn't check |
22:49:05 | disruptek | nice. |
22:49:50 | disruptek | alright, i'll code this up tomorrow. |
22:49:57 | disruptek | thanks, shashlick. |
22:50:09 | disruptek | you see, it can work if you put the effort in. 😉 |
22:51:32 | dom96 | right, I still don't understand what the purpose of this is |
22:52:13 | disruptek | choosenim's shim causes nimph to setup the compiler's config incorrectly. |
22:52:26 | disruptek | which causes it to produce $nim paths that are incorrect. |
22:55:11 | dom96 | what changes does nimph make to the compiler's config? |
22:55:54 | disruptek | i don't understand. |
22:56:17 | disruptek | none. |
22:56:52 | disruptek | because the compiler isn't capable of parsing nimble package structure, we have to supply --path statements. |
22:56:58 | dom96 | in what way does nimph "setup the compiler's config" then? |
22:57:09 | disruptek | we shorten these automagically using the compiler's pathSub routines. |
22:57:26 | disruptek | $nim is one such substitution. |
22:57:40 | disruptek | it holds the wrong value when nimph is used with choosenim. |
22:57:55 | dom96 | Nimble packages aren't stored relative to Nim's location |
22:57:58 | disruptek | because the location of nim.exe has no bearing on the location of the libraries. |
22:58:08 | dom96 | How are you using $nim to shorten these paths, and why are you even doing that? |
22:58:29 | disruptek | i'm doing it because it's nice. |
22:58:32 | disruptek | it's a nice feature. |
22:59:20 | dom96 | In what way is it nice? lol |
22:59:29 | disruptek | i understand that it might not make much sense when you use a package manager that doesn't support local deps. |
22:59:34 | dom96 | and I still don't understand how you shorten these, can you give an example? |
22:59:51 | disruptek | sure. my home directory is /home/adavidoff. |
23:00:00 | disruptek | i put most of my projects in /home/adavidoff/git. |
23:00:13 | disruptek | when i have local deps, which is 100% of the time, i put them in project/deps. |
23:00:25 | disruptek | this turns into project/deps/pkgs for nimble-compat reasons. |
23:00:27 | * | tane quit (Quit: Leaving) |
23:00:39 | disruptek | so i specify my `--nimblePath="$config/deps/pkgs/"` |
23:00:55 | disruptek | because this is uniformly correct and shorter than specifying my home, etc. |
23:01:22 | disruptek | nimph automatically shortens paths when it adds --path statements to a nim.cfg. |
23:01:30 | * | josch557 quit (Quit: ERC (IRC client for Emacs 26.3)) |
23:03:37 | shashlick | I think the use case for $nim was probably mainly for compiler |
23:03:58 | disruptek | yes, that's what i use it for. |
23:04:15 | shashlick | Or did you expect packages also to be there?disruptek |
23:04:46 | disruptek | i wanted to vcs a .cfg that specified --path="$nim". |
23:04:53 | disruptek | s/vcs/distribute/ |
23:04:56 | shashlick | Yep so this was just a case where $nim showed up there incorrectly |
23:05:16 | shashlick | dom96: this is the usecfg feature we discussed at length |
23:05:27 | disruptek | no, it's correct. |
23:05:59 | disruptek | what's incorrect is the assumption that `(which nim)/../lib` is the config.libpath. |
23:06:19 | shashlick | Well if you had the right compiler path, you'd never expect anyone to put nimble packages in the compiler base path |
23:06:35 | disruptek | it has nothing at all to do with packages. |
23:06:38 | disruptek | nothing. |
23:06:59 | shashlick | Never know though, there will always be someone |
23:07:21 | disruptek | nimph has a bug regardless of whether it's working with packages. |
23:07:25 | dom96 | I'm still lost as to why this is important for nimph. But it's late so I'm likely just too tired to understand. |
23:07:42 | disruptek | it's important because bugs cause grief. |
23:07:49 | disruptek | broken windows. |
23:08:29 | dom96 | what bugs? How does this fix bugs? |
23:08:55 | disruptek | i just can't keep talking about this on stream. |
23:09:01 | disruptek | it's really not important. |
23:09:05 | disruptek | it'll be fixed tomorrow. |
23:09:09 | disruptek | 😉 |
23:12:26 | shashlick | dom96: nimph is creating nim.cfg with $ paths so that they aren't hard coded |
23:12:55 | shashlick | Choosenim creates shims / symlinks so $nim was coming out wrong |
23:13:20 | dom96 | Why is nimph creating paths containing $nim though? |
23:13:25 | shashlick | So nimph will use nim dump to get right $nim |
23:13:56 | ryukoposting | this is the first time I've heard anything about nimph, shows how long I disappeared for lol |
23:14:09 | disruptek | $nim was the shortest path. |
23:14:16 | FromDiscord | <Rika> how long have you been gone for? |
23:14:43 | * | derka quit (Ping timeout: 265 seconds) |
23:15:17 | shashlick | Cause findExe("nim") is ~~/.nimble/bin/nim so $nim becomes ~~/.nimble and then path to and pkg in ~/.nimble/pkgs became $nim/pkgs |
23:18:17 | dom96 | Now I get it. That's a hack that depends on how choosenim installs nim |
23:18:47 | dom96 | If you're putting these into the .nim.cfg and intend it to be pushed to git then that's a horrible idea |
23:19:15 | disruptek | hey, thanks, buddy. |
23:19:29 | disruptek | i think your choosenim shims are a horrible idea. 😁 |
23:19:50 | dom96 | Why? |
23:20:20 | disruptek | muddy semantics that serve no purpose. |
23:20:36 | disruptek | but i'm on stream and really don't have the interest in debating it. |
23:20:41 | dom96 | You think I implemented these shims for fun? :) |
23:20:48 | * | couven92 quit (Read error: Connection reset by peer) |
23:20:49 | disruptek | you can come on mumble if you want to chat about it. |
23:20:54 | ryukoposting | Rika: few months |
23:20:57 | dom96 | They have a very particular purpose: Windows has no symlink support |
23:21:09 | ryukoposting | what are shims? |
23:21:14 | * | couven92 joined #nim |
23:21:24 | FromDiscord | <Rika> executables that redirect input to the real executable |
23:22:43 | ryukoposting | as a way to have a standard reference point for where to find a program, even when it isn't there? |
23:23:15 | dom96 | as a way to emulate symlinks because Windows sucks |
23:24:23 | ryukoposting | I've been developing my current project on Windows since it's something that will almost exclusively get used on windows, yeah this whole "4 different terminals to do what unix does with 1" thing is annoying |
23:24:46 | ryukoposting | why do you need to emulate symlinks? |
23:25:07 | FromGitter | <timotheecour> @dom96 i’ve always wondered about this; windows does have symlinks AFAIK https://docs.microsoft.com/en-us/windows/win32/fileio/symbolic-links; btw that’s the issue talking about using symlinks: https://github.com/dom96/choosenim/issues/126 |
23:25:09 | disbot | ➥ `Error: Spawning of process failed` caused by choosenim using a wrapper process instead of symbolic link ; snippet at 12https://play.nim-lang.org/#ix=2gGt |
23:25:13 | dom96 | ryukoposting, for choosenim |
23:25:18 | leorize | ryukoposting: choosenim need to switch between different compiler versions without altering paths |
23:25:28 | leorize | timotheecour: you need admin to create them |
23:25:44 | dom96 | ^ also they suck, and only work on latest Windows versions AFAIK |
23:25:57 | dom96 | I for one care about supporting as far back as Windows XP |
23:26:02 | dom96 | or at least I did at the time |
23:26:10 | FromGitter | <timotheecour> https://www.wintellect.com/non-admin-users-can-now-create-symlinks-windows-10/ |
23:26:23 | FromGitter | <timotheecour> (from dec 2016) |
23:26:30 | leorize | in windows 10 :) |
23:26:39 | shashlick | This isn't 100% |
23:26:40 | ryukoposting | What if you just had an environment variable that pointed to a directory with some kind of compiler manifest? Then that file could just be JSON with either a bunch of absolute paths, or paths relative to the path specified in the env variable |
23:27:02 | leorize | ryukoposting: why are you making this more complicated :P |
23:27:03 | shashlick | Scoop uses links and even as admin I couldn't delete them |
23:27:38 | ryukoposting | environment variables have relatively good portability |
23:27:52 | leorize | or you can use shim binaries |
23:28:01 | shashlick | Modifying path doesn't work either on windows, child process cannot change path for parent cmd process |
23:28:07 | leorize | which is much simpler :p |
23:28:39 | FromDiscord | <mratsim> @disruptek, are you rewriting PathOfBuilding in Nim? :p |
23:28:48 | leorize | shashlick: I never figured out how chocolatey did it, though it might just be because it's written in batch/powershell |
23:28:48 | ryukoposting | Are the shims pointing to different compilers? |
23:29:06 | leorize | yes, everytime you switch, new shims |
23:29:08 | disruptek | mratsim: yeah |
23:29:11 | disruptek | well, sorta. |
23:29:15 | disruptek | bbiab |
23:29:20 | dom96 | nimble does it a slightly different way btw, it sorta works but had flaws too (it generates .bat and .cmd files) |
23:29:43 | leorize | shims are pretty battle proven |
23:29:52 | leorize | chocolatey uses them since forever |
23:30:00 | disruptek | you know what's battle-proven? |
23:30:02 | disruptek | rename. |
23:30:08 | FromDiscord | <Rika> rename what |
23:30:09 | disruptek | it's atomic and very, very fast. |
23:30:20 | shashlick | Nimble is worse since findExe doesn't work |
23:30:22 | shashlick | On windows |
23:31:04 | ryukoposting | huh. I guess it makes sense. shims have a nice advantage in the sense that you can call them like a normal program |
23:31:40 | FromDiscord | <mratsim> findExe works on Windows in powershell |
23:31:43 | dom96 | disruptek, so tell me, do you have an alternative that isn't horrible? :) |
23:31:46 | shashlick | Cross platform is hard even in Nim |
23:32:03 | FromDiscord | <mratsim> findExe is broken in bash windows |
23:32:21 | leorize | @mratsim: it's not broken :) |
23:32:24 | ryukoposting | I guess I wouldn't worry about atomicity in something that a user is changing very rarely, and from a command-line tool |
23:32:24 | shashlick | I had to change nimterop to look for toast in relative path since findExe wasn't reliable |
23:32:25 | leorize | bash is broken :) |
23:32:38 | FromDiscord | <mratsim> It ate about 2 days of fighting against Windows CI to finally have a script that work on WIndows + Mac + Linux |
23:32:59 | FromGitter | <timotheecour> I think we could simply add a `—usesymlinks` option: `choosenim —usesymlinks path` |
23:33:23 | leorize | please don't complicate it anymore |
23:33:41 | FromGitter | <timotheecour> so vast majority of users who are on a OS that can use symlinks can use that, others (on old windows versions) can keep using shims. |
23:33:58 | leorize | uhmm, on linux it uses symlinks |
23:34:07 | leorize | shims are only used on windows iiuc |
23:34:09 | FromGitter | <timotheecour> Huh? not on OSX at least |
23:34:37 | FromGitter | <timotheecour> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5e89198c167a0419f1877556] |
23:35:04 | ryukoposting | I mean, why would you use them on a system where symlinks exist |
23:35:10 | dom96 | it doesn't |
23:36:06 | FromGitter | <timotheecour> shims IS the complication. It caused bugs like https://github.com/dom96/choosenim/issues/126, and is less performant as it involves a process call overhead just to invoke nim. It’s fine as a workaround if your OS is old windows, but other ppl shouldn’t have to suffer from its consequences |
23:36:08 | disbot | ➥ `Error: Spawning of process failed` caused by choosenim using a wrapper process instead of symbolic link ; snippet at 12https://play.nim-lang.org/#ix=2gGt |
23:36:12 | ryukoposting | that was directed at leorize, dom |
23:37:07 | ryukoposting | If a single extra process call is the thing causing performance issues with your builds, there's a bigger problem and it has nothing to do with nim |
23:37:07 | FromGitter | <timotheecour> I think `—usesymlinks` is the perfect answer. Nothing complicated. |
23:37:22 | leorize | don't add more choices, make the choices permanent |
23:37:31 | leorize | use symlinks when supported, else shims |
23:37:39 | FromDiscord | <Rika> the shim overhead is barely noticeable |
23:37:43 | leorize | also please avoid symlinks on windows |
23:38:04 | ryukoposting | I can see where shims are fragile, for sure, but what on Windows isn't |
23:38:17 | leorize | anything related to new features in windows that tries to emulate unix is inherently broken |
23:38:32 | FromGitter | <timotheecour> on OS where symlinks are always supported, we can make `—usesymlinks` the default. on windows, it makes senses to make it an option |
23:38:55 | ryukoposting | until fork() exists in windows, nothing except the most trivial stuff made for unix will work 100% right on windows |
23:39:09 | leorize | nah, choosenim is supposed to be "the simple tool" to manage your installations |
23:39:27 | leorize | more choices are evil in this case |
23:39:36 | dom96 | yep |
23:39:54 | ryukoposting | the entire process model is fundamentally different, and shims seem like the most straightforward way to deal with that |
23:40:32 | FromGitter | <awr1> fork() was a mistake |
23:40:49 | * | FromDiscord <KingDarBoja> Meanwhile, been coding my entire life on Windows |
23:40:56 | ryukoposting | your opinion is trash and you should feel bad awr1 |
23:41:23 | FromGitter | <awr1> lol |
23:41:25 | leorize | lol |
23:41:35 | leorize[m] | lol |
23:41:38 | ryukoposting | lol |
23:42:01 | FromDiscord | <KingDarBoja> lol |
23:42:05 | ryukoposting | KingDarBoja I admire your bravery |
23:42:33 | FromGitter | <awr1> windows aint bad |
23:42:34 | ryukoposting | In other news, I'm making a Visual Novel engine to end all other visual novel engines |
23:42:35 | FromDiscord | <KingDarBoja> I have seen the symlink issue on Windows several times, mostly on NodeJS stuff |
23:43:14 | FromGitter | <awr1> https://www.microsoft.com/en-us/research/uploads/prod/2019/04/fork-hotos19.pdf |
23:43:23 | leorize | windows is where bugs are features, tbf |
23:43:36 | FromDiscord | <KingDarBoja> The only thing that is really annoying are tutorials always being made on linux or mac... But there are few on Windows lol |
23:44:04 | FromGitter | <awr1> honestly most of the win32 api is pretty straightforward |
23:44:04 | leorize | WSA_poll randomly broke? oh, we know but everyone has been walking around it, so it's a feature now :) |
23:44:31 | ryukoposting | it's all Nim macros sitting on top of SDL2. dom96 there's a reason I made that PR lol |
23:45:02 | * | krux02_ joined #nim |
23:45:10 | leorize | I don't mind not using fork(), it's an artifact of a time where posix refuses threads |
23:45:41 | FromDiscord | <mratsim> pitchfork() |
23:45:43 | FromGitter | <timotheecour> => https://github.com/dom96/choosenim/issues/189 (regarding shims vs symlinks) |
23:45:43 | disbot | ➥ use symlinks instead of shims where symlinks are supported |
23:46:29 | FromGitter | <awr1> introducing the all-new system call, `spoon` |
23:46:34 | ryukoposting | there are cases where processes are the appropriate solution. If you *can* do something with threads, 99% of the time you shouldn't be doing it with processes |
23:46:47 | ryukoposting | that doesn't make fork() bad, it serves an entirely separate purpose from threads |
23:47:08 | leorize | the fork()-exec() pattern for spawning is bad |
23:47:13 | leorize | sans where it makes sense |
23:47:19 | leorize | (ie. security applications) |
23:47:42 | * | krux02 quit (Ping timeout: 260 seconds) |
23:47:42 | leorize | but for general usage, it's slow and it's completely horrible to work with |
23:48:18 | ryukoposting | compared to what alternative? |
23:48:23 | leorize | posix_spawn |
23:49:02 | FromDiscord | <Rika> awr1: should have said cutlery |
23:49:50 | ryukoposting | on any system with an MMU posix_spawn is just fork-exec with a couple other minor system calls in between |
23:49:56 | leorize | you don't have to do makeshift message passing just to tell your parent that you couldn't exec() to the child due to some syscall failed before |
23:50:12 | leorize | you don't carry the cost of copying the entire address space |
23:50:22 | ryukoposting | you don't copy the entire address space with fork |
23:50:30 | leorize | yes, you still do |
23:50:38 | leorize | vfork() existed just to avoid that |
23:50:46 | leorize | and then it died because it's too unsafe |
23:51:05 | leorize | also, posix_spawn is implemented efficently on non-linux systems |
23:51:17 | leorize | ie. it's vfork()-exec() on haiku |
23:51:40 | leorize | on linux you have to ask for it to be efficient, which is why we still use our clone()-based implementation in the stdlib |
23:51:44 | FromGitter | <awr1> there has been pushback to implementing posix_spawn with fork |
23:52:20 | ryukoposting | fork doesn't copy a process' virtual address space with the exception of the few places it has to, e.g. the page currently containing the bottom of the stack |
23:52:43 | ryukoposting | it's all COW |
23:52:53 | leorize | well it has to copy the stack, and that's not small |
23:53:14 | leorize | gitlab actually measured the impact in their own software caused by fork-exec |
23:53:19 | FromGitter | <awr1> COW also invokes its own problems |
23:53:53 | ryukoposting | the default limit on linux AFAIK is 8MB |
23:54:51 | ryukoposting | and it only /needs/ to copy whatever frame the stack pointer is currently in. When the sp drops back below that frame, or a write occurs based on an offset that goes up the stack far enough to be in a different frame, then it copies |
23:57:11 | leorize | well the page table still have to be copied |
23:58:10 | FromGitter | <awr1> do fork/COW impls do that in practice RE: stack frame copying |
23:58:29 | FromGitter | <awr1> i would have just assumed that they would copy the whole stack |
23:58:43 | leorize | this problem has been well researched and has it's impact measured in a real-world program |
23:59:26 | ryukoposting | in a hierarchical page table, which is all x86 machines, you'd need to copy the outer page and one inner page at a minimum. only 8K |