<< 13-05-2023 >>

00:04:52*dooptydoo90x quit (Quit: WeeChat 3.5)
00:14:08*krux02_ quit (Remote host closed the connection)
00:31:35*lucasta joined #nim
01:03:49*progranner joined #nim
01:07:35*progranner quit (Client Quit)
02:21:15FromDiscord<Prestige> I'm running into a problem parsing json in a static block, is there an issue here? https://play.nim-lang.org/#ix=4vJV
02:24:37FromDiscord<Elegantbeef> There might be, try with devel
02:26:57FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4vJW
02:27:39FromDiscord<Prestige> hm that's interesting, an issue with the data then perhaps
02:31:14FromDiscord<Prestige> ah it's some weird thing with karax apparently
02:33:05FromDiscord<Elegantbeef> You can use the jsonutils module to get around oddities if you need
02:49:40FromDiscord<Prestige> Not sure what the issue is, but I can statically read the text, then parse the json in a non-static context
02:50:00FromDiscord<Prestige> only issue is, I don't need this text in a variable anymore
03:25:57FromDiscord<Prestige> Okay, another static block question...can we not modify a table in a static context? E.g. https://play.nim-lang.org/#ix=4vK1
03:26:25FromDiscord<Elegantbeef> Nope const is constant
03:26:26FromDiscord<Prestige> My goal here is to populate a table at compile time, will be using data from a file I've read statically, so it wouldn't be hand-jammed
03:26:41FromDiscord<Elegantbeef> you want `var lookup {.compileTime.} =...`
03:27:28FromDiscord<Elegantbeef> Or just `var` since it's a compile time value
03:27:48FromDiscord<Prestige> And that'll still prevent it from being modified outside of the static block?
03:28:03FromDiscord<Elegantbeef> Of course
03:28:10FromDiscord<Prestige> Cool, thanks
03:28:11FromDiscord<Elegantbeef> It doesnt exist outside of the static block
03:28:58*lucasta quit (Remote host closed the connection)
04:41:36*rockcavera quit (Remote host closed the connection)
05:15:32*TakinOver joined #nim
05:26:59*TakinOver quit (Ping timeout: 246 seconds)
05:33:34FromDiscord<voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=4vKk
05:34:18FromDiscord<Elegantbeef> (fileN\: i, first\: iPos - fileStart, last\: ePos - fileStart)\` I think, no clue using named tuples is a faux pas for me
05:34:58FromDiscord<voidwalker> Error: type mismatch: got 'seq[tuple[fileN: int, first: uint, last: uint]]' for '@[(fileN: i, first: iPos - fileStart, last: ePos - fileStart)]' but expected 'seq[FileSlice]'
05:34:59FromDiscord<voidwalker> haha
05:35:14FromDiscord<voidwalker> (edit) "haha ... " added "(for your try)"
05:35:33FromDiscord<voidwalker> ah wait there's an int mismatch there
05:35:44FromDiscord<voidwalker> yep, works now
05:36:24FromDiscord<voidwalker> I don't know if it's a good idea to use tuples though. I read some tuples vs object theories, and I'm still leaning towards tuple
05:36:56FromDiscord<Elegantbeef> I somewhat agree with Araq in that if you name a tuple you want an object
05:37:15FromDiscord<voidwalker> then why bother to make named tuples lol
05:37:30FromDiscord<voidwalker> (edit) "make" => "implement" | "implementnamed tuples ... lol" added "in nim"
05:37:48FromDiscord<Elegantbeef> `proc doThing(): tuple[x, y: int]` is better than `(int, int)`
05:41:07FromDiscord<voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=4vKl
05:41:33FromDiscord<Elegantbeef> Or just a proc
05:41:48FromDiscord<voidwalker> If I want to use that syntax
05:41:57FromDiscord<Elegantbeef> `if [iPos, ePos].inRrange(fileStart..fileEnd)`
05:41:59FromDiscord<Elegantbeef> I dont think a macro can do that
06:01:09FromDiscord<cmc> sent a code paste, see https://play.nim-lang.org/#ix=4vKr
06:03:36FromDiscord<Elegantbeef> No objects are not tuples
06:12:32*azimut quit (Ping timeout: 240 seconds)
06:21:01*junaid_ joined #nim
06:24:04FromDiscord<cmc> Well yeah but you could represent an object's type by having a tuple of identical structure
06:24:12FromDiscord<Elegantbeef> Not all objects
06:24:43FromDiscord<Elegantbeef> But yea a macro would work for non variant objects
06:28:23*GreaseMonkey quit (Remote host closed the connection)
06:37:12FromDiscord<Elegantbeef> Kinda hacky Cmc but your problem did tickle my brain's fancy https://play.nim-lang.org/#ix=4vKv
06:37:42FromDiscord<Elegantbeef> Fun little problem of how best handle this
06:40:08FromDiscord<sOkam!> Is it possible to add `{}` to a `&""" some text """` multiline formatted string, so that the brackets that need to exist in the string don't need to be escaped one by one? đŸ€”
06:40:18FromDiscord<Elegantbeef> Slightly cleaner solution https://play.nim-lang.org/#ix=4vKw no longer uses a macro as the entry
06:40:56FromDiscord<Elegantbeef> What do you mean?
06:44:01FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4vKx
06:45:04FromDiscord<sOkam!> if I say `mycode = &""" main(){ {mynum} }"""`... brackets that should be added won't be there, and need to be escaped
06:46:58FromDiscord<Elegantbeef> `fmt` has an overload that takes the open/closed chars
06:47:15FromDiscord<Elegantbeef> Alternatively just use strutils' `%` like a sane person would
06:48:20FromDiscord<sOkam!> % seems more sensible for this usecase, yep
07:07:53*junaid_ quit (Remote host closed the connection)
07:30:15*lucasta joined #nim
07:30:50FromDiscord<sOkam!> sent a code paste, see https://paste.rs/hPb
07:31:10FromDiscord<Rika> you have to specify that N is a static int here `...es[N: static int](d...`
07:31:31FromDiscord<sOkam!> i was getting the same error with that for some reason
07:32:10FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4vKB
07:32:36FromDiscord<Rika> and your usage?
07:33:17FromDiscord<sOkam!> oh, do i need to specify on calling the function?
07:33:29FromDiscord<Elegantbeef> Well yea, how else would it get a value
07:34:03FromDiscord<sOkam!> i guess i will remove the input `count` vector then
07:37:55FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4vKC
07:37:57FromDiscord<sOkam!> what am I doing wrong?
07:38:06FromDiscord<Rika> count must be compile time derivable
07:38:22FromDiscord<sOkam!> it is, count is a const
07:38:57FromDiscord<Rika> `vec.genInstances[: count.x, count.y]()` i think should be the syntax
07:39:16FromDiscord<Elegantbeef> Yea method call syntax limitation
07:39:23FromDiscord<sOkam!> why the `: `?
07:39:44FromDiscord<Elegantbeef> Cause otherwise it's `[](ven.genInstances, countX, countY)`
07:39:52FromDiscord<sOkam!> ic
07:40:37FromDiscord<sOkam!> changed the `vec` to be inside the parenthesis, and it worked
07:40:43FromDiscord<Prestige> Anyone know if karax supports images? I can't seem to get anything to render, although it compiles
07:41:04FromDiscord<Elegantbeef> I really should see about making that error message better
07:41:15FromDiscord<Elegantbeef> Supports them how
07:41:25FromDiscord<Elegantbeef> I use karax for my website and it embeds image nodes just fine
07:41:42FromDiscord<Prestige> How are you doing that? Everything I've tried comes up blank
07:42:12FromDiscord<Elegantbeef> An `img(src = url)`
07:42:57FromDiscord<Prestige> ah ty, I was using `image(src = url)`
07:43:12FromDiscord<Elegantbeef> html tags my guy!
07:43:55FromDiscord<Prestige> idk how karax works lol
07:44:25FromDiscord<Elegantbeef> It's a wrapping around the html dom practically
07:44:49FromDiscord<Elegantbeef> So unless things interfere with nim's syntax(div for instance being `tdiv`) it's the same as you would in html
07:46:57FromDiscord<Prestige> Sweet, that's helpful
07:47:26FromDiscord<Elegantbeef> It actually uses some form of a virtual dom, but that's an implementation detail for the most part
07:49:46NimEventerNew post on r/nim by pysan3: `isMainModule` with `runnableExamples`?, see https://reddit.com/r/nim/comments/13gaz8v/ismainmodule_with_runnableexamples/
07:55:19*sagax quit (Remote host closed the connection)
07:58:27FromDiscord<Bung> how to know which nim version the specific version nimble shiped with?
08:25:03FromDiscord<Bung> if anyone has answer please ping me .
08:46:42*disso_pch quit (Quit: Leaving)
08:57:22FromDiscord<Duskhorn The Eclipsed> sent a code paste, see https://play.nim-lang.org/#ix=4vKL
08:58:06FromDiscord<sOkam!> sounds like the perfect question for beef 🙂
08:58:26FromDiscord<Duskhorn The Eclipsed> shall we ping beef :3
09:02:27FromDiscord<Duskhorn The Eclipsed> I'd do it myself but there's two beefs
09:04:14FromDiscord<Duskhorn The Eclipsed> oh well↔@Beef Broccoli @ElegantBeef I require one of you two's assistane
09:04:16FromDiscord<Duskhorn The Eclipsed> (edit) "assistane" => "assistance"
09:07:04FromDiscord<sOkam!> I wouldn't be surprised if he gets pinged by writing `concept`, haha 🙈
09:07:38FromDiscord<Duskhorn The Eclipsed> Ok I'm reading the docs again and I think I know where I'm wrong↔> You can also apply the type modifier to create a named instance of the type itself↔so yeah
09:07:59FromDiscord<Rika> yeah
09:08:00FromDiscord<Duskhorn The Eclipsed> what I'm doing is declaring V and E as instance of the concept G
09:08:34*PMunch joined #nim
09:08:35FromDiscord<Duskhorn The Eclipsed> How can I do what I'm trying to do though? generics?
09:09:14FromDiscord<Duskhorn The Eclipsed> yeah that did it
09:09:16FromDiscord<Duskhorn The Eclipsed> :dusky:
09:10:33FromDiscord<Duskhorn The Eclipsed> thanks anyways!
10:08:23*greaser|q joined #nim
10:08:23*greaser|q quit (Changing host)
10:08:23*greaser|q joined #nim
10:09:58*greaser|q is now known as GreaseMonkey
10:32:19PMunchGtk is surprisingly annoying to find docs for..
10:34:00PMunchSince it's wrapped for just about every language just googling the name of a proc brings up everything..
10:34:44*lucasta quit (Quit: Leaving)
10:56:43FromDiscord<federico3> owlkettle comes to the rescue (partially)
11:21:41FromDiscord<Phil> Yeh, owlkettle does a decent job of keeping you from needing to deal with that
11:39:02PMunchHmm, maybe I should have a look at owlkettle..
11:39:09PMunchI've written my entire app in Gtk by now though..
11:47:32FromDiscord<Phil> Does gtk have a storybook equivalent?↔Where you can show individual widgets controlling their in and outputs for a kind of design system
11:49:40FromDiscord<Phil> https://philippmdoerner.github.io/nimstoryfont-gui/?path=/story/designsystem-templates-spellstemplatecomponent--default↔Something like this, a tool to showcase individual widgets
12:09:12PMunchWell it has Glade
12:09:20PMunchWhich I guess is similar
12:09:35PMunchIt is a program where you can build UIs graphically
12:10:08PMunch(and then optionally save a textual representation which you can load in your program)
12:11:09PMunchBut Gtk is very bound by it's C nature and performance qualities
12:11:37PMunchSo the whole thing is a bit weird to use
12:12:34PMunchDoesn't help that just about every single bit of it is customiseable, so simple things often ends up feeling hard because it's a matter of picking the right set of options from a very complex system
12:59:44FromDiscord<AmjadHD> When I try to boot the compiler, I get: `C:\Users\User\.choosenim\toolchains\nim-#devel\compiler\extccomp.nim(24, 39) Error: cannot open file: ../dist/checksums/src/checksums/sha1`
13:56:58FromDiscord<Entikan> what's a good way to get a very large mutable 3d array of bits?
13:58:41FromDiscord<Entikan> tried `newSeqWith(sX, newSeqWith(sY, newSeq[int](sZ))` but it seems takes a long time construct
13:58:45FromDiscord<Entikan> (edit) "tried `newSeqWith(sX, newSeqWith(sY, newSeq[int](sZ))` but it seems takes a long time ... construct" added "to"
13:59:14FromDiscord<Rika> do you need the arrays to be resizable
13:59:38FromDiscord<Entikan> maybe not
14:00:08FromDiscord<Entikan> it would be nice if I could have multiple in different sizes
14:01:16FromDiscord<Entikan> one of `210` and one of `212`, etc
14:01:22FromDiscord<Entikan> (edit) "`212`," => "`2012`,"
14:01:26FromDiscord<Entikan> (edit) "`2012`," => "`212`,"
14:02:31FromDiscord<Entikan> but it's not that important
14:06:59FromDiscord<Entikan> ah yeah I can just have a few sizes so no, they don't
14:15:05*rockcavera joined #nim
15:18:23FromDiscord<auxym> at that point I would consider making a strided array API, so your data is actually stored in a flat array (or seq), but can be accessed as 3d with procs or macros. kinda like arraymancer but extend it to support single bits
15:19:08*azimut joined #nim
15:21:51FromDiscord<auxym> see mratsim's post in this thread for a simple implementation: https://forum.nim-lang.org/t/8835
15:21:54FromDiscord<auxym> @Entikan
15:21:59*Notxor joined #nim
15:30:05*ehmry quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
15:31:33*ehmry joined #nim
16:16:56*azimut quit (Ping timeout: 240 seconds)
16:22:14FromDiscord<mratsim> In reply to @Entikan "what's a good way": for array of bits, get familiar with bitvectors first, and then combine my tensor code with my bit read/write code: https://github.com/mratsim/constantine/blob/1c5341fd7e8af9084223b5bce616b4a8262eab14/constantine/math/arithmetic/bigints.nim#L329-L355
16:24:28FromDiscord<mratsim> this one is also a bitarray but backed by bytes instead of uint64: https://github.com/mratsim/constantine/blob/1c5341fd7e8af9084223b5bce616b4a8262eab14/constantine/math/elliptic/ec_endomorphism_accel.nim#L150-L183
16:36:15*disso-peach joined #nim
16:36:56FromDiscord<Nlits (Ping on reply)> Why can't i use a case statement with cstrings?
16:58:42FromDiscord<user2m> sent a code paste, see https://play.nim-lang.org/#ix=4vLT
16:58:52FromDiscord<user2m> proc
16:58:57FromDiscord<Rika> probably via macro
16:59:03FromDiscord<Rika> otherwise no
17:05:30FromDiscord<user2m> hmmm havent even looked at macros yet so I'll save that for a later date
17:05:49FromDiscord<deech> In reply to @user2m "Hey all is it": As a workaround you can make the argument a tuple? `proc p(a:tuple[arg1: string, arg2: int])`
17:07:36FromDiscord<deech> (edit) "In reply to @user2m "Hey all is it": As a workaround you can make the argument a tuple? `proc p(a:tuple[arg1: string, arg2: int])` ... " added "and call it with `p((arg1: "hello", arg2: 1))`"
17:09:03FromDiscord<user2m> In reply to @deech "As a workaround you": not a bad workaround!!
17:10:49FromDiscord<deech> The downside is you'll have to destructure it manually with `let (arg1, arg2) = a` or access with a dot, eg `a.arg1`.
17:26:07*Guest17 joined #nim
17:26:45*Guest17 quit (Client Quit)
17:28:24*azimut joined #nim
17:32:48*lucasta joined #nim
17:46:25FromDiscord<user2m> sent a code paste, see https://play.nim-lang.org/#ix=4vLX
17:46:58FromDiscord<Rika> case typeof b↔?
17:47:05FromDiscord<Rika> and i dont think that would work, im not sure
17:48:15FromDiscord<user2m> sent a long message, see http://ix.io/4vLZ
17:54:20FromDiscord<user2m> sent a code paste, see https://play.nim-lang.org/#ix=4vM0
17:54:45FromDiscord<user2m> sent a code paste, see https://play.nim-lang.org/#ix=4vM1
18:03:32*PMunch quit (Quit: Leaving)
18:13:07FromDiscord<deech> sent a code paste, see https://play.nim-lang.org/#ix=4vMa
18:43:33*lucasta quit (Remote host closed the connection)
18:47:26*FromDiscord quit (Remote host closed the connection)
18:47:39*FromDiscord joined #nim
18:51:07FromDiscord<Entikan> In reply to @mratsim "for array of bits,": thanks a lot, this is very insightful
19:09:16FromDiscord<user2m> In reply to @deech "I think you want": right again!! Thanks for the help @deech !
19:27:59FromDiscord<AmjadHD> Anyone gets this when booting the compiler ? `C:\Users\User\.choosenim\toolchains\nim-#devel\compiler\extccomp.nim(24, 39) Error: cannot open file: ../dist/checksums/src/checksums/sha1`
19:31:48FromDiscord<mratsim> In reply to @AmjadHD "Anyone gets this when": You might need to update. Or reload submodules/csources
20:32:20FromDiscord<demotomohiro> In reply to @AmjadHD "Anyone gets this when": You might compiling devel Nim with stable Nim.↔If so, you need to compile devel Nim with build_all.bat.
20:33:37FromDiscord<demotomohiro> That builds Nim from C sources and build devel Nim using it.
20:48:20FromDiscord<AmjadHD> In reply to @demotomohiro "You might compiling devel": Thanks, `build_all.bat` fixes it.
21:19:59*xet7 quit (Remote host closed the connection)
21:20:47*lucasta joined #nim
21:21:29*progranner joined #nim
21:21:44*progranner quit (Client Quit)
21:34:27*disso-peach quit (Quit: Leaving)
22:18:33FromDiscord<Nlits (Ping on reply)> How do I add two tables together? (Ping on reply)
22:24:19FromDiscord<Dudugz> You mean merge them?
22:25:11FromDiscord<Dudugz> In reply to @not logged in "How do I add": ``std/tables`` has a ``merge`` proc
22:25:38FromDiscord<Dudugz> ``T1.merge T2``
22:38:27*Notxor quit (Remote host closed the connection)
23:28:53*progranner joined #nim
23:29:12*progranner quit (Client Quit)
23:40:54FromDiscord<Elegantbeef> @Duskhorn The Eclipsed just remember I didnt follow up, fix your bug?
23:52:44*progranner joined #nim
23:56:46*pharonix71 quit (Remote host closed the connection)
23:57:16*pharonix71 joined #nim