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:15 | FromDiscord | <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:37 | FromDiscord | <Elegantbeef> There might be, try with devel |
02:26:57 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4vJW |
02:27:39 | FromDiscord | <Prestige> hm that's interesting, an issue with the data then perhaps |
02:31:14 | FromDiscord | <Prestige> ah it's some weird thing with karax apparently |
02:33:05 | FromDiscord | <Elegantbeef> You can use the jsonutils module to get around oddities if you need |
02:49:40 | FromDiscord | <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:00 | FromDiscord | <Prestige> only issue is, I don't need this text in a variable anymore |
03:25:57 | FromDiscord | <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:25 | FromDiscord | <Elegantbeef> Nope const is constant |
03:26:26 | FromDiscord | <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:41 | FromDiscord | <Elegantbeef> you want `var lookup {.compileTime.} =...` |
03:27:28 | FromDiscord | <Elegantbeef> Or just `var` since it's a compile time value |
03:27:48 | FromDiscord | <Prestige> And that'll still prevent it from being modified outside of the static block? |
03:28:03 | FromDiscord | <Elegantbeef> Of course |
03:28:10 | FromDiscord | <Prestige> Cool, thanks |
03:28:11 | FromDiscord | <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:34 | FromDiscord | <voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=4vKk |
05:34:18 | FromDiscord | <Elegantbeef> (fileN\: i, first\: iPos - fileStart, last\: ePos - fileStart)\` I think, no clue using named tuples is a faux pas for me |
05:34:58 | FromDiscord | <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:59 | FromDiscord | <voidwalker> haha |
05:35:14 | FromDiscord | <voidwalker> (edit) "haha ... " added "(for your try)" |
05:35:33 | FromDiscord | <voidwalker> ah wait there's an int mismatch there |
05:35:44 | FromDiscord | <voidwalker> yep, works now |
05:36:24 | FromDiscord | <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:56 | FromDiscord | <Elegantbeef> I somewhat agree with Araq in that if you name a tuple you want an object |
05:37:15 | FromDiscord | <voidwalker> then why bother to make named tuples lol |
05:37:30 | FromDiscord | <voidwalker> (edit) "make" => "implement" | "implementnamed tuples ... lol" added "in nim" |
05:37:48 | FromDiscord | <Elegantbeef> `proc doThing(): tuple[x, y: int]` is better than `(int, int)` |
05:41:07 | FromDiscord | <voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=4vKl |
05:41:33 | FromDiscord | <Elegantbeef> Or just a proc |
05:41:48 | FromDiscord | <voidwalker> If I want to use that syntax |
05:41:57 | FromDiscord | <Elegantbeef> `if [iPos, ePos].inRrange(fileStart..fileEnd)` |
05:41:59 | FromDiscord | <Elegantbeef> I dont think a macro can do that |
06:01:09 | FromDiscord | <cmc> sent a code paste, see https://play.nim-lang.org/#ix=4vKr |
06:03:36 | FromDiscord | <Elegantbeef> No objects are not tuples |
06:12:32 | * | azimut quit (Ping timeout: 240 seconds) |
06:21:01 | * | junaid_ joined #nim |
06:24:04 | FromDiscord | <cmc> Well yeah but you could represent an object's type by having a tuple of identical structure |
06:24:12 | FromDiscord | <Elegantbeef> Not all objects |
06:24:43 | FromDiscord | <Elegantbeef> But yea a macro would work for non variant objects |
06:28:23 | * | GreaseMonkey quit (Remote host closed the connection) |
06:37:12 | FromDiscord | <Elegantbeef> Kinda hacky Cmc but your problem did tickle my brain's fancy https://play.nim-lang.org/#ix=4vKv |
06:37:42 | FromDiscord | <Elegantbeef> Fun little problem of how best handle this |
06:40:08 | FromDiscord | <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:18 | FromDiscord | <Elegantbeef> Slightly cleaner solution https://play.nim-lang.org/#ix=4vKw no longer uses a macro as the entry |
06:40:56 | FromDiscord | <Elegantbeef> What do you mean? |
06:44:01 | FromDiscord | <sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4vKx |
06:45:04 | FromDiscord | <sOkam!> if I say `mycode = &""" main(){ {mynum} }"""`... brackets that should be added won't be there, and need to be escaped |
06:46:58 | FromDiscord | <Elegantbeef> `fmt` has an overload that takes the open/closed chars |
06:47:15 | FromDiscord | <Elegantbeef> Alternatively just use strutils' `%` like a sane person would |
06:48:20 | FromDiscord | <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:50 | FromDiscord | <sOkam!> sent a code paste, see https://paste.rs/hPb |
07:31:10 | FromDiscord | <Rika> you have to specify that N is a static int here `...es[N: static int](d...` |
07:31:31 | FromDiscord | <sOkam!> i was getting the same error with that for some reason |
07:32:10 | FromDiscord | <sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4vKB |
07:32:36 | FromDiscord | <Rika> and your usage? |
07:33:17 | FromDiscord | <sOkam!> oh, do i need to specify on calling the function? |
07:33:29 | FromDiscord | <Elegantbeef> Well yea, how else would it get a value |
07:34:03 | FromDiscord | <sOkam!> i guess i will remove the input `count` vector then |
07:37:55 | FromDiscord | <sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4vKC |
07:37:57 | FromDiscord | <sOkam!> what am I doing wrong? |
07:38:06 | FromDiscord | <Rika> count must be compile time derivable |
07:38:22 | FromDiscord | <sOkam!> it is, count is a const |
07:38:57 | FromDiscord | <Rika> `vec.genInstances[: count.x, count.y]()` i think should be the syntax |
07:39:16 | FromDiscord | <Elegantbeef> Yea method call syntax limitation |
07:39:23 | FromDiscord | <sOkam!> why the `: `? |
07:39:44 | FromDiscord | <Elegantbeef> Cause otherwise it's `[](ven.genInstances, countX, countY)` |
07:39:52 | FromDiscord | <sOkam!> ic |
07:40:37 | FromDiscord | <sOkam!> changed the `vec` to be inside the parenthesis, and it worked |
07:40:43 | FromDiscord | <Prestige> Anyone know if karax supports images? I can't seem to get anything to render, although it compiles |
07:41:04 | FromDiscord | <Elegantbeef> I really should see about making that error message better |
07:41:15 | FromDiscord | <Elegantbeef> Supports them how |
07:41:25 | FromDiscord | <Elegantbeef> I use karax for my website and it embeds image nodes just fine |
07:41:42 | FromDiscord | <Prestige> How are you doing that? Everything I've tried comes up blank |
07:42:12 | FromDiscord | <Elegantbeef> An `img(src = url)` |
07:42:57 | FromDiscord | <Prestige> ah ty, I was using `image(src = url)` |
07:43:12 | FromDiscord | <Elegantbeef> html tags my guy! |
07:43:55 | FromDiscord | <Prestige> idk how karax works lol |
07:44:25 | FromDiscord | <Elegantbeef> It's a wrapping around the html dom practically |
07:44:49 | FromDiscord | <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:57 | FromDiscord | <Prestige> Sweet, that's helpful |
07:47:26 | FromDiscord | <Elegantbeef> It actually uses some form of a virtual dom, but that's an implementation detail for the most part |
07:49:46 | NimEventer | New 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:27 | FromDiscord | <Bung> how to know which nim version the specific version nimble shiped with? |
08:25:03 | FromDiscord | <Bung> if anyone has answer please ping me . |
08:46:42 | * | disso_pch quit (Quit: Leaving) |
08:57:22 | FromDiscord | <Duskhorn The Eclipsed> sent a code paste, see https://play.nim-lang.org/#ix=4vKL |
08:58:06 | FromDiscord | <sOkam!> sounds like the perfect question for beef đ |
08:58:26 | FromDiscord | <Duskhorn The Eclipsed> shall we ping beef :3 |
09:02:27 | FromDiscord | <Duskhorn The Eclipsed> I'd do it myself but there's two beefs |
09:04:14 | FromDiscord | <Duskhorn The Eclipsed> oh wellâ”@Beef Broccoli @ElegantBeef I require one of you two's assistane |
09:04:16 | FromDiscord | <Duskhorn The Eclipsed> (edit) "assistane" => "assistance" |
09:07:04 | FromDiscord | <sOkam!> I wouldn't be surprised if he gets pinged by writing `concept`, haha đ |
09:07:38 | FromDiscord | <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:59 | FromDiscord | <Rika> yeah |
09:08:00 | FromDiscord | <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:35 | FromDiscord | <Duskhorn The Eclipsed> How can I do what I'm trying to do though? generics? |
09:09:14 | FromDiscord | <Duskhorn The Eclipsed> yeah that did it |
09:09:16 | FromDiscord | <Duskhorn The Eclipsed> :dusky: |
09:10:33 | FromDiscord | <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:19 | PMunch | Gtk is surprisingly annoying to find docs for.. |
10:34:00 | PMunch | Since 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:43 | FromDiscord | <federico3> owlkettle comes to the rescue (partially) |
11:21:41 | FromDiscord | <Phil> Yeh, owlkettle does a decent job of keeping you from needing to deal with that |
11:39:02 | PMunch | Hmm, maybe I should have a look at owlkettle.. |
11:39:09 | PMunch | I've written my entire app in Gtk by now though.. |
11:47:32 | FromDiscord | <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:40 | FromDiscord | <Phil> https://philippmdoerner.github.io/nimstoryfont-gui/?path=/story/designsystem-templates-spellstemplatecomponent--defaultâ”Something like this, a tool to showcase individual widgets |
12:09:12 | PMunch | Well it has Glade |
12:09:20 | PMunch | Which I guess is similar |
12:09:35 | PMunch | It is a program where you can build UIs graphically |
12:10:08 | PMunch | (and then optionally save a textual representation which you can load in your program) |
12:11:09 | PMunch | But Gtk is very bound by it's C nature and performance qualities |
12:11:37 | PMunch | So the whole thing is a bit weird to use |
12:12:34 | PMunch | Doesn'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:44 | FromDiscord | <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:58 | FromDiscord | <Entikan> what's a good way to get a very large mutable 3d array of bits? |
13:58:41 | FromDiscord | <Entikan> tried `newSeqWith(sX, newSeqWith(sY, newSeq[int](sZ))` but it seems takes a long time construct |
13:58:45 | FromDiscord | <Entikan> (edit) "tried `newSeqWith(sX, newSeqWith(sY, newSeq[int](sZ))` but it seems takes a long time ... construct" added "to" |
13:59:14 | FromDiscord | <Rika> do you need the arrays to be resizable |
13:59:38 | FromDiscord | <Entikan> maybe not |
14:00:08 | FromDiscord | <Entikan> it would be nice if I could have multiple in different sizes |
14:01:16 | FromDiscord | <Entikan> one of `210` and one of `212`, etc |
14:01:22 | FromDiscord | <Entikan> (edit) "`212`," => "`2012`," |
14:01:26 | FromDiscord | <Entikan> (edit) "`2012`," => "`212`," |
14:02:31 | FromDiscord | <Entikan> but it's not that important |
14:06:59 | FromDiscord | <Entikan> ah yeah I can just have a few sizes so no, they don't |
14:15:05 | * | rockcavera joined #nim |
15:18:23 | FromDiscord | <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:51 | FromDiscord | <auxym> see mratsim's post in this thread for a simple implementation: https://forum.nim-lang.org/t/8835 |
15:21:54 | FromDiscord | <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:14 | FromDiscord | <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:28 | FromDiscord | <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:56 | FromDiscord | <Nlits (Ping on reply)> Why can't i use a case statement with cstrings? |
16:58:42 | FromDiscord | <user2m> sent a code paste, see https://play.nim-lang.org/#ix=4vLT |
16:58:52 | FromDiscord | <user2m> proc |
16:58:57 | FromDiscord | <Rika> probably via macro |
16:59:03 | FromDiscord | <Rika> otherwise no |
17:05:30 | FromDiscord | <user2m> hmmm havent even looked at macros yet so I'll save that for a later date |
17:05:49 | FromDiscord | <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:36 | FromDiscord | <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:03 | FromDiscord | <user2m> In reply to @deech "As a workaround you": not a bad workaround!! |
17:10:49 | FromDiscord | <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:25 | FromDiscord | <user2m> sent a code paste, see https://play.nim-lang.org/#ix=4vLX |
17:46:58 | FromDiscord | <Rika> case typeof bâ”? |
17:47:05 | FromDiscord | <Rika> and i dont think that would work, im not sure |
17:48:15 | FromDiscord | <user2m> sent a long message, see http://ix.io/4vLZ |
17:54:20 | FromDiscord | <user2m> sent a code paste, see https://play.nim-lang.org/#ix=4vM0 |
17:54:45 | FromDiscord | <user2m> sent a code paste, see https://play.nim-lang.org/#ix=4vM1 |
18:03:32 | * | PMunch quit (Quit: Leaving) |
18:13:07 | FromDiscord | <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:07 | FromDiscord | <Entikan> In reply to @mratsim "for array of bits,": thanks a lot, this is very insightful |
19:09:16 | FromDiscord | <user2m> In reply to @deech "I think you want": right again!! Thanks for the help @deech ! |
19:27:59 | FromDiscord | <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:48 | FromDiscord | <mratsim> In reply to @AmjadHD "Anyone gets this when": You might need to update. Or reload submodules/csources |
20:32:20 | FromDiscord | <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:37 | FromDiscord | <demotomohiro> That builds Nim from C sources and build devel Nim using it. |
20:48:20 | FromDiscord | <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:33 | FromDiscord | <Nlits (Ping on reply)> How do I add two tables together? (Ping on reply) |
22:24:19 | FromDiscord | <Dudugz> You mean merge them? |
22:25:11 | FromDiscord | <Dudugz> In reply to @not logged in "How do I add": ``std/tables`` has a ``merge`` proc |
22:25:38 | FromDiscord | <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:54 | FromDiscord | <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 |