<< 04-04-2023 >>

00:28:00*lucas_ta joined #nim
00:47:28*lucas_ta quit (Quit: Leaving)
00:47:53*lucasta joined #nim
00:48:53*lucasta quit (Remote host closed the connection)
00:49:14*lucasta joined #nim
00:51:10*lucasta quit (Client Quit)
00:54:37FromDiscord<GoMpow2> how to match in case of expression for all other enum values?
00:55:44FromDiscord<Elegantbeef> else
01:01:46FromDiscord<GoMpow2> thx
01:04:46*lucasta joined #nim
01:04:47*lucasta quit (Read error: Connection reset by peer)
01:07:15*nanxiao joined #nim
01:16:37*lucasta joined #nim
01:16:40*lucasta quit (Remote host closed the connection)
01:24:35*lucasta joined #nim
01:39:19*lucasta quit (Quit: Leaving)
03:13:04*nanxiao quit (Quit: Client closed)
03:15:04*derpydoo joined #nim
03:20:20*pbsds quit (Quit: The Lounge - https://thelounge.chat)
03:22:20*pbsds joined #nim
03:35:10*nanxiao joined #nim
04:29:22*nanxiao quit (Quit: Client closed)
05:09:12*nanxiao joined #nim
05:14:40*derpydoo quit (Ping timeout: 252 seconds)
05:44:36*advesperacit joined #nim
05:49:53FromDiscord<System64 ~ Flandre Scarlet> Is it normal I cannot do that? https://media.discordapp.net/attachments/371759389889003532/1092687463526436895/image.png
05:51:42FromDiscord<huantian> `var renderTextures: array[2, RenderTexture]`
05:52:07FromDiscord<huantian> the array type doesn't act as a constructor
05:52:22FromDiscord<System64 ~ Flandre Scarlet> Oh alright, it works now↵Thanks
06:07:29FromDiscord<sOkam!> how do you correctly convert an `array[N, char]` to a nim string?↵right now with `std/strbasics add` it adds even the ending set of million `\x00` characters 😔↵do I just cast to cstring, or is there some other way?
06:07:52FromDiscord<sOkam!> i tried searching the chat, but only that option showed up, and its not behaving well
06:08:07FromDiscord<Elegantbeef> You cannot without allocating
06:08:55FromDiscord<Elegantbeef> `$cast[cstring](myArr[0])`
06:08:55FromDiscord<sOkam!> i dont mind allocating it. i just want it to convert it correctly
06:09:09FromDiscord<Elegantbeef> The above only works if it's `\0` terminated
06:09:13FromDiscord<Elegantbeef> If it's not use use strbasics
06:09:13FromDiscord<sOkam!> kk ill try that
06:11:48FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4sC9
06:12:27FromDiscord<sOkam!> i guess it means they are not null terminated? 🤔
06:12:31FromDiscord<Elegantbeef> you need to `rfind`
06:13:43FromDiscord<sOkam!> i don't quite follow why
06:14:42FromDiscord<Elegantbeef> you find a `\0` in the array
06:15:34FromDiscord<sOkam!> i don't have a string, though. rfind seems to search in strings
06:16:04FromDiscord<Elegantbeef> rfind works on arrays
06:16:23FromDiscord<sOkam!> what module is it in?
06:16:29FromDiscord<Elegantbeef> system
06:16:45FromDiscord<sOkam!> its not showing up in the manual search 😔
06:16:46FromDiscord<Elegantbeef> Wait it's not
06:16:49FromDiscord<Elegantbeef> lol
06:17:46*nanxiao quit (Quit: Client closed)
06:18:17FromDiscord<Elegantbeef> I guess just find one
06:18:47FromDiscord<sOkam!> wdym?
06:20:02FromDiscord<Elegantbeef> Or just do it manually
06:20:06FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4sCd
06:21:52*Notxor joined #nim
06:21:57FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4sCe
06:23:15*kenran joined #nim
06:27:10FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4sCf
06:36:16*tiorock joined #nim
06:36:16*tiorock quit (Changing host)
06:36:16*tiorock joined #nim
06:36:16*rockcavera is now known as Guest7846
06:36:16*tiorock is now known as rockcavera
06:39:22*Guest7846 quit (Ping timeout: 276 seconds)
06:54:25*nanxiao joined #nim
07:03:59*ltriant quit (Ping timeout: 246 seconds)
07:15:31*TakinOver quit (Ping timeout: 250 seconds)
07:16:25*TakinOver joined #nim
07:17:26*PMunch joined #nim
07:52:03*lucasta joined #nim
07:56:01*nanxiao quit (Quit: Client closed)
07:58:36*nanxiao joined #nim
08:07:30FromDiscord<ringabout> > Iterators that are neither marked {.closure.} nor {.inline.} explicitly default to being inline, but this may change in future versions of the implementation.↵https://nim-lang.github.io/Nim/manual.html#iterators-and-the-for-statement-firstminusclass-iterators↵It does cause problems for iterators without pragmas. I suppose it was not lifted properly at the transf phase.
08:28:49*derpydoo joined #nim
09:18:45*nanxiao quit (Quit: Client closed)
09:28:42PMunchHmm I have an application which displays some HTML. Now I've given the users the ability to add their own HTML templates the content will be put into. But I still want to be able to add some scripts, styles, fonts, etc.
09:29:47PMunchI'd love to give the user the ability to supply a full HTML document, or just what goes into the body part, and then stitch it together with my script and style tags
09:30:02PMunchI guess there aren't any HTML merging libraries out there by chance?
09:31:58*nanxiao joined #nim
09:56:18FromDiscord<amadan> sent a long message, see http://ix.io/4sD9
09:57:45*nanxiao quit (Quit: Client closed)
10:02:39FromDiscord<System64 ~ Flandre Scarlet> if((str.len and 1).bool) better than if(str.len % 2 === 1) change my mind
10:05:03*jmdaemon quit (Ping timeout: 260 seconds)
10:22:10FromDiscord<amadan> Mean if `.len` is unsigned then the c compiler would optimise them to the same anyways?
10:23:50FromDiscord<amadan> Looks like it does https://godbolt.org/z/reqbTPYGx↵But I like the second one personally
10:24:00FromDiscord<amadan> (edit) "Looks like it does https://godbolt.org/z/reqbTPYGx↵But I like the second one personally ... " added "(using `%`)"
10:24:09FromDiscord<amadan> (edit) "anyways?" => "anyways no?"
10:27:08FromDiscord<firq> Is ORC working with threadpool? I'm getting "SIGSEGV\: Illegal storage access. (Attempt to read from nil?)" even with simple toy tests using Nim 1.6.12
10:30:27FromDiscord<firq> And it seems to work fine with both the default GC and with ARC
10:36:43*nanxiao joined #nim
10:37:36*azimut_ joined #nim
10:39:00FromDiscord<firq> To answer my own question\: https://github.com/nim-lang/Nim/issues/14901 reports the same issue, though there is a fix for it. I can't figure out if that fix went into 1.6.\ or only on 2.\ though.
10:40:50*azimut quit (Ping timeout: 255 seconds)
10:43:54*nanxiao quit (Quit: Client closed)
11:13:43PMunchHmm, the thing is I want them to be able to either upload a full HTML document, or just a snippet.
11:13:51PMunchI guess I'll have to go the htmlparser route..
11:17:37NimEventerNew thread by alexeypetrushin: Is such HTML template possible?, see https://forum.nim-lang.org/t/10067
11:19:21FromDiscord<Marcus> Would be really nice to get a stable release with the fix for infinite recursion in nimsuggest.
11:20:21PMunchIndeed
11:20:30PMunchBetter yet some QC on the nimsuggest project :P
11:33:55FromDiscord<Yardanico> In reply to @firq "To answer my own": only 2.x
11:34:03FromDiscord<Yardanico> it wasn't backported it seems
11:39:20NimEventerNew post on r/nim by angel__-__-: Block motions for vim (for Nim), see https://reddit.com/r/nim/comments/12bgcgj/block_motions_for_vim_for_nim/
11:55:20PMunchHmm @amadan, htmlparser seems to break strings in embedded JavaScript..
11:56:42FromDiscord<amadan> Yeah that was the same problem I mentioned sadly↵Haven't looked into it too much so don't even know if it's an easy fix or not
12:01:44*om3ga joined #nim
12:04:19*ltriant joined #nim
12:10:56FromDiscord<firq> Ok, good to know. Thanks↵(@Yardanico)
12:20:07*derpydoo quit (Quit: derpydoo)
12:24:49FromDiscord<creative> has anyone done osdev? mainly for x86_64
12:29:57FromDiscord<Yardanico> In reply to @creative "has anyone done osdev?": yeah a couple of people did with Nim, although nothing serious
12:30:03FromDiscord<Yardanico> you can find those projects on github
12:30:19FromDiscord<Yardanico> although they're kind of outdated by using --os:standalone with --gc:none while now you can use --os:any + mm:arc
12:30:34FromDiscord<creative> ah thanks
12:48:27*rockcavera quit (Remote host closed the connection)
13:05:45*rockcavera joined #nim
13:10:29*xet7 quit (Ping timeout: 268 seconds)
13:20:00*rockcavera quit (Remote host closed the connection)
14:10:54*PMunch quit (Quit: Leaving)
14:25:38FromDiscord<Ayy Lmao> What's the best way to use some c headers that need to be included in a specific order?
14:29:44FromDiscord<demotomohiro> Ask c header author to fix the c headers so that they can be included in any order.
14:45:13*kenran quit (Remote host closed the connection)
14:58:38*progranner joined #nim
15:18:43*progranner quit (Ping timeout: 276 seconds)
15:18:50NimEventerNew thread by ringabout: How could I set up an i386 CI for Nim?, see https://forum.nim-lang.org/t/10069
15:43:05*arkurious joined #nim
15:59:47FromDiscord<michaelb.eth> In reply to @System64 "if((str.len and 1).bool) better": zero isn’t falsy in Nim so `str.len and 1` is problematic
16:00:24FromDiscord<michaelb.eth> (edit) "is problematic" => "won’t work like you want"
16:01:02FromDiscord<michaelb.eth> actually maybe converters kick in, should have. Hacked before replying…
16:01:16FromDiscord<michaelb.eth> (edit) "have. Hacked" => "have checked"
16:08:03FromDiscord<Rika> In reply to @michaelb.eth "zero isn’t falsy in": str.len and 1 is not what you think it is
16:08:22FromDiscord<Rika> its a bitwise and
16:08:41FromDiscord<Rika> nim bitwise ops share the same operator keyword as boolean ops
16:08:44FromDiscord<Rika> overloaded by type
16:08:45FromDiscord<michaelb.eth> yep, should have had coffee first 😄
16:09:04FromDiscord<michaelb.eth> I was just about to retract
16:11:10FromDiscord<Rika> haha
16:11:16FromDiscord<Rika> too quick for you
16:11:39FromDiscord<michaelb.eth> I tend to use bitops, though it’s a bit annoying how prior to 1.6 (I think, or maybe 1.4) bitand and bitor, et al. are not variadic
16:18:33FromDiscord<michaelb.eth> In reply to @sOkam! "how do you correctly": nim-stew’s `string.fromBytes` in its `byteutils` may be of help
16:18:44FromDiscord<michaelb.eth> (edit) "In reply to @sOkam! "how do you correctly": nim-stew’s `string.fromBytes` in its `byteutils` ... may" added "module"
16:22:39FromDiscord<System64 ~ Flandre Scarlet> In reply to @michaelb.eth "zero isn’t falsy in": Why not treating zero and nil as falsy?
16:24:41FromDiscord<Rika> In reply to @System64 "Why not treating zero": nim has no concept of truthiness
16:24:54FromDiscord<Rika> if its not a boolean, it isnt treated as one
16:25:16FromDiscord<Rika> but technically nim DOES has some sense of truthiness actually
16:25:37FromDiscord<Rika> integers that are 0, when converted to bool explicitly, will be false
16:25:43FromDiscord<Rika> numbers rather
17:31:10*TakinOver quit (Ping timeout: 265 seconds)
17:31:28*rockcavera joined #nim
17:34:12*TakinOver joined #nim
17:52:15*kenran joined #nim
18:02:48*jmdaemon joined #nim
18:37:23*deadmarshal quit (Quit: IRCNow and Forever!)
18:53:50*deadmarshal_ joined #nim
19:12:13*tiorock joined #nim
19:12:13*tiorock quit (Changing host)
19:12:14*tiorock joined #nim
19:12:14*rockcavera is now known as Guest3404
19:12:14*tiorock is now known as rockcavera
19:16:06*Guest3404 quit (Ping timeout: 255 seconds)
19:29:19*lucasta quit (Remote host closed the connection)
19:44:09*kenran quit (Remote host closed the connection)
19:53:52FromDiscord<guttural666> nimsuggest/nimlsp not working is a really shite situation, nim is now a pain in the ass to program in
20:07:59*advesperacit quit ()
20:12:03*progranner joined #nim
20:12:45*progranner quit (Read error: Connection reset by peer)
20:25:01FromDiscord<hellerbarde> What is the idiomatic way to "execv" a process in nim, i.e. inheriting the process id?↵(Equivalent to "exec $programname" in shell script.)
20:25:05FromDiscord<hellerbarde> s
20:28:32*TakinOver quit (Ping timeout: 250 seconds)
20:30:53FromDiscord<Nerve> In reply to @hellerbarde "What is the idiomatic": `osproc.execCmdEx`
20:38:45*rockcavera is now known as Guest8996
20:38:45*tiorock joined #nim
20:38:45*Guest8996 quit (Killed (cadmium.libera.chat (Nickname regained by services)))
20:38:45*tiorock is now known as rockcavera
20:54:25FromDiscord<Takemichi Hanagaki> In reply to @guttural666 "nimsuggest/nimlsp not working is": I see your point, often I have problems with nimsuggest. Time to check code, to get references... And memory usage...↵Today, nimsuggest was using every available memory space...
20:57:41*qpls1908 joined #nim
20:58:01qpls1908What is the type of {1: "foo"}?
20:58:04qpls1908and where is this documented?
20:58:16qpls1908I am trying to learn nim, and I see things like {1: "foo"}.newTable
20:58:28qpls1908which seems odd, since I would think {} is already a dict of some sort
20:58:34qpls1908but it seems to be an array of tuples
20:59:03qpls1908though I can't figure out where the syntax is documented
21:01:52FromDiscord<Marcus> Anyone have a Github actions setup for building nim apps for arm as well as x86?
21:20:29FromDiscord<demotomohiro> @qpls1908 It is documented in https://nim-lang.org/docs/manual.html#statements-and-expressions-table-constructor↵and↵https://nim-lang.org/docs/tables.html#newTable%2CopenArray%5B%5D
21:26:25FromDiscord<huantian> In reply to @Marcus "Anyone have a Github": no examples but you'd want to look at using <https://nim-lang.org/docs/nimc.html#crossminuscompilation> to point to the gcc-arm-none-eabi` package which i think ubuntu has
21:26:28FromDiscord<huantian> (edit) "gcc-arm-none-eabi`" => "`gcc-arm-none-eabi`"
21:33:02FromDiscord<hellerbarde> But the documentation says that this returns a result. I am looking for the proc that will replace the process, like execv, execve, etc do.↵(@Nerve)
21:35:36FromDiscord<Elegantbeef> You can always import execv and friends, but execCmdEx is blocking so for most intents it's the same
21:36:57FromDiscord<hellerbarde> Afaik it will create another level in the process hierarchy which is what i am looking to avoid.↵I will look into importing execv then. Thanks 👍
21:38:28FromDiscord<demotomohiro> @hellerbarde As far as I know, there is no proc that will replace the process in stdlib.↵So you would need to use procs in posix module.
21:39:39FromDiscord<Elegantbeef> Matrix reactions do not propagate to discord and vice versa
21:43:10FromDiscord<hellerbarde> Oh. Ok. @demotomohiro\: thanks!
22:01:09*Notxor quit (Quit: Leaving)
23:00:59*jmdaemon quit (Ping timeout: 248 seconds)
23:04:35FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4sG7
23:05:29FromDiscord<sOkam!> (edit) "https://play.nim-lang.org/#ix=4sG7" => "https://play.nim-lang.org/#ix=4sG8"
23:19:14FromDiscord<kiell> are db_ modules usable in nimscript?
23:21:20*jmdaemon joined #nim
23:36:06FromDiscord<Ayy Lmao> Is there not a way to deal with multiple c headers that need to be included in a specific order? I am having a lot of trouble with this.
23:47:49FromDiscord<Elegantbeef> @kiell\: no
23:48:02FromDiscord<Elegantbeef> Ayylmao use `emit` perhaps
23:48:44FromDiscord<Ayy Lmao> In reply to @Elegantbeef "<@109181558149120000>\: no": The emit pragma works but how do I use it from the module's scope so that the user of the module doesn't have to worry about it?
23:49:08FromDiscord<Ayy Lmao> In order for it to work you have to emit the include header code in the user code
23:50:48FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4sGb
23:51:25FromDiscord<Elegantbeef> `allocCstringArray`
23:51:38FromDiscord<sOkam!> there is no way around allocating i assume?
23:51:56FromDiscord<Elegantbeef> Put the emit at the top level of your module?↵(@Ayy Lmao)
23:52:04FromDiscord<Elegantbeef> Correct a cstring array is a nil terminated cstring collection
23:52:14FromDiscord<Elegantbeef> So there is no way of doing it without allocating
23:52:48FromDiscord<Ayy Lmao> In reply to @Elegantbeef "Put the emit at": It doesn't end up emitting it in the user code if I do that.
23:53:09FromDiscord<Ayy Lmao> And then it says I have undefined things
23:53:32FromDiscord<Elegantbeef> Could you compile the C files instead?
23:53:48FromDiscord<Elegantbeef> Alternatively you could use a `include` as ugly as it is
23:54:44FromDiscord<Ayy Lmao> Yeah I had it working on windows without using the header files but I couldn't get it to work on webassembly properly for some reason. I suspect maybe it had to do with a bunch of platform specific code in the header files.
23:56:26FromDiscord<Ayy Lmao> I tried making my own c header file with the includes in the right order but that doesn't seem to work either
23:58:34FromDiscord<Elegantbeef> What files are you including?
23:59:07FromDiscord<Ayy Lmao> sent a code paste, see https://play.nim-lang.org/#ix=4sGc