<< 09-04-2025 >>

01:10:18*tiorock joined #nim
01:10:18*tiorock quit (Changing host)
01:10:18*tiorock joined #nim
01:10:18*rockcavera quit (Killed (molybdenum.libera.chat (Nickname regained by services)))
01:10:18*tiorock is now known as rockcavera
01:28:24tokyovigilanteAmun-Ra: I can just import va_list from C thus: type va_list* {.importc: "va_list", header: "<stdarg.h>".} = object
01:29:38tokyovigilanteand then just pass it between Nim and C as a pointer, but my issue is really that an older version of Futhark generated a Nim definitifion for a C function using a va_list, but now uses the {.varargs.} pragma, which isn't interoperable between C and Nim unfortunately. The C header I'm wrapping doesn't seem to have changed
01:33:56tokyovigilanteAh no actually I'm an idiot, I rewrote this using a va_list myself 5 months ago and promptly forgot I'd done it... Sigh. Would be ideal if Futhark could use va_lists but seems this is my fault.
01:36:02*SchweinDeBurg quit (Ping timeout: 252 seconds)
01:39:28*SchweinDeBurg joined #nim
01:44:29*SchweinDeBurg quit (Ping timeout: 265 seconds)
01:45:41*SchweinDeBurg joined #nim
02:33:13*rockcavera quit (Remote host closed the connection)
02:39:29*beholders_eye quit (Quit: WeeChat 4.5.1)
02:58:18*pmp-p_ quit (Ping timeout: 276 seconds)
02:59:55*pmp-p joined #nim
03:51:16*SchweinDeBurg quit (Ping timeout: 252 seconds)
03:53:35*SchweinDeBurg joined #nim
04:06:02*ntat joined #nim
04:46:59*SchweinDeBurg quit (Ping timeout: 268 seconds)
04:53:52*ntat quit (Quit: leaving)
05:01:55*SchweinDeBurg joined #nim
05:04:44*ntat joined #nim
05:39:04Amun-Ra;)
05:39:57Amun-Ratokyovigilante: yes, I know you can importc it; I find varargs much more operable than creating va_list every call
05:47:12*coldfeet joined #nim
06:28:04*coldfeet quit (Quit: Lost terminal)
06:46:14*coldfeet joined #nim
07:21:48*ntat quit (Quit: leaving)
07:45:30*Lord_Nightmare quit (Quit: ZNC - http://znc.in)
07:45:52*Lord_Nightmare joined #nim
07:57:17*coldfeet quit (Quit: Lost terminal)
07:57:39FromDiscord<fabric.input_output> In reply to @battery.acid.bubblegum "As well as maybe": too busy getting the initial rendering right
07:57:55FromDiscord<fabric.input_output> In reply to @Elegantbeef "What's your goal with": a sort of CAD thingy
08:03:04*pmp-p quit (Quit: No Ping reply in 180 seconds.)
08:04:23*pmp-p joined #nim
08:14:24*pmp-p quit (Ping timeout: 260 seconds)
08:16:50*pmp-p joined #nim
08:20:40*void09 quit ()
08:21:23*void09 joined #nim
09:00:50tokyovigilanteAmun-Ra: thanks, I don't have a problem with varargs but just can't figure out how to have a nim callback function with them which can be passed to C code as a pointer, ie there's no Nim equivalent to the ... parameter, Nim expects a named vararg type
09:02:22Amun-Rayes, there's not equivalent for those two
09:04:07tokyovigilanteright, that's what I'm struggling with, so I think for this specific case I need to stick with va_list so both Nim and C just see a single pointer
09:41:08*ntat joined #nim
10:09:07*beholders_eye joined #nim
10:36:24*ntat quit (Read error: Connection reset by peer)
10:37:20*beholders_eye quit (Ping timeout: 244 seconds)
10:46:50*ntat joined #nim
11:05:22FromDiscord<Robyn [She/Her]> In reply to @fabric.input_output "too busy getting the": fair
11:17:52FromDiscord<fabric.input_output> I don't know how to antialias it 😦
11:20:26FromDiscord<fabric.input_output> aaa opengl is hard
11:23:21FromDiscord<fabric.input_output> maybe I should take this to #gamedev
11:33:56*ntat quit (Quit: leaving)
11:38:50FromDiscord<nocturn9x> huh
11:39:02FromDiscord<nocturn9x> how can this possibly segfault when `self.limiter` is an object? https://media.discordapp.net/attachments/371759389889003532/1359492801863094363/image.png?ex=67f7add6&is=67f65c56&hm=29da3cd18c1ae1c9f3b6bfe23b6ff21773ec179d0aea8e5953d43dd220a038c8&
11:39:05FromDiscord<nocturn9x> it's not a ref lol
11:39:13FromDiscord<nocturn9x> and neither is anything contained in what `expired()` calls
11:39:44FromDiscord<nocturn9x> `self` is also an `object`
11:39:53FromDiscord<nocturn9x> hidden pointer tho
11:39:56FromDiscord<nocturn9x> cuz `var SearchManager`
11:41:35FromDiscord<nocturn9x> sent a code paste, see https://play.nim-lang.org/#pasty=REfdkzRY
11:41:37FromDiscord<nocturn9x> this is the function at hand
11:41:38FromDiscord<nocturn9x> so weird
12:05:41*beholders_eye joined #nim
12:15:40FromDiscord<nocturn9x> sent a code paste, see https://play.nim-lang.org/#pasty=LNZYyfzn
12:15:58FromDiscord<nocturn9x> also, what exactly is causing the segfault here?? The limiter exists and so does the search manager
12:16:33FromDiscord<nocturn9x> sent a code paste, see https://play.nim-lang.org/#pasty=iLologsB
12:16:38FromDiscord<nocturn9x> this contains the values I expect
12:29:09*beholders_eye quit (Ping timeout: 248 seconds)
12:39:19*ntat joined #nim
12:44:28*beholders_eye joined #nim
13:44:46FromDiscord<anuke> Does the standard library have a variable length bitvector anywhere?
13:45:22FromDiscord<anuke> (edit) "bitvector anywhere?" => "bitvector/bitset?"
13:47:14FromDiscord<anuke> There seems to be a `bitsets` module, but it's undocumented and internal
13:47:21FromDiscord<mratsim> no
13:47:51FromDiscord<mratsim> though maybe look for "succinct data structure" since it's the name of those kinds of data structures
13:48:14FromDiscord<mratsim> I have a couple of implementations here and there but they only support setting bits and retrieval
13:49:16FromDiscord<mratsim> In reply to @anuke "Does the standard library": https://github.com/mratsim/nim-project-euler/blob/master/src/lib/bithacks.nim#L34-L65
13:52:33FromDiscord<anuke> Just wondering - is there a reason why it uses a `seq[int]` and not a `seq[int64]`? The Java implementations I've seen use `int64`s - is `int` being `int32` on 32-bit platforms faster for bitsets?
14:16:11*amadaluzia joined #nim
15:07:13FromDiscord<ieltan> In reply to @anuke "Just wondering - is": Cause the size of `int` is platform dependent. On modern platforms `sizeof(int)` is 8 bytes (64 bits), on some it's 4 bytes (34 bits)
15:07:20FromDiscord<ieltan> (edit) "(34" => "(32"
15:08:20FromDiscord<ieltan> It's not necessarily to make int faster but to have compatibility with platforms that doesn't support 64 bits ints
15:10:17*derpydoo joined #nim
15:15:09FromDiscord<anuke> In reply to @ieltan "Cause the size of": I'm aware, but that's not what I'm asking - I'm asking why the `seq` of the bitset isn't always a 64-bit integer.
15:15:37FromDiscord<anuke> `int64` is supported on every platform (aside from perhaps some ancient ones)
15:15:48FromDiscord<anuke> (edit) "`int64` is supported on every platform (aside from perhaps some ... ancient" added "irrelevant"
15:31:29FromDiscord<TFed> ExecProcess - returns stdout and optionally errors↵ExecCmd - returns exit status code↵execCmdEx - returns [output, exitCode]
15:32:03FromDiscord<TFed> how do you run shell commands from nim?
15:32:26FromDiscord<TFed> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/1359551295056380037): execProcess - returns stdout and optionally errors↵execCmd - returns exit status code↵execCmdEx - returns [output, exitCode]
15:32:55FromDiscord<TFed> i wrote my own readCommand() function that returns [output, errors, exitCode]
15:34:07FromDiscord<TFed> i wrote readCommand() function that's based on execCmdEx() but saves errors in tmp file to return [output, errors, exitCode]
15:34:29FromDiscord<TFed> i wrote readCommand() function that's based on execCmdEx() but saves errors in tmp file....↵↵so it returns [output, errors, exitCode]
15:36:18FromDiscord<TFed> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/1359551295056380037): `execProcess` - returns `output` and optionally `errors`↵`execCmd` - returns `exit status code`↵`execCmdEx` - returns `\[output, exitCode\]`
15:36:24FromDiscord<TFed> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/1359551295056380037): `execProcess` - returns `output` and optionally `errors`↵`execCmd` - returns `exit status code`↵`execCmdEx` - returns `[output, exitCode]`
15:36:45FromDiscord<TFed> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/1359552055647277339): i wrote `readCommand()` function that's based on `execCmdEx()` but saves errors in tmp file....so it returns `[output, errors, exitCode]`
15:38:50FromDiscord<n0_sh4d3> hi!
15:53:44*pmp-p quit (Ping timeout: 245 seconds)
15:57:08*pmp-p joined #nim
17:18:34*derpydoo quit (Quit: derpydoo)
17:24:35*amadaluzia quit (Changing host)
17:24:35*amadaluzia joined #nim
18:14:26*hernan604 is now known as HER
18:14:58*HER is now known as hernan604
18:15:04*hernan604 is now known as hernan
18:15:06*hernan is now known as hernan604
19:19:39*xet7 quit (Remote host closed the connection)
19:25:03*xet7 joined #nim
19:29:05*xet7 quit (Remote host closed the connection)
20:25:59FromDiscord<threefour> How would I go about making a template that assigns a value to the same field on multiple objects?
20:26:17FromDiscord<threefour> (edit) "How would I go about making a template that assigns a value to the same ... field" added "given"
20:28:38FromDiscord<spotlightkid> Do you want to pass the objects or are you retrieving them in the proc/template?
20:28:43FromDiscord<threefour> sent a code paste, see https://play.nim-lang.org/#pasty=GtUHViBW
20:28:53FromDiscord<threefour> (edit) "https://play.nim-lang.org/#pasty=PyKMPzAv" => "https://play.nim-lang.org/#pasty=emFANqgX"
20:31:10*xet7 joined #nim
20:33:01FromDiscord<devlop_gaming> Two backslashes is for single slashes in a file path right?
20:34:54FromDiscord<lainlaylie> In reply to @threefour "Something like this, but": this already works if testPeople is a var and you use mitems. is it a requirement that it works on immutable values?
20:36:23FromDiscord<lainlaylie> In reply to @devlop_gaming "Two backslashes is for": https://nim-lang.org/docs/manual.html#lexical-analysis-string-literals
20:38:11FromDiscord<spotlightkid> I.e. https://play.nim-lang.org/#pasty=RxcWoJry↵(@lainlaylie)
20:38:56FromDiscord<threefour> My example is minimal, but my applied scenario has a lot of extra boilerplate that I would like to eliminate via a template. So a way to provide the list of objects, the key, and the value, and then have the template handle the boilerplate, is what I'm looking for.
20:40:21FromDiscord<threefour> In reply to @spotlightkid "I.e. https://play.nim-lang.org/#pasty=RxcWoJry (<@3": Awesome! Looks like I was close. The compiler messages were throwing me off a bit.
20:42:07FromDiscord<threefour> Appreciate it
20:57:17FromDiscord<threefour> sent a code paste, see https://play.nim-lang.org/#pasty=ZsbrydYA
21:00:47FromDiscord<lainlaylie> sent a code paste, see https://play.nim-lang.org/#pasty=evUGqMUF
21:15:35*ntat quit (Quit: leaving)
21:22:47FromDiscord<threefour> What in the black magic
21:24:58FromDiscord<pattmayne> I started using Nim for a bigger project than usual and it's a really fun language.
21:25:33FromDiscord<pattmayne> It combines some of the stuff I like about JavaScript with the good stuff from compiled languages.
21:34:34*rockcavera joined #nim
22:02:17FromDiscord<Elegantbeef> @lainlaylie people will do anything but use a for loop
22:19:43FromDiscord<meteoraxv> hi, is there a way to see the time taken running a unit test?
22:19:57FromDiscord<meteoraxv> for benchmarking purposes
22:56:55*SchweinDeBurg quit (Quit: WeeChat 4.7.0-dev)
23:12:06*rockcavera quit (Remote host closed the connection)
23:12:51*rockcavera joined #nim
23:16:41*SchweinDeBurg joined #nim
23:35:15*beholders_eye quit (Ping timeout: 276 seconds)