<< 19-10-2023 >>

00:08:01FromDiscord<0ffh> So let's say XML/XHTML, just to be on the safe side.
00:10:23FromDiscord<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:04FromDiscord<JJ> many questions about some case statement macros
00:59:21FromDiscord<JJ> sent a code paste, see https://play.nim-lang.org/#ix=4Jmy
01:01:38FromDiscord<JJ> sent a code paste, see https://play.nim-lang.org/#ix=4JmA
01:02:10FromDiscord<JJ> i think there's something subtle (or maybe blatantly obvious) i'm missing
01:23:54FromDiscord<Elegantbeef> Case statement macros do not use that syntax JJ
01:24:24FromDiscord<Elegantbeef> `macro `case`(n: tuple): untyped =`
01:24:34FromDiscord<Elegantbeef> @JJ
01:24:36FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4JmD
01:26:36FromDiscord<Elegantbeef> Is what you want for the latter
01:26:40FromDiscord<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:27FromDiscord<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:45FromDiscord<michaelb.eth> (edit) "`defined(gcc)`?" => "`defined(gcc)`, etc.?"
02:23:17FromDiscord<leorize> it's dependent on the --cc option
02:23:24FromDiscord<leorize> which is set to gcc by default
03:01:36*beholders_eye quit (Ping timeout: 258 seconds)
04:04:17FromDiscord<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:30FromDiscord<Elegantbeef> `dynlib`
04:06:02FromDiscord<pcarrier> sent a code paste, see https://play.nim-lang.org/#ix=4Jn4
04:06:05FromDiscord<pcarrier> and it still disappears from my C++ file
04:07:27FromDiscord<Elegantbeef> Are you sure?
04:07:48FromDiscord<pcarrier> yes?
04:08:02FromDiscord<pcarrier> yes.
04:08:40FromDiscord<pcarrier> sent a code paste, see https://play.nim-lang.org/#ix=4Jn5
04:10:28FromDiscord<Elegantbeef> Nim does not even do DCE itself
04:10:56FromDiscord<pcarrier> well, doesn't seem to emit C++ code for my proc
04:11:09FromDiscord<Elegantbeef> Did you import the module?
04:11:09FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4Jn6
04:11:20FromDiscord<pcarrier> import which module?
04:11:30FromDiscord<Elegantbeef> The one that declares the proc
04:12:04FromDiscord<pcarrier> I have `bin = @[filename]` where `src/filename.nim` declares `eval_stor`
04:12:30FromDiscord<pcarrier> (edit) "@[filename]`" => "@["filename"]`" | "`eval_stor`" => "`eval_stor`, so nothing to import?"
04:12:56FromDiscord<Elegantbeef> Try `extern` then
04:13:11FromDiscord<Elegantbeef> If this is not a dynamic library there is no reason to compile an unused proc in
04:13:44FromDiscord<pcarrier> I'm compiling for wasm, it makes sense here
04:13:54FromDiscord<pcarrier> (edit) "wasm," => "wasm using cheerp,"
04:13:58FromDiscord<Elegantbeef> It doesnt really
04:14:20FromDiscord<Elegantbeef> There are mechanisms in the compiler to keep it alive
04:14:25FromDiscord<pcarrier> I want it to be exposed to JS, that's how it's done
04:14:31FromDiscord<Elegantbeef> I know
04:14:33FromDiscord<pcarrier> (edit) "I want it to be exposed to JS, that's how it's done ... " added "on the C++ side"
04:14:46FromDiscord<pcarrier> OK, so how do I keep it alive before the C++ compilation phase? 😄
04:15:11FromDiscord<Elegantbeef> Are you using emscripten?
04:15:14FromDiscord<pcarrier> nope, cheerp
04:15:27FromDiscord<pcarrier> emscripten was a world of pain, I'm giving the alternative a try
04:15:38FromDiscord<Elegantbeef> Emscripten has a mechanism to keep procs alive iirc
04:15:51FromDiscord<Elegantbeef> No clue about cheerp
04:16:33FromDiscord<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:45FromDiscord<pcarrier> (edit) "proc" => "proc, nothing cheerp can do about that"
04:17:15FromDiscord<Elegantbeef> Right Nim actually does basic DCE, forgot about that
04:17:16FromDiscord<Elegantbeef> `exportc, dynlib` should cause it to generate
04:17:25FromDiscord<pcarrier> and it doesn't
04:21:05FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4Jn6
04:21:07FromDiscord<Elegantbeef> I don't know what to say
04:21:09FromDiscord<Elegantbeef> It generates it here
04:23:22FromDiscord<pcarrier> sent a code paste, see https://play.nim-lang.org/#ix=4Jn7
04:23:37FromDiscord<Elegantbeef> Just to do a sanity check
04:23:41FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4Jn8
04:25:35FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4Jna
04:25:58FromDiscord<Elegantbeef> `-f` and `-c` are just to disregard cache and to Nim compile only
04:26:09FromDiscord<Elegantbeef> Just to make it clear that they're not influencing anything
04:26:19FromDiscord<Elegantbeef> I do not need a useless C++ compile error in my life
04:26:50FromDiscord<Elegantbeef> Even with `-d:release` it outputs it
04:26:57FromDiscord<Elegantbeef> So what's your `nim -v` and also OS?
04:28:01FromDiscord<pcarrier> sent a code paste, see https://play.nim-lang.org/#ix=4Jnb
04:28:52FromDiscord<ElegantBeouf> I hate that I can tell when the bridge dies
04:28:55FromDiscord<ElegantBeouf> Yea that's same as mee
04:28:57FromDiscord<ElegantBeouf> (edit) "mee" => "me"
04:29:16FromDiscord<ElegantBeouf> I'd suggest to replicate what I've done to ensure it works outside of your project
04:34:22FromDiscord<pcarrier> can't repro so far
04:34:30FromDiscord<pcarrier> (edit) "can't repro ... so" added "my problem in another project"
04:34:50FromDiscord<ElegantBeouf> were you always using `nimble build` to make it?
04:35:10FromDiscord<pcarrier> yup
04:35:57FromDiscord<ElegantBeouf> Odd
04:40:18FromDiscord<pcarrier> the code in question: https://github.com/pcarrier/form/blob/cheerp/src/formicid.nim
04:40:27FromDiscord<pcarrier> nothing emitted for evalSTOR
04:40:50FromDiscord<ElegantBeouf> you omitted `dynlib`
04:41:09FromDiscord<pcarrier> right now yes, a minute ago no 🙂
04:41:34FromDiscord<pcarrier> added
04:44:46FromDiscord<ElegantBeouf> You didnt pop the headers
04:44:52FromDiscord<pcarrier> ah?
04:44:54FromDiscord<ElegantBeouf> If you supply a header Nim does not import code
04:45:11FromDiscord<ElegantBeouf> `push header` does not say "Include this header" it says "add this header to any type defs here"
04:45:26FromDiscord<pcarrier> alrighty, how do I include instead sorry?
04:47:02FromDiscord<ElegantBeouf> That should be more correct
04:47:02FromDiscord<ElegantBeouf> sent a code paste, see https://play.nim-lang.org/#ix=4Jne
04:48:30FromDiscord<pcarrier> many thanks, testing
05:35:56FromDiscord<pcarrier> K, I think I've gone through most things
05:36:48FromDiscord<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:30FromDiscord<pcarrier> so back to emscripten. looks like I need to free the cstring I receive as an argument
06:15:38FromDiscord<pcarrier> can I ask the nim GC to take ownership or some such?
06:16:53FromDiscord<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:07FromDiscord<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:09FromDiscord<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:04FromDiscord<Chronos [She/Her]> Maybe using an async client would be better for this actually
07:23:10FromDiscord<Elegantbeef> If you're IO bound you need to use async or similar
07:28:59FromDiscord<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:04FromDiscord<pcarrier> any idea why my stack would keep growing in emscripten wasm?
07:39:30*redj joined #nim
07:39:40FromDiscord<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:57FromDiscord<pcarrier> does Nim do some magic with the C stack?
07:42:25FromDiscord<pcarrier> (edit) "does Nim do some magic with the C stack? ... " added "something must be happening…"
07:45:17FromDiscord<Elegantbeef> Nope it doesnt do any magic
07:45:53FromDiscord<pcarrier> well, I'm at a loss. that stack keeps shrinking over invocations
07:46:11FromDiscord<Elegantbeef> Not that it'll help here but will note you should have a `proc NimMain() {.importc, cdecl.}` and `once: NimMain()`
07:46:30FromDiscord<Elegantbeef> Not that it matters here but it does call all top level code which can be important in the future
07:47:46FromDiscord<Elegantbeef> that `cast[string]` is pretty suspicious, there is a `parseHex` inside `std/parseutils` that takes a `openArray[char]`
07:48:56FromDiscord<pcarrier> hmmm doing the proc `NimMain()` leads to a stack overflow upon load
07:49:15FromDiscord<pcarrier> sent a code paste, see https://play.nim-lang.org/#ix=4JnQ
07:49:27FromDiscord<pcarrier> yup that creates a recursion without termination
07:50:01FromDiscord<Elegantbeef> How did you call it?
07:50:23FromDiscord<pcarrier> sent a code paste, see https://play.nim-lang.org/#ix=4JnR
07:50:48FromDiscord<Elegantbeef> I meant wrapping it with a `once: ` in your entry proc
07:50:49FromDiscord<Elegantbeef> the eval
07:51:05FromDiscord<Elegantbeef> That NimMain shouldnt even run, unless the JS wasm calls a init proc
07:51:15FromDiscord<Elegantbeef> Well web wasm
07:51:21FromDiscord<Elegantbeef> Ironically I've never used wasm in browser
07:51:26FromDiscord<pcarrier> thanks
07:51:54FromDiscord<Elegantbeef> If toplevel code runs that means your runtime calls `NimMain` indirectly and my suggestions was redundant
07:51:54FromDiscord<pcarrier> looks like NimMain solved it
07:52:01FromDiscord<pcarrier> wait, I grew everything
07:52:24FromDiscord<pcarrier> nope, no change 🙂
07:53:06FromDiscord<Elegantbeef> Like I said it wouldn't change it.
07:53:10FromDiscord<Elegantbeef> I personally get an index error
07:54:07FromDiscord<Elegantbeef> 22030 errors with an index error
07:55:16FromDiscord<pcarrier> pushed your suggestions
07:55:33FromDiscord<pcarrier> (edit) "suggestions" => "suggestions, thanks"
07:56:14FromDiscord<Elegantbeef> again that `once: ` should be inside `eval_stor`
07:56:18FromDiscord<Elegantbeef> at top level it does not make sense
07:56:21FromDiscord<pcarrier> oh. thanks.
07:56:27FromDiscord<Elegantbeef> But you also indicated it's called at top level
07:56:31FromDiscord<Elegantbeef> So it's likely redundant
07:57:05FromDiscord<Elegantbeef> Are you using `-d:useMalloc`?
07:57:12FromDiscord<pcarrier> yup
07:57:30FromDiscord<pcarrier> tried without too
07:58:04FromDiscord<pcarrier> (edit) "too" => "too, same result"
07:58:08FromDiscord<pcarrier> (edit) "result" => "failure"
08:03:57FromDiscord<Elegantbeef> Remove `danger`
08:05:02FromDiscord<pcarrier> replaced it with release
08:05:23FromDiscord<pcarrier> similar outcome.
08:05:45FromDiscord<Elegantbeef> Should be the same outcome but give more diagnostics
08:05:52FromDiscord<Elegantbeef> Assuming you remove the `stacktrace:off` and other errors
08:06:17FromDiscord<Elegantbeef> Atleast if the error is inside the wasm
08:06:35FromDiscord<pcarrier> would Nim detect a stack leak though?
08:07:16FromDiscord<pcarrier> removed `stacktrace:off`, nothing more
08:07:25FromDiscord<Elegantbeef> It wouldnt detect a stack leak of course
08:07:34FromDiscord<pcarrier> well, the problem is a stack leak
08:08:08FromDiscord<Elegantbeef> There's nothing in the Nim code to cause any memory leak
08:08:17FromDiscord<pcarrier> agreed 🙂
08:08:40FromDiscord<Elegantbeef> The Nim isnt even recursive! 😄
08:16:35*beholders_eye joined #nim
08:36:53FromDiscord<demotomohiro> What does "stack leak" mean?
08:49:44FromDiscord<Elegantbeef> I assume it's the stack grows too much for the wasm VM
08:50:13FromDiscord<Elegantbeef> Leaking in that for some reason there is no reclimation of the memory
08:50:19FromDiscord<Elegantbeef> Though I do not recall WASM's impl
09:19:05*JessieBroke quit (Remote host closed the connection)
09:19:48FromDiscord<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:36FromDiscord<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:05NimEventerNew 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:23NimEventerNew 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:38FromDiscord<nnsee> In reply to @NimEventer "New thread by Aria_Forgetful:": what? this confuses me
12:45:32FromDiscord<Chronos [She/Her]> Must be doing something funky for that to happen honestly
12:46:08FromDiscord<Chronos [She/Her]> Or `x` doesn't actually accept a uint
12:46:42FromDiscord<ieltan> "i have type mismatch but i wont give you the type signature, help me out"
12:46:47FromDiscord<ieltan> lol
13:09:43FromDiscord<Phil> In reply to @nnsee "what? this confuses me": They provided more code
13:09:59FromDiscord<Phil> Overall she wants to mutate the return value of a proc without assigning it to a variable anywhere
13:10:47FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4Jp9
13:12:02Amun-Rahmm
13:12:12Amun-RaPhil: 502
13:12:22FromDiscord<Phil> 502?
13:12:34Amun-RaI mean I see bad gateway
13:12:43FromDiscord<Phil> Where? What?
13:12:47FromDiscord<Phil> Context!
13:12:53Amun-Raplay.nim-lang.org
13:13:28FromDiscord<Phil> Yeap, harddrive full
13:13:48Amun-Raoh
13:14:37arkanoidis there a reason why std/atomics depends on CPP when C11 atomics exists? https://en.cppreference.com/w/c/atomic
13:14:46FromDiscord<kcvinker5420> sent a code paste, see https://play.nim-lang.org/#ix=4Jpc
13:15:51FromDiscord<nnsee> yes
13:15:56Amun-Raarkanoid: it doesn't
13:16:25FromDiscord<Phil> In reply to @Amun-Ra "oh": Give me a bit, I'll see what I can do
13:16:36Amun-Raarkanoid: https://github.com/nim-lang/Nim/blob/devel/lib/pure/concurrency/atomics.nim#L167-L173
13:17:43Amun-Racode after line 54 is for cpp backend, when it's on
13:21:43arkanoidnot sure why, I didn't saw that switch before. Sorry for bothering
13:22:29Amun-Rano worries
13:26:25FromDiscord<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:08FromDiscord<kcvinker5420> sent a code paste, see https://play.nim-lang.org/#ix=4Jq1
15:05:09FromDiscord<Phil> Alrighty, found out what's wrong, currently rebuilding images, should be up in a bit, I'll let you guys know
15:06:51FromDiscord<Phil> In reply to @kcvinker5420 "I got the result": Ident aka IdentNodes are something you can create via `newIdentNode(<nameOfIdentifierAsString>)`
15:07:13FromDiscord<Phil> IdentNodes are basically nothng other than kind of variable/fieldname kind of thing.↵They define that a symbol exists
15:07:28FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4Jq2
15:07:43FromDiscord<kcvinker5420> I want to get the ident of a function. Which is a prameter of my macro
15:08:28FromDiscord<Phil> The above generates `result = <resultType>()`
15:08:28FromDiscord<kcvinker5420> @Phil, in this example, you used "result". But I want to use the function name
15:08:49FromDiscord<Phil> Yeah, the above is just an example on how you generate identNodes, it's straight from the mapster project.
15:08:57FromDiscord<Phil> (edit) "project." => "package."
15:08:59FromDiscord<kcvinker5420> Oh I see
15:09:19FromDiscord<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:00FromDiscord<Phil> Note that you can also always use dumpAstGen 😛
15:10:12FromDiscord<Phil> (Though Beef will not like you if you do it, it's like chaining sequtils operators)
15:10:14FromDiscord<kcvinker5420> Oh, great. Thanks
15:10:49FromDiscord<Phil> See if that approach works for you, but also check if you can maybe also use quote do or the like
15:11:02FromDiscord<Phil> As quote do stuff is infinitely more readable
15:11:20FromDiscord<kcvinker5420> Oh, Okay. Let me check that
15:35:57*alphacentauri quit (Quit: WeeChat 4.1.0)
15:42:23FromDiscord<Phil> Man, rebuilding images eats time
15:49:37FromDiscord<kcvinker5420> sent a code paste, see https://play.nim-lang.org/#ix=4Jqg
15:51:51FromDiscord<Phil> A statement list is basically just a list of lines, a code-block you could say
15:52:16FromDiscord<Phil> Just make a statement list where fn is the first node and add the assignment node after
15:53:02FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4Jqi
15:53:32FromDiscord<Phil> I haven't tried this out, so no guarantee this code works 1:1 like this
15:53:32FromDiscord<kcvinker5420> Oh I see. Thanks. Let me try
15:53:40FromDiscord<Phil> But that's the principle
15:53:41FromDiscord<kcvinker5420> No probs
15:53:48FromDiscord<kcvinker5420> Oky
15:55:39FromDiscord<kcvinker5420> @Phil , Yeah, it worked !
15:56:13FromDiscord<Phil> Sidenote:↵You may want to validate that evt and fn are the node-kinds you expect in order to avoid bugs
15:56:39FromDiscord<Phil> If you want to keep writing macros via nodes that is
15:57:22FromDiscord<kcvinker5420> Oh, okay
15:58:23FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4Jql
15:59:38FromDiscord<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:41FromDiscord<kcvinker5420> Well, this was my first successful macro. I didn't try `quote do` yet.
16:01:08FromDiscord<Phil> Check, is it slowly clicking on how you're basically glueing words together to form lines of codes 😄 ?
16:02:29FromDiscord<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:06NimEventerNew 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:40FromDiscord<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:25FromDiscord<JJ> In reply to @Elegantbeef "Case statement macros do": :0 thanks a bunch beef
18:45:48FromDiscord<JJ> sent a code paste, see https://play.nim-lang.org/#ix=4JqS
18:46:01FromDiscord<JJ> (can generate it manually ofc but it was a surprising little edge case)
18:47:21FromDiscord<Chronos [She/Her]> In reply to @isofruit "Wow, that poor server": Does the playground need a rewrite or something?
18:53:00FromDiscord<Phil> Nah, building dozens of Nim docker images just takes a while if you do it on a server with one thread
18:53:21FromDiscord<Phil> Thread mind you, not core
18:54:54FromDiscord<Chronos [She/Her]> Ah
18:55:04FromDiscord<Chronos [She/Her]> Can't you delegate the work to another service?
18:56:20FromDiscord<Phil> Nope. I maybe could build the images locally but I've got no desire to experiment with changing the workflow
18:56:46FromDiscord<Phil> Particularly as this generally is a rare operation
19:01:31*alphacentauri joined #nim
19:03:34FromDiscord<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:13FromDiscord<Chronos [She/Her]> In reply to @isofruit "Nope. I maybe could": Fair
19:12:53*junaid_ quit (Remote host closed the connection)
19:36:48FromDiscord<Chronos [She/Her]> Oh does anyone know if the JS backend supports httpclient?
19:37:42*xet7 quit (Quit: Leaving)
19:38:45FromDiscord<Chronos [She/Her]> That is a no, from a quick test
20:03:03FromDiscord<Elegantbeef> Of course not `quote` and `genast` need to be able to parse it↵(@JJ)
20:03:11FromDiscord<Elegantbeef> `echo result.repr`↵(@JJ)
20:07:04FromDiscord<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:18FromDiscord<patz3r.eth> I found this. Still the best way? Seems complicated. https://www.kitware.com/cross-compiling-for-raspberry-pi/
20:10:43FromDiscord<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:55FromDiscord<Phil> (edit) "compiler" => "compile"
20:12:13FromDiscord<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:54FromDiscord<Elegantbeef> You either use zig or use a gcc that targets arm64
20:14:02FromDiscord<Phil> In reply to @patz3r.eth "I guess the idea": You can use the zig compiler immediately, its fairly easy
20:14:22FromDiscord<Elegantbeef> So when you setup zig you have to pass the target triple for arm64
20:15:03FromDiscord<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:46FromDiscord<patz3r.eth> Cool - thanks for the links.
21:01:12FromDiscord<JJ> In reply to @Elegantbeef "`echo result.repr` (<@572634810917322773>)": oh of course, i keep forgetting that exists. ty
21:07:52FromDiscord<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:24FromDiscord<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:15FromDiscord<JJ> okie. i think i am thoroughly disillusioned with `quote do`
21:32:11FromDiscord<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:36FromDiscord<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:57FromDiscord<JJ> (edit) removed "ex. `quote do: if 'this': true else: false` (where `'` are backticks)"
21:35:59FromDiscord<JJ> sent a code paste, see https://play.nim-lang.org/#ix=4Jry
21:42:10FromDiscord<Elegantbeef> Nope
21:42:55FromDiscord<Elegantbeef> You're using quote do like a maniac anyway
21:43:42FromDiscord<Elegantbeef> I'm of course mostly kidding
21:44:43FromDiscord<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:00FromDiscord<Elegantbeef> Well not really
21:45:17FromDiscord<Elegantbeef> In this case you pretty much have to use dumpast style
21:45:32FromDiscord<Elegantbeef> Though I might question why you're using tuple destructuring
21:48:50FromDiscord<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:23FromDiscord<Elegantbeef> Right you making the ast more complicated for no reason
21:49:28FromDiscord<Elegantbeef> It's just a chain of `let x = y`
21:50:01FromDiscord<Elegantbeef> the first two are identical though
21:50:42FromDiscord<JJ> oh god they are. then what is this bug i've hit?? weird
21:53:09FromDiscord<ElegantBeouf> Bridge moment 😄
21:53:24FromDiscord<ElegantBeouf> Give it 2 minutes and the message will appear
21:53:28FromDiscord<ElegantBeouf> Or look at matrix and see it now
21:53:40FromDiscord<Elegantbeef> `nnkLet.newTree(nnkVarTuple.newTree(idents & @[newEmptyNode(), value]))` 😄
22:00:23FromDiscord<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:47FromDiscord<JJ> ty beef 😄
22:21:23FromDiscord<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:07FromDiscord<girvo> sent a code paste, see https://play.nim-lang.org/#ix=4JrF
22:29:21FromDiscord<girvo> Now with v2 it appears to not work that way, but I don't quite understand the nimble develop README explanation
22:29:46FromDiscord<sOkam! 🫐> In reply to @girvo "Now with v2 it": im not sure anybody understands it
22:30:07FromDiscord<girvo> oh good lol
22:30:07FromDiscord<sOkam! 🫐> i personally moved to atlas for replacing the local development workflow, its superior by a lot
22:30:18FromDiscord<girvo> nimble develop -g doesn't appear to fix it either
22:30:29FromDiscord<girvo> Despite apparently having the previous global semantics
22:30:30FromDiscord<sOkam! 🫐> nimble develop has been borked for months, and no signs of ever getting fixed from what i can see
22:30:34FromDiscord<girvo> Fuck
22:30:52FromDiscord<girvo> Well that sucks. Aside from atlas, how do we replicate that workflow?
22:30:57FromDiscord<girvo> Or, simply, we can't?
22:31:09FromDiscord<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:36FromDiscord<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:52FromDiscord<girvo> Cheers! Glad to know my teammate isn't losing the plot haha
22:32:58FromDiscord<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:18FromDiscord<girvo> Oh thats useful!
22:33:28FromDiscord<girvo> This is in a mono-repo, in a devcontainer with known paths
22:33:32FromDiscord<girvo> (edit) "This is in a mono-repo, in a devcontainer with known paths ... " added "(always)"
22:33:46FromDiscord<nasuray> In reply to @girvo "This is in a": Even better lol
22:34:04FromDiscord<girvo> It's why I was so confused as to why nimble develop stopped working when we upgraded to v2 haha
22:37:26FromDiscord<Phil> I've been using --path for a while, it works well!
23:10:41FromDiscord<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:11FromDiscord<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:30FromDiscord<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:16FromDiscord<girvo> Neat 🙂