00:08:38 | * | lucasta quit (Remote host closed the connection) |
00:53:20 | * | ovenpasta quit (Ping timeout: 246 seconds) |
01:32:19 | * | Lord_Nightmare quit (Quit: ZNC - http://znc.in) |
01:35:02 | * | Lord_Nightmare joined #nim |
01:40:04 | * | azimut joined #nim |
03:24:37 | * | disso_pch joined #nim |
03:26:13 | FromDiscord | <bung8954> is there short way allocate memory without cast the result to `ptr ObjA` ? eg. `cast[ptr ObjA](alloc0(sizeof(ObjA)))` |
03:26:38 | * | disso-peach quit (Ping timeout: 246 seconds) |
03:34:51 | FromDiscord | <Elegantbeef> `create(ObjA)` |
03:42:48 | FromDiscord | <bung8954> ty, works, much simpler |
06:57:19 | * | junaid_ joined #nim |
06:58:18 | * | PMunch joined #nim |
06:58:38 | * | ntat joined #nim |
07:24:38 | * | junaid_ quit (Remote host closed the connection) |
07:35:51 | * | cyraxjoe quit (Ping timeout: 245 seconds) |
07:36:35 | * | cyraxjoe joined #nim |
07:38:05 | * | ovenpasta joined #nim |
07:42:37 | * | ehmry quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
07:43:18 | * | ehmry joined #nim |
07:44:48 | * | cyraxjoe quit (Ping timeout: 246 seconds) |
07:50:25 | * | cyraxjoe joined #nim |
08:17:38 | * | ovenpasta quit (Ping timeout: 246 seconds) |
08:17:57 | * | ovenpasta joined #nim |
09:06:25 | FromDiscord | <bung8954> @jmgomez does the `.pdb` file help debugging a third party dll ? I have a program that call dll function that throw nil access error |
09:16:07 | * | junaid_ joined #nim |
09:17:35 | * | junaid_ quit (Remote host closed the connection) |
09:29:22 | * | jmdaemon quit (Ping timeout: 245 seconds) |
09:30:51 | FromDiscord | <ieltan> Can someone explain the semantics of `object of X` vs `ref object of X` ? |
09:31:59 | FromDiscord | <ieltan> It's not documented in Nim docs unless i missed it |
09:32:26 | FromDiscord | <ambient3332> IIRC object of X can't handle circular reference, therefore ref object |
09:35:28 | FromDiscord | <demotomohiro> In reply to @ieltan "Can someone explain the": https://internet-of-tomohiro.netlify.app/nim/faq.en.html#type-when-to-use-ref-object-vs-plain-object-qmark |
09:46:41 | * | sagax quit (Ping timeout: 245 seconds) |
09:50:11 | PMunch | @ieltan, `object of X` is inheriting from X. Basically it creates a struct with the parent object as a member along with all the fields. Because the object is a member of the struct (and not via a pointer) you can't place a normal object as a field in itself. This is because the size would then be infinite (due to the infinite recursion). `ref object of X` is basically the same thing, but now our type is a ref object. This means that we can also have it as a |
09:50:11 | PMunch | field in our struct, as the size of a pointer is always fixed so we don't get the infinite recursion and size problem. |
09:59:46 | FromDiscord | <ieltan> In reply to @PMunch "<@256520101015060480>, `object of X`": I see, so it's fine to use `object of` if i don't have any issue with recursion ? |
10:00:01 | FromDiscord | <ieltan> In reply to @demotomohiro "https://internet-of-tomohiro.netlify.app/nim/faq.en": Thanks for the docs đ |
10:02:52 | PMunch | Sure |
10:03:07 | PMunch | Of course all the normal things around reference vs. object semantics still hold |
10:03:44 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @ambient3332 "OTFFT is 8x faster": Oh, can it do FFT and inverse FFT? |
10:04:10 | FromDiscord | <System64 ~ Flandre Scarlet> Oh yeah it can! |
10:05:30 | FromDiscord | <ambient3332> It has a full C API https://github.com/amb/nim_audiobook/blob/no-arraymancer/otfft-simple/otfft_c.nim |
10:06:01 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @ambient3332 "It has a full": https://github.com/amb/nim_audiobook/blob/main/fft.nimâ”Oh this thing has the power of 2 thing oof |
10:06:30 | FromDiscord | <ambient3332> That's just my homebrew, nothing to do with OTFFT |
10:06:47 | FromDiscord | <System64 ~ Flandre Scarlet> Oh alright sorry |
10:07:02 | FromDiscord | <ambient3332> http://wwwa.pikara.ne.jp/okojisan/otfft-en/index.html |
10:07:27 | FromDiscord | <System64 ~ Flandre Scarlet> oh otfft uses pointer stuff |
10:26:13 | FromDiscord | <ambient3332> also (related) a pretty cool explanation of Fourier transform: https://www.youtube.com/watch?v=FjmwwDHT98c |
10:47:57 | ntat | Does anyone have experience with using OpenCV in Nim? |
11:27:19 | FromDiscord | <jmgomez> In reply to @bung8954 "<@726017160115126333> does the `.pdb`": the third party must have the symbols. I use them so I can hotreload + debug on win |
11:27:21 | FromDiscord | <enthus1ast> aehm |
11:27:22 | FromDiscord | <enthus1ast> i access a let from multiple threads, the compiler complains that its not gcsafe, but it should be, can i somehow disable gcsafe for this one proc? |
11:27:22 | FromDiscord | <enthus1ast> not proc |
11:27:23 | FromDiscord | <enthus1ast> let var |
11:27:24 | FromDiscord | <enthus1ast> what i did before was to create a proc that just returns this, and in the proc i cast it gcsafe, but this is lame. |
11:27:27 | FromDiscord | <enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=4Ae7 |
11:59:37 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @ambient3332 "also (related) a pretty": Oh pretty interesting! |
12:44:27 | FromDiscord | <heysokam> sent a code paste, see https://play.nim-lang.org/#ix=4AgB |
13:00:52 | FromDiscord | <odexine> `--warning[HoleEnumConv]:off`? idk |
13:18:57 | FromDiscord | <heysokam> In reply to @odexine "`--warning[HoleEnumConv]:off`? idk": `Error: invalid command line option: '--warning[HoleEnumConv]'` |
13:19:45 | FromDiscord | <odexine> use two :: instead of = |
13:19:53 | FromDiscord | <odexine> `--warning:HoleEnumConv:off` perhaps? |
13:19:59 | FromDiscord | <odexine> i'm just wondfering why it would say it doesnt exist |
13:20:18 | FromDiscord | <heysokam> that's what the docs say, but it breaks |
13:22:32 | FromDiscord | <odexine> it works for me? |
13:27:10 | FromDiscord | <heysokam> In reply to @odexine "it works for me?": stable or devel? |
13:27:17 | FromDiscord | <odexine> 1.6.14 |
13:28:07 | FromDiscord | <heysokam> im on devel, don't know if that changes anything |
13:28:40 | FromDiscord | <heysokam> and cannot go back to 1.6.14 to test, since this project relies on the new `std/paths` đŠ |
13:57:09 | FromDiscord | <bung8954> In reply to @jmgomez "the third party must": I've add linker flags that generated myProgram.pdb file after compiling, does that satisfy the requirements? |
14:04:57 | * | anddam quit (Quit: WeeChat 3.8) |
14:20:56 | * | anddam joined #nim |
14:21:09 | FromDiscord | <michaelb.eth> In reply to @enthus1ast "what i did before": depending on the rhs of a global `let foo = ...`, reading `foo` from another thread may mess up the ref counts of the GC in the original thread, and the program may crash later with SIGSEGV |
14:28:06 | FromDiscord | <odexine> In reply to @heysokam "and cannot go back": works on latest devel |
14:30:45 | FromDiscord | <jmgomez> In reply to @bung8954 "I've add linker flags": Im not sure what are you trying to do, if its to debug a third party lib/app, it isnt enough. For your own app, it should be enough yes. Everything "special" I do for NUE on Windows is in that file that I linked |
14:34:12 | FromDiscord | <bung8954> In reply to @jmgomez "Im not sure what": app is my own, linked dll is not, so I dont know why it throw nil acess error when call dll's function |
14:35:11 | FromDiscord | <jmgomez> yeah, then you need the debug symbols for the linked dll |
14:38:30 | FromDiscord | <bung8954> I see, seems like I should download from there https://learn.microsoft.com/en-us/windows-hardware/drivers/debugger/microsoft-public-symbols |
14:53:02 | FromDiscord | <ac1original> How can I run the entire code from another class? |
15:02:06 | FromDiscord | <demotomohiro> https://nim-lang.org/docs/manual.html#modules |
15:26:57 | FromDiscord | <treeform> In reply to @shad.ow "i'm using `spacy` currently,": You can just create an fake entry to check? |
15:29:21 | FromDiscord | <treeform> `findInRange(Entry(pos:...))` |
15:29:42 | FromDiscord | <treeform> I should provide overloads that just take a `Vec2`. |
15:43:13 | * | lucasta joined #nim |
15:44:43 | * | lucasta quit (Max SendQ exceeded) |
17:47:59 | * | jmdaemon joined #nim |
18:15:23 | FromDiscord | <turtlebasket> asked this in lang dev but no response\: is Nim keeping style insensitivity? |
18:16:56 | FromDiscord | <turtlebasket> oh wow look at that it's treeform |
18:17:20 | FromDiscord | <turtlebasket> @treeform\: thanks for making istrolid i played the shit out of that game in middle school ;) |
18:20:13 | FromDiscord | <shad.ow> In reply to @treeform "You can just create": yeah that's what i did |
18:20:19 | FromDiscord | <treeform> Thanks for playing! |
18:20:20 | FromDiscord | <shad.ow> and i made the id uint32.max |
18:20:32 | FromDiscord | <treeform> In reply to @turtlebasket "<@107140179025735680>\: thanks for making": Thanks for playing! |
18:23:44 | FromDiscord | <demotomohiro> @turtlebasket https://github.com/nim-lang/RFCs/issues/456â”https://github.com/nim-lang/RFCs/issues/472 |
18:29:16 | FromDiscord | <nervecenter> In reply to @turtlebasket "asked this in lang": There is no indication that it is ever going away. And in case you need anything anecdotal, I have a product in production that's small to mediumish with 20k lines of Nim, I do Pythonic snake_case and 4-space indentation (including calling library functions with snake_case), and none of it has ever been a problem. |
18:29:39 | FromDiscord | <nervecenter> (edit) "In reply to @turtlebasket "asked this in lang": There is no indication that it is ever going away. And in case you need anything anecdotal, I have a product in production that's small to mediumish with 20k lines of Nim, I do Pythonic snake_case and 4-space indentation (including calling ... library" added "standard" |
18:30:55 | FromDiscord | <nervecenter> In reply to @turtlebasket "asked this in lang": There is no indication that it is ever going away. And in case you need anything anecdotal, I have a product in production that's small to mediumish with 20k lines of Nim, I do Pythonic snake_case and 4-space indentation (including calling standard library functions with snake_case), and none of it has ever been a problem. |
18:35:53 | FromDiscord | <turtlebasket> the one complaint I've seen that I consider valid is probably the one about CFFI |
18:36:07 | FromDiscord | <turtlebasket> I think a pragma or compiler flag could probably fix that though |
18:46:38 | FromDiscord | <bostonboston> sent a code paste, see https://play.nim-lang.org/#ix=4Aia |
18:48:44 | FromDiscord | <demotomohiro> You can import C variables/functions with `importc` pragma and assign different names so that you import C identifiers like getFoo and get_foo.â”But using different names from C lib might confuse you if you learn about it from the manual or C example code . |
18:50:42 | FromDiscord | <nervecenter> I typically wrap my `importc` signatures with a Nim proc that looks and feels like Nim, and internally does all the conversion work necessary. I think I might be paying a price for using an extra stack frame and doing some extra copying, but it makes my FFI calls blend in natively. |
18:51:33 | FromDiscord | <nervecenter> Then I can choose exactly what case I want to use and even pick my own name to use in the rest of my code |
18:59:33 | Amun-Ra | /fset |
18:59:37 | Amun-Ra | sorry |
19:17:55 | NimEventer | New post on r/nim by DiscoVoadordeVenus: Why the Nim libraries use GC?, see https://reddit.com/r/nim/comments/14w3co4/why_the_nim_libraries_use_gc/ |
19:31:40 | * | ntat_ joined #nim |
19:31:57 | * | ntat quit (Ping timeout: 250 seconds) |
19:32:37 | * | ntat_ is now known as ntat |
20:27:49 | FromDiscord | <turtlebasket> is it possible to make an infix operator with a non-2 arity |
20:28:26 | FromDiscord | <turtlebasket> ...like `1 `op` 2 3` or somethingâ”or does that require a macro |
20:30:25 | FromDiscord | <turtlebasket> ...like `1 `op` 2 3` or somethingâ”or does that require a macro |
20:32:39 | * | PMunch quit (Quit: leaving) |
20:32:53 | FromDiscord | <Elegantbeef> you'd need to do `1 op (2, 3)` or similar |
20:32:58 | FromDiscord | <Elegantbeef> infix operators are binary in Nim |
20:34:07 | FromDiscord | <Elegantbeef> `a @! b, c` does not compile you can check with `std/macros.dumptree` |
20:41:36 | FromDiscord | <turtlebasket> ah so it works but with the second argument as a collection |
20:41:45 | FromDiscord | <Elegantbeef> Right, a tuple is the most sensible way around |
20:42:15 | FromDiscord | <turtlebasket> since infix ops are technically functions does this mean that `abc(x, y, z)` is equivalent to `abc((x, y, z))` |
20:42:39 | FromDiscord | <Elegantbeef> No a tuple is not the same as x, y, z |
20:43:10 | FromDiscord | <Elegantbeef> the first would be `proc abc(x, y, z: T)` the latter `proc abc(tup: YourTupleHere)` |
20:43:34 | FromDiscord | <turtlebasket> i see |
20:43:34 | FromDiscord | <turtlebasket> so that only applies to infix then |
20:43:39 | FromDiscord | <Elegantbeef> What? |
20:43:45 | FromDiscord | <Elegantbeef> Tuples are not invocations |
20:44:00 | FromDiscord | <Elegantbeef> `echo (1, 2, 3)` and `echo(1, 2, 3)` are two different things |
20:44:07 | FromDiscord | <Elegantbeef> One prints a tuple, the other prints the integers alone |
20:44:33 | FromDiscord | <yandall> sent a code paste, see https://play.nim-lang.org/#ix=4AiE |
20:45:20 | FromDiscord | <yandall> (edit) "https://play.nim-lang.org/#ix=4AiE" => "https://play.nim-lang.org/#ix=4AiF" |
20:45:48 | FromDiscord | <Elegantbeef> do you need a header for `Accept:"application/json"`? |
20:46:55 | FromDiscord | <yandall> I don't think so |
20:47:08 | FromDiscord | <Elegantbeef> Well curl also gets a binary blob |
20:48:17 | FromDiscord | <yandall> weird. If I try with postman it gets a json |
20:48:47 | FromDiscord | <Elegantbeef> Perhaps it's a user agent related? |
20:49:37 | FromDiscord | <yandall> What is the use agent for httpclient module? |
20:49:55 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/httpclient.html#defUserAgent |
20:50:49 | FromDiscord | <yandall> It works on postman with this user agent |
20:51:02 | * | cyraxjoe quit (Ping timeout: 246 seconds) |
20:51:35 | * | cyraxjoe joined #nim |
20:52:58 | FromDiscord | <Elegantbeef> Cause I only get binary data with curl even with user agent and accepting json |
20:53:48 | * | LyndsySimon joined #nim |
20:54:12 | FromDiscord | <yandall> I have never seen this behavior before |
20:55:59 | FromDiscord | <Elegantbeef> Wait the response header says it's gzipped |
20:57:32 | FromDiscord | <Elegantbeef> Yep |
20:57:34 | FromDiscord | <spotlightkid> With `http -j` I get a JSON response. Are you quoting the URL correctly when using curl? |
20:57:47 | FromDiscord | <spotlightkid> `http` = HTTPie |
20:58:03 | FromDiscord | <Elegantbeef> I get a gzipped response that if i run `gzip -d` on it gets the right information |
20:58:14 | FromDiscord | <spotlightkid> yeah |
20:58:26 | FromDiscord | <yandall> Ok, that makes sense |
20:58:58 | FromDiscord | <yandall> How do I unziped on nim? |
20:59:00 | FromDiscord | <Elegantbeef> Well I guess you check the response header if it's gzipped you use zippy on it |
20:59:42 | FromDiscord | <Elegantbeef> Zippy is the easiest way as it's pure Nim, there are bindings for C libraries you can use aswell |
21:00:50 | FromDiscord | <yandall> I'll try that |
21:01:43 | FromDiscord | <yandall> The only thing that still confuses me is that this other store uses the same api but doesn't have that problem "https://www.exito.com/Lentejas?_q=Lentejas&map=ft&pickRuntime=queryData" |
21:01:45 | Amun-Ra | and you can set Accept-Encoding: identity not to get gzipped content |
21:03:33 | FromDiscord | <Elegantbeef> I don't think this particular server cares |
21:06:32 | FromDiscord | <yandall> I just try zippy. I got my json, thanks @elegantbeef |
21:06:57 | FromDiscord | <Elegantbeef> no problem |
21:07:19 | FromDiscord | <Elegantbeef> Given my lack of web experience I'm amazed I reasoned this one |
21:12:43 | FromDiscord | <JJ> beef remind me why do you hate rust enums |
21:12:49 | FromDiscord | <JJ> or rather that they're called enums |
21:13:31 | FromDiscord | <Elegantbeef> They're not ordinals |
21:13:45 | FromDiscord | <JJ> ah got it |
21:13:49 | FromDiscord | <Elegantbeef> There is no order to them |
21:14:11 | FromDiscord | <Elegantbeef> Having it be `None -> Circle -> Square` is the same as `Square -> None -> Circle` |
21:14:26 | FromDiscord | <Elegantbeef> An enumeration by definition is ordered đ |
21:14:58 | * | azimut quit (Ping timeout: 240 seconds) |
21:15:00 | FromDiscord | <Elegantbeef> I can see with like Odin style Unions where order matters, calling the branches enums |
21:15:13 | FromDiscord | <Elegantbeef> cause they're an ordered set of valid types |
21:16:01 | FromDiscord | <Elegantbeef> Ie `union{f32, u32}` can convert to `union{f32, u32, string}` but cannot convert to `union{u32, f32}` |
21:16:01 | FromDiscord | <Elegantbeef> Atleast from my understanding they can convert that way |
21:16:29 | FromDiscord | <Elegantbeef> But with Rust enums the tag is hidden and they're order independant |
21:16:39 | FromDiscord | <JJ> oh that's interesting |
21:16:48 | FromDiscord | <JJ> i gotta read up on odin sounds like |
21:16:57 | FromDiscord | <Elegantbeef> Odin's unions are so close to being good |
21:17:25 | FromDiscord | <Elegantbeef> Been looking into it a bit recently and seen(really forced myself into) a conversation about the conversions |
21:17:46 | FromDiscord | <Elegantbeef> Sadly gingerbill does not want to enable conversions from a union to a superset or order invariant |
21:17:54 | FromDiscord | <JJ> oh they have a union/enum distinction? hmm |
21:17:59 | FromDiscord | <Elegantbeef> So that means any union conversion is manual, cause fuck you |
21:18:04 | FromDiscord | <JJ> i actually like that a lot i think |
21:18:06 | FromDiscord | <Elegantbeef> Unions are tagged unions, enums are enums |
21:18:26 | FromDiscord | <JJ> In reply to @Elegantbeef "So that means any": that's a shame structural typing is so nice |
21:18:46 | FromDiscord | <Elegantbeef> The nice thing is that unions are first classed and work for whenever you just want to a easy tagged union a lot like leorize's union |
21:18:48 | FromDiscord | <JJ> you can model multiple inheritance super well with structural typing of structs |
21:19:09 | FromDiscord | <Elegantbeef> Well we're talking about a type conversion from like `union{f32, u32}` to `union{u32, f32}` |
21:19:20 | FromDiscord | <Elegantbeef> There is just no language feature for that cause "what if the tag is invalid" |
21:19:36 | FromDiscord | <JJ> ah |
21:19:49 | FromDiscord | <Elegantbeef> Quite a dumb argument imo for disallowing it, but meh odin is very odd |
21:20:09 | FromDiscord | <Elegantbeef> Odin already has bound checks and allows you to assert a union is a specific branch |
21:20:51 | FromDiscord | <Elegantbeef> But yea Odin has some interesting design for some builtins |
21:21:02 | FromDiscord | <Elegantbeef> Like it has SOA and AOS syntax built into the language, same with swizzling |
21:21:20 | FromDiscord | <Elegantbeef> It's aimed towards gamedev/graphics programming so it's interesting in that regard |
21:23:01 | FromDiscord | <Elegantbeef> Sadly though it's all about no hidden flow control and manual memory control, so it's not very interesting to me |
21:23:36 | FromDiscord | <Elegantbeef> https://odin-lang.org/docs/overview/#soa-data-types if interested about the SOA stuff |
21:24:22 | FromDiscord | <Elegantbeef> https://odin-lang.org/docs/overview/#using-statement is also pretty interesting |
21:24:51 | FromDiscord | <Elegantbeef> Instead of making the programmer write properties you can just say on the struct "Hey this has a position, but i'd like to have .x, .y, .z work on it" |
21:29:38 | FromDiscord | <etra> lol, just checking the site, this statement is uh, somethingâ”`In general, self hosting before a stable language and compiler exists is masturbatory pleasure.` |
21:29:55 | FromDiscord | <Elegantbeef> Yea I disagree with gingerbill there |
21:30:06 | * | ntat quit (Quit: Leaving) |
21:30:37 | FromDiscord | <Elegantbeef> The main benefit of self hosting is that you have a way for your community to contribute to the language without having to learn a new language |
23:52:56 | * | ovenpasta quit (Ping timeout: 245 seconds) |