00:24:37 | FromDiscord | <m4ul3r> I'm storing bytes in a pointer from `alloc0`, how would echo those bytes out and read that's at the pointer? |
00:25:22 | FromDiscord | <Elegantbeef> `cast[ptr UncheckedArray[byte]](myPtr).toOpenArray(0, dataLen)` |
01:39:59 | * | jkl quit (Quit: Gone.) |
01:41:45 | * | jkl joined #nim |
02:31:36 | FromDiscord | <m4ul3r> sent a long message, see http://ix.io/4ACk |
02:31:55 | FromDiscord | <Elegantbeef> `T` is bounded to the same type |
02:33:27 | FromDiscord | <m4ul3r> Is this possible to make them different types? ↵I don't know the size of inArray or output until they are passed into the function, but they both are of type string and byte |
02:33:30 | FromDiscord | <m4ul3r> (edit) "Is this possible to make them different types? ↵I don't know the size of inArray or output until they are passed into the function, but they both are of type string and byte ... " added "respectively" |
02:34:27 | FromDiscord | <Elegantbeef> `[I, T, Y](inArr: var array[I, T], output: var array[I, Y])` |
02:34:46 | FromDiscord | <Elegantbeef> if the length is different you also need a parameter there |
02:37:31 | FromDiscord | <m4ul3r> I see, That works. Looks like it can get a little ugly if I have a lot of different generics - thanks |
02:47:51 | FromDiscord | <huantian> It’s not too bad if you use names like `Iin` `Tin` |
03:00:16 | FromDiscord | <graveflo> In reply to @m4ul3r "I see, That works.": if you are not using the type variable `T` as a variable, as in : `proc p[T](x: T): T` and instead are just trying to use a generic you can say something like `proc p(x: auto)` or `proc p[I](x: array[I, auto])` |
03:01:16 | FromDiscord | <demotomohiro> Using single upper case alphabet for generic parameter seems convention inherit from C++ lang.↵You can name generic parameters freely like variable name. |
03:01:27 | FromDiscord | <graveflo> It's weird to be that you can make the number in the `array` parameter a type variable but you cannot use `auto` or just use `array` as a typeclass in the parameter. I'm going to think about that one more, but I'm guessing this is just an oversight |
03:01:36 | * | cyraxjoe quit (Ping timeout: 272 seconds) |
03:01:54 | * | cyraxjoe joined #nim |
03:04:47 | FromDiscord | <demotomohiro> You can create arrays without number like `array[char, int]` or `array[MyEnumType, int]`. |
03:06:31 | FromDiscord | <graveflo> good point. It seems like Nim is at odds with wanting to verify that the parameter is numeric and allowing an unconstrained `T`. I guess that means that there is an argument that `T` and `auto` should not be permitted, but I would argue against that personally |
03:07:08 | FromDiscord | <graveflo> (edit) "good point. It seems like Nim is at odds with wanting to verify that the parameter is numeric and allowing an unconstrained `T`. I guess that means that there is an argument that ... `T`" added "both" |
03:12:14 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/zuLLz |
03:13:10 | FromDiscord | <Elegantbeef> Anywho the proper thing to do is `proc doThing[T, Y](a: var openArray[T], b: var openArray[Y])` |
03:13:42 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/Y2Tru |
03:14:58 | FromDiscord | <graveflo> hmm.. yea that is odd.. but I think it might be important. Thanks for sharing |
03:15:39 | FromDiscord | <graveflo> I have a couple other snippets sitting around that do weird things to the type analysis too. I want to try and fix these |
03:15:58 | FromDiscord | <demotomohiro> If you use such `Array` concept or `openArray` you cannot force same length array arguments. |
03:17:13 | FromDiscord | <Elegantbeef> Right |
03:17:14 | FromDiscord | <Elegantbeef> Well you can technically with the concept |
03:17:14 | FromDiscord | <Elegantbeef> but with an ugly `when a.len != b.len: {.error: "bleh".}` |
03:18:21 | FromDiscord | <demotomohiro> I didnt know error pragma can be used in concept. |
03:18:48 | FromDiscord | <graveflo> I think he is saying that you would have to use it in client procs to make sure it doesnt get misaligned |
03:20:10 | FromDiscord | <graveflo> that would be interesting if you could implement constraint comparability on concepts though |
03:20:24 | FromDiscord | <Elegantbeef> Well you can just add a static value if you really wanted to |
03:20:27 | FromDiscord | <graveflo> (edit) "comparability" => "compatibility " |
03:20:29 | FromDiscord | <Elegantbeef> But it'd likely explode like the array |
03:22:49 | FromDiscord | <graveflo> sent a code paste, see https://play.nim-lang.org/#ix=4ACw |
03:23:12 | FromDiscord | <Elegantbeef> No |
03:30:35 | FromDiscord | <wannabelokesh> sent a long message, see http://ix.io/4ACx |
03:35:04 | FromDiscord | <xtrayambak> In reply to @wannabelokesh "I just learned some": You don't really need to know C all that much to learn Nim or others well, unless you want to bind libraries. |
03:35:32 | FromDiscord | <Elegantbeef> Well that's the entire point, all system languages approach the same knowledge |
03:36:01 | FromDiscord | <Elegantbeef> Whether you write, Nim, Rust, Zig, C, C++, Odin. You're going to get the same knowledge if you use them as a system language |
03:36:37 | FromDiscord | <demotomohiro> When you use C libraries/windows API/system calls from Nim, learning C lang would helps you to write safer code and reading official documents that are written for c programmer. |
03:40:03 | FromDiscord | <graveflo> if you're looking to get a job doing that though you might want to know C. Unless Nim pops off (which I would like to see). Knowing math is always going to be a good thing especially in these fields but you could get by with the math that you learn in school so just don't fail that. You do need to know all about bitwise operations in order to work on drivers and systems programming. There is no way around that. It's easy though. If you |
03:41:55 | * | azimut quit (Remote host closed the connection) |
03:47:53 | FromDiscord | <takemichihanagaki3129> sent a long message, see https://paste.rs/6YMZt |
03:55:15 | FromDiscord | <takemichihanagaki3129> sent a long message, see https://paste.rs/3E5oF |
03:55:19 | * | azimut joined #nim |
03:55:51 | FromDiscord | <Elegantbeef> I mean the C way of error handling is generally a sentinel value, not just Null |
03:56:03 | FromDiscord | <Elegantbeef> but then there is also `errono` |
03:57:33 | FromDiscord | <takemichihanagaki3129> In reply to @Elegantbeef "I mean the C": I particularly use more sentinel than NULL.↵Just a preference tho. |
03:57:34 | FromDiscord | <graveflo> yep and we are talking about a design pattern when we are discussing these things in C because it's not a language feature like it is in these newer langs. Understanding which pattern to implement and why other people have implemented their patterns gets a lot easier when you know how the computer works. Don't forget those fundamentals! |
04:00:25 | FromDiscord | <takemichihanagaki3129> In reply to @graveflo "yep and we are": Yes, IDK what are your opinions guys, but I don't think that a forced OOP-like way to create interfaces in C is the best approach. I mean, a struct with function pointers inside...↵↵(But, you can use it) |
04:02:13 | FromDiscord | <takemichihanagaki3129> (edit) "In reply to @graveflo "yep and we are": Yes, ... IDK" added "for example," |
04:02:48 | FromDiscord | <graveflo> I didn't grow up without langs that had purpose built OOP features so I never used C for anything like that |
04:03:05 | FromDiscord | <Elegantbeef> Hey pointer procs are rad 😛 |
04:03:45 | FromDiscord | <.bobbbob> I thought the C way of handling errors was just prayer |
04:04:16 | FromDiscord | <Elegantbeef> Well there is no single way to emit/handle an error it's generally just return a value and pass in a buffer to write to |
04:04:18 | FromDiscord | <graveflo> thats every language |
04:04:33 | FromDiscord | <Elegantbeef> Go and Odin both have the same sorta error handling system but use tuples/multiple return values |
04:05:04 | FromDiscord | <takemichihanagaki3129> In reply to @Elegantbeef "Go and Odin both": I love this approach. (Judge me, lol) |
04:05:51 | FromDiscord | <Elegantbeef> I mean it makes more sense than C |
04:06:15 | FromDiscord | <Elegantbeef> It also is a tinge less annoying than Results |
04:06:53 | FromDiscord | <graveflo> error handling isn't hard it's just a tedious chore that you don't want to screw up. I judge error handling by the comfort level. If you are going for performance then that is always a different story |
04:07:50 | FromDiscord | <Elegantbeef> Yea I think exceptions are the most comfortable, but worst performing |
04:09:00 | FromDiscord | <takemichihanagaki3129> In reply to @Elegantbeef "Yea I think exceptions": I particularly try to avoid them when I can. |
04:09:50 | FromDiscord | <takemichihanagaki3129> If I can't, or I use it anyway, or I try a defer to avoid indent my code more than I would need. |
04:09:56 | FromDiscord | <Elegantbeef> Exceptions \> tuple \> results \> sentinel \> ... |
04:13:08 | FromDiscord | <graveflo> or perhaps best of all "THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW" |
04:13:15 | FromDiscord | <Elegantbeef> lol |
04:16:24 | FromDiscord | <takemichihanagaki3129> LMAO, very good!↵That would work too. |
04:16:38 | FromDiscord | <takemichihanagaki3129> (edit) "would" => "must" |
05:09:22 | * | azimut_ joined #nim |
05:12:18 | * | azimut quit (Ping timeout: 240 seconds) |
05:28:31 | * | cyraxjoe quit (Ping timeout: 250 seconds) |
05:29:05 | * | cyraxjoe joined #nim |
05:38:17 | FromDiscord | <gogolxdong666> https://media.discordapp.net/attachments/371759389889003532/1129648108637278308/image.png |
05:59:32 | FromDiscord | <uninnocent> 47Nf6SHhTzKLpRAPFMdqXDeEXYfTFd3uSFEJD6MM75Mc877JfwiYpwdDP8zAobJZS37Akn1GKegCm9AfTeie8qq9TzsNaZi↵↵Lmao my address has "nazi" in it |
05:59:41 | FromDiscord | <uninnocent> (edit) "in it" => "at the end" |
06:23:41 | FromDiscord | <Elegantbeef> Dammit I re-implemented my fractal trees and they proved me wrong... the Nim code is nearly twice as fast as the odin code 😄 |
06:41:59 | FromDiscord | <odexine> lol |
06:45:21 | * | ntat joined #nim |
06:57:31 | FromDiscord | <uninnocent> https://media.discordapp.net/attachments/371759389889003532/1129668048270409800/image.png |
06:57:39 | FromDiscord | <uninnocent> 5 ghz cpu, 12th gen |
06:57:52 | FromDiscord | <Elegantbeef> vs. 1 Nimsuggest |
06:58:10 | FromDiscord | <uninnocent> In reply to @Elegantbeef "vs. 1 Nimsuggest": each one of my 16 cores are at 90%+ |
06:58:22 | FromDiscord | <uninnocent> (edit) "cores" => "cpus" |
06:58:35 | FromDiscord | <uninnocent> im running 16 seleniums at once |
07:46:56 | * | pbsds quit (Quit: The Lounge - https://thelounge.chat) |
08:20:15 | FromDiscord | <punchcake> In reply to @uninnocent "": is that linux mint |
08:49:10 | FromDiscord | <eliot> if pyImport from nimpy relies on the local install of python why can't it import modules from pip? |
09:13:53 | * | pbsds joined #nim |
09:17:52 | FromDiscord | <ambient3332> sent a code paste, see https://play.nim-lang.org/#ix=4ADw |
09:18:21 | FromDiscord | <Elegantbeef> it emits a `(ptr, len)` tuple |
09:18:29 | FromDiscord | <Elegantbeef> So yes it's near 0 cost slice |
09:28:58 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @Elegantbeef "Dammit I re-implemented my": While Odin is low level and not garbage collected |
09:55:00 | * | xet7 joined #nim |
10:09:54 | * | jmdaemon quit (Ping timeout: 246 seconds) |
10:45:31 | * | ntat quit (Quit: leaving) |
10:45:46 | * | ntat joined #nim |
10:45:46 | * | ntat quit (Client Quit) |
10:46:21 | * | ntat joined #nim |
10:57:50 | * | ntat left #nim (#nim) |
11:02:33 | * | gst joined #nim |
11:03:48 | * | ntat joined #nim |
11:12:39 | * | ntat quit (Quit: leaving) |
11:12:54 | * | ntat joined #nim |
11:19:40 | FromDiscord | <catnowblue> In reply to @hotdog "I think it's because": there's nothing wrong with my types |
11:20:16 | FromDiscord | <catnowblue> the fact that `.to` and `fromJson(type)` gives error which don't have explaination what causes of them |
11:21:04 | FromDiscord | <odexine> There is, hotdog just said that there’s a problem if you name the type the same name as the file it is in there would be a problem |
11:21:20 | FromDiscord | <odexine> Please try changing the name of the file at least |
11:25:45 | FromDiscord | <catnowblue> weird |
11:28:52 | FromDiscord | <craciu25_YT> how can I use `hashlib`? I have looked and theres no docs and in the read me just says things that I don't know what they even mean. I just want to encode a string into a sha256 hash. How can I do that? |
11:34:26 | FromDiscord | <w1redch4d> are there any nim code eval bot in here? |
11:34:28 | FromDiscord | <odexine> sent a code paste, see https://play.nim-lang.org/#ix=4ADS |
11:34:48 | FromDiscord | <odexine> Single line evaluation only |
11:34:54 | FromDiscord | <w1redch4d> sadge |
11:35:01 | FromDiscord | <odexine> If that’s okay with you use “!eval …” |
11:35:24 | FromDiscord | <w1redch4d> any bot-commands channel or something? |
11:35:43 | FromDiscord | <odexine> Not really |
11:35:51 | FromDiscord | <w1redch4d> ok then ig |
11:36:16 | FromDiscord | <w1redch4d> sent a code paste, see https://paste.rs/3vpi8 |
11:36:20 | FromDiscord | <odexine> Single line, as in literally |
11:36:30 | FromDiscord | <w1redch4d> bruh |
11:36:40 | FromDiscord | <odexine> !eval echo "hi" |
11:36:44 | FromDiscord | <w1redch4d> (edit) "sent a code paste, see https://play.nim-lang.org/#ix=4ADT" => "!eval echo "Hello World"" |
11:36:45 | NimBot | hi |
11:36:48 | FromDiscord | <w1redch4d> kekw |
11:36:51 | FromDiscord | <w1redch4d> oh |
11:36:56 | FromDiscord | <odexine> Edits don’t work because it’s from IRC |
11:37:02 | FromDiscord | <w1redch4d> ah |
11:37:03 | FromDiscord | <w1redch4d> ok |
11:42:32 | FromDiscord | <craciu25_YT> sent a code paste, see https://paste.rs/6nnOT |
11:43:06 | FromDiscord | <w1redch4d> saw the source code, seems like it sends the req to here : https://play.nim-lang.org |
11:43:11 | FromDiscord | <w1redch4d> aight seems fair |
12:55:27 | FromDiscord | <odexine> In reply to @craciu25_YT "I get that count": Can I see what you wrote and the whole compiler output? |
12:57:54 | FromDiscord | <craciu25_YT> I already found the issue. I'm stupid and I haved another variable called count |
12:58:02 | * | ntat quit (Quit: leaving) |
12:58:02 | FromDiscord | <craciu25_YT> but anyways thanks you |
12:58:16 | * | ntat joined #nim |
13:30:29 | FromDiscord | <craciu25_YT> is it possible to convert a string that is basically a hash to a `RHASH_SHA256` variable type? |
13:39:04 | FromDiscord | <odexine> Why? What use would that provide |
13:40:57 | * | xet7 quit (Ping timeout: 246 seconds) |
13:47:41 | FromDiscord | <craciu25_YT> To try to speedup the program. It has to hash a list of strings and maybe if I skip doing every check the `$` to convert it to a string and I directly check if it is the one I'm looking |
13:47:51 | FromDiscord | <craciu25_YT> easier words, a hash cracker |
13:52:45 | FromDiscord | <odexine> I see |
13:52:48 | FromDiscord | <odexine> That makes sense |
13:52:56 | FromDiscord | <odexine> I don’t think it’s possible without hacking on the library though |
13:54:10 | NimEventer | New post on r/nim by qtless: Built-in UI components, see https://reddit.com/r/nim/comments/150cnaa/builtin_ui_components/ |
14:02:05 | * | xet7 joined #nim |
14:13:52 | FromDiscord | <ambient3332> This is a little bit frustrating: depending on the Nim version, Weave library gives me all kinds of different errors |
14:14:02 | FromDiscord | <ambient3332> none of them actually work |
14:22:49 | FromDiscord | <treeform> In reply to @jmgomez "I mean, treeform doenst": The only notible thing I did is remove the PHP backend. You welcome! |
14:28:53 | FromDiscord | <jmgomez> In reply to @treeform "The only notible thing": not bad, but falls short. You should have remove the js one as well 😛 |
14:29:34 | FromDiscord | <odexine> In reply to @treeform "The only notible thing": You did? Dope |
14:29:57 | FromDiscord | <treeform> I makey money off the js backend! I can't cut the branch I sit on. |
14:30:09 | FromDiscord | <treeform> (edit) "makey" => "make" |
14:31:32 | FromDiscord | <jmgomez> fair, it was a joke anyways. I use it from time to time 🙂 |
14:31:57 | FromDiscord | <jmgomez> so you dont use the c/cpp ones? |
14:32:42 | FromDiscord | <treeform> I know 🙂 |
14:32:56 | FromDiscord | <odexine> Someone abolish JavaScript instead |
14:32:57 | FromDiscord | <odexine> Then we can replace the backend |
14:33:29 | FromDiscord | <treeform> I do use both the c and js backend a ton. |
14:37:30 | FromDiscord | <jmgomez> nice, no cpp though? I dont think many people uses it. IMO it's under advertised. ↵Did a few things to improve it for Nim 2.0, `virtual` probably being the most awaited |
14:46:13 | FromDiscord | <deech4592> It would be 10x harder to bind to a C++ library without the cpp backend, which I still believe differentiates Nim from almost every other language except maybe D. |
14:48:51 | FromDiscord | <jmgomez> 100% agree. The C++ backend was actually the main reason of why I looked into Nim in the first place (now there are others oc). I wouldnt bother with D as is not that different from C++ |
14:50:40 | FromDiscord | <jmgomez> BTW @deech4592 you may be interested in this: https://github.com/nim-lang/RFCs/issues/530↵It's already implemented, and waiting to be merged (targets 2.2). It solves the `destructor` issue that you brought up as an intentional side effect |
14:50:42 | FromDiscord | <deech4592> If D had something like orc/arc I would probably have gone with it ... |
14:54:04 | FromDiscord | <treeform> Yea, cpp backend is cool. But I don't really use it. I just write libs from scratch. |
15:01:05 | FromDiscord | <odexine> Speaking of libraries I’ve been thinking of adding JXL support to pixie but haven’t gotten to doing it hahaha |
15:01:10 | FromDiscord | <odexine> Sounds hard but fun |
15:03:03 | FromDiscord | <griffith1deadly> In reply to @jmgomez "100% agree. The C++": c++ backend very good for UE game hacking 🙂 |
15:15:18 | FromDiscord | <treeform> In reply to @odexine "Speaking of libraries I’ve": JPEG XL? Man jpeg is so hard. We still need to add a Jpeg writer. I would not mind if some one added that. |
15:17:36 | FromDiscord | <odexine> In reply to @treeform "JPEG XL? Man jpeg": It sounds like a challenge and I’ll see if I could do it haha |
15:18:27 | FromDiscord | <odexine> especially that my research topic is looking like it’s going to hone around image processing |
15:19:08 | FromDiscord | <treeform> Cool I recommend watching these vids first: https://www.youtube.com/watch?v=0me3guauqOU and https://www.youtube.com/watch?v=Kv1Hiv3ox8I |
15:25:25 | FromDiscord | <ambient3332> sent a code paste, see https://play.nim-lang.org/#ix=4AEF |
15:25:31 | FromDiscord | <ambient3332> How do I fold in Discord |
15:30:51 | * | blackbeard420_ quit (Quit: ZNC 1.8.2 - https://znc.in) |
15:31:03 | * | blackbeard420 joined #nim |
15:34:25 | FromDiscord | <odexine> In reply to @treeform "Cool I recommend watching": 🫡 |
15:42:09 | FromDiscord | <ambient3332> Apparently it spawns a ton of threads but only one of them is doing actual work and the rest are just waiting sync |
15:44:13 | * | ntat quit (Quit: leaving) |
15:44:28 | * | ntat joined #nim |
15:58:32 | FromDiscord | <uninnocent> In reply to @punchcake "is that linux mint": No |
15:58:36 | FromDiscord | <uninnocent> It's manjoro |
16:03:20 | FromDiscord | <gogolxdong666> https://media.discordapp.net/attachments/371759389889003532/1129805405363650591/image.png |
16:06:54 | * | ntat quit (Quit: leaving) |
16:07:09 | * | ntat joined #nim |
16:12:10 | * | ntat quit (Quit: leaving) |
16:12:24 | * | ntat joined #nim |
16:13:28 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @griffith1deadly "try kotlin for making": Btw, isn't Kotlin more for phone apps? |
16:15:30 | FromDiscord | <michaelb.eth> In reply to @sys64 "Btw, isn't Kotlin more": Kotlin is a general purpose lang targeting the JVM created by the JetBrains company, but googl chose to promote it as a top-choice for developing Android apps, which is maybe where you get the idea its for phone apps |
16:16:09 | FromDiscord | <michaelb.eth> (edit) "JVM" => "JVM; the lang was" |
16:16:43 | FromDiscord | <griffith1deadly> In reply to @sys64 "Btw, isn't Kotlin more": no, just java/kotlin can to android, and kotlin has more useful libraries for it |
16:20:24 | FromDiscord | <bung8954> why my stdcall proc also has illegal capture problem ? |
16:21:13 | * | ntat quit (Quit: leaving) |
16:21:38 | FromDiscord | <bung8954> or should I change passed in ref object as ptr |
16:21:49 | FromDiscord | <System64 ~ Flandre Scarlet> @michaelb.eth @griffith1deadly Oh alright↵And is it faster than Java? |
16:21:54 | * | ntat joined #nim |
16:22:18 | FromDiscord | <griffith1deadly> it ~speed's java, but more comfortable |
16:22:32 | * | ntat quit (Client Quit) |
16:22:53 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @griffith1deadly "it ~speed's java, but": Java and its verbosity |
16:23:23 | * | ntat joined #nim |
16:29:20 | FromDiscord | <griffith1deadly> sent a code paste, see https://play.nim-lang.org/#ix=4AGy |
16:30:07 | FromDiscord | <ambient3332> Too bad it uses curly braces instead of significant indentation 🤔 |
16:30:24 | FromDiscord | <System64 ~ Flandre Scarlet> Kotlin syntax is beautiful |
16:30:41 | FromDiscord | <ambient3332> I hate curly braces 😅 |
16:31:11 | FromDiscord | <System64 ~ Flandre Scarlet> > public static void main(String[] args) throws TimeoutException, ExecutionException, InterruptedException ↵Aaaaaaaah |
16:31:15 | FromDiscord | <griffith1deadly> i hate significant indentation but love nim |
16:33:30 | FromDiscord | <System64 ~ Flandre Scarlet> But Kotlin is still waaaay easier than Rst |
16:33:50 | FromDiscord | <griffith1deadly> all people need hate rst |
16:34:01 | FromDiscord | <ambient3332> Rust is easier once your project is built |
16:34:14 | FromDiscord | <demotomohiro> In reply to @bung8954 "why my stdcall proc": Only closure proc can capture local variables from its enclosing scope. |
16:34:47 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @ambient3332 "Rust is easier once": Trying to take user input and print it back in Rust↵# PAIN |
16:35:10 | FromDiscord | <spotlightkid> I hate that almost all PLs require you to use symbols, which are very uncomfortable to type on non-english keyboards.↵But then again, I don't want to write Inform 7 either ("Time is an object of type integer"...)😉 |
16:36:20 | FromDiscord | <ambient3332> I've switched to US layout since forever and just occasionally have a keyboard shortcut to switch back to native to native stuff |
16:36:36 | FromDiscord | <bung8954> In reply to @demotomohiro "Only closure proc can": so how to solve it, global variable? am wrapping c so it must be stdcall |
16:37:00 | FromDiscord | <michaelb.eth> In reply to @bung8954 "so how to solve": what's in the global variable? |
16:38:09 | FromDiscord | <demotomohiro> In reply to @bung8954 "so how to solve": Do you want to pass a callback function to C function? |
16:38:14 | FromDiscord | <bung8954> am trying not using global variable |
16:38:25 | FromDiscord | <griffith1deadly> In reply to @sys64 "Trying to take user": or start thread with argument to lambda |
16:38:44 | FromDiscord | <griffith1deadly> (i trying it with my gui app for not blocking) |
16:38:57 | FromDiscord | <bung8954> sent a code paste, see https://play.nim-lang.org/#ix=4AGA |
16:39:30 | FromDiscord | <bung8954> I need store some context information that get from com interface. |
16:39:49 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @griffith1deadly "or start thread with": Rst with multithreading for↵# Maximum pain |
16:39:53 | FromDiscord | <odexine> In reply to @spotlightkid "I hate that almost": inform sounds scary |
16:40:06 | FromDiscord | <ambient3332> Rust multithreading is actually the most comfortable I ever had |
16:40:12 | FromDiscord | <ambient3332> just add .par_iter() and move on |
16:40:27 | FromDiscord | <griffith1deadly> java/kotlin multithreading very easy |
16:42:57 | FromDiscord | <demotomohiro> sent a code paste, see https://play.nim-lang.org/#ix=4AGC |
16:44:51 | FromDiscord | <demotomohiro> I think you need to read more offical manual or documents to learn about how to use that interface. |
16:45:44 | FromDiscord | <bung8954> I can extends that vtable, I thought I can just pass variable like c but it doesn't |
16:46:38 | FromDiscord | <griffith1deadly> In reply to @ambient3332 "just add .par_iter() and": also java/kotlin has .parallelStream() |
16:47:35 | FromDiscord | <demotomohiro> Most of C functions that takes callback function have userDataPointer so that you can pass any type of data to the callback. But I don't know if C function you are using have same pattern. |
16:50:51 | FromDiscord | <bung8954> same theory like this https://www.codeproject.com/Articles/13601/COM-in-plain-C |
16:58:35 | FromDiscord | <jmgomez> In reply to @bung8954 "I can extends that": if you are using a C++ lib, why not target the C++ backend and make your life easier? |
17:00:58 | FromDiscord | <griffith1deadly> In reply to @griffith1deadly "just identical code in": @System64 ~ Flandre Scarlet !! in kotlin indicates what value cannot be null, and in case nulling it throw exception↵also kotlin has ? safe call's methods, like myVariable?.myMethod()↵in java only good way just check value for not null by if (value != null) {} |
17:01:41 | FromDiscord | <demotomohiro> Maybe you can create a new type that inherit `ICoreWebView2....Handler` and add any variable you want.↵Then create and initialize it in `newControllerCompletedHandler` and return address of it as base type.↵In callback function, you upcast to actual type and access fields.↵C++ can do such thing but I don't know if it is safe to do with com interface. |
17:01:47 | FromDiscord | <bung8954> In reply to @jmgomez "if you are using": I already wrapped for two platform and targeting c ... |
17:03:29 | FromDiscord | <bung8954> now am trying to pass non trackable variable. |
17:07:29 | FromDiscord | <griffith1deadly> anyone try multithreading with allographer?↵why i can in main thread create connection for db and call its methods good, but when i'm create connection inside thread my program crashes without stackstace/errors |
17:32:03 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @griffith1deadly "<@380360389377916939> !! in kotlin": Ah yeah, so like C# |
17:39:16 | FromDiscord | <bung8954> In reply to @demotomohiro "Maybe you can create": yeah, I extends that handler now works fine , code much cleaner |
17:39:55 | * | jmdaemon joined #nim |
18:54:11 | FromDiscord | <4zv4l> How do I exportc a vararg function ? I don’t stop getting segfault when my C code call that function (only when accessing the varargs arguments) |
18:56:02 | FromDiscord | <4zv4l> Also depending on the —mm i choose the function segfault when being called or when I access the varargs argument (arc goes to accessing, refc segfault when calling directly) |
19:21:48 | FromDiscord | <juan_carlos> In reply to @4zv4l "How do I exportc": `{.exportc, varargs.}` |
19:28:44 | FromDiscord | <spatchler> So i am trying to get easygl working, and when using an example that involves model loading with assimp, when loading the model it says out of memory why is this happening? |
19:40:55 | FromDiscord | <4zv4l> In reply to @juan_carlos "`{.exportc, varargs.}`": I tried but it still segfault |
19:42:23 | FromDiscord | <4zv4l> Ive low connection, gonna try to send code snippet |
19:42:37 | FromDiscord | <juan_carlos> In reply to @4zv4l "I tried but it": Try openArray instead of varargs ?, maybe its a bug. |
19:45:18 | * | azimut_ quit (Ping timeout: 240 seconds) |
19:45:52 | FromDiscord | <4zv4l> sent a long message, see http://ix.io/4AH8 |
19:45:59 | FromDiscord | <4zv4l> That’s my current code |
19:46:09 | FromDiscord | <4zv4l> Which is segfaulting |
19:53:07 | Amun-Ra | https://nim-lang.org/docs/manual.html#foreign-function-interface-varargs-pragma |
19:53:13 | FromDiscord | <4zv4l> And when I wanna try with a Nim program to test the library I get a tons of « multiple definition of <Nim stdlib functions> » |
19:53:31 | Amun-Ra | varargs pragma != varargs[cstring] |
19:54:47 | FromDiscord | <4zv4l> Yes ? Can you explain a bit further please ? |
19:55:20 | Amun-Ra | void printf(const char *fmt, ...) is proc printf(formatstr: cstring) {.nodecl, varargs.} |
19:56:03 | FromDiscord | <4zv4l> Yeah and I didn’t get why I couldn’t use varargs[cstring, `$`] to define it instead of using varargs pragma |
19:56:12 | Amun-Ra | varargs[cstring] is nimproc construct and I think it cannot be exported as exportc 1:1 |
19:56:31 | FromDiscord | <4zv4l> Oh so I can’t make a varargs proc and use it in my c code ? |
19:56:38 | Amun-Ra | not 1 : 1 |
19:56:47 | FromDiscord | <4zv4l> Whats 1 : 1 ? |
19:57:00 | Amun-Ra | but I may be wrong |
19:57:15 | Amun-Ra | I mean not one on one |
19:57:32 | Amun-Ra | not directly |
19:57:43 | FromDiscord | <4zv4l> In reply to @4zv4l "And when I wanna": Then if I can’t use with C, how can I use my Nim static lib with a Nim program without getting a bunch of redefinition ? |
19:58:28 | FromDiscord | <4zv4l> It still confuses me the static lib contains all those stdlib function even if I don’t think I use them ↵It makes a pretty big static lib for just two proc |
19:58:47 | Amun-Ra | I've never used one |
20:00:17 | FromDiscord | <4zv4l> Okay, thank you already 😄 |
20:00:30 | Amun-Ra | "normal" static libs are just imported during the compilation and built into the code |
20:01:02 | Amun-Ra | is there an equivalent of .a library with nimcalls? dunnp |
20:01:05 | Amun-Ra | dunno* |
20:03:18 | FromDiscord | <4zv4l> In reply to @Amun-Ra ""normal" static libs are": Don’t you mean object file ? |
20:15:38 | FromDiscord | <Elegantbeef> `--nimMainPrefix:"mylib"` should emit a prefix all Nim symbols iirc |
20:15:38 | FromDiscord | <Elegantbeef> I might be wrong |
20:37:04 | * | gst quit (Quit: Client closed) |
21:06:02 | * | xet7 quit (Quit: Leaving) |
21:35:18 | * | lumidify_ quit (Ping timeout: 260 seconds) |
21:36:11 | * | lumidify joined #nim |
21:38:42 | * | ntat quit (Quit: leaving) |
23:23:57 | * | antranigv quit (Quit: ZNC 1.8.2 - https://znc.in) |
23:24:18 | * | antranigv joined #nim |
23:48:24 | * | xet7 joined #nim |
23:58:26 | * | lucasta joined #nim |