01:31:24 | * | ltriant_ quit (Ping timeout: 255 seconds) |
01:49:00 | * | arkurious quit (Quit: Leaving) |
01:56:58 | * | derpydoo joined #nim |
02:01:47 | FromDiscord | <Rika> In reply to @arkanoid "I'm quite confused. I've": Async check just adds an error handler to bubble up any errors, other than that it’s equivalent to discard |
02:02:53 | arkanoid | RiKa, it does not bubble up, it explodes. you can't catch whats raised within asynccheck |
02:03:36 | FromDiscord | <Rika> Well, otherwise you won’t even see the error IIRC |
02:05:13 | arkanoid | Rika: it's very confusing, it took me a while to find out how to make async programs error resilient |
02:05:29 | FromDiscord | <Rika> If you look at the code for async check all it does is add an error handler that re raises the error |
02:06:23 | arkanoid | the point is that it's not a raise, it's a stinger missile to your main |
02:07:28 | FromDiscord | <Rika> It raises it just doesn’t raise back into the caller |
02:07:45 | arkanoid | it raises into something you can't control |
02:08:02 | arkanoid | event loop I suppose |
02:08:11 | FromDiscord | <Rika> If you want to handle an error in a future you don’t await you have to use the error handler/callback style of async |
02:08:28 | FromDiscord | <Rika> Or |
02:08:36 | arkanoid | sure, I found it the hard way |
02:09:01 | FromDiscord | <Rika> Make another async proc that does await the error raising proc and handles the errors and async check that |
02:09:53 | arkanoid | I wrote my custom asyncCatch function that takes same parameters as asyncCheck but raises errore to my error/logging handler |
02:10:57 | arkanoid | but now I know that if I don't care about the errors, I can just discard the future |
02:11:36 | arkanoid | it's wrong, I know, but it would have saved me from very bad server crashes tmm |
02:12:07 | FromDiscord | <Rika> Well it wouldn’t log |
02:12:44 | arkanoid | better than crashing indeed |
02:13:21 | arkanoid | in my opinion, asyncCheck is a no-go. I've found no real use of it once I've found out the consequences |
02:13:46 | arkanoid | in which context the user wants a function that if errors it kills the whole process? |
02:27:25 | arkanoid | also, it makes the use think it can catch the exception somehow, but it's not. The raise is just to collect stack before detonating your app. Should be documented as a panic |
04:19:24 | NimEventer | New post on r/nim by cell_me_C_twos: Sequoia pgp library hasn’t been updated in 5 years., see https://reddit.com/r/nim/comments/11nefqm/sequoia_pgp_library_hasnt_been_updated_in_5_years/ |
04:26:41 | FromDiscord | <T0lk1en> Yo what’s up y’all |
04:27:47 | * | azimut quit (Ping timeout: 255 seconds) |
04:27:53 | FromDiscord | <gogolxdong> How to connect nimbus-eth1 to custom private chain? |
04:30:24 | FromDiscord | <T0lk1en> https://github.com/ba0f3/sequoia.nim |
04:30:48 | FromDiscord | <T0lk1en> outdated library getting the same error brought up by an open issue in the github. ANy advice? |
04:31:16 | FromDiscord | <T0lk1en> "outdated" i guess i may be jumping to conclusions |
04:31:27 | FromDiscord | <T0lk1en> its 5 years since last update |
04:43:23 | NimEventer | New thread by dwhall256: Can Nim do Type States?, see https://forum.nim-lang.org/t/9976 |
04:53:46 | FromDiscord | <huantian> huh I wonder if it's possible to emit a static error in a type block? |
04:54:04 | FromDiscord | <huantian> trying to make something for the above thread, was wondering if it's possible to error on an invalid generic state |
04:54:24 | FromDiscord | <jtv> yes, macros.error() |
04:54:36 | FromDiscord | <huantian> the problem is that it doesn't parse |
04:54:55 | FromDiscord | <jtv> Then no, if it's not valid nim then nim handles that error |
04:55:27 | FromDiscord | <Elegantbeef> Use a enum + static and eh voila |
04:56:20 | FromDiscord | <Elegantbeef> Need to look at that rust stuff more though |
04:56:22 | FromDiscord | <huantian> sent a code paste, see https://play.nim-lang.org/#ix=4qpd |
04:56:48 | FromDiscord | <huantian> just wondering if it's possible to dos something like this, ie direction shouldn't have a value if TEnabled is false |
04:57:25 | FromDiscord | <Elegantbeef> Make a template generate the type and check the values is what i do |
04:57:46 | FromDiscord | <huantian> ooh that could work |
04:57:52 | FromDiscord | <huantian> is that overcomplicating the question though lmao |
04:58:53 | FromDiscord | <Elegantbeef> I need to look at it more to think of a trick |
05:00:13 | FromDiscord | <huantian> actually I think one problem is that nim doesn't let you shadow variables |
05:00:26 | FromDiscord | <Elegantbeef> What? |
05:02:08 | FromDiscord | <huantian> https://play.nim-lang.org/#ix=4qpg |
05:02:28 | FromDiscord | <huantian> in rust, I think, you would be able to do `var config = ...` instead of `config1` like I did |
05:03:28 | FromDiscord | <Elegantbeef> `if true` ... |
05:04:28 | FromDiscord | <huantian> ig, but doesn't that just keep getting more and more nested as I go |
05:05:38 | FromDiscord | <Elegantbeef> Sure, but short of changing Nim there isnt much you can do |
05:05:44 | FromDiscord | <huantian> yeah |
05:06:21 | FromDiscord | <huantian> also I think I'm overcompilcating the example they have |
05:13:45 | FromDiscord | <huantian> wait is this a bug? why does this code compile |
05:13:51 | FromDiscord | <huantian> sent a code paste, see https://play.nim-lang.org/#ix=4qph |
05:14:31 | FromDiscord | <huantian> `a` is constrained to be `bool` but I created an instance of `Test[1]` |
05:15:23 | FromDiscord | <Elegantbeef> On devel? |
05:15:29 | FromDiscord | <Elegantbeef> bool -\> int on stable |
05:15:34 | FromDiscord | <huantian> nope 1.6.10 on playground |
05:15:42 | FromDiscord | <huantian> In reply to @Elegantbeef "bool -\> int on": wdym |
05:16:18 | FromDiscord | <huantian> it works no matter what I change bool and int into I think |
05:16:31 | FromDiscord | <Elegantbeef> On stable a static bool is turned into an int due to the vm storing it that way |
05:16:36 | FromDiscord | <Elegantbeef> I cannot remember if ring changed it |
05:17:27 | FromDiscord | <huantian> sent a code paste, see https://play.nim-lang.org/#ix=4qpi |
05:17:28 | FromDiscord | <huantian> this also works |
05:17:35 | FromDiscord | <huantian> sent a code paste, see https://play.nim-lang.org/#ix=4qpj |
05:18:08 | FromDiscord | <huantian> sent a code paste, see https://play.nim-lang.org/#ix=4qpk |
05:18:11 | FromDiscord | <huantian> this fails to compile correctly |
05:20:11 | FromDiscord | <huantian> seems like a bug with generic constraints and static paramenters? |
05:20:24 | FromDiscord | <Elegantbeef> Yea static parameters are funny in many ways |
05:20:46 | FromDiscord | <huantian> like just ignoring generic constraints entirelly? 😛 |
05:21:58 | FromDiscord | <Elegantbeef> Generic aliases do the same |
05:23:18 | FromDiscord | <huantian> fonky |
05:24:27 | FromDiscord | <huantian> maybe it'll be fixed when we improve the "Cannot instantiate" error |
05:25:08 | FromDiscord | <huantian> it's even worse than the proc mismatch error right now 😛 |
06:48:50 | * | rockcavera quit (Remote host closed the connection) |
06:54:07 | * | Jjp137 quit (Ping timeout: 260 seconds) |
06:54:25 | * | Jjp137 joined #nim |
07:04:41 | * | kenran joined #nim |
07:20:49 | * | advesperacit joined #nim |
08:00:28 | FromDiscord | <Elegantbeef> huantian\: i did finally take a look at it and expanded your example 😄 |
08:21:16 | * | Notxor joined #nim |
08:22:03 | * | azimut joined #nim |
08:26:57 | FromDiscord | <narimiran> Nim 1.6.12 is out!↵https://nim-lang.org/blog/2023/03/10/version-1612-released.html |
08:30:57 | NimEventer | New thread by Araq: Version 1.6.12 released!, see https://forum.nim-lang.org/t/9977 |
08:58:03 | * | PMunch joined #nim |
08:58:56 | FromDiscord | <Phil> > My line of work prohibits metaprogramming↵Wut ? |
08:59:27 | FromDiscord | <Phil> Hmm wait, may actually be a fair point if macros and co are deemed to much of a risk to write yourself because of the difficulty associated |
08:59:28 | FromDiscord | <Elegantbeef> They might think it has a runtime cost |
09:01:32 | FromDiscord | <huantian> Ah thanks I didn’t think of disabling copy to mimic rust ownership |
09:06:36 | PMunch | @Phil, who said that? |
09:06:57 | FromDiscord | <Elegantbeef> https://forum.nim-lang.org/t/9976#65760 |
09:09:10 | PMunch | Aha, I see |
09:09:17 | PMunch | For embedded work even, that's just silly |
09:09:35 | FromDiscord | <Elegantbeef> It might be the case that they think there is runtime overhead |
09:09:40 | PMunch | If I where to guess they've simply misunderstood what meta-programming in Nim is |
09:09:42 | PMunch | Yeah |
09:10:34 | PMunch | I mean if meta-programming required the NimScript interpreter to be embedded in your program then I get that embedded work wouldn't want to touch it |
09:19:05 | FromDiscord | <planetis> Is there a point for `=sink` now that `=wasMoved` exists? |
09:19:27 | FromDiscord | <planetis> (since sink is inferred) |
09:25:28 | PMunch | Hmm, `choosenim update stable` doesn't upgrade my Nim :( |
09:28:00 | FromDiscord | <huantian> Uh oh! |
09:42:49 | FromDiscord | <djazz> choosenim versions lists 1.6.12 but it doesnt want to update |
09:45:12 | FromDiscord | <djazz> Its just not marked as the stable version. Idk how it works |
09:45:32 | FromDiscord | <Coachonko> Must be unstable, like our community |
09:45:39 | FromDiscord | <Coachonko> 😎 |
09:46:46 | FromDiscord | <djazz> Ah, http://nim-lang.org/channels/stable gives 1.6.10 |
09:46:56 | FromDiscord | <djazz> So not an issue with choosenim |
09:50:53 | PMunch | Now the big question is, who manages that.. |
09:53:33 | FromDiscord | <Phil> Oh lord, is choosenim another entry for the infrastructure list? |
09:56:17 | PMunch | Looks like it |
10:04:38 | FromDiscord | <jmgomez> Why this situation exists? Where nobody know who owns what? |
10:05:37 | PMunch | Basically just a bunch of legacy stuff |
10:05:39 | FromDiscord | <enthus1ast> Yeah we need an "infrastructure" list with owners and stand-in's when the owner is currently not available |
10:06:08 | PMunch | The moderator team is working on organising everything and making sure that everything has a maintainer |
10:06:27 | PMunch | @enthus1ast, yeah this is pretty much exactly what we're working towards |
10:06:32 | FromDiscord | <enthus1ast> oh, good \:) |
10:07:22 | PMunch | We haven't made any public announcements yet, but we're working on multiple improvements :) |
10:08:37 | FromDiscord | <ringabout> And I have finished a roadmap for community building => https://github.com/nim-lang/RFCs/issues/513 |
10:37:42 | FromDiscord | <ringabout> In reply to @PMunch "The moderator team is": We should add these tasks to the roadmap too. |
10:51:36 | FromDiscord | <ringabout> In reply to @ringabout "And I have finished": I have added three management-related goals. |
10:52:07 | FromDiscord | <ringabout> Add list of Nim-related infrastructure and responsible folks <-> Add list of people that make up the community organization <-> Publish Nim moderation policies |
11:06:09 | FromDiscord | <Phil> I wonder what the "cleanest" way to write a parameterized tests with std/unittest is |
11:06:21 | FromDiscord | <Phil> write the test as a template that eats the parameters? |
11:23:08 | FromDiscord | <Andreas> macro-problem with a empty proc-signature `proc()`↵`Error: internal error: environment misses: this_val`↵the macro processes a nim-proc with a empty signature . The macro then adds a std-signature to it. this_val-param gets added and the resulting signature looks good ? The error is reported on the first use of the added parameters. Shall i make a copy the proc's-body and construct a new proc ? <4-min>-later: same error with a new pro |
11:31:18 | FromDiscord | <apahl> sent a code paste, see https://play.nim-lang.org/#ix=4qqI |
11:32:56 | FromDiscord | <Rika> Wrap in try except, I don’t know if there’s a cast for raise effects |
11:34:16 | FromDiscord | <ringabout> sent a code paste, see https://play.nim-lang.org/#ix=4qqJ |
11:34:43 | FromDiscord | <apahl> Ok, thank you! |
11:34:53 | FromDiscord | <ringabout> (edit) "https://play.nim-lang.org/#ix=4qqJ" => "https://play.nim-lang.org/#ix=4qqK" |
12:32:26 | FromDiscord | <enthus1ast> @aruZeta\: i just used qrGen (+ pixie renderer) for mass generating wireguard config files to easily let my users scan the qrcode \:) |
12:32:36 | FromDiscord | <enthus1ast> works perfectly |
12:32:47 | FromDiscord | <enthus1ast> i even added text to the qrcode |
12:33:40 | FromDiscord | <aruZeta> Thats nice gg! |
13:29:38 | FromDiscord | <Nerve> Are there any compiler devs available today? I might have a killer bug but I'm not knowledgeable enough on compiler internals |
13:31:31 | FromDiscord | <Nerve> It's a C library import that works perfectly in a debug build, but `-d:release` causes it to throw segfaults |
13:33:20 | FromDiscord | <Nerve> However, with `-d:release`, `echo`ing a value in the calling `proc` makes it work, inexplicably |
13:43:24 | * | arkurious joined #nim |
13:46:08 | FromDiscord | <Nerve> Huh, I may have found what's happening |
13:48:42 | * | rockcavera joined #nim |
14:17:29 | FromDiscord | <hotdog> In reply to @Nerve "However, with `-d:release`, `echo`ing": Perhaps a small timing issue. Does putting a short sleep in place of the echo have the same effect? |
14:17:52 | FromDiscord | <djazz> @PMunch trying out nimbleutils, seems like all fields are hidden? How to get version? Error: undeclared field: 'version' for type nimbleutils.NimblePkg |
14:18:00 | FromDiscord | <Nerve> Actually doesn't seem to work anymore |
14:18:01 | FromDiscord | <djazz> I tried `getPackage(nimblePath).version.tag` |
14:20:03 | FromDiscord | <Nerve> In reply to @hotdog "Perhaps a small timing": Yeah not a timing issue |
14:30:58 | FromDiscord | <djazz> `include futhark` worked, but imports all internal symbols also XD |
14:31:05 | FromDiscord | <djazz> include nimbleutils |
14:41:46 | * | al1ranger joined #nim |
14:43:07 | * | al1ranger quit (Client Quit) |
15:05:25 | NimEventer | New post on r/nim by akomomssim: How hard would it be to port the nim runtime to a console?, see https://reddit.com/r/nim/comments/11nrj0g/how_hard_would_it_be_to_port_the_nim_runtime_to_a/ |
15:26:48 | termer | someone tell this person that people have already gotten nim working on switch |
15:26:54 | termer | I have no reddit account |
15:26:58 | FromDiscord | <elvodqa> Can I create a type of multiple types? eg: `type Value = int|string|Table`? |
15:27:31 | termer | yes |
15:27:42 | termer | however, type checks are at compile time, not runtime |
15:28:00 | termer | so when you use it and you want to differentiate between them in a proc, you have to use "when myArg is int" or similar |
15:28:23 | termer | type Union = int|string|Table |
15:28:30 | termer | proc doThing(myArg: Union) = |
15:28:35 | termer | when myArg is int: |
15:28:40 | termer | # Do stuff |
15:28:42 | termer | etc |
15:29:49 | termer | elvodqa, I recommend you try out inim, it's a usable Nim REPL. It makes it easy to test things out without openin a text editor and calling the compiler |
15:30:03 | FromDiscord | <elvodqa> In reply to @termer "<@429283718629163018>, I recommend you": I see thank you |
15:30:21 | FromDiscord | <elvodqa> I wanted to learn nim by making a small project |
15:30:27 | termer | https://github.com/inim-repl/INim |
15:30:30 | termer | what kind of project? |
15:30:39 | FromDiscord | <elvodqa> toml parser |
15:31:18 | termer | should be pretty easy, go for it |
15:33:33 | FromDiscord | <elvodqa> sent a code paste, see https://play.nim-lang.org/#ix=4qs3 |
15:36:29 | FromDiscord | <elvodqa> I might be using the `Table[T, T]` wrong but I couldn't find any examples of this kind of usage. I'm using `initTable` in my proc but if there is a better type for `Toml`, I'm ok to use it. |
15:45:03 | * | koltrast quit (Ping timeout: 255 seconds) |
15:45:36 | * | advesperacit quit () |
15:51:28 | * | kenran quit (Remote host closed the connection) |
15:59:39 | FromDiscord | <Nerve> If a C library expects a buffer passed to it in the form const uint8_t, how do I pass to it? |
15:59:58 | FromDiscord | <Rika> In reply to @elvodqa "Going back to my": Can’t use it that way, no |
16:00:11 | FromDiscord | <Rika> You can see how the JSON module does it, since it’s similar |
16:00:30 | * | nyeaa492842301 quit (Quit: The Lounge - https://thelounge.chat) |
16:00:35 | FromDiscord | <Nerve> sent a code paste, see https://play.nim-lang.org/#ix=4qsd |
16:00:49 | FromDiscord | <Nerve> (edit) "https://play.nim-lang.org/#ix=4qsd" => "https://play.nim-lang.org/#ix=4qse" |
16:01:08 | FromDiscord | <Rika> ptr UncheckedArray[uint8] |
16:01:16 | FromDiscord | <Rika> I would say that is the best choice |
16:01:27 | FromDiscord | <Nerve> (edit) "https://play.nim-lang.org/#ix=4qse" => "https://play.nim-lang.org/#ix=4qsf" |
16:01:30 | * | nyeaa492842301 joined #nim |
16:01:58 | FromDiscord | <Nerve> How would I take a string (like JSON) and pass that to it, then get it back out? |
16:02:10 | FromDiscord | <Nerve> (edit) "it" => "a string" | "out?" => "out for writing to file?" |
16:02:35 | FromDiscord | <Nerve> So round-trip, string -> ptr UncheckedArray[uint8] -> string |
16:02:41 | FromDiscord | <Nerve> (edit) "string" => "`string" | "string" => "string`" |
16:04:39 | FromDiscord | <gogolxdong> Is ORC running as ARC when there is no circular reference? |
16:32:20 | * | koltrast joined #nim |
16:35:16 | * | koltrast quit (Client Quit) |
16:36:09 | * | koltrast joined #nim |
16:44:40 | FromDiscord | <Nerve> If I need to pass a pointer to a number to a C function, where it uses that number and then overwrites it such that I need to reference it again, what's the best way to do this? Specifically, `encoded_size` in the function definition above: You pass in the allocated size of your `encoded_buffer`, and Brotli writes into that same address the size of data it actually compressed, so I need to read it back out. |
16:52:59 | * | azimut quit (Ping timeout: 255 seconds) |
16:57:49 | FromDiscord | <djazz> futhark fails to build opir on nim 1.6.12 on windows ... |
16:58:10 | FromDiscord | <djazz> gcc error, static assertion failed |
17:04:48 | FromDiscord | <djazz> oh... choosenim installed 32 bit nim on 64 bit windows |
17:05:02 | FromDiscord | <djazz> 🤦♂️ 🤦 🤦♀️ |
17:05:40 | FromDiscord | <djazz> thats why i got an error in nimbase.h, couldt agree on size of pointer |
17:09:11 | FromDiscord | <djazz> reinstalled, it got x64 now, weird... |
17:11:37 | NimEventer | New post on r/nim by thindil: [Nim Blog] Nim version 1.6.12 released, see https://reddit.com/r/nim/comments/11nut5b/nim_blog_nim_version_1612_released/ |
17:14:08 | FromDiscord | <djazz> i cant replicate it 🤷♂️ |
17:18:15 | FromDiscord | <Nerve> In reply to @Nerve "If I need to": I'm stupid and figured it out. `size_t` corresponds to `culonglong` and I was equating it with `cuint`. |
17:18:40 | FromDiscord | <Nerve> If you're building an interface to C, it's always safe to assume `size_t` is 64 bits on any non-embedded systems |
17:19:07 | FromDiscord | <djazz> nim has `csize_t` |
17:19:13 | FromDiscord | <Nerve> Really? |
17:19:17 | FromDiscord | <Nerve> oh wow |
17:19:17 | FromDiscord | <djazz> yeah |
17:19:44 | FromDiscord | <djazz> `csize_t {.importc: "size_t", nodecl.} = uint` |
17:19:53 | FromDiscord | <Nerve> So that automatically gets the correct size for `size_t` |
17:19:56 | FromDiscord | <djazz> so nim thinks it is an uint |
17:19:56 | FromDiscord | <Nerve> Nice |
17:20:26 | FromDiscord | <djazz> give it a try |
17:20:48 | FromDiscord | <Nerve> Works like a charm |
17:20:54 | FromDiscord | <djazz> :nim1: |
18:05:49 | FromDiscord | <Hourglass [She/Her]> Not sure how I'm supposed to keep my server alive now that all the blocking code has been moved to a plugin :p |
18:06:03 | FromDiscord | <Hourglass [She/Her]> Because my code just exits now |
18:06:20 | * | rmt joined #nim |
18:14:58 | rmt | Hello, g'day, etc. I'm musing about the best way to trigger an async event from a separate thread. Specifically, a RT audio thread (jack initially) would produce data which could then be consumed by an async proc on the primary thread. |
18:23:12 | rmt | Hm, maybe AsyncEvent is what I'm after. |
18:26:35 | FromDiscord | <Hourglass [She/Her]> Welp my code does not like the dependency system apparently |
18:36:11 | FromDiscord | <Hourglass [She/Her]> Well this is annoying |
18:36:13 | FromDiscord | <Hourglass [She/Her]> Gdb hangs |
18:38:01 | FromDiscord | <Hourglass [She/Her]> Ah, nvm |
18:38:21 | FromDiscord | <Hourglass [She/Her]> Anyway it seems to be a logic error? |
18:42:03 | FromDiscord | <Hourglass [She/Her]> I don't think shared libraries like working with eachother |
18:42:08 | FromDiscord | <Hourglass [She/Her]> This is annoying |
19:00:22 | FromDiscord | <Livid> Is there a way to get the number of references to an reference? |
19:01:23 | FromDiscord | <jtv> There wouldn't be a general-purpose way. There might be one if you're using ARC/ORC (not sure), but not if you're using any other memory manager. |
19:02:12 | FromDiscord | <jtv> ARC/ORC will count references, tracing collectors do not. |
19:32:33 | * | ehmry quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
19:33:44 | * | ehmry joined #nim |
19:39:13 | * | rmt quit (Ping timeout: 268 seconds) |
19:42:30 | FromDiscord | <Yepoleb> In reply to @Livid "Is there a way": the reference count is stored in the `RefHeader` which is placed before the referenced object. you can access it with some unsafe casting |
19:42:46 | FromDiscord | <Yepoleb> the implementation is in this file https://github.com/nim-lang/Nim/blob/version-1-6/lib/system/arc.nim |
20:14:36 | NimEventer | New thread by moigagoo: Template in template: should this work?, see https://forum.nim-lang.org/t/9978 |
20:14:40 | * | azimut joined #nim |
20:57:12 | * | derpydoo quit (Quit: derpydoo) |
21:07:37 | * | pbsds3 joined #nim |
21:07:42 | * | pbsds quit (Ping timeout: 252 seconds) |
21:07:42 | * | pbsds3 is now known as pbsds |
21:48:30 | FromDiscord | <Ayy Lmao> sent a code paste, see https://play.nim-lang.org/#ix=4qu0 |
21:49:07 | FromDiscord | <Ayy Lmao> I have tried the exportc pragma but upon inspecting the nimcache I don't seem to be getting the `extern "C"` part. |
21:53:38 | Amun-Ra | are you trying to exportc nimcall function? |
21:57:46 | FromDiscord | <Ayy Lmao> I'm trying to export an instance of a struct that has functions I guess. I am trying to make an audio plugin in this format https://github.com/free-audio/clap. The entry point seems to be a struct and I haven't seen anything like that before. |
21:59:56 | FromDiscord | <Ayy Lmao> sent a code paste, see https://play.nim-lang.org/#ix=4qu6 |
22:00:11 | FromDiscord | <Ayy Lmao> (edit) "https://play.nim-lang.org/#ix=4qu6" => "https://play.nim-lang.org/#ix=4qu7" |
22:01:26 | Amun-Ra | add a '*' to clang_entry |
22:02:06 | Amun-Ra | I've never exported a variable in nim |
22:02:52 | FromDiscord | <Ayy Lmao> Hmm, I still seem to be getting a private variable in the generated code `N_LIB_PRIVATE tyObject_clap_plugin_entry_tyT9cO1eaflePB8yduVylsyw clap_entry;` |
22:03:25 | FromDiscord | <Elegantbeef> Your type should be `importc`'d or `exportC`'d |
22:06:41 | FromDiscord | <Ayy Lmao> When I importc the types I get errors, and when I exportc them the `clap_entry` variable is still private for some reason. |
22:09:12 | FromDiscord | <Ayy Lmao> This is the source code I am referencing for an example plugin https://raw.githubusercontent.com/nakst/cdn/main/clap-tutorial-part-1-plugin.cpp |
22:10:18 | FromDiscord | <Ayy Lmao> I am assuming if I set it up right I can get away with not including the `clap.h` header. |
22:13:14 | via__ | i've got a tool i'm working on that, when it finishes running, segfaults when using --gc:orc/arc (not without). gdb puts the segfault in eq_destroy__system_xxxx from nimDestroyAndDispose. how could i go about debugging this, and/or should it be a nim github issue? |
22:13:54 | via__ | oh. 1.6.12 was released today lol, i suppose i can try that first |
22:15:53 | via__ | still happens |
22:17:39 | via__ | but yeah, any advice on how i could try to break it down to a small sample without just trial and error? |
22:25:09 | Amun-Ra | via__: I'd add sanitizers |
22:26:22 | * | derpydoo joined #nim |
22:27:08 | via__ | Amun-Ra: whats that? sorry i'm relatively new to nim |
22:27:46 | via__ | i mean i know how to use -fsanitize with gcc or whatever, but in this case i do actually have a backtrace with debug symbols, its just all up in orc/arc itself so i dunno how to debug that |
22:28:27 | PMunch | Uhm, what? `/.choosenim/toolchains/nim-1.6.12/lib/pure/parseutils.nim(637, 30) Error: type mismatch: got 'int32' for '1048576' but expected 'float64 = float'` |
22:28:56 | Amun-Ra | via__: I mean perhaps ubsan/etc. can add additional info |
22:29:12 | Amun-Ra | could |
22:29:16 | via__ | okay sure, i can try, though yeah its in nim's arc/orc itself |
22:29:47 | via__ | i meant more how can i narrow down what nim code i have is whats triggering this so i can make a minimal reproduction. i'll give that a shot |
22:39:46 | FromDiscord | <Ayy Lmao> I must be missing something. When I try to compile https://github.com/free-audio/clap/blob/main/src/plugin-template.c with vcc, it tells me that I need to define an entry point. Can you even have a struct as your entry point? Am I missing a function entry point somewhere? |
22:47:30 | * | lumo_e joined #nim |
22:52:08 | * | Notxor quit (Remote host closed the connection) |
22:57:58 | FromDiscord | <Hourglass [She/Her]> In reply to @via__ "i've got a tool": I actually had that issue earlier today but I'm doing shared library stuff so it's hacky as hell, also I'm using the latest devel |
22:58:31 | Amun-Ra | if it's a dll struct can't be an entry point |
22:58:47 | Amun-Ra | (iirc) |
22:59:24 | FromDiscord | <Hourglass [She/Her]> That's not my direct issue, I'm passing an object between two shared libraries but I'm taking a break from it right now |
23:00:05 | FromDiscord | <Ayy Lmao> In reply to @Amun-Ra "if it's a dll": Interestingly enough I can compile https://github.com/free-audio/clap/blob/main/src/plugin-template.c with gcc. |
23:00:21 | FromDiscord | <Ayy Lmao> But my DAW still doesn't detect it. |
23:13:05 | NimEventer | New thread by radsoc: Number of requests issue with Httpbeast, see https://forum.nim-lang.org/t/9979 |
23:17:08 | FromDiscord | <Nilts> how would i run strip on a cstring without extra conversions? |
23:20:16 | Amun-Ra | right one - set '\x00' in a proper place |
23:20:30 | Amun-Ra | left one - moveMem |
23:41:45 | * | Mi joined #nim |
23:43:30 | * | PMunch quit (Quit: leaving) |