00:08:01 | FromDiscord | <0ffh> So let's say XML/XHTML, just to be on the safe side. |
00:10:23 | FromDiscord | <0ffh> Also embedded CSS and JS not included, natch. |
00:51:39 | * | beholders_eye quit (Ping timeout: 258 seconds) |
00:53:23 | * | beholders_eye joined #nim |
00:56:04 | FromDiscord | <JJ> many questions about some case statement macros |
00:59:21 | FromDiscord | <JJ> sent a code paste, see https://play.nim-lang.org/#ix=4Jmy |
01:01:38 | FromDiscord | <JJ> sent a code paste, see https://play.nim-lang.org/#ix=4JmA |
01:02:10 | FromDiscord | <JJ> i think there's something subtle (or maybe blatantly obvious) i'm missing |
01:23:54 | FromDiscord | <Elegantbeef> Case statement macros do not use that syntax JJ |
01:24:24 | FromDiscord | <Elegantbeef> `macro `case`(n: tuple): untyped =` |
01:24:34 | FromDiscord | <Elegantbeef> @JJ |
01:24:36 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4JmD |
01:26:36 | FromDiscord | <Elegantbeef> Is what you want for the latter |
01:26:40 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4JmE |
01:46:17 | * | beholders_eye quit (Ping timeout: 255 seconds) |
01:48:01 | * | beholders_eye joined #nim |
02:19:27 | FromDiscord | <michaelb.eth> how does the Nim compiler determine `defined(clang)`, `defined(gcc)`? are those defines relative to the compiler Nim was built with, or when invoked is the compiler checking the environment? I'm poking around but haven't figured it out yet, maybe someone here knows |
02:19:45 | FromDiscord | <michaelb.eth> (edit) "`defined(gcc)`?" => "`defined(gcc)`, etc.?" |
02:23:17 | FromDiscord | <leorize> it's dependent on the --cc option |
02:23:24 | FromDiscord | <leorize> which is set to gcc by default |
03:01:36 | * | beholders_eye quit (Ping timeout: 258 seconds) |
04:04:17 | FromDiscord | <pcarrier> is there a way to make sure my function doesn't get DCE? I already have `{.exportc.}` but it doesn't show up in the generated .cpp |
04:04:30 | FromDiscord | <Elegantbeef> `dynlib` |
04:06:02 | FromDiscord | <pcarrier> sent a code paste, see https://play.nim-lang.org/#ix=4Jn4 |
04:06:05 | FromDiscord | <pcarrier> and it still disappears from my C++ file |
04:07:27 | FromDiscord | <Elegantbeef> Are you sure? |
04:07:48 | FromDiscord | <pcarrier> yes? |
04:08:02 | FromDiscord | <pcarrier> yes. |
04:08:40 | FromDiscord | <pcarrier> sent a code paste, see https://play.nim-lang.org/#ix=4Jn5 |
04:10:28 | FromDiscord | <Elegantbeef> Nim does not even do DCE itself |
04:10:56 | FromDiscord | <pcarrier> well, doesn't seem to emit C++ code for my proc |
04:11:09 | FromDiscord | <Elegantbeef> Did you import the module? |
04:11:09 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4Jn6 |
04:11:20 | FromDiscord | <pcarrier> import which module? |
04:11:30 | FromDiscord | <Elegantbeef> The one that declares the proc |
04:12:04 | FromDiscord | <pcarrier> I have `bin = @[filename]` where `src/filename.nim` declares `eval_stor` |
04:12:30 | FromDiscord | <pcarrier> (edit) "@[filename]`" => "@["filename"]`" | "`eval_stor`" => "`eval_stor`, so nothing to import?" |
04:12:56 | FromDiscord | <Elegantbeef> Try `extern` then |
04:13:11 | FromDiscord | <Elegantbeef> If this is not a dynamic library there is no reason to compile an unused proc in |
04:13:44 | FromDiscord | <pcarrier> I'm compiling for wasm, it makes sense here |
04:13:54 | FromDiscord | <pcarrier> (edit) "wasm," => "wasm using cheerp," |
04:13:58 | FromDiscord | <Elegantbeef> It doesnt really |
04:14:20 | FromDiscord | <Elegantbeef> There are mechanisms in the compiler to keep it alive |
04:14:25 | FromDiscord | <pcarrier> I want it to be exposed to JS, that's how it's done |
04:14:31 | FromDiscord | <Elegantbeef> I know |
04:14:33 | FromDiscord | <pcarrier> (edit) "I want it to be exposed to JS, that's how it's done ... " added "on the C++ side" |
04:14:46 | FromDiscord | <pcarrier> OK, so how do I keep it alive before the C++ compilation phase? 😄 |
04:15:11 | FromDiscord | <Elegantbeef> Are you using emscripten? |
04:15:14 | FromDiscord | <pcarrier> nope, cheerp |
04:15:27 | FromDiscord | <pcarrier> emscripten was a world of pain, I'm giving the alternative a try |
04:15:38 | FromDiscord | <Elegantbeef> Emscripten has a mechanism to keep procs alive iirc |
04:15:51 | FromDiscord | <Elegantbeef> No clue about cheerp |
04:16:33 | FromDiscord | <pcarrier> to be clear this has nothing to do with cheerp itself, the generated C++ doesn't have a function for the proc |
04:16:45 | FromDiscord | <pcarrier> (edit) "proc" => "proc, nothing cheerp can do about that" |
04:17:15 | FromDiscord | <Elegantbeef> Right Nim actually does basic DCE, forgot about that |
04:17:16 | FromDiscord | <Elegantbeef> `exportc, dynlib` should cause it to generate |
04:17:25 | FromDiscord | <pcarrier> and it doesn't |
04:21:05 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4Jn6 |
04:21:07 | FromDiscord | <Elegantbeef> I don't know what to say |
04:21:09 | FromDiscord | <Elegantbeef> It generates it here |
04:23:22 | FromDiscord | <pcarrier> sent a code paste, see https://play.nim-lang.org/#ix=4Jn7 |
04:23:37 | FromDiscord | <Elegantbeef> Just to do a sanity check |
04:23:41 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4Jn8 |
04:25:35 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4Jna |
04:25:58 | FromDiscord | <Elegantbeef> `-f` and `-c` are just to disregard cache and to Nim compile only |
04:26:09 | FromDiscord | <Elegantbeef> Just to make it clear that they're not influencing anything |
04:26:19 | FromDiscord | <Elegantbeef> I do not need a useless C++ compile error in my life |
04:26:50 | FromDiscord | <Elegantbeef> Even with `-d:release` it outputs it |
04:26:57 | FromDiscord | <Elegantbeef> So what's your `nim -v` and also OS? |
04:28:01 | FromDiscord | <pcarrier> sent a code paste, see https://play.nim-lang.org/#ix=4Jnb |
04:28:52 | FromDiscord | <ElegantBeouf> I hate that I can tell when the bridge dies |
04:28:55 | FromDiscord | <ElegantBeouf> Yea that's same as mee |
04:28:57 | FromDiscord | <ElegantBeouf> (edit) "mee" => "me" |
04:29:16 | FromDiscord | <ElegantBeouf> I'd suggest to replicate what I've done to ensure it works outside of your project |
04:34:22 | FromDiscord | <pcarrier> can't repro so far |
04:34:30 | FromDiscord | <pcarrier> (edit) "can't repro ... so" added "my problem in another project" |
04:34:50 | FromDiscord | <ElegantBeouf> were you always using `nimble build` to make it? |
04:35:10 | FromDiscord | <pcarrier> yup |
04:35:57 | FromDiscord | <ElegantBeouf> Odd |
04:40:18 | FromDiscord | <pcarrier> the code in question: https://github.com/pcarrier/form/blob/cheerp/src/formicid.nim |
04:40:27 | FromDiscord | <pcarrier> nothing emitted for evalSTOR |
04:40:50 | FromDiscord | <ElegantBeouf> you omitted `dynlib` |
04:41:09 | FromDiscord | <pcarrier> right now yes, a minute ago no 🙂 |
04:41:34 | FromDiscord | <pcarrier> added |
04:44:46 | FromDiscord | <ElegantBeouf> You didnt pop the headers |
04:44:52 | FromDiscord | <pcarrier> ah? |
04:44:54 | FromDiscord | <ElegantBeouf> If you supply a header Nim does not import code |
04:45:11 | FromDiscord | <ElegantBeouf> `push header` does not say "Include this header" it says "add this header to any type defs here" |
04:45:26 | FromDiscord | <pcarrier> alrighty, how do I include instead sorry? |
04:47:02 | FromDiscord | <ElegantBeouf> That should be more correct |
04:47:02 | FromDiscord | <ElegantBeouf> sent a code paste, see https://play.nim-lang.org/#ix=4Jne |
04:48:30 | FromDiscord | <pcarrier> many thanks, testing |
05:35:56 | FromDiscord | <pcarrier> K, I think I've gone through most things |
05:36:48 | FromDiscord | <pcarrier> unfortunately Cheerp doesn't seem to have a reasonably efficient way to pass strings around like emscripten, which reads/writes heaps and strings from tight loops JS |
05:46:39 | * | redj joined #nim |
05:58:18 | * | azimut quit (Ping timeout: 256 seconds) |
05:58:28 | * | advesperacit joined #nim |
06:11:23 | * | rockcavera quit (Remote host closed the connection) |
06:15:30 | FromDiscord | <pcarrier> so back to emscripten. looks like I need to free the cstring I receive as an argument |
06:15:38 | FromDiscord | <pcarrier> can I ask the nim GC to take ownership or some such? |
06:16:53 | FromDiscord | <pcarrier> (edit) "ask the nim GC to take ownership or some such?" => "make sure my code disposes of a string received as an argument?" |
06:17:07 | FromDiscord | <pcarrier> (edit) "can I make sure my code ... disposes" added "and/or Nim's GC" |
06:34:52 | * | redj quit (Ping timeout: 248 seconds) |
06:35:37 | * | redj joined #nim |
07:19:09 | FromDiscord | <Chronos [She/Her]> Hm, if I want to make a lot of requests and I want to do multiple at a time, would threadpool + httpclient be what I should use? From the posts about it on the forum, seems like there's issues with memory safety bc of the global ssl context |
07:21:04 | FromDiscord | <Chronos [She/Her]> Maybe using an async client would be better for this actually |
07:23:10 | FromDiscord | <Elegantbeef> If you're IO bound you need to use async or similar |
07:28:59 | FromDiscord | <Chronos [She/Her]> Good to know |
07:29:05 | * | redj quit (Read error: Connection reset by peer) |
07:29:08 | * | redj_ joined #nim |
07:38:55 | * | redj_ quit (Read error: Connection reset by peer) |
07:39:04 | FromDiscord | <pcarrier> any idea why my stack would keep growing in emscripten wasm? |
07:39:30 | * | redj joined #nim |
07:39:40 | FromDiscord | <pcarrier> it's perfectly reproducible, see console in https://formic.id/ ; shrinking the stack size makes the problem happen much faster (now in a few seconds with 4K of stack) |
07:41:57 | FromDiscord | <pcarrier> does Nim do some magic with the C stack? |
07:42:25 | FromDiscord | <pcarrier> (edit) "does Nim do some magic with the C stack? ... " added "something must be happening…" |
07:45:17 | FromDiscord | <Elegantbeef> Nope it doesnt do any magic |
07:45:53 | FromDiscord | <pcarrier> well, I'm at a loss. that stack keeps shrinking over invocations |
07:46:11 | FromDiscord | <Elegantbeef> Not that it'll help here but will note you should have a `proc NimMain() {.importc, cdecl.}` and `once: NimMain()` |
07:46:30 | FromDiscord | <Elegantbeef> Not that it matters here but it does call all top level code which can be important in the future |
07:47:46 | FromDiscord | <Elegantbeef> that `cast[string]` is pretty suspicious, there is a `parseHex` inside `std/parseutils` that takes a `openArray[char]` |
07:48:56 | FromDiscord | <pcarrier> hmmm doing the proc `NimMain()` leads to a stack overflow upon load |
07:49:15 | FromDiscord | <pcarrier> sent a code paste, see https://play.nim-lang.org/#ix=4JnQ |
07:49:27 | FromDiscord | <pcarrier> yup that creates a recursion without termination |
07:50:01 | FromDiscord | <Elegantbeef> How did you call it? |
07:50:23 | FromDiscord | <pcarrier> sent a code paste, see https://play.nim-lang.org/#ix=4JnR |
07:50:48 | FromDiscord | <Elegantbeef> I meant wrapping it with a `once: ` in your entry proc |
07:50:49 | FromDiscord | <Elegantbeef> the eval |
07:51:05 | FromDiscord | <Elegantbeef> That NimMain shouldnt even run, unless the JS wasm calls a init proc |
07:51:15 | FromDiscord | <Elegantbeef> Well web wasm |
07:51:21 | FromDiscord | <Elegantbeef> Ironically I've never used wasm in browser |
07:51:26 | FromDiscord | <pcarrier> thanks |
07:51:54 | FromDiscord | <Elegantbeef> If toplevel code runs that means your runtime calls `NimMain` indirectly and my suggestions was redundant |
07:51:54 | FromDiscord | <pcarrier> looks like NimMain solved it |
07:52:01 | FromDiscord | <pcarrier> wait, I grew everything |
07:52:24 | FromDiscord | <pcarrier> nope, no change 🙂 |
07:53:06 | FromDiscord | <Elegantbeef> Like I said it wouldn't change it. |
07:53:10 | FromDiscord | <Elegantbeef> I personally get an index error |
07:54:07 | FromDiscord | <Elegantbeef> 22030 errors with an index error |
07:55:16 | FromDiscord | <pcarrier> pushed your suggestions |
07:55:33 | FromDiscord | <pcarrier> (edit) "suggestions" => "suggestions, thanks" |
07:56:14 | FromDiscord | <Elegantbeef> again that `once: ` should be inside `eval_stor` |
07:56:18 | FromDiscord | <Elegantbeef> at top level it does not make sense |
07:56:21 | FromDiscord | <pcarrier> oh. thanks. |
07:56:27 | FromDiscord | <Elegantbeef> But you also indicated it's called at top level |
07:56:31 | FromDiscord | <Elegantbeef> So it's likely redundant |
07:57:05 | FromDiscord | <Elegantbeef> Are you using `-d:useMalloc`? |
07:57:12 | FromDiscord | <pcarrier> yup |
07:57:30 | FromDiscord | <pcarrier> tried without too |
07:58:04 | FromDiscord | <pcarrier> (edit) "too" => "too, same result" |
07:58:08 | FromDiscord | <pcarrier> (edit) "result" => "failure" |
08:03:57 | FromDiscord | <Elegantbeef> Remove `danger` |
08:05:02 | FromDiscord | <pcarrier> replaced it with release |
08:05:23 | FromDiscord | <pcarrier> similar outcome. |
08:05:45 | FromDiscord | <Elegantbeef> Should be the same outcome but give more diagnostics |
08:05:52 | FromDiscord | <Elegantbeef> Assuming you remove the `stacktrace:off` and other errors |
08:06:17 | FromDiscord | <Elegantbeef> Atleast if the error is inside the wasm |
08:06:35 | FromDiscord | <pcarrier> would Nim detect a stack leak though? |
08:07:16 | FromDiscord | <pcarrier> removed `stacktrace:off`, nothing more |
08:07:25 | FromDiscord | <Elegantbeef> It wouldnt detect a stack leak of course |
08:07:34 | FromDiscord | <pcarrier> well, the problem is a stack leak |
08:08:08 | FromDiscord | <Elegantbeef> There's nothing in the Nim code to cause any memory leak |
08:08:17 | FromDiscord | <pcarrier> agreed 🙂 |
08:08:40 | FromDiscord | <Elegantbeef> The Nim isnt even recursive! 😄 |
08:16:35 | * | beholders_eye joined #nim |
08:36:53 | FromDiscord | <demotomohiro> What does "stack leak" mean? |
08:49:44 | FromDiscord | <Elegantbeef> I assume it's the stack grows too much for the wasm VM |
08:50:13 | FromDiscord | <Elegantbeef> Leaking in that for some reason there is no reclimation of the memory |
08:50:19 | FromDiscord | <Elegantbeef> Though I do not recall WASM's impl |
09:19:05 | * | JessieBroke quit (Remote host closed the connection) |
09:19:48 | FromDiscord | <demotomohiro> That sounds like, on wasm, when stack overflow happened, that stack memory got leaked?↵I don't know about wasm, but when you build Nim code with C backend with default option, stack overflow is detected and the program quits. |
09:58:36 | FromDiscord | <0ffh> In reply to @.aingel. "Is this really true?": Okay, I checked my memory and dug out some old Matlab code from work for parsing XML, so no self-closing tags, as you said.↵It weighs in at ~60 LOC, but it uses a pre-made tokenizer which is another ~60 LOC.↵That said, I'm sure the library you mentioned does tons more than my little parser, on top of HTML's idiosyncracies like self-closing tags. |
10:36:05 | NimEventer | New Nimble package! fftr - The fastest Fourier transform in the Rhein (so far), see https://github.com/arnetheduck/nim-fftr |
10:51:58 | * | azimut joined #nim |
12:15:02 | * | beholders_eye quit (Ping timeout: 255 seconds) |
12:15:23 | NimEventer | New thread by Aria_Forgetful: Using return value of a procedure as an argument for a different procedure, see https://forum.nim-lang.org/t/10555 |
12:21:39 | * | derpydoo joined #nim |
12:27:05 | * | beholders_eye joined #nim |
12:33:38 | FromDiscord | <nnsee> In reply to @NimEventer "New thread by Aria_Forgetful:": what? this confuses me |
12:45:32 | FromDiscord | <Chronos [She/Her]> Must be doing something funky for that to happen honestly |
12:46:08 | FromDiscord | <Chronos [She/Her]> Or `x` doesn't actually accept a uint |
12:46:42 | FromDiscord | <ieltan> "i have type mismatch but i wont give you the type signature, help me out" |
12:46:47 | FromDiscord | <ieltan> lol |
13:09:43 | FromDiscord | <Phil> In reply to @nnsee "what? this confuses me": They provided more code |
13:09:59 | FromDiscord | <Phil> Overall she wants to mutate the return value of a proc without assigning it to a variable anywhere |
13:10:47 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4Jp9 |
13:12:02 | Amun-Ra | hmm |
13:12:12 | Amun-Ra | Phil: 502 |
13:12:22 | FromDiscord | <Phil> 502? |
13:12:34 | Amun-Ra | I mean I see bad gateway |
13:12:43 | FromDiscord | <Phil> Where? What? |
13:12:47 | FromDiscord | <Phil> Context! |
13:12:53 | Amun-Ra | play.nim-lang.org |
13:13:28 | FromDiscord | <Phil> Yeap, harddrive full |
13:13:48 | Amun-Ra | oh |
13:14:37 | arkanoid | is there a reason why std/atomics depends on CPP when C11 atomics exists? https://en.cppreference.com/w/c/atomic |
13:14:46 | FromDiscord | <kcvinker5420> sent a code paste, see https://play.nim-lang.org/#ix=4Jpc |
13:15:51 | FromDiscord | <nnsee> yes |
13:15:56 | Amun-Ra | arkanoid: it doesn't |
13:16:25 | FromDiscord | <Phil> In reply to @Amun-Ra "oh": Give me a bit, I'll see what I can do |
13:16:36 | Amun-Ra | arkanoid: https://github.com/nim-lang/Nim/blob/devel/lib/pure/concurrency/atomics.nim#L167-L173 |
13:17:43 | Amun-Ra | code after line 54 is for cpp backend, when it's on |
13:21:43 | arkanoid | not sure why, I didn't saw that switch before. Sorry for bothering |
13:22:29 | Amun-Ra | no worries |
13:26:25 | FromDiscord | <Phil> In reply to @Amun-Ra "I mean I see": Hmm I started a process and informed others, though with my current level of knowledge I can't seem to get it fully back up and running.↵The frontend is available, merely the backend is entirely dead |
14:41:25 | * | rockcavera joined #nim |
15:05:08 | FromDiscord | <kcvinker5420> sent a code paste, see https://play.nim-lang.org/#ix=4Jq1 |
15:05:09 | FromDiscord | <Phil> Alrighty, found out what's wrong, currently rebuilding images, should be up in a bit, I'll let you guys know |
15:06:51 | FromDiscord | <Phil> In reply to @kcvinker5420 "I got the result": Ident aka IdentNodes are something you can create via `newIdentNode(<nameOfIdentifierAsString>)` |
15:07:13 | FromDiscord | <Phil> IdentNodes are basically nothng other than kind of variable/fieldname kind of thing.↵They define that a symbol exists |
15:07:28 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4Jq2 |
15:07:43 | FromDiscord | <kcvinker5420> I want to get the ident of a function. Which is a prameter of my macro |
15:08:28 | FromDiscord | <Phil> The above generates `result = <resultType>()` |
15:08:28 | FromDiscord | <kcvinker5420> @Phil, in this example, you used "result". But I want to use the function name |
15:08:49 | FromDiscord | <Phil> Yeah, the above is just an example on how you generate identNodes, it's straight from the mapster project. |
15:08:57 | FromDiscord | <Phil> (edit) "project." => "package." |
15:08:59 | FromDiscord | <kcvinker5420> Oh I see |
15:09:19 | FromDiscord | <Phil> As you can see, it just takes a string and declares "There's a symbol with the name of this string out there" |
15:10:00 | FromDiscord | <Phil> Note that you can also always use dumpAstGen 😛 |
15:10:12 | FromDiscord | <Phil> (Though Beef will not like you if you do it, it's like chaining sequtils operators) |
15:10:14 | FromDiscord | <kcvinker5420> Oh, great. Thanks |
15:10:49 | FromDiscord | <Phil> See if that approach works for you, but also check if you can maybe also use quote do or the like |
15:11:02 | FromDiscord | <Phil> As quote do stuff is infinitely more readable |
15:11:20 | FromDiscord | <kcvinker5420> Oh, Okay. Let me check that |
15:35:57 | * | alphacentauri quit (Quit: WeeChat 4.1.0) |
15:42:23 | FromDiscord | <Phil> Man, rebuilding images eats time |
15:49:37 | FromDiscord | <kcvinker5420> sent a code paste, see https://play.nim-lang.org/#ix=4Jqg |
15:51:51 | FromDiscord | <Phil> A statement list is basically just a list of lines, a code-block you could say |
15:52:16 | FromDiscord | <Phil> Just make a statement list where fn is the first node and add the assignment node after |
15:53:02 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4Jqi |
15:53:32 | FromDiscord | <Phil> I haven't tried this out, so no guarantee this code works 1:1 like this |
15:53:32 | FromDiscord | <kcvinker5420> Oh I see. Thanks. Let me try |
15:53:40 | FromDiscord | <Phil> But that's the principle |
15:53:41 | FromDiscord | <kcvinker5420> No probs |
15:53:48 | FromDiscord | <kcvinker5420> Oky |
15:55:39 | FromDiscord | <kcvinker5420> @Phil , Yeah, it worked ! |
15:56:13 | FromDiscord | <Phil> Sidenote:↵You may want to validate that evt and fn are the node-kinds you expect in order to avoid bugs |
15:56:39 | FromDiscord | <Phil> If you want to keep writing macros via nodes that is |
15:57:22 | FromDiscord | <kcvinker5420> Oh, okay |
15:58:23 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4Jql |
15:59:38 | FromDiscord | <Phil> This is a problem you don't have with stuff like "quote do" as you don't code with NimNodes, but that has its own limitations (I think? Beef might know more there, I never got that to do exactly what I wanted) |
16:00:41 | FromDiscord | <kcvinker5420> Well, this was my first successful macro. I didn't try `quote do` yet. |
16:01:08 | FromDiscord | <Phil> Check, is it slowly clicking on how you're basically glueing words together to form lines of codes 😄 ? |
16:02:29 | FromDiscord | <kcvinker5420> In reply to @isofruit "Check, is it slowly": Yup. It's really fun |
16:34:06 | * | azimut quit (Ping timeout: 256 seconds) |
16:36:06 | NimEventer | New thread by lou15b: What is the need for "GC safe" when using ORC/ARC?, see https://forum.nim-lang.org/t/10556 |
16:45:07 | * | xet7 joined #nim |
16:45:16 | * | beholders_eye quit (Quit: WeeChat 3.6) |
16:51:02 | * | junaid_ joined #nim |
17:32:40 | FromDiscord | <Phil> Wow, that poor server really is doing some work rebuilding those images, it's been 2.5h... may still take a while for the playground to get back up |
18:44:25 | FromDiscord | <JJ> In reply to @Elegantbeef "Case statement macros do": :0 thanks a bunch beef |
18:45:48 | FromDiscord | <JJ> sent a code paste, see https://play.nim-lang.org/#ix=4JqS |
18:46:01 | FromDiscord | <JJ> (can generate it manually ofc but it was a surprising little edge case) |
18:47:21 | FromDiscord | <Chronos [She/Her]> In reply to @isofruit "Wow, that poor server": Does the playground need a rewrite or something? |
18:53:00 | FromDiscord | <Phil> Nah, building dozens of Nim docker images just takes a while if you do it on a server with one thread |
18:53:21 | FromDiscord | <Phil> Thread mind you, not core |
18:54:54 | FromDiscord | <Chronos [She/Her]> Ah |
18:55:04 | FromDiscord | <Chronos [She/Her]> Can't you delegate the work to another service? |
18:56:20 | FromDiscord | <Phil> Nope. I maybe could build the images locally but I've got no desire to experiment with changing the workflow |
18:56:46 | FromDiscord | <Phil> Particularly as this generally is a rare operation |
19:01:31 | * | alphacentauri joined #nim |
19:03:34 | FromDiscord | <JJ> `expandMacros` seems to be failing to dump anything for my macro that expands to having a syntax error. is that normal behavior? if so, how do i debug this? |
19:12:13 | FromDiscord | <Chronos [She/Her]> In reply to @isofruit "Nope. I maybe could": Fair |
19:12:53 | * | junaid_ quit (Remote host closed the connection) |
19:36:48 | FromDiscord | <Chronos [She/Her]> Oh does anyone know if the JS backend supports httpclient? |
19:37:42 | * | xet7 quit (Quit: Leaving) |
19:38:45 | FromDiscord | <Chronos [She/Her]> That is a no, from a quick test |
20:03:03 | FromDiscord | <Elegantbeef> Of course not `quote` and `genast` need to be able to parse it↵(@JJ) |
20:03:11 | FromDiscord | <Elegantbeef> `echo result.repr`↵(@JJ) |
20:07:04 | FromDiscord | <patz3r.eth> Can anyone point me to instructions on how to compile a binary for a Raspberry Pi (running Raspbian) from MacOS? I saw one post saying they used the Zig compiler, which is an interesting mashup. |
20:08:18 | FromDiscord | <patz3r.eth> I found this. Still the best way? Seems complicated. https://www.kitware.com/cross-compiling-for-raspberry-pi/ |
20:10:43 | FromDiscord | <Phil> In reply to @patz3r.eth "I found this. Still": I have no idea about how you compile to raspberry pi.↵I can hand you easy instructions for using the zig compiler though if you know how to use the zig compiler to compiler for the pi |
20:10:55 | FromDiscord | <Phil> (edit) "compiler" => "compile" |
20:12:13 | FromDiscord | <patz3r.eth> I guess the idea would be to compile nim to C, and then use the Zig compiler to cross-compile to Raspberry Pi. |
20:13:54 | FromDiscord | <Elegantbeef> You either use zig or use a gcc that targets arm64 |
20:14:02 | FromDiscord | <Phil> In reply to @patz3r.eth "I guess the idea": You can use the zig compiler immediately, its fairly easy |
20:14:22 | FromDiscord | <Elegantbeef> So when you setup zig you have to pass the target triple for arm64 |
20:15:03 | FromDiscord | <Phil> https://github.com/enthus1ast/zigcc↵Package to trivialize it.↵Here where it originated from.↵https://stackoverflow.com/questions/73345643/how-to-use-the-zig-compiler-in-order-to-compile-nim-code |
20:15:46 | FromDiscord | <patz3r.eth> Cool - thanks for the links. |
21:01:12 | FromDiscord | <JJ> In reply to @Elegantbeef "`echo result.repr` (<@572634810917322773>)": oh of course, i keep forgetting that exists. ty |
21:07:52 | FromDiscord | <Chronos [She/Her]> Is there a way to wait for multiple futures to be completed at once and get the result from that? |
21:08:24 | FromDiscord | <Chronos [She/Her]> While I could separate the logic so it's all done at once, it all has to add data to the same global object anyway, which would probably complicate things a bit |
21:21:45 | * | advesperacit quit () |
21:29:15 | FromDiscord | <JJ> okie. i think i am thoroughly disillusioned with `quote do` |
21:32:11 | FromDiscord | <JJ> not loving that you can sneakily inject the wrong ast into it even when said ast was formed from `quote do`. i suppose that's reasonable but annoying |
21:34:36 | FromDiscord | <JJ> any chance you can inject multiple NimNodes into one unquoted section with `quote do`? ex. `quote do: if 'this': true else: false` (where `'` are backticks) |
21:34:57 | FromDiscord | <JJ> (edit) removed "ex. `quote do: if 'this': true else: false` (where `'` are backticks)" |
21:35:59 | FromDiscord | <JJ> sent a code paste, see https://play.nim-lang.org/#ix=4Jry |
21:42:10 | FromDiscord | <Elegantbeef> Nope |
21:42:55 | FromDiscord | <Elegantbeef> You're using quote do like a maniac anyway |
21:43:42 | FromDiscord | <Elegantbeef> I'm of course mostly kidding |
21:44:43 | FromDiscord | <Phil> In reply to @Elegantbeef "You're using quote do": See, if beef is gonna disapprove anyway, you might as well make macros dumpAstGen style! |
21:45:00 | FromDiscord | <Elegantbeef> Well not really |
21:45:17 | FromDiscord | <Elegantbeef> In this case you pretty much have to use dumpast style |
21:45:32 | FromDiscord | <Elegantbeef> Though I might question why you're using tuple destructuring |
21:48:50 | FromDiscord | <JJ> In reply to @Elegantbeef "Though I might question": yeah. i think it's turned out to be a bad approach. `let (a,) = ...`, `let (a, b) = ...`, `let a = ...` all have very different AST representations as it turns out |
21:49:23 | FromDiscord | <Elegantbeef> Right you making the ast more complicated for no reason |
21:49:28 | FromDiscord | <Elegantbeef> It's just a chain of `let x = y` |
21:50:01 | FromDiscord | <Elegantbeef> the first two are identical though |
21:50:42 | FromDiscord | <JJ> oh god they are. then what is this bug i've hit?? weird |
21:53:09 | FromDiscord | <ElegantBeouf> Bridge moment 😄 |
21:53:24 | FromDiscord | <ElegantBeouf> Give it 2 minutes and the message will appear |
21:53:28 | FromDiscord | <ElegantBeouf> Or look at matrix and see it now |
21:53:40 | FromDiscord | <Elegantbeef> `nnkLet.newTree(nnkVarTuple.newTree(idents & @[newEmptyNode(), value]))` 😄 |
22:00:23 | FromDiscord | <nasuray> In reply to @isofruit "https://github.com/enthus1ast/zigcc Package to triv": @patz3r.eth (shameless plug) to trivialize it even more https://github.com/daylinmorgan/forge |
22:04:31 | * | koltrast quit (Ping timeout: 264 seconds) |
22:20:47 | FromDiscord | <JJ> ty beef 😄 |
22:21:23 | FromDiscord | <JJ> ...yeah, also gonna totally abandon quoting for now, i think. i'm constructing things in some weird way that's absolutely borking the ast |
22:29:07 | FromDiscord | <girvo> sent a code paste, see https://play.nim-lang.org/#ix=4JrF |
22:29:21 | FromDiscord | <girvo> Now with v2 it appears to not work that way, but I don't quite understand the nimble develop README explanation |
22:29:46 | FromDiscord | <sOkam! 🫐> In reply to @girvo "Now with v2 it": im not sure anybody understands it |
22:30:07 | FromDiscord | <girvo> oh good lol |
22:30:07 | FromDiscord | <sOkam! 🫐> i personally moved to atlas for replacing the local development workflow, its superior by a lot |
22:30:18 | FromDiscord | <girvo> nimble develop -g doesn't appear to fix it either |
22:30:29 | FromDiscord | <girvo> Despite apparently having the previous global semantics |
22:30:30 | FromDiscord | <sOkam! 🫐> nimble develop has been borked for months, and no signs of ever getting fixed from what i can see |
22:30:34 | FromDiscord | <girvo> Fuck |
22:30:52 | FromDiscord | <girvo> Well that sucks. Aside from atlas, how do we replicate that workflow? |
22:30:57 | FromDiscord | <girvo> Or, simply, we can't? |
22:31:09 | FromDiscord | <sOkam! 🫐> In reply to @girvo "nimble develop -g doesn't": yeah, i tried that too, and resolved to literally ditch nimble altogether, except for the external user interface of the lib |
22:31:36 | FromDiscord | <sOkam! 🫐> In reply to @girvo "Or, simply, we can't?": i have no clue, i tried and failed, and atlas worked fairly easily. maybe someone else knows |
22:31:52 | FromDiscord | <girvo> Cheers! Glad to know my teammate isn't losing the plot haha |
22:32:58 | FromDiscord | <nasuray> In reply to @girvo "Or, simply, we can't?": The simplest thing is to do exactly what atlas does yourself. Just write a `nim.cfg` with relative paths. `--path:"../../server"` |
22:33:18 | FromDiscord | <girvo> Oh thats useful! |
22:33:28 | FromDiscord | <girvo> This is in a mono-repo, in a devcontainer with known paths |
22:33:32 | FromDiscord | <girvo> (edit) "This is in a mono-repo, in a devcontainer with known paths ... " added "(always)" |
22:33:46 | FromDiscord | <nasuray> In reply to @girvo "This is in a": Even better lol |
22:34:04 | FromDiscord | <girvo> It's why I was so confused as to why nimble develop stopped working when we upgraded to v2 haha |
22:37:26 | FromDiscord | <Phil> I've been using --path for a while, it works well! |
23:10:41 | FromDiscord | <girvo> How's `--path` work? Do I have two `--path` lines in the `nim.cfg` in the dependency (lithium_message) pointing to server and firmware? Or the other way around: firmware and server have a --path that points to lithium_message? |
23:22:11 | FromDiscord | <nasuray> It's essentially a compiler flag so for the module you plan to compile add the deps to the path. FWIW nimble basically does the same thing when you run `nimble build` but it the path it adds is to the installation it knows about: `~/. nimble/pkg2/package-name-hash/` |
23:25:30 | FromDiscord | <Elegantbeef> It's not too disimilar to `-I` for gcc |
23:27:25 | * | azimut joined #nim |
23:32:31 | * | lumo_e joined #nim |
23:58:16 | FromDiscord | <girvo> Neat 🙂 |