<< 07-02-2025 >>

00:14:14*pbsds356 joined #nim
00:14:37*pbsds35 quit (Read error: Connection reset by peer)
00:14:38*pbsds356 is now known as pbsds35
00:51:47FromDiscord<heysokam> In reply to @.bobbbob "another question, how do": you can't call any private symbol at all. but you can create a module called `private.nim` or similar, and store/export the symbols from there, so its clear that they are not meant to be part of the public api
00:52:24FromDiscord<heysokam> if you need multiple files, to avoid cyclics, the same could be done with a folder instead
00:54:46FromDiscord<heysokam> I figure you might also make the file that has private symbols runnable as a test file directly, so you can have tests for those symbols in the same file↵but I haven't done that myself in nim, so don't know how it would work. but it should be possible
00:55:43FromDiscord<heysokam> (edit) "might" => "could" | "directly, so" => "directly,↵so" | "the" => "that" | "file↵but" => "file without exporting them↵but"
01:11:08FromDiscord<nasuray> In reply to @.bobbbob "another question, how do": You can import it with {.all.} https://nim-lang.org/docs/manual_experimental.html#importing-private-symbols
01:59:14*rockcavera quit (Remote host closed the connection)
02:30:09*def-- joined #nim
02:30:35*def- quit (Read error: Connection reset by peer)
02:30:35*def-- is now known as def-
03:47:38*def- quit (Quit: -)
03:50:17*def- joined #nim
04:13:29*xet7 quit (Remote host closed the connection)
04:16:18*Jjp137 quit (Ping timeout: 268 seconds)
04:16:34FromDiscord<alarie25> hello everyone,
04:16:37FromDiscord<alarie25> quick stupid question
04:16:58FromDiscord<alarie25> how do i make the nim compuler output the executable to a specific directly
04:17:03FromDiscord<alarie25> (edit) "directly" => "directory"
04:18:24FromDiscord<Elegantbeef> https://nim-lang.org/docs/nimc.html#compiler-usage-commandminusline-switches flags are all here you're looking for `--outdir`
04:24:07FromDiscord<alarie25> ah ok,
04:24:12FromDiscord<alarie25> i couldnt find the compiler usage docs
04:24:13FromDiscord<alarie25> thanks
04:29:31*SchweinDeBurg quit (Quit: WeeChat 4.6.0-dev)
04:29:58*SchweinDeBurg joined #nim
04:40:35FromDiscord<lainlaylie> can we whip up an LLM bot trained on all the Nim docs that can answer simple questions here
05:19:57FromDiscord<heysokam> In reply to @nasuray "You can import it": oh, damn, true. i forgot about `{.all.}`
06:52:21*alexdaguy joined #nim
07:57:05*redj quit (Ping timeout: 272 seconds)
07:57:08*redj_ joined #nim
08:20:36*ensyde joined #nim
08:32:13*ensyde quit (Quit: WeeChat 4.5.1)
08:34:33FromDiscord<swalf> sent a long message, see https://pasty.ee/XKlgKUux
09:31:40*m5zs7k quit (Ping timeout: 244 seconds)
09:36:49*m5zs7k joined #nim
10:36:07FromDiscord<nocturn9x> how safe is it to pass pointers via channels?
10:36:39FromDiscord<nocturn9x> trying to create a very simple worker pool tailored to my use case
10:37:58FromDiscord<nocturn9x> and I was wondering if if this flow makes sense. So, my worker threads need to have one pointer to a shared data structure (data races when accessing it are irrelevant), the rest is all thread-local lookup tables which are copied from the "main" thread. So I could have a `WorkerPool` object which gets passed the pointers for all the stuff it needs to copy plus the shared data structure, and passes those along to the workers over a chann
10:47:36FromDiscord<volt_eye.> sent a long message, see https://pasty.ee/vpRfqxjP
10:49:48FromDiscord<nocturn9x> well that's one hell of a wall of text
10:49:49FromDiscord<nocturn9x> lol
10:51:11FromDiscord<volt_eye.> In reply to @nocturn9x "well that's one hell": He is always excited to help, 😁
10:51:34FromDiscord<nocturn9x> removing a lot of the spacing would probably be best though :P
10:52:14FromDiscord<volt_eye.> Well That will be work for me, next time I will tell him to do it himself
10:53:27FromDiscord<volt_eye.> Do you use nim regularly though
10:56:15FromDiscord<janakali> In reply to @swalf "Hello, I have a": this guide is up-to-date: https://internet-of-tomohiro.pages.dev/nim/gdb.en
10:59:13FromDiscord<luteva> are there any libs for parsing "default" logfiles? Like common apache httpd / apache tomcat / nginx log formats?
11:00:14FromDiscord<luteva> maybe there's a (nimble) package that foccuses on having common formats pre-implemented parsers?
11:15:06FromDiscord<nnsee> In reply to @lainlaylie "can we whip up": we can, and i'm going to be honest here, it doesn't even sound like that bad of an idea. would need a huge context window though and would be pretty expensive
11:23:04FromDiscord<swalf> Thank you very much, I'll try to follow this one and find if with this script something improves.↵(@janakali)
11:24:35FromDiscord<luteva> In reply to @nnsee "we can, and i'm": there are ~ 40.000 nimble packages around there. Idk if this is enough context (especially as some may be quite old)?!?
11:26:49FromDiscord<swalf> Thank you for this IA-based answer, more or less chat gpt resembles the idea I have about nim tools ecosystem right now. I hope nim will have soon a more powerful tools and docs to attract many new comers.↵(@volt_eye.)
11:28:14FromDiscord<lainlaylie> i only meant stuff like the manual, experimental manual, move semantic docs, nimc.html, etc. I feel like 50% of the questions here are answerable by content in those pages
11:40:36FromDiscord<janakali> In reply to @swalf "Thank you very much,": nim-gdb works with Nim 2.0.14 but it wasn't updated for 2.2.x
11:42:30FromDiscord<janakali> probably a good idead to report it in the repo: https://github.com/nim-lang/Nim/issues
11:55:59FromDiscord<nocturn9x> hmm and here I am again
11:56:12FromDiscord<nocturn9x> facing the issue of "if I spawn 2 threads it all works, if I spawn 3 or more I get random crashes"
11:56:25FromDiscord<nocturn9x> it seems that a thing I'm passing as a `var` parameter is somehow magically disappearing
11:56:27FromDiscord<nocturn9x> and becomes nil
11:56:33FromDiscord<nocturn9x> even though the underlying object is not a reference
11:58:28FromDiscord<nocturn9x> how would I even debug this?
12:02:17FromDiscord<nocturn9x> ahh no wait I might know the problem
12:29:17FromDiscord<nocturn9x> yep I was doing fucky stuff with references
12:29:18FromDiscord<nocturn9x> seems to be fixed
12:35:34FromDiscord<nocturn9x> yeah so channels seem to be working pretty well
12:35:45FromDiscord<nocturn9x> I got two set up in a producer/consumer fashion
12:35:53FromDiscord<nocturn9x> hopefully it passes my testing :')
13:09:10*alexdaguy quit (Quit: w)
13:14:52FromDiscord<luteva> I am getting the error:↵could not load: libpcre.so↵this is new. It probably was removed from the std library, right? Does someone know in which version it was removed?
13:18:56FromDiscord<luteva> oh, i probably was wrong. This should have come in with an OS upgrade, right?
13:19:12FromDiscord<luteva> or is this a nim specific problem?
13:22:08FromDiscord<nnsee> In reply to @luteva "I am getting the": nim still depends on the old deprecated version of pcre. an update probably removed it from your system
13:22:11FromDiscord<nnsee> https://github.com/nim-lang/Nim/pull/24405
13:22:27FromDiscord<nnsee> when this is merged, this should be fixed
13:23:34FromDiscord<nnsee> if people are now starting to get errors because of this, i think this issue should be fast tracked
13:24:07*ntat joined #nim
13:26:45FromDiscord<ayex> due to pcre, I usually do not use regex from stdlib, but instead this pure nim implementation\:↵https://github.com/nitely/nim-regex
13:26:54Amun-RaI located the code that caused
13:26:57Amun-Raargh
13:27:06FromDiscord<nnsee> In reply to @Amun-Ra "I located the code": finally
13:27:10FromDiscord<nnsee> someone found the code that caused
13:27:17Amun-Ra;)
13:27:34Amun-RaI pressed cursor-up + enter in the wrong tab ;)
13:31:06*xet7 joined #nim
14:11:53*Artea quit (Quit: ZNC 1.9.1 - https://znc.in)
14:26:57*Artea joined #nim
15:06:05*ntat quit (Quit: Leaving)
15:14:17*m5zs7k quit (Ping timeout: 268 seconds)
15:15:49*ntat joined #nim
15:35:39*m5zs7k joined #nim
15:48:09*coldfeet joined #nim
15:49:37*ntat quit (Quit: Leaving)
16:17:43*ntat joined #nim
16:46:08FromDiscord<fl4shk> is there any way I could have only the functions/types I develop in Nim end up in the output C code?
16:51:22FromDiscord<fl4shk> any compiler options, etc
16:51:27FromDiscord<fl4shk> for an embedded systems project
16:52:32Amun-Rathere's --os=standalone with a "but"
16:59:17*ntat quit (Quit: Leaving)
17:04:16*derpydoo joined #nim
17:12:35FromDiscord<fl4shk> what is the "but"?
17:16:26Amun-Rait requires a little more work than other oses
17:18:08FromDiscord<fl4shk> what kind of work?
17:20:13Amun-Rayou need to implement your own panicoverride.nim
17:25:53FromDiscord<fl4shk> okay let me look into that
17:26:26FromDiscord<fl4shk> I need to learn more of the Nim language probably before I do that
17:27:21Amun-Rathat's a good plan
17:28:46FromDiscord<fl4shk> https://github.com/dom96/nimkernel/blob/master/panicoverride.nim this is a small file at least
17:30:04FromDiscord<fl4shk> though this `nimkernel` repo was apparently last updated 4 years ago, according to GitHub
17:30:18FromDiscord<fl4shk> still though I think this could be a good reference for me
17:32:04*Jjp137 joined #nim
17:32:56FromDiscord<fl4shk> how difficult is it to have Nim output code for an embedded CPU that has a custom instruction set assuming I have a GCC port that emits code for the CPU?
17:33:08FromDiscord<fl4shk> this is maybe a question that's better for #embedded but I'll leave it here
17:33:08Amun-RaI don't think dom96 is active anymore
17:33:16FromDiscord<fl4shk> hm
17:33:29FromDiscord<fl4shk> well either way that `panicoverride.nim` could be of interest to me
17:33:33FromDiscord<fl4shk> the whole thing could be of interest
17:34:46FromDiscord<fl4shk> looks like dom96's github account actually does have recent contributes
17:34:49FromDiscord<fl4shk> from this month even
17:34:54FromDiscord<fl4shk> contributions
17:35:49Amun-Raah, so his not active in community only
17:35:54FromDiscord<fl4shk> ah
17:53:09FromDiscord<fl4shk> this command failed to run: ↵`nim cc -c --genScript:on --noMain:on --nimcache:./outdir --os:standalone --mm:none -d:useMalloc -d:release --overflowChecks:off --floatChecks:off --cpu:arm --tlsEmulation:off main.nim panicoverride.nim`
17:53:19FromDiscord<fl4shk> can you tell me how I would fix this?
17:53:46FromDiscord<fl4shk> the error is this:↵`Error: arguments can only be given if the '--run' option is selected`
17:55:11FromDiscord<fl4shk> so I suppose maybe I have to provide the `.nim` files separately?
17:55:16FromDiscord<lainlaylie> `...main.nim panicoverride.nim`
17:55:32Amun-Raremove panicoverride.nim from args list
17:55:32FromDiscord<lainlaylie> panicoverride.nim is being interpreted as you trying to run main.nim and pass arguments to it
17:55:40FromDiscord<fl4shk> right, gotcha
17:56:10FromDiscord<fl4shk> so a lot more code is present here than the sample code I wrote
17:56:14FromDiscord<fl4shk> a lot more C code
17:56:35FromDiscord<fl4shk> maybe I need more options
18:04:11*jjido joined #nim
18:08:28FromDiscord<fl4shk> so how do you specify a cross compiler will be used?
18:08:51Amun-Ra--gcc.exe=gcc --gcc.linkerexe=linker
18:08:57FromDiscord<fl4shk> ah
18:08:59Amun-Ra--cflags=…
18:11:13FromDiscord<fl4shk> the `compile_main.sh` doesn't seem to respect
18:11:17FromDiscord<fl4shk> the gcc I picked
18:11:54FromDiscord<fl4shk> maybe it's because I had set the output language to C++ though
18:12:58Amun-RaC++ target uses differentopts
18:13:18FromDiscord<fl4shk> ah
18:13:29FromDiscord<fl4shk> well it's not `--g++.exe`
18:13:31FromDiscord<fl4shk> apparently
18:13:47Amun-Ragcc.cpp.exe and gcc.cpp.linkerexe
18:13:59FromDiscord<fabric.input_output> cpp or cxx?
18:14:09FromDiscord<fl4shk> I can try both
18:14:10FromDiscord<fl4shk> :)
18:14:11Amun-Racpp
18:14:30Amun-Radon't forget to switch backend to C++ with -b=cpp
18:14:35FromDiscord<fl4shk> right
18:14:36FromDiscord<fabric.input_output> btw you can make a `config.nims` where you specify these options and have it work for the project
18:14:45FromDiscord<fl4shk> I just wrote a shell script for the tim ebeing
18:14:49FromDiscord<fabric.input_output> wait
18:14:55FromDiscord<fabric.input_output> I think it has a different name
18:15:01FromDiscord<fl4shk> huh?
18:15:19Amun-Rafabric: nim.cfg?
18:15:26FromDiscord<fl4shk> thanks very much for your help
18:15:28FromDiscord<fabric.input_output> yeah
18:16:50FromDiscord<fl4shk> excellent! first Nim program built for my custom CPU
18:17:06FromDiscord<fl4shk> I had to trick the Nim compiler into outputting 32-bit pointers though
18:17:08FromDiscord<fabric.input_output> In reply to @Amun-Ra "fabric: nim.cfg?": people usually write these for custom toolchains
18:17:11FromDiscord<fl4shk> so I went with `--cpu:arm`
18:17:17FromDiscord<fl4shk> sure
18:17:48FromDiscord<fl4shk> my custom CPU is something I've developed as an FPGA implementation only because I cannot for the life of me afford the monetary cost of getting a custom chip made
18:17:48FromDiscord<fl4shk> haha
18:17:52FromDiscord<fabric.input_output> https://github.com/nim-lang/Nim/blob/devel/config/nim.cfg
18:17:54FromDiscord<fl4shk> some day though maybe...
18:17:57FromDiscord<fl4shk> I'll look at that
18:19:09FromDiscord<fl4shk> ah this looks easy enough
18:19:25*ntat joined #nim
18:19:30Amun-RaI use one for AmigaOS
18:19:41FromDiscord<fl4shk> ah
18:19:44FromDiscord<fl4shk> Yeah that's a good point
18:20:00FromDiscord<fl4shk> Nim looks like a better pick of language to me than what I was doing in C++
18:20:03FromDiscord<fl4shk> for my purposes
18:20:25FromDiscord<fl4shk> so... attempting to compile Nim into PipelineC-compatible C is probably what I'll do next
18:20:36FromDiscord<fl4shk> or maybe I'll just save Nim for actual software
18:20:57FromDiscord<fl4shk> and continue translating my C++ code for a software 3D rasterizer into PipelineC
18:21:04FromDiscord<fl4shk> ...anyway, that's off topic for this channel
18:28:10FromDiscord<fl4shk> does writing an allocator take much if I just want it to use `malloc` and `free` in the C code?
18:28:19FromDiscord<fl4shk> lets' say I want C++ style RAII
18:28:25FromDiscord<fl4shk> (edit) "lets'" => "let's"
18:32:31FromDiscord<fabric.input_output> it's not particularly hard just writing an allocator
18:32:38FromDiscord<fl4shk> hm okay
18:32:49FromDiscord<fabric.input_output> but the raii thing, nim has the `=destroy` hook
18:43:57FromDiscord<fl4shk> `=destroy` should be good to look into
18:44:26FromDiscord<fl4shk> I have another question: how do I do multiple `.nim` files
18:44:46FromDiscord<fl4shk> with one `.c`/`.cpp` file per `.nim` file of mine
18:44:48Amun-Raimport one in the other
18:44:52FromDiscord<fl4shk> ah
18:44:55FromDiscord<fl4shk> gotcha
19:02:22FromDiscord<threefour> So it sounds like you shouldn't use built-in async with ARC because it's cyclic. Does anyone know if coroutines are cyclic, and if I can use those on ARC instead?
19:19:01*derpydoo quit (Quit: derpydoo)
19:19:47*jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…)
19:36:14*derpydoo joined #nim
19:39:44*coldfeet quit (Quit: Lost terminal)
19:45:11FromDiscord<nocturn9x> haven't read the whole convo but
19:45:14FromDiscord<nocturn9x> can't you use ORC?
19:45:19FromDiscord<nocturn9x> do you need hard realtime guarantees?
19:46:03FromDiscord<nocturn9x> like unless you're writing some high performance, long running application that cannot afford to be stopped by a cycle collector you should be fine
19:46:18FromDiscord<nocturn9x> and generally coroutines are focused more on efficiency and managing I/O workloads which are light on CPU time
19:46:27FromDiscord<nocturn9x> so is ORC not an option?
19:59:26FromDiscord<threefour> I was more curious if there's a workaround to IO bottleneck, if I'm trying to avoid ORC.
20:02:22FromDiscord<fl4shk> how does one ensure that a variable in the generated C code is marked as `static`
20:02:25FromDiscord<fl4shk> (edit) "`static`" => "`static`?"
20:09:52FromDiscord<fl4shk> also is there any way I can prevent the C code that gets generated from having `nimZeroMem` be called on my temporary structs?
20:10:58*derpydoo quit (Quit: derpydoo)
20:11:47FromDiscord<fl4shk> hm. Perhaps I'd better save Nim for use outside PipelineC
20:14:27FromDiscord<fabric.input_output> In reply to @fl4shk "also is there any": use the `noinit` pragma
20:15:57FromDiscord<fl4shk> In reply to @fabric.input_output "use the `noinit` pragma": I tried that
20:16:11FromDiscord<fl4shk> how do I apply that to a temporary variable?
20:16:23FromDiscord<fabric.input_output> `var v {.noinit}`
20:16:26FromDiscord<fl4shk> I tried doing it, but the temporary was still set to zero
20:16:27FromDiscord<fabric.input_output> same for let
20:16:30FromDiscord<fl4shk> I did htat
20:16:32FromDiscord<fl4shk> but it didn't work
20:16:33FromDiscord<fabric.input_output> huh
20:16:34FromDiscord<fabric.input_output> weird
20:16:45FromDiscord<fl4shk> let me try again
20:17:39FromDiscord<fl4shk> sent a code paste, see https://play.nim-lang.org/#pasty=zknaCvua
20:18:14FromDiscord<fl4shk> the commetned-out `temp.x = left.x div right` (and similar line for `temp.y`) made it so there's no actual initialization
20:18:30FromDiscord<fl4shk> sent a code paste, see https://play.nim-lang.org/#pasty=MGEqVRAN
20:18:40FromDiscord<fl4shk> so do I need to mark `x` and `y` as `noinit`
20:18:46FromDiscord<fl4shk> (edit) "`noinit`" => "`noinit`?"
20:19:12FromDiscord<fabric.input_output> no, the pragma works only for variables and for functions (where it applies to the result)
20:19:22FromDiscord<fabric.input_output> btw you can also just use the `result` variable
20:19:43FromDiscord<fl4shk> so I need to be entirely without use of pointers for PipelineC
20:19:51FromDiscord<fabric.input_output> ?
20:20:03FromDiscord<fl4shk> I'm doing something weird here
20:23:00FromDiscord<fabric.input_output> In reply to @fl4shk "I tried doing it,": for me it's not doing that
20:23:09FromDiscord<fl4shk> hm
20:23:23FromDiscord<fl4shk> you used my code as written?
20:23:47FromDiscord<fl4shk> wait a minute
20:24:07FromDiscord<fabric.input_output> https://media.discordapp.net/attachments/371759389889003532/1337519278504677488/image.png?ex=67a7bd65&is=67a66be5&hm=bfd2382dabc203712494750b65e630c1087166851ceb476e791bc92adcfa2b9b&
20:24:10FromDiscord<fabric.input_output> yeah
20:24:46FromDiscord<fl4shk> I had `--checks:off`
20:25:36FromDiscord<fl4shk> sent a code paste, see https://paste.rs/6Cqzb
20:25:42FromDiscord<fl4shk> this is what I had for my thing
20:25:50FromDiscord<fl4shk> is there another compile flag I need?
20:27:02FromDiscord<fabric.input_output> with checks off I get this https://media.discordapp.net/attachments/371759389889003532/1337520012780372078/image.png?ex=67a7be14&is=67a66c94&hm=5667602023a10a88a2394a1c294e97403035db4a8ba8798ab258e3c9b849dfc9&
20:27:08FromDiscord<fabric.input_output> let me try with your command
20:29:11FromDiscord<fabric.input_output> oh hmm it zeroes it now
20:29:16FromDiscord<fabric.input_output> weird
20:29:19FromDiscord<fl4shk> ...okay how do I turn that off?
20:31:09FromDiscord<fabric.input_output> I think it's `--mm:none` that's doing it
20:31:50FromDiscord<fl4shk> removing that doesn't seem to get rid of it
20:32:08FromDiscord<fl4shk> oh
20:32:10FromDiscord<fl4shk> wait now it does huh
20:32:36FromDiscord<fl4shk> without `--mm:none` and without `-d:useMalloc`
20:32:49FromDiscord<fl4shk> very nice, that's what I neede dfor this weird use case
20:33:07FromDiscord<nnsee> what is PopelineC and why does it require you to do all of these things
20:33:08FromDiscord<fabric.input_output> nah it still does it with no `-d:useMalloc` for me
20:33:10FromDiscord<nnsee> pipeline, even
20:33:22FromDiscord<fabric.input_output> it depends only on `--mm:none`
20:34:30FromDiscord<nnsee> oh, looks verilog-ish
20:34:33FromDiscord<fl4shk> In reply to @nnsee "what is PopelineC and": PipelineC is a hardware description language that accepts a variant of C/C++ as the input language
20:34:38FromDiscord<fl4shk> well
20:34:55FromDiscord<fl4shk> yeah
20:35:01FromDiscord<fl4shk> it's an FPGA language/HDL
20:35:07FromDiscord<fabric.input_output> might wanna take this with the c-suite at #internals
20:35:11FromDiscord<nnsee> i see i see
20:35:28FromDiscord<fl4shk> ...anyway being able to use Nim for FPGA development just seems good
20:35:35FromDiscord<fabric.input_output> you could
20:35:37FromDiscord<fabric.input_output> make a macro
20:35:39FromDiscord<fabric.input_output> for a dsl
20:35:41FromDiscord<fabric.input_output> lol
20:35:50FromDiscord<fl4shk> I suppose that's a better option
20:36:02FromDiscord<fl4shk> I was thinking of doing something like that anwyay, as it'd allow more control over the C code
20:36:08FromDiscord<fabric.input_output> def
20:37:01FromDiscord<fl4shk> I'll save that for later. Right now, I have a fixed function GPU that I'm implementing in PipelineC based upon the C++ code I wrote that implements a software rasterizer.
20:37:15FromDiscord<fl4shk> anyway, one reason I'm interested in Nim at all is that I can use it with my GCC backend.
20:37:21FromDiscord<fl4shk> ...for one of my other projects
20:37:23FromDiscord<fl4shk> that embedded CPU
20:37:38FromDiscord<fl4shk> every new-fangled language seems to go with LLVM
20:39:26FromDiscord<fl4shk> I do need to do something with LLVM for another one of my personal projects, but I'm saving that for later
20:43:37FromDiscord<fabric.input_output> there's also nlvm
21:07:35FromDiscord<explosiveend> sent a code paste, see https://play.nim-lang.org/#pasty=nePbZbuo
21:08:07FromDiscord<explosiveend> i assumed it'd round every item at the end to 1 decimal place, but here's the output
21:08:07FromDiscord<explosiveend> https://media.discordapp.net/attachments/371759389889003532/1337530348875157525/image.png?ex=67a7c7b5&is=67a67635&hm=5b2831e0346cbb668a5ba5fcb2d11f763705d9b1c0ee232ef2ffe61cf09808db&
21:08:18FromDiscord<explosiveend> (i just started using nim so idk what i'm doing :Waaa:)
21:08:51FromDiscord<Elegantbeef> Floats are floats
21:09:12FromDiscord<Elegantbeef> You want to convert it to a string and `formatFloat`
21:09:55FromDiscord<Elegantbeef> This isn't Nim
21:09:59FromDiscord<Elegantbeef> This is general programming
21:12:33FromDiscord<explosiveend> In reply to @Elegantbeef "Floats are floats": hmm not sure if i understand what this means...
21:13:07FromDiscord<explosiveend> i haven't tried conv to string, but i dont understand why
21:13:28FromDiscord<Elegantbeef> Floating point values cannot represent every number in the world
21:13:54FromDiscord<Elegantbeef> `0.1f + 0.2f` does not show as 0.3
21:14:30FromDiscord<Elegantbeef> https://timothybramlett.com/floating-point-imprecision/
21:15:02FromDiscord<explosiveend> ah i see, i'll take a look thanks
21:17:04FromDiscord<nnsee> In reply to @explosiveend "hmm not sure if": https://0.30000000000000004.com/
21:34:57FromDiscord<fl4shk> In reply to @fabric.input_output "there's also nlvm": so like, that's an idea, but what I'm doing here isn't targeting an LLVM target I don't think?
21:35:23FromDiscord<Elegantbeef> nlvm is a separate compiler
21:35:47FromDiscord<Elegantbeef> So the only way you used llvm is if you targetted clang or zig 😄
21:44:34FromDiscord<fl4shk> well
21:44:37FromDiscord<fl4shk> ...hm
21:44:41FromDiscord<fl4shk> I'll look at nlvm
21:45:34FromDiscord<fl4shk> so... this seems like something I can't use
21:45:48FromDiscord<fl4shk> part of the reason I'm using the nim compiler is that it emits C code
21:47:15FromDiscord<fl4shk> Is there a way I can get `nim` to output C `for` loops without having to make a full DSL for emitting C?
21:49:13FromDiscord<Elegantbeef> Nope
21:49:24FromDiscord<Elegantbeef> You can make an iterator which emits the C style code and then invoke that
21:49:28FromDiscord<fl4shk> ooh?
21:49:43FromDiscord<fl4shk> I'll look at the iterators
21:49:58FromDiscord<fl4shk> I do strictly need the C code to contain a `for` loop
21:50:09FromDiscord<Elegantbeef> What an odd requirement
21:50:21FromDiscord<fl4shk> sure, but my situation is strange :P
21:51:26FromDiscord<fl4shk> though let me see
21:51:34FromDiscord<fl4shk> I didn't actually check if I could use a `while` loop
21:51:42FromDiscord<fl4shk> I was just assuming I needed it
21:51:49FromDiscord<fl4shk> to be a `for` loop
21:52:03FromDiscord<fl4shk> anyway, the full DSL for outputting C is something I want... but that'll come later
21:53:41FromDiscord<Elegantbeef> There is the emit pragma so you already have that dsl
21:53:44FromDiscord<Elegantbeef> Not that it makes much sense to fill your Nim code with C
21:56:37FromDiscord<fl4shk> I'll look at the emit pragma
21:56:47FromDiscord<fl4shk> most of the time, I don't need C for this
21:57:02FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=DztwcSJD
21:57:41FromDiscord<fl4shk> that's good to see. Also apparently while loops are supported to a degree
21:58:29FromDiscord<fl4shk> so anyway, I'll probably be able to use mostly regular Nim
22:04:06*ntat quit (Quit: Leaving)
22:13:36FromDiscord<nnsee> In reply to @Elegantbeef "To give an example": that's actually fascinating
22:14:43FromDiscord<fabric.input_output> In reply to @fl4shk "so like, that's an": I hear something with llvm and we're in a nim context so first thing that comes to my mind is nlvm. you chose if that is useful to you or not. I'm not sure what the something is tbh
22:15:32*jjido joined #nim
22:15:57FromDiscord<fl4shk> In reply to @fabric.input_output "I hear something with": there are currently two purposes for my use of Nim:
22:16:35FromDiscord<fl4shk> PipelineC, FPGA language taking a variant of C as input↵ baremetal software running on a CPU I've developed as FPGA code
22:24:12FromDiscord<fabric.input_output> is pipelineC a compiler project you've made?
22:25:57*Jjp137 quit (Ping timeout: 248 seconds)
22:27:19FromDiscord<fl4shk> not me
22:27:28FromDiscord<fl4shk> it's by someone other than me (who I am friends with)
22:30:57FromDiscord<firasuke> is it possible to use `walkDir` or `walkDirRec` to yield all files in a directory including symlinks?
22:32:21FromDiscord<Elegantbeef> `walkDirREc` takes in a `yieldFilter` set
22:34:37FromDiscord<firasuke> In reply to @Elegantbeef "`walkDirREc` takes in a": but `yieldFilter` either shows `pcFile` or `pcLinkToFile`, or can you group them?
22:35:03FromDiscord<firasuke> ah you can group them, silly me
22:36:02FromDiscord<Elegantbeef> It is a set yes 😄
22:39:37*derpydoo joined #nim
22:45:37FromDiscord<nocturn9x> In reply to @nnsee "https://0.30000000000000004.com/": great website
22:45:37FromDiscord<nocturn9x> lol
22:46:50FromDiscord<nnsee> the nim examples could be improved
22:47:08FromDiscord<nnsee> as clearly there are cases where this behavior is exhibited
22:48:00FromDiscord<nocturn9x> yeah
23:01:50*xet7 quit (Quit: Leaving)
23:04:59FromDiscord<fl4shk> is there any way I can mark a Nim `var` or `let` as `static` in the C code? That's relevant only for PipelineC. Maybe via `.emit.`
23:05:34FromDiscord<Elegantbeef> `{.globa.}`
23:05:39FromDiscord<Elegantbeef> global even
23:05:53FromDiscord<fl4shk> ah
23:06:01FromDiscord<fl4shk> that is good to see
23:06:50FromDiscord<fl4shk> I want to look into macros more
23:06:57FromDiscord<fl4shk> I'm likely to not need too too much of that
23:07:16*derpydoo quit (Ping timeout: 268 seconds)
23:51:12*Jjp137 joined #nim