00:00:33 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/0IhmF |
00:04:32 | FromDiscord | <that_dude.> Ah |
00:06:43 | FromDiscord | <demotomohiro> https://internet-of-tomohiro.netlify.app/nim/faq.en.html#type-how-to-store-different-types-in-seqqmark↵How to store different types in seq? That is frequently asked here but do people really use such a seq? |
00:26:05 | * | flouer__ joined #nim |
00:33:04 | FromDiscord | <lucidrains> ah, worth following or no?↵(@willyboar) |
01:14:59 | * | jmdaemon quit (Ping timeout: 264 seconds) |
01:32:01 | FromDiscord | <takemichihanagaki3129> In reply to @demotomohiro "https://internet-of-tomohiro.netlify.app/nim/faq.en": Impressive! My first guess would be "use an union", but, DAMN, it is 20000% better and idiomatic. |
01:32:17 | FromDiscord | <takemichihanagaki3129> (edit) "it" => "that" |
01:32:26 | FromDiscord | <takemichihanagaki3129> I absolutely loved it! |
01:35:39 | FromDiscord | <Elegantbeef> I mean a union is the proper solution 😄 |
01:36:24 | * | derpydoo quit (Ping timeout: 250 seconds) |
02:20:00 | * | flouer__ quit (Ping timeout: 260 seconds) |
02:22:19 | * | disso-peach joined #nim |
02:45:33 | FromDiscord | <heysokam> In reply to @demotomohiro "https://internet-of-tomohiro.netlify.app/nim/faq.en": yes.↵https://github.com/heysokam/ngpu/blob/f039a1b0289ce0035a9af1bb7415d38d461f1ebf/examples/e17_multimesh.nim#L179C1-L179C1 |
02:48:28 | FromDiscord | <Elegantbeef> That's not different types though, that's a tuple |
02:48:40 | FromDiscord | <heysokam> which is made of different types |
02:48:52 | FromDiscord | <heysokam> arbitrary types, in fact |
02:49:02 | FromDiscord | <Elegantbeef> When people want to have different types they want each instance to be a different type not shared fields |
02:49:19 | FromDiscord | <heysokam> what are shared fields? |
02:49:38 | FromDiscord | <Elegantbeef> In your api you have two fields that are not overlapping |
02:50:32 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4zi3 |
02:50:54 | FromDiscord | <heysokam> why? not following 🤔 |
02:51:18 | FromDiscord | <Elegantbeef> Cause they do not want to have a tuple they want to have different types in a collection |
02:51:31 | FromDiscord | <Elegantbeef> so `@[10, "h", 'a', 30f, MyObject()]` |
02:51:36 | FromDiscord | <Elegantbeef> Using a tuple doesnt express that |
02:51:55 | FromDiscord | <heysokam> i was recommended here to use a tuple |
02:52:19 | FromDiscord | <heysokam> whats the way to actually pass different types as a sequence? |
02:52:25 | FromDiscord | <Elegantbeef> You arent trying to make a heterogenous collection |
02:52:44 | FromDiscord | <heysokam> ? |
02:52:51 | FromDiscord | <heysokam> they are different types |
02:53:01 | FromDiscord | <heysokam> is that not heterogeneous? |
02:53:24 | FromDiscord | <Elegantbeef> You're making a key value pair |
02:53:25 | FromDiscord | <Elegantbeef> Or object variants as they're called |
02:53:25 | FromDiscord | <Elegantbeef> You use tagged unions |
02:53:41 | FromDiscord | <Elegantbeef> They're the same type of `(Uniform, Renderer)` |
02:54:26 | FromDiscord | <heysokam> In reply to @Elegantbeef "Or object variants as": are object variants allowed to be different from each other in kind? |
02:54:41 | FromDiscord | <heysokam> (edit) "kind?" => "kind, when stored in a seq?" |
02:55:35 | FromDiscord | <Elegantbeef> They are overlaped and ensure you only access a specific branch when it's valid |
02:55:58 | FromDiscord | <heysokam> i don't know what that means |
02:56:59 | FromDiscord | <Elegantbeef> The size of an object variant is the size of the largest branch, the size of a tuple is the size of all fields |
02:57:01 | FromDiscord | <Elegantbeef> An object variant is only allowed to be in on state at a time |
02:57:01 | FromDiscord | <Elegantbeef> one state\ |
02:58:19 | FromDiscord | <heysokam> but can two variant objects have different states and be in the same sequence? |
02:58:27 | FromDiscord | <Elegantbeef> Yes |
02:58:32 | FromDiscord | <heysokam> i thought the kind was a type diferentiator |
02:59:46 | FromDiscord | <heysokam> wait... the types are [T].. does that also limit the variant? |
03:00:00 | FromDiscord | <Elegantbeef> Yes |
03:00:05 | FromDiscord | <heysokam> how is the variant object going to know that it needs to cover every single T? |
03:00:16 | FromDiscord | <heysokam> automatically, and implied by its contents? |
03:00:26 | FromDiscord | <Elegantbeef> Object variants are not automatic |
03:00:28 | FromDiscord | <Elegantbeef> rtfm here |
03:00:38 | FromDiscord | <heysokam> so then a tuple is the solution |
03:01:13 | * | lucasta quit (Remote host closed the connection) |
03:01:16 | FromDiscord | <Elegantbeef> For your problem yes |
03:01:30 | FromDiscord | <Elegantbeef> Generally speaking you do not want to support arbitrary types and do not want to box data |
03:01:38 | FromDiscord | <heysokam> because its not `(Uniform, Texture, Uniform)` its `Uniform[SomeType], Texture, Uniform[OtherType]` |
03:02:18 | FromDiscord | <heysokam> In reply to @Elegantbeef "Generally speaking you do": yeah but you were just saying right now that i was doing it wrong, and you recommended me to use a tuple a while ago... so... its mixed information, and i don't have the knowledge to understand why |
03:02:24 | FromDiscord | <heysokam> if you say its bad, i trust it |
03:02:32 | FromDiscord | <heysokam> but if you say both.... what do i pick? 🙈 |
03:02:48 | FromDiscord | <heysokam> but yeah, worrying for no reason |
03:03:32 | FromDiscord | <Elegantbeef> I didnt say you're doing it wrong |
03:03:36 | FromDiscord | <Elegantbeef> I'm saying you're solving a different problem |
03:03:57 | * | lucasta joined #nim |
03:04:14 | FromDiscord | <heysokam> In reply to @Elegantbeef "They're the same type": this omits the generic, which implies that a variant is correct, which implies that i was doing it wrong by inference |
03:04:32 | FromDiscord | <Elegantbeef> No it doesnt |
03:04:58 | FromDiscord | <Elegantbeef> A sequence of mixed objects needs a variant |
03:05:09 | FromDiscord | <heysokam> but you omitted the T |
03:05:11 | FromDiscord | <demotomohiro> seq can add/remove objects at runtime but tuple cannot.↵seq allows randrom access with runtime value but you can access a element of tuple only with compile time int. |
03:05:35 | FromDiscord | <heysokam> well, nvm. its useless arguing |
03:05:59 | FromDiscord | <Elegantbeef> "omited the T"? |
03:06:04 | FromDiscord | <Elegantbeef> There was no T |
03:06:16 | FromDiscord | <heysokam> RenderData[Uniforms] is a T |
03:06:18 | FromDiscord | <Elegantbeef> In a statically typed programming language tuples are statically typed heterogeneous product types, and sequences are a collection of a homogenous type |
03:06:28 | FromDiscord | <Elegantbeef> If you want to dynamically store a group of values you cannot do it inside a tuple |
03:08:17 | FromDiscord | <Elegantbeef> If you wanted to store an int and a float inside of a sequence using a tuple is not the correct solution has it has 0 type information |
03:18:39 | FromDiscord | <JJ> how do you create a reference to an existing type? |
03:18:53 | FromDiscord | <Elegantbeef> `new MyType` |
03:18:59 | FromDiscord | <Elegantbeef> `(ref MyType)(...))` |
03:19:43 | FromDiscord | <JJ> er, an existing object |
03:19:57 | FromDiscord | <JJ> i have a `Stack` that i would like a pointer to |
03:20:53 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/V4odL |
03:21:02 | FromDiscord | <Elegantbeef> You cannot create a `ref` of stack type |
03:21:09 | FromDiscord | <Elegantbeef> you can only take the addr |
03:21:59 | FromDiscord | <demotomohiro> `ref` types always refers to heap. |
03:22:26 | FromDiscord | <JJ> sent a code paste, see https://play.nim-lang.org/#ix=4xfc |
03:22:32 | FromDiscord | <JJ> sent a code paste, see https://play.nim-lang.org/#ix=4zi8 |
03:22:37 | FromDiscord | <Elegantbeef> why not use a bool + template? |
03:23:27 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/cXptf |
03:23:54 | FromDiscord | <demotomohiro> In reply to @omentic "like, i've got this": In that case, both `ws` and `rs` need to be `ref Stack` or use bool + template as Elegantbeef says. |
03:24:01 | FromDiscord | <JJ> rust-style reference semantics were the first thing that came to mind |
03:24:52 | FromDiscord | <JJ> In reply to @Elegantbeef "You cannot create a": oh. right |
03:25:18 | FromDiscord | <demotomohiro> ref in Nim is bit different from reference in rust. |
03:25:45 | FromDiscord | <demotomohiro> https://nim-lang.org/docs/manual_experimental.html#view-types↵This is more similar to rust's reference. |
03:25:56 | FromDiscord | <Elegantbeef> Don't use views they're broken 😄 |
03:31:09 | FromDiscord | <JJ> bluh. that reminds me, i don't know how sinks work |
03:31:23 | FromDiscord | <JJ> iirc they were not enforced or something weird |
03:31:45 | FromDiscord | <Elegantbeef> The compiler copies if required to make the code compile |
03:34:55 | FromDiscord | <bostonboston> But you can still forbid copy's can't you |
03:35:03 | FromDiscord | <Elegantbeef> Yea |
03:35:03 | FromDiscord | <bostonboston> Or will that cause too many problems |
03:35:08 | FromDiscord | <Elegantbeef> You can make `=copy` error |
03:35:24 | FromDiscord | <JeysonFlores> sent a long message, see http://ix.io/4zie |
03:35:44 | FromDiscord | <Elegantbeef> Use a macro |
03:38:12 | FromDiscord | <demotomohiro> In reply to @bostonboston "Or will that cause": I tried to make `=copy` error and tested with seq: https://internet-of-tomohiro.netlify.app/nim/faq.en.html#type-can-i-use-object-types-for-seq-even-if-copying-is-disabledqmark |
03:39:25 | FromDiscord | <Elegantbeef> It does exactly what it does in rust by default |
03:39:29 | FromDiscord | <Elegantbeef> But it also makes it amazing |
03:39:30 | FromDiscord | <Elegantbeef> annoying\ |
03:46:21 | FromDiscord | <demotomohiro> In reply to @JeysonFlores "how can I catch": Custom pragma is applied to where procedure is defined, not to procedure call site. |
03:47:17 | * | lucasta quit (Quit: Leaving) |
03:53:12 | * | disso-peach quit (Quit: Leaving) |
04:09:21 | FromDiscord | <willyboar> In reply to @lucidrains "ah, worth following or": I guess you don't lose something to do it. They do a lot of stuff but I don't know how usable is at the moment. If you want to contribute to the project go for it. |
04:14:27 | * | disso-peach joined #nim |
04:16:30 | FromDiscord | <uninnocent> How can I get the ram size? |
04:16:41 | FromDiscord | <uninnocent> Like how many gbs of ram a device has |
04:26:37 | FromDiscord | <demotomohiro> !eval import sequtils; echo "/proc/meminfo".lines.toSeq[0] |
04:27:37 | NimBot | Compile failed: <no output> |
04:29:19 | * | disso-peach quit (Quit: Leaving) |
04:29:22 | FromDiscord | <huantian> Where’s the template to get the first value of an iterator haha |
04:36:59 | FromDiscord | <heysokam> sent a code paste, see https://play.nim-lang.org/#ix=4ziq |
04:40:46 | FromDiscord | <uninnocent> is it possible to compile nim without having nim installed? |
04:40:55 | FromDiscord | <uninnocent> like have a nim executable compile another nim executable |
04:41:13 | FromDiscord | <uninnocent> !eval import sequtils; echo "/proc/meminfo".lines.toSeq[0] |
04:42:11 | FromDiscord | <uninnocent> In reply to @demotomohiro "!eval import sequtils; echo": Error: unhandled exception: cannot open: /proc/meminfo [IOError] |
04:42:13 | NimBot | Compile failed: <no output> |
04:46:41 | FromDiscord | <demotomohiro> In reply to @uninnocent "is it possible to": You can compile Nim compiler using gcc without Nim:↵https://github.com/nim-lang/Nim#compiling |
04:47:07 | FromDiscord | <uninnocent> In reply to @demotomohiro "You can compile Nim": Alright, and what about that memory thing? |
04:47:15 | FromDiscord | <uninnocent> it didn't seem to run correctly |
04:47:16 | FromDiscord | <demotomohiro> In reply to @uninnocent "Error: unhandled exception: cannot": It works only on linux. |
04:47:25 | FromDiscord | <uninnocent> Ah, well I need a solution for windows. |
04:48:28 | FromDiscord | <demotomohiro> You probably need to find out the windows API that tells total ram amount. |
04:49:18 | FromDiscord | <uninnocent> BOOL GetPhysicallyInstalledSystemMemory(↵ [out] PULONGLONG TotalMemoryInKilobytes↵); |
04:49:22 | FromDiscord | <uninnocent> and how would I use this with nimlang? |
04:49:28 | FromDiscord | <uninnocent> Just import winim and run that function + echo it? |
04:50:32 | FromDiscord | <uninnocent> Apparently not |
04:50:42 | FromDiscord | <uninnocent> sent a code paste, see https://play.nim-lang.org/#ix=4zir |
04:51:37 | FromDiscord | <demotomohiro> sent a code paste, see https://play.nim-lang.org/#ix=4zis |
04:52:07 | FromDiscord | <demotomohiro> I dont has windows and that code is not tested.= |
04:53:37 | FromDiscord | <uninnocent> You mipelt it, but otherwise it works fine |
04:55:57 | FromDiscord | <heysokam> In reply to @uninnocent "is it possible to": you could have a binary that downloads the source code of nim, a correct zigcc for the system, and builds the nim compiler with zigcc... so essentially you don't even need gcc if you go that route. only a tool to download and call for the other requirements locally |
05:21:29 | FromDiscord | <Elegantbeef> Drop the first one |
05:21:31 | FromDiscord | <emanresu3> sent a code paste, see https://paste.rs/wdKoz |
05:22:12 | FromDiscord | <emanresu3> but then a call with a seq wouldn't work |
05:22:13 | FromDiscord | <Elegantbeef> Yea it does |
05:22:16 | FromDiscord | <Elegantbeef> `seq`, `array` and `openArray` implicitly convert to `varargs` |
05:22:33 | FromDiscord | <arathanis> wow i had that totally backwards lol |
05:22:45 | FromDiscord | <arathanis> oh wait i think i know what you mean now |
05:22:59 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4ziz |
05:23:22 | FromDiscord | <emanresu3> you're right, I didn't realize, thanks |
05:23:29 | FromDiscord | <Elegantbeef> No problem |
05:23:35 | FromDiscord | <Elegantbeef> What did you have backwards arath? |
05:24:30 | FromDiscord | <arathanis> oh i thought about how varargs is transformed into an array, but you were talking about implicit conversion before that happens i believe |
05:24:52 | FromDiscord | <arathanis> or maybe in lieu of that happening? |
05:24:56 | FromDiscord | <Elegantbeef> Only `myCall(a, b, c, d, e)` is converted into an array |
05:25:12 | FromDiscord | <arathanis> with myCall having varargs right? |
05:25:36 | FromDiscord | <arathanis> but really varargs is like a special version of openarray? or is that not quite right? |
05:25:55 | FromDiscord | <Elegantbeef> `varargs` also accepts `seq`, `array`, `openArray` since it's pretty much an alias to the latter |
05:26:07 | FromDiscord | <Elegantbeef> It's pretty much a special openarray |
05:26:36 | FromDiscord | <arathanis> so its basically an openarray with special syntax for procedure calls |
05:26:55 | FromDiscord | <Elegantbeef> Yes |
05:27:33 | FromDiscord | <demotomohiro> https://nim-lang.org/docs/manual.html#types-varargs↵> A varargs parameter is an openarray parameter that additionally allows to pass a variable number of arguments to a procedure. The compiler converts the list of arguments to an array implicitly: |
05:27:41 | FromDiscord | <arathanis> well hey there it is |
05:27:46 | FromDiscord | <arathanis> https://media.discordapp.net/attachments/371759389889003532/1123484865740947486/image.png |
05:27:55 | FromDiscord | <Elegantbeef> rtfm is too hard 😄 |
05:28:02 | FromDiscord | <arathanis> the manual lies |
05:28:10 | FromDiscord | <Elegantbeef> How? |
05:28:30 | FromDiscord | <Elegantbeef> The manual is the closest thing we have to a spec, so if it lies, someone needs to fix it or the compiler |
05:28:44 | FromDiscord | <arathanis> it says "manual" when so many things in nim are automatic and free |
05:28:47 | FromDiscord | <arathanis> 😉 |
05:28:55 | FromDiscord | <Elegantbeef> lol |
05:30:44 | FromDiscord | <arathanis> `varargs[typed]` is the spooky magic |
05:30:56 | FromDiscord | <Elegantbeef> It's not that spooky |
05:31:02 | FromDiscord | <arathanis> i know lol |
05:31:10 | FromDiscord | <arathanis> its for echo |
05:31:14 | FromDiscord | <arathanis> and abuse |
05:31:55 | FromDiscord | <arathanis> its mostly just slightly different than normal varargs in that normal varargs wont nest implicit arrays |
05:32:01 | FromDiscord | <arathanis> but varargs[typed] will |
05:32:06 | FromDiscord | <arathanis> according to the manual |
05:32:14 | FromDiscord | <Elegantbeef> It's not even for echo |
05:32:14 | FromDiscord | <Elegantbeef> Echo uses it, but I don't think it needs to |
05:32:41 | FromDiscord | <arathanis> well the manual says its "required so that the builtin echo proc does what is expected" |
05:33:47 | FromDiscord | <arathanis> looks like its so `echo @[1, 2, 3]` prints the string repr of the seq and not `123` if it was used like openarray |
05:34:47 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4ziB |
05:36:20 | FromDiscord | <Elegantbeef> Maybe it was required in the past? Cause I do not think so any further |
05:37:01 | FromDiscord | <arathanis> sent a code paste, see https://play.nim-lang.org/#ix=4ziC |
05:37:04 | FromDiscord | <arathanis> this makes it not behave like you expect |
05:37:08 | FromDiscord | <Elegantbeef> Right |
06:07:20 | FromDiscord | <JJ> In reply to @Elegantbeef "The compiler copies if": hmm. i wish it would provide a warning when it does so. |
06:07:59 | FromDiscord | <Elegantbeef> `--hint[Performance]: on` |
06:08:04 | FromDiscord | <JJ> that'd make `sink` and `lent` annotations very nice to work with for performance |
06:08:15 | FromDiscord | <JJ> 😮 😮 😮 |
06:08:34 | FromDiscord | <Elegantbeef> Could even turn it into an error disallowing any implicit copies |
06:08:45 | FromDiscord | <JJ> okay wow i will try that out |
06:09:16 | om3ga | play.nim-lang.org opens at your side? |
06:09:31 | FromDiscord | <JJ> In reply to @Elegantbeef "Could even turn it": i'd just love it if those hints were turned on by default, it'd make nim particularly more appealing to rust folks imo |
06:09:36 | FromDiscord | <Elegantbeef> I know I do not write any performance sensitive code, but I really do not get why people are so scared of the implicit copies |
06:09:49 | FromDiscord | <Elegantbeef> If you have a large object you likely will error the copy anyway |
06:10:00 | FromDiscord | <Elegantbeef> Or the object will be a `ref` for whatever reason |
06:10:25 | FromDiscord | <JJ> well making `=copy` an error takes effort |
06:10:49 | FromDiscord | <Elegantbeef> Sure but many people write code with implicit copies |
06:12:09 | FromDiscord | <Elegantbeef> If that errored by default you've made the barrier to the language much higher |
06:12:12 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/wWE6v |
06:12:26 | FromDiscord | <Elegantbeef> Nim trusts the programmer's intentions |
06:12:37 | FromDiscord | <Elegantbeef> If you say you want to use a after it was supposedly used it trusts that you wanted to copy |
06:13:15 | FromDiscord | <Elegantbeef> the benefit is that you can do like `echo myVar` anywhere in code and get information temporarily, yes I'm promoting echo debugging 😄 |
06:13:57 | FromDiscord | <Elegantbeef> You can also disable implicit copies inside any function by using pragmas to enable erroring on Performance |
06:14:42 | FromDiscord | <Elegantbeef> I don't know I just find trusting the programmer about these things the better solution, probably biased due to Nim |
06:16:30 | om3ga | hmm, what means "trusting programmer" |
06:17:05 | FromDiscord | <Elegantbeef> The compiler/language assumes what the programmer said to do is what it is desired |
06:17:16 | FromDiscord | <Elegantbeef> Rust doesnt trust the programmer so a use after move is an error |
06:17:28 | om3ga | aah rust... |
06:17:28 | FromDiscord | <Elegantbeef> Nim trust's the programmer so a use after move causes a copy where the use was supposed to be |
06:17:56 | FromDiscord | <Elegantbeef> "where the move was supposed to be" |
06:18:39 | om3ga | did you know, rust don't has uninitialized array declaration of fixed size? |
06:18:53 | FromDiscord | <Elegantbeef> I do not know what that means |
06:19:13 | FromDiscord | <Elegantbeef> you mean like `var a {.noinit.}: array[10, int]`? |
06:19:31 | om3ga | you cannot declare array with size of 100 elements without initializing it |
06:19:46 | FromDiscord | <Elegantbeef> Sure you technically cannot in Nim without doing it either 😛 |
06:19:47 | om3ga | what means if will zero terminate, or fill with some def. values |
06:20:33 | FromDiscord | <JJ> In reply to @Elegantbeef "If that errored by": yeah, i agree: that's why i think `--hint[Performance]: on` by default would be cool |
06:21:02 | FromDiscord | <Elegantbeef> `let array: [i32; 3] = [0; 3];` seems to be valid so idk what you mean |
06:22:03 | FromDiscord | <Elegantbeef> Well PRs welcome 2.0 is out soon 😄 |
06:22:05 | om3ga | Elegantbeef no, I mean: var a: array[10,char] VS var b: array[10,char] = '\0' |
06:22:52 | FromDiscord | <Elegantbeef> I'm confused cant you do `let a: [char, 10] = ['\0'];`? |
06:23:05 | FromDiscord | <Elegantbeef> I do not know Rust and only looked at arrays due to you, so I'm guessing |
06:23:16 | om3ga | I mean when I don't want to do it, rust not allows |
06:23:38 | FromDiscord | <Elegantbeef> I do not get what you mean, so I'll shush |
06:23:40 | om3ga | it's not about me, more about my co-worker who studies rust |
06:25:11 | om3ga | hmm, ok. maybe my english sucks, but code example pretty informative what I mean |
06:26:22 | om3ga | rust does var b variant in any case, by assigning to array some value, and it takes a lot of time |
06:27:05 | FromDiscord | <Elegantbeef> Couldnt you do `[]` then intialize it the same way you would in Nim |
06:27:54 | om3ga | in C is the same, char a[10] < uninitialized arr |
06:28:20 | om3ga | Elegantbeef, the problem is that rust not allows you to have uninitialized array |
06:28:32 | om3ga | it has no trust to programmer, as you said |
06:28:51 | FromDiscord | <Elegantbeef> Oh shit `[]` fails |
06:32:21 | FromDiscord | <gogolxdong666> Is there any way to sync nimbus-eth2 with geth which has a different chainId? |
06:32:34 | FromDiscord | <Elegantbeef> Oh god it's "init 3 elements with value 0" |
06:32:37 | FromDiscord | <Elegantbeef> Cause that's better than just `[0..]` or something similar 😄 |
06:33:40 | FromDiscord | <gentk> am I perhaps missing some std function to turn a tuple to a string array? e.g. (4, "str", 12.3) to ["4", "str", "12.3"] |
06:34:05 | om3ga | also it's not clear how rust uses arrays in stack |
06:34:27 | FromDiscord | <Elegantbeef> I doubt that function exists gentk, it's pretty simple though |
06:34:40 | om3ga | it can be like they're not in stack at all |
06:34:52 | FromDiscord | <gogolxdong666> `build/nimbus_beacon_node --el=http://149.28.74.252:8545` |
06:35:30 | FromDiscord | <uninnocent> is there any way to run an executable in memory without using shellcode? |
06:35:55 | om3ga | gentk , tuple is a typed array of fixed size, you can read values and assign to a string |
06:36:44 | FromDiscord | <Elegantbeef> There's a `fields` iterator which you'll want to use for this |
06:37:21 | om3ga | in Nim if I not mistaken, tuple is in stack |
06:37:33 | FromDiscord | <Elegantbeef> It's a value type yes |
06:38:48 | om3ga | playground dead :( |
06:39:47 | FromDiscord | <gentk> yes I found the fields iterator, but building a fixed length array you then need both an index and iterating over values |
06:40:02 | FromDiscord | <gentk> so the code didn't seem that elegant, so checked if I'm missing something |
06:40:08 | FromDiscord | <gentk> (edit) "so the code didn't seem that elegant, so checked if I'm missing something ... " added "obvious" |
06:40:20 | FromDiscord | <gentk> (edit) "values" => "fields" |
06:40:59 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4ziR |
06:41:28 | FromDiscord | <gentk> ah didn't know about enumerate |
06:41:46 | FromDiscord | <Elegantbeef> `enumerate t.fields`\ |
06:42:25 | FromDiscord | <gentk> thanks, that's convenient |
06:48:53 | FromDiscord | <JJ> sent a code paste, see https://play.nim-lang.org/#ix=4ziT |
06:49:25 | FromDiscord | <Elegantbeef> I think the compiler knows you didnt actually sink it |
06:50:08 | FromDiscord | <gentk> sent a code paste, see https://play.nim-lang.org/#ix=4ziU |
06:50:19 | FromDiscord | <Elegantbeef> Right cause `[]` on a tuple has to be static |
06:50:33 | FromDiscord | <gentk> (edit) "https://play.nim-lang.org/#ix=4ziU" => "https://play.nim-lang.org/#ix=4ziV" |
06:50:54 | FromDiscord | <Elegantbeef> Oh JJ this is a global variable aswell |
06:53:00 | FromDiscord | <Elegantbeef> Or i'm missing something |
06:54:13 | om3ga | play.nim-lang.org works? I get timeout error |
06:54:26 | FromDiscord | <Elegantbeef> No it doesnt |
06:54:29 | FromDiscord | <Elegantbeef> It's down right now |
06:54:35 | FromDiscord | <Elegantbeef> Move to a modern platform if you want to see code blocks 😄 |
06:54:52 | om3ga | aah, thanks, you posted links, that's why I'm asking |
06:55:27 | FromDiscord | <Elegantbeef> We didnt |
06:55:32 | FromDiscord | <Elegantbeef> We posted code blocks 😛 |
06:55:59 | om3ga | hmm, I need more coffee |
07:00:20 | FromDiscord | <JJ> In reply to @Elegantbeef "Oh JJ this is": hmm. i still can't get it to trigger. |
07:00:33 | FromDiscord | <Elegantbeef> Yea I'm too tired to catch why it's not triggering atm |
07:10:35 | FromDiscord | <Elegantbeef> Oh @JJ it's cause `LargeStruct` is unsinkable anyway |
07:11:33 | FromDiscord | <Elegantbeef> The hint is only made where it makes sense, a large type that is unsinkable doesnt make to warning when it's copied |
07:12:04 | FromDiscord | <Elegantbeef> As soon as you add some heap memory with `seq` or `string` it creates the hint |
07:13:15 | FromDiscord | <Elegantbeef> It's not like it could do much else given `sink LargeObject` is just "copy this object" |
07:16:31 | FromDiscord | <JJ> oh, duh, that makes sense |
07:16:52 | FromDiscord | <JJ> for some reason i was thinking "hmm i need a large type. i shall make something big on the stack" |
07:17:10 | FromDiscord | <JJ> ignoring that the stack literally elides all memory management and does its own thing |
07:19:01 | FromDiscord | <JJ> although... i still can't seem to produce the hint |
07:19:15 | FromDiscord | <Elegantbeef> Add a seq field |
07:19:54 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4zj1 |
07:20:35 | FromDiscord | <Elegantbeef> It also works top level, but move semantics can be funny top level |
07:21:23 | FromDiscord | <JJ> still not getting it. previously tried with `ref object` too |
07:21:26 | FromDiscord | <JJ> `nim c --hint[Performance]:on`? |
07:21:44 | FromDiscord | <JJ> oh what the hey it's that `var` |
07:22:18 | FromDiscord | <Elegantbeef> cannot sink memory that's immutable so copy is required anyway |
07:22:28 | FromDiscord | <Elegantbeef> Same logic as array |
07:22:40 | FromDiscord | <JJ> really? hmm |
07:22:43 | FromDiscord | <JJ> why is that the case? |
07:23:24 | FromDiscord | <Elegantbeef> `move` takes a `var T` |
07:24:22 | FromDiscord | <Elegantbeef> Perhaps due to copy elison/cursor semantics, though idk |
07:25:14 | FromDiscord | <Elegantbeef> It's quite easy to just error the copy if you really care about this stuff, or even make it write stack traces in a debug build |
07:27:44 | FromDiscord | <JJ> huh. i feel like you could escape scope by writing to a global or smth though, and i'd think sink would be helpful there |
07:27:47 | FromDiscord | <JJ> if that makes sense |
07:28:05 | FromDiscord | <JJ> also wait do you mean any array? so any fixed memory allocation even if it's mutable? |
07:29:01 | FromDiscord | <Elegantbeef> What? |
07:29:16 | FromDiscord | <JJ> In reply to @Elegantbeef "Same logic as array": what'd you mean here? |
07:29:45 | FromDiscord | <Elegantbeef> It's not the same logic as arrays |
07:30:03 | FromDiscord | <Elegantbeef> It's just that `let` does not guarantee you own the resources, so you cannot `sink` it I assume |
07:31:58 | FromDiscord | <JJ> hmm. that's interesting. |
07:33:06 | FromDiscord | <Elegantbeef> Copy elison means `let` does not always own resources |
07:33:11 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/8CIdq |
07:35:09 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4zj4 |
07:35:53 | FromDiscord | <JJ> how'd you get the expanded arc? also the code block broke across the bridge |
07:36:05 | FromDiscord | <Elegantbeef> `--expandArc: main` |
07:36:26 | FromDiscord | <Elegantbeef> https://hatebin.com/zichyypved |
07:40:15 | FromDiscord | <Elegantbeef> Can one move an immutable object in Rust? |
07:41:03 | FromDiscord | <JJ> yes, you do so by default |
07:41:37 | FromDiscord | <JJ> but references in rust are at the level of types which is... interesting (a poor design decision) |
07:43:08 | FromDiscord | <JJ> sent a code paste, see https://play.nim-lang.org/#ix=4zj8 |
07:43:59 | FromDiscord | <JJ> or, i may be still thinking about it wrong, actually. |
07:46:03 | FromDiscord | <JJ> yeah i really don't understand this. you're freeing the memory associated with a: but then you're setting the fields of a once again? and saying a was moved? |
07:46:54 | om3ga | my colleague seems will stop to continue learning rust |
07:46:56 | FromDiscord | <JJ> hmm. going to read through this again in the morn |
08:02:19 | * | ntat joined #nim |
08:10:07 | * | PMunch joined #nim |
08:42:50 | FromDiscord | <Elegantbeef> @JJ\: you do not know what was in the memory before so you destroy it, then you disarm the destructor with `wasMoved` then you set the fields |
08:48:08 | * | azimut_ quit (Ping timeout: 240 seconds) |
09:02:29 | om3ga | [email protected]@[email protected]:1134:9: warning: ‘free’ called on a pointer to an unallocated object ‘-8B’ [-Wfree-nonheap-object] |
09:04:48 | om3ga | --d:release causes this |
09:07:49 | FromDiscord | <jvlenprzz> I need help |
09:07:51 | FromDiscord | <jvlenprzz> i cant install nimble |
09:07:55 | FromDiscord | <jvlenprzz> ERROR: Failed building wheel for nimble-install↵Failed to build nimble-install↵ERROR: Could not build wheels for nimble-install, which is required to install pyproject.toml-based projects |
09:08:07 | FromDiscord | <jvlenprzz> Can someone help me? |
09:08:25 | FromDiscord | <jvlenprzz> wheel |
09:08:40 | om3ga | gcc compiler, while clang not reports this warning (what ofc not means absence of problem) |
09:09:50 | FromDiscord | <jvlenprzz> do u know how |
09:10:59 | * | m5zs7k quit (Ping timeout: 246 seconds) |
09:11:14 | FromDiscord | <Elegantbeef> This is a chat for the Nim programming language not a python library |
09:11:41 | FromDiscord | <jvlenprzz> Yes but since i want to install Nim into python and i cant |
09:11:42 | FromDiscord | <jvlenprzz> you should help me |
09:12:03 | PMunch | Install Nim into Python? |
09:12:06 | PMunch | What does that even mean? |
09:12:14 | om3ga | what? |
09:12:45 | * | m5zs7k joined #nim |
09:13:07 | PMunch | I guess this thing? https://github.com/juancarlospaco/nimble_install |
09:14:10 | * | ntat quit (Read error: Connection reset by peer) |
09:14:13 | FromDiscord | <Elegantbeef> People make the oddest packages |
09:14:32 | FromDiscord | <jvlenprzz> want to install this https://pypi.org/project/nimble-install/ |
09:14:41 | Amun-Ra | "Install Nim packages directly from Python PIP" but why? |
09:15:00 | PMunch | In case you have a Python library which uses a Nim-built package on the side |
09:15:03 | PMunch | I guess |
09:15:13 | Amun-Ra | hmm |
09:15:26 | PMunch | jvlenprzz, that's not a package you install on its own. It's used to install Nimble packages with pip |
09:15:32 | om3ga | I allways had problems with installing python packages. It almost never works as it should |
09:15:37 | FromDiscord | <jvlenprzz> Yes and thats what i want to do |
09:15:47 | FromDiscord | <jvlenprzz> Install Nimble packages with pip |
09:15:53 | FromDiscord | <jvlenprzz> But how am i supossed to use it |
09:16:31 | PMunch | If you read the documentation at the link I sent you I think you will figure it out |
09:16:42 | PMunch | You need to give it a `--install-option` parameter |
09:16:56 | FromDiscord | <jvlenprzz> I mean ill start from zero, i want to install a python thing which just works with nim and nim.cfg files so i deduced its nimble cause it doesnt have any setup py |
09:17:01 | FromDiscord | <jvlenprzz> no such option: --install-option |
09:17:07 | FromDiscord | <jvlenprzz> Thats what it says kekw |
09:17:12 | PMunch | Hmm |
09:17:26 | PMunch | Maybe this nimble-install package is not the same as nimble_install.. |
09:18:39 | PMunch | Try with `--nimble=` |
09:20:08 | PMunch | Hmm, its @juancarlospaco which has made the package |
09:20:12 | PMunch | Maybe they're online? |
09:20:26 | FromDiscord | <jvlenprzz> I mean |
09:20:30 | FromDiscord | <jvlenprzz> .nim is a nimble file right |
09:20:34 | PMunch | No |
09:20:44 | FromDiscord | <jvlenprzz> fml |
09:20:45 | PMunch | .nim is a Nim file, Nimble is Nims package manager |
09:20:58 | PMunch | So Python -> Nim, Pip -> Nimble |
09:21:07 | FromDiscord | <JJ> In reply to @Elegantbeef "<@572634810917322773>\: you do not": hmm. okay that makes sense: but then, why isn't the source marked as no longer usable, and how does this avoid copying memory? |
09:21:13 | om3ga | this is python package integration with nim |
09:21:14 | PMunch | But you would use Nimble to install Nim projects |
09:21:20 | om3ga | not related directly to nim |
09:21:50 | PMunch | True, but we talk about unrelated stuff here all the time :P |
09:22:10 | FromDiscord | <jvlenprzz> So in order to install a ZIP which all it has is .nim archives, no setup.py what should i do |
09:22:42 | om3ga | sure, I don't see any problem here too. But what happens in this python kitchen, who knows? :) |
09:22:44 | PMunch | Do you have a link to it? |
09:23:10 | FromDiscord | <jvlenprzz> Ye sure |
09:23:12 | FromDiscord | <jvlenprzz> i need to install this |
09:23:18 | FromDiscord | <jvlenprzz> https://github.com/qb-0/pyMeow |
09:23:36 | NimEventer | New thread by Oecophylla: Undeclared field - Unrecognized proc, see https://forum.nim-lang.org/t/10308 |
09:24:20 | PMunch | I assume what you did was run the suggested `pip install pyMeow*.zip` command? |
09:25:09 | FromDiscord | <jvlenprzz> Okey i did pip install pyMeow-master.zip |
09:25:14 | PMunch | Aah |
09:25:17 | FromDiscord | <jvlenprzz> Cause the file name is not pyMeow |
09:25:19 | PMunch | That's your problem |
09:25:32 | PMunch | You just grabbed a zip-ed version of the repository |
09:25:52 | PMunch | And not one of the release zip files (like it told you in the line above) |
09:26:24 | FromDiscord | <jvlenprzz> Okey |
09:26:26 | FromDiscord | <jvlenprzz> its time to kill myself |
09:26:28 | FromDiscord | <jvlenprzz> ty for the help xd |
09:26:36 | FromDiscord | <jvlenprzz> And sorry for disturbing |
09:26:37 | PMunch | If you follow that "Release Section" link you will find a zip file called something like pyMeow-1.43.25.zip |
09:26:44 | PMunch | That is the actual Python package |
09:27:01 | PMunch | Probably built from a GitHub action or something |
09:27:17 | PMunch | So yeah, just grab that and the install should work fine |
09:28:05 | PMunch | No problem, hope you didn't spend too long trying to debug this :P |
09:28:22 | PMunch | Oh, and cheats are lame.. Just to get that out there |
09:28:35 | PMunch | Unless you play single player only of course, then by all means |
09:30:13 | PMunch | Honestly pretty cool how Nim can be shipped as a Python package this easily though |
09:35:00 | PMunch | Unfortunately they don't have their packaging pipeline in the repository :( |
09:36:41 | * | ntat joined #nim |
09:39:58 | FromDiscord | <heysokam> sent a code paste, see https://play.nim-lang.org/#ix=4zjt |
09:44:30 | FromDiscord | <Chronos [She/Her]> In reply to @heysokam "is there a way": I think you'd use a block there |
09:44:31 | PMunch | Hmm, I don't think so |
09:44:50 | FromDiscord | <Chronos [She/Her]> In reply to @heysokam "is there a way": Doesn't seem doable, couldn't you just use an else statement there! |
09:44:52 | FromDiscord | <Chronos [She/Her]> ? |
09:44:58 | FromDiscord | <Chronos [She/Her]> Or when not defined(release) |
09:45:06 | PMunch | I'm guessing they want to avoid the indentation |
09:45:32 | PMunch | Having your entire module indented can be a bit annoying |
09:45:56 | FromDiscord | <Chronos [She/Her]> True but I see no other solution |
09:46:05 | PMunch | What you could do is place your actual code in a different file, and then have `when defined(someswitch): include actualImplementation` |
09:46:19 | FromDiscord | <Chronos [She/Her]> i was about to say that xD |
09:51:53 | FromDiscord | <heysokam> In reply to @yu.vitaqua.fer.chronos "I think you'd use": its the literal opposite of a block |
09:52:15 | FromDiscord | <heysokam> In reply to @PMunch "I'm guessing they want": exactly |
09:52:37 | FromDiscord | <heysokam> In reply to @PMunch "What you could do": ahh true, it actually makes sense in this case even. good idea |
09:52:51 | FromDiscord | <heysokam> (edit) "even." => "even, since its an entire file that is being ruled out." |
09:54:36 | PMunch | It's a bit annoying to have these tiny stub files though |
09:54:43 | PMunch | Especially if you're looking for code |
09:54:55 | FromDiscord | <heysokam> sent a code paste, see https://play.nim-lang.org/#ix=4zjz |
09:59:00 | FromDiscord | <Chronos [She/Her]> I meant because you can do `break label` |
09:59:55 | * | ntat quit (Ping timeout: 250 seconds) |
10:01:19 | FromDiscord | <heysokam> ah i see what you mean |
10:01:35 | FromDiscord | <heysokam> yeah, but that would break out of the block, not the file 🙂 |
10:02:01 | FromDiscord | <heysokam> (edit) "file 🙂" => "file. 🙂↵so, essentially the same as a when block 🤷♂️" |
10:02:18 | PMunch | Maybe you could create an RFC to make the module an implicit block. So you could `break moduleName` |
10:02:38 | FromDiscord | <heysokam> whats an rfc? |
10:02:59 | PMunch | Request For Comment, the official process of getting changes into Nim |
10:03:24 | FromDiscord | <heysokam> ah ic |
10:06:56 | * | ntat joined #nim |
10:22:41 | FromDiscord | <heysokam> Does adding: `{.dynlib: "libassimp.so".}` implicitly make the compiler say `--passL:"-lassimp"`? 🤔 |
10:25:20 | FromDiscord | <yepoleb> No, it generates code to load the symbol when the program is started, but it does not use the regular linker |
10:26:27 | FromDiscord | <yepoleb> If you want to dynamically link in the C way you have to omit the dynlib pragma and instead pass -lassimp |
10:32:48 | FromDiscord | <heysokam> In reply to @yepoleb "If you want to": oh! so -l is not needed?↵so it would be like doing `-l` but then create a proc to load the symbols directly or something? 🤔 |
10:33:53 | FromDiscord | <yepoleb> -l is not needed. It uses the dynlib module instead of the system linker. |
10:34:55 | om3ga | and when exe cant find dynlib, it will throw error if you add --d:nimDebugDlOpen |
10:35:30 | om3ga | in windows all dlls should be placed next to the binary |
10:37:23 | FromDiscord | <heysokam> yeah, thats why i prefer static linking. but the compiler setup is crashing on double definition issue, so i figured I could just use dynamic for now like the other bindings were doing |
10:37:42 | FromDiscord | <heysokam> In reply to @yepoleb "-l is not needed.": oh great to know. thx! |
10:38:29 | om3ga | you should specify sources of the lib that you want to compile statically |
10:38:54 | om3ga | bind them manually, and include in your code |
10:39:27 | om3ga | btw not all libs can be statically compiled/linked |
10:59:27 | FromDiscord | <jviega> What architecture? I have a hack for that problem that works very well, but I don't do Windows 🙂 |
11:00:32 | FromDiscord | <Chronos [She/Her]> In reply to @PMunch "Maybe you could create": I feel like this is somewhat niche tbh |
11:10:50 | FromDiscord | <heysokam> In reply to @om3ga "bind them manually, and": yeah, they are. but they are double defining for some reason |
11:47:32 | PMunch | Hmm, does anyone have a better image search than Google Lens? |
11:48:12 | PMunch | I'm looking for something I believe is a sensor, and I have a couple images of it from different angles, but Google Lens doesn't give me anything useful.. |
12:07:18 | FromDiscord | <auxym> inaturalist seek is pretty good for plants and animals, but I don't think that'll help you 😛 |
12:13:20 | FromDiscord | <Benjamin> Have you tried reverse image search, e.g., TinEye? It's best for exact matches AFAIK, but might be worth a try |
12:33:23 | PMunch | Trying TinEye now |
12:33:29 | PMunch | Hmm, 0 matches |
12:36:07 | PMunch | Hmm, here are the images I'm using by the way. If anyone else want to try (or recognise it :P) https://uploads.peterme.net/thing1.png https://uploads.peterme.net/thing2.png https://uploads.peterme.net/thing3.png |
12:42:36 | FromDiscord | <auxym> you could always try r/whatisthisthing (unless they are still on strike/blackout) |
12:45:30 | PMunch | True, but I'm trying to stay away from Reddit myself |
12:48:16 | FromDiscord | <odexine> whats it described to do |
12:48:42 | PMunch | Well that's what I'm trying to figure out |
12:49:15 | FromDiscord | <yepoleb> Is there any additional context? |
12:49:19 | PMunch | I thought it might've been a temperature sensor initially, but it's missing any sort of air hole as far as I can tell |
12:50:21 | PMunch | Wells it's attached to a sensor/unit attached to powerlines |
12:50:36 | PMunch | Hmm, it might be an antenna |
13:01:07 | PMunch | It's pointing down though |
13:11:42 | * | Arthur1 joined #nim |
13:13:11 | * | Arthur quit (Ping timeout: 250 seconds) |
13:13:12 | * | Arthur1 is now known as Arthur |
13:21:40 | FromDiscord | <Zoom> Points down you say? 100% 5G cancer-emitter.↵(<@709044657232936960_=50=4dunch=5b=49=52=43=5d>) |
13:21:54 | PMunch | Haha :P |
13:22:58 | FromDiscord | <Zoom> Oops, thought this is #nim-offtopic |
13:23:13 | * | FromDiscord quit (Remote host closed the connection) |
13:23:26 | * | FromDiscord joined #nim |
13:23:35 | * | FromDiscord quit (Remote host closed the connection) |
13:23:48 | * | FromDiscord joined #nim |
13:24:31 | * | FromDiscord quit (Remote host closed the connection) |
13:24:39 | PMunch | No worries, the question was off-topic to begin with :P |
13:24:44 | * | FromDiscord joined #nim |
13:33:20 | FromDiscord | <gamedroit> Is there a site that cites best practices for writing code in Nim? |
13:33:35 | PMunch | We have the NEP-1 |
13:33:50 | PMunch | And Status wrote a style guide, but it's a bit conservative for my liking |
13:34:27 | FromDiscord | <gamedroit> sure |
13:37:10 | FromDiscord | <gamedroit> 1.6.14 in the bugfixed ``Fixed “Use of _ (as var placeholder) inside a template causes XDeclaredButNotUsed hints”`` appears twice https://media.discordapp.net/attachments/371759389889003532/1123608029657567312/image.png |
13:37:17 | FromDiscord | <gamedroit> (edit) "bugfixed" => "bugfixes" |
13:39:17 | * | void09 quit (Server closed connection) |
13:39:32 | * | void09 joined #nim |
13:50:45 | PMunch | Hmm, slight annoyance. `var (x, _) = tupleReturner()` works, but redefining only `x` later like this doesn't `(x, _) = tupleReturner()`. |
13:57:50 | * | PMunch quit (Quit: Leaving) |
14:35:01 | FromDiscord | <gamedroit> lol nim 1.6.14, i tried to run and my anti-virus neutralized it https://media.discordapp.net/attachments/371759389889003532/1123622586320945152/image.png |
14:39:15 | * | GoldLeader87 joined #nim |
14:42:24 | FromDiscord | <nervecenter> windows, yuk |
14:47:46 | FromDiscord | <djazz> > `doAssert TEST_PLAIN_DOUBLE_1 == 123.cdouble`↵> These tests are a bit problematic, will work fine on 64-bit machines, but on architectures where the default float size is not 64-bits these will fail..↵PMunch: hmm, how would it fail? |
14:48:08 | FromDiscord | <djazz> the exact type isnt stored in opir output, just the value in json |
14:48:48 | FromDiscord | <djazz> or would the types cdouble and clongdouble not exist on those platforms? |
14:51:48 | FromDiscord | <djazz> `const Testplaindouble1 = 123.0` |
14:51:55 | FromDiscord | <djazz> is whats generated |
15:12:19 | * | GoldLeader87 quit (Quit: GoldLeader87) |
15:44:19 | om3ga | PMunch hall sensor? |
15:46:18 | FromDiscord | <odexine> if it were a hall sensor what would it be for |
15:47:13 | om3ga | measuring current |
15:53:54 | FromDiscord | <djazz> @pmunch can you bump nimbleutils version to include my fix for freertos please? futhark broke now cuz i have 0.3.0 installed in nimble pkgs2 xD |
15:56:37 | FromDiscord | <pmunch> Right, the nimble 2.0 system is a mess.. |
15:56:48 | FromDiscord | <pmunch> Can't bump it right now |
16:01:36 | FromDiscord | <djazz> yeah i was testing nim devel |
16:02:28 | FromDiscord | <choltreppe> does someone know what could cause a `out of memmory` error, or has a tip on how to go about finding the problem? |
16:04:45 | * | jkl quit (Quit: Gone.) |
16:07:00 | FromDiscord | <Zoom> Something fails to allocate. Do you mean get an OutOfMemDefect/OutOfMemError exception? |
16:07:01 | FromDiscord | <Zoom> Something fails to allocate. Do you mean you get an OutOfMemDefect/OutOfMemError exception? |
16:09:45 | FromDiscord | <choltreppe> I think so. its an runtime error. but I dont get any stacktrace |
16:11:37 | FromDiscord | <choltreppe> sent a code paste, see https://play.nim-lang.org/#ix=4zkB |
16:20:55 | * | azimut joined #nim |
16:26:01 | * | FromDiscord quit (Ping timeout: 250 seconds) |
16:26:21 | * | FromDiscord joined #nim |
16:46:08 | * | azimut quit (Ping timeout: 240 seconds) |
17:15:03 | * | flouer__ joined #nim |
17:16:07 | * | jkl joined #nim |
17:42:55 | FromDiscord | <that_dude.> Did you make sure to use the right flags for valgrind? I know there's issues with the defaults |
17:45:48 | * | azimut joined #nim |
17:55:27 | FromDiscord | <Andreas> what is ??? https://media.discordapp.net/attachments/371759389889003532/1123673026874056714/std_collection.png |
17:55:41 | FromDiscord | <Andreas> (edit) "what is ... ???" added "yellow" |
17:56:25 | FromDiscord | <Andreas> (edit) "what is yellow ??? ... https://media.discordapp.net/attachments/371759389889003532/1123673026874056714/std_collection.png" added "and blows everything out of the water.." |
18:06:22 | FromDiscord | <JJ> can i directly substitute something out conditionally with a template? or do i have to use a macro |
18:08:17 | FromDiscord | <JJ> sent a code paste, see https://play.nim-lang.org/#ix=4zl7 |
18:15:11 | * | junaid_ joined #nim |
18:34:16 | * | xet7 joined #nim |
18:36:36 | FromDiscord | <.alea.> @elegantbeef is your fungus package published to nimble? |
18:42:38 | FromDiscord | <.alea.> hmm? https://media.discordapp.net/attachments/371759389889003532/1123684900793491596/image.png |
18:42:55 | FromDiscord | <.alea.> isn't 1.6.14 the latest release? |
18:45:17 | FromDiscord | <Andreas> In reply to @.alea. "isn't 1.6.14 the latest": yes, but there is a 2.0 around the corner. 1.6.4. is latest stable |
18:45:39 | FromDiscord | <Andreas> (edit) "stable" => "stable↵and fungus is afaik not on nimble.." |
18:45:47 | FromDiscord | <.alea.> what's the 1.9.1 being referenced then? |
18:45:55 | FromDiscord | <.alea.> A mistake? |
18:46:42 | FromDiscord | <Andreas> In reply to @.alea. "what's the 1.9.1 being": hmm, well, i'd guess thats the pre-2.0 numbering |
18:46:56 | FromDiscord | <Andreas> (edit) "In reply to @.alea. "what's the 1.9.1 being": hmm, well, i'd guess thats the pre-2.0 numbering ... " added "for devel" |
18:48:06 | * | xet7 quit (Quit: Leaving) |
18:49:25 | * | flouer__ quit (Ping timeout: 240 seconds) |
18:50:26 | FromDiscord | <Andreas> fungus et friends https://github.com/beef331?tab=repositories&q=&type=&language=nim&sort= |
18:56:19 | * | junaid_ quit (Remote host closed the connection) |
19:03:35 | FromDiscord | <JJ> yeah devel is 1.9.5 rn |
19:13:46 | FromDiscord | <Elegantbeef> 1.9.1 was the name of devel at the time of writing fungus |
19:13:53 | FromDiscord | <Elegantbeef> It does require a devel compiler otherwise I'd use stable |
19:28:56 | * | ntat quit (Quit: Leaving) |
19:38:31 | NimEventer | New thread by basilajith: Why is a Nim enthusiast/programmer called a "Nimmer"?, see https://forum.nim-lang.org/t/10309 |
19:45:18 | * | flouer__ joined #nim |
20:07:55 | * | gshumway quit (Server closed connection) |
20:13:37 | * | gshumway joined #nim |
20:14:23 | * | flouer__ quit (Ping timeout: 250 seconds) |
20:40:27 | * | flouer__ joined #nim |
21:11:11 | FromDiscord | <_alkamist_> sent a code paste, see https://paste.rs/Gz7K4 |
21:13:05 | FromDiscord | <_alkamist_> I'm in this position where having a user proc after named arguments would be ergonomic but writing overloads for every case would be a real drag. |
21:15:10 | FromDiscord | <Elegantbeef> is `userProc = (proc() = echo "user Proc")` too much? 😄 |
21:19:31 | FromDiscord | <_alkamist_> In reply to @Elegantbeef "is `userProc = (proc()": I suppose that works. Is there a way to default `userProc` to a proc that does nothing? |
21:19:42 | FromDiscord | <_alkamist_> The compiler complains at me about a bunch of pragmas when I try |
21:19:45 | FromDiscord | <Elegantbeef> `userProc = (proc() = discard)` |
21:20:27 | FromDiscord | <_alkamist_> This doesn't work |
21:20:27 | FromDiscord | <_alkamist_> sent a code paste, see https://play.nim-lang.org/#ix=4zlK |
21:20:44 | FromDiscord | <_alkamist_> Error: type mismatch: got <int literal(1), userProc: proc (){.gcsafe, locks: 0.}> |
21:21:51 | FromDiscord | <demotomohiro> sent a code paste, see https://play.nim-lang.org/#ix=4zlL |
21:22:16 | FromDiscord | <Elegantbeef> The issue is that the proc likely got no side effect and assumed all procs had no side effect |
21:22:33 | FromDiscord | <Elegantbeef> by annotating the type you tell it it's supposed to have no side effects |
21:22:50 | FromDiscord | <_alkamist_> sent a code paste, see https://play.nim-lang.org/#ix=4zlM |
21:23:02 | FromDiscord | <Elegantbeef> You could also just have a nil and then check that of course |
21:23:52 | FromDiscord | <demotomohiro> sent a code paste, see https://play.nim-lang.org/#ix=4zlN |
21:24:33 | FromDiscord | <Elegantbeef> Sure but nimcall can upcast to closure |
21:24:46 | FromDiscord | <_alkamist_> In reply to @Elegantbeef "You could also just": Hmmm, I think I like the idea of having it nil and checking. |
21:24:54 | FromDiscord | <Elegantbeef> If i actually implemented my PR all procs could, but alas it causes issues and I don't know why |
22:06:52 | * | flouer__ quit (Ping timeout: 240 seconds) |
23:48:31 | * | flouer joined #nim |