<< 30-12-2021 >>

00:00:39FromDiscord<dizzyliam> oh nice, that could actually be really useful
00:18:49FromDiscord<Elegantbeef> Yep if you have any issues feel free to holler at me
00:45:39FromDiscord<dizzyliam> thanks
00:50:54FromDiscord<TheAlex> Hello, I'm new to Nim and I couldn't find anything on the and operator. I tried ``and`` and ``&&`` but I got errors.
00:51:16FromDiscord<TheAlex> for ``and`` I got ``10 other mismatching symbols have been suppressed; compile with --showAllMismatches:on to see them``
00:52:01FromDiscord<TheAlex> for ``&&`` I get ``Error: undeclared identifier: '&&'``
00:54:35FromDiscord<Rosen> Can you give some more context? Can you show the line it was throwing that first error at you at?
00:56:25FromDiscord<TheAlex> sent a code paste, see https://play.nim-lang.org/#ix=3JZC
00:57:09FromDiscord<TheAlex> (edit) "https://play.nim-lang.org/#ix=3JZC" => "https://play.nim-lang.org/#ix=3JZD"
00:59:29FromDiscord<Elegantbeef> `if i mod 3 == 0 and i mod 5 == 0`
00:59:55FromDiscord<Elegantbeef> or `i mod 3 and i mod 5 == 0`
01:00:04FromDiscord<Elegantbeef> Though that's bitwise `and`
01:00:12FromDiscord<TheAlex> ah so does ``%%`` not work in in nim?
01:00:29FromDiscord<Elegantbeef> I mean it works but it's not the operator for modulo
01:00:50FromDiscord<Elegantbeef> https://nim-lang.org/docs/system.html#%25%25%2Cint%2Cint
01:00:51FromDiscord<Elegantbeef> It's unsigned modulo
01:01:25FromDiscord<Elegantbeef> Nim being wirth inspired prefers word operators in many cases
01:01:28FromDiscord<Fish-Face> I am attempting to use `iterutils`, so procs which expect `Iterable` for the first time. I am surprised that a `seq` is not an `Iterable`. What am I missing and where should I read about what `Iterable` actually is?
01:01:35FromDiscord<TheAlex> In reply to @Elegantbeef "Nim being wirth inspired": I see, thank you
01:02:55FromDiscord<Elegantbeef> `type Iterable[T] = (iterator: T) | Slice[T]` yea it's not
01:02:55FromDiscord<Elegantbeef> In this definition you need to do `seq.items`
01:03:10FromDiscord<dizzyliam> In reply to @Fish-Face "I am attempting to": https://nim-by-example.github.io/for_iterators/
01:04:36FromDiscord<Fish-Face> @ElegantBeef ah I see that makes some sense. Confusingly a seq literal doesn't want to be `items`d
01:04:44FromDiscord<Fish-Face> @dizzyliam `Iterable`, not `iterator` πŸ™‚
01:04:55FromDiscord<dizzyliam> oops yeah i got confused
01:05:14FromDiscord<dizzyliam> where does `iterutils` come from?
01:06:45FromDiscord<Fish-Face> hmm, you can do `for x in @[1, 2, 3].items` but not `for x in iterutils.map(@[1, 2, 3].items, ...)` it seems
01:07:06FromDiscord<Fish-Face> https://hookrace.net/nim-iterutils/iterutils.html
01:07:47FromDiscord<dizzyliam> thanks
01:07:57FromDiscord<Fish-Face> it's on github too
01:09:04FromDiscord<Elegantbeef> And even then it might not work
01:09:05FromDiscord<Elegantbeef> Due to `items` being an inline iterator
01:09:46FromDiscord<Fish-Face> ah so I got confused
01:09:54FromDiscord<Fish-Face> `Iterable` is not `iterable` πŸ™ƒ
01:10:01FromDiscord<Elegantbeef> It's a nimble package
01:10:24FromDiscord<Elegantbeef> Like i said it's a inline iterator
01:10:46FromDiscord<Fish-Face> and `seq.items` is `iterable` (not `iterator`) so not one of the types in `Iterable`
01:10:51FromDiscord<Elegantbeef> Shameless https://github.com/beef331/slicerator/blob/master/src/slicerator.nim#L201-L204
01:11:16FromDiscord<Elegantbeef> Yep
01:11:33FromDiscord<Elegantbeef> I have some silly macros i'm working on
01:11:59FromDiscord<Elegantbeef> But it's in progress
01:12:01FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3JZL
01:12:27FromDiscord<Elegantbeef> Wel `items` is an `iterator` but it's not `iterator: T` since that's an `iterator: T {.closure.}` as `closure` is the default calling convention for iterators
01:12:42FromDiscord<Fish-Face> huh
01:13:31FromDiscord<Fish-Face> So if you define an `inline` iterator that yields `T` that is not `iterator: T`?
01:13:39FromDiscord<Elegantbeef> Indeed
01:13:49FromDiscord<Fish-Face> `nimble` won't acknowledge the existence of `slicerator`, strangely
01:13:52FromDiscord<Fish-Face> I am on 1.6.2
01:13:57FromDiscord<Elegantbeef> It's not in the repository
01:13:59FromDiscord<Elegantbeef> or registry
01:14:00FromDiscord<Fish-Face> but OK, this is not such a big deal atm
01:14:01FromDiscord<Fish-Face> ah
01:14:13FromDiscord<Elegantbeef> You need to install it using the git url presently as i havent got to publishing
01:14:28FromDiscord<Elegantbeef> I want to figure out that `chain` macro and document/clean everything up still
01:15:07FromDiscord<Elegantbeef> My `zip` `map` `filter` work on iterators regardless where they come from so you can do `0..10` or `[10, 20, 30]` or w/e
01:20:27FromDiscord<evoalg> In reply to @Fish-Face "`nimble` won't acknowledge the": do this: `nimble install https://github.com/beef331/slicerator` ... and since beefy is working on it currently, beefy is open to suggestions, so if you've got some ideas then you could help shape slicerator into something better but suggesting them to beefy
01:24:54FromDiscord<Fish-Face> Well I only wanted it to speed up an AOC solution more elegantly to beat some friends' times so nothing critical πŸ˜›
01:25:07FromDiscord<Elegantbeef> So then slicerator will do better πŸ˜›
01:26:02FromDiscord<Fish-Face> yes but there is overhead of instantiating the mapped sequence vs the overhead of performing the `map` in the body of the loop vs the overhead of adding unpublished packages to the build instructions πŸ˜›
01:26:22FromDiscord<Elegantbeef> It is published
01:26:33FromDiscord<Elegantbeef> You add `requires "https://github.com/beef331/slicerator"` to your nimble file and you did it
01:27:08FromDiscord<Elegantbeef> If you arent using a nimble file, i dont know what to say, use one
01:27:30FromDiscord<Fish-Face> and I already committed the other version some minutes ago πŸ™ƒ
01:27:49FromDiscord<Elegantbeef> Where are your solutions?
01:28:14FromDiscord<Fish-Face> https://github.com/fish-face/aoc2021/
01:28:30FromDiscord<Fish-Face> but I will not be accepting Pull Requests for this πŸ˜‰
01:29:23nrds<Prestige99> Is there a way to have a nim file force a certain switch on? Like switch("threads", "on") but not in config.nims
01:30:27FromDiscord<Elegantbeef> fish face is using a shell script instead of using a nimble file
01:30:30FromDiscord<Elegantbeef> Jeez πŸ˜›
01:31:29FromDiscord<Elegantbeef> I dont think so prestige
01:31:36nrds<Prestige99> rip
01:31:50FromDiscord<Fish-Face> that's a Dockerfile, not a shell script πŸ˜› it does call `nimble` directly though yes
01:32:35FromDiscord<Elegantbeef> No it calls nim
01:32:55FromDiscord<Elegantbeef> Ah nvm you do call nimble in the docker file
01:33:03FromDiscord<Elegantbeef> You really made this more complicated than it needs be
01:33:15FromDiscord<Fish-Face> eh?
01:33:22FromDiscord<Fish-Face> I think you don't know what it needs to be
01:33:44FromDiscord<Fish-Face> the Dockerfile is a requirement.
01:35:37FromDiscord<Elegantbeef> Putting your deps in a docker install command instead of just in a root nimble file
01:35:38FromDiscord<Elegantbeef> You want a portable environment to build/time your solutions to play code racer with your friends
01:35:43FromDiscord<Elegantbeef> Anyway i'll shush
01:35:46FromDiscord<Elegantbeef> Probably annoying you anyway
01:52:50*xet7 quit (Remote host closed the connection)
02:09:18*xet7 joined #nim
02:18:40*xet7 quit (Remote host closed the connection)
02:21:41*xet7 joined #nim
02:38:57*neurocyte0132889 quit (Ping timeout: 240 seconds)
02:53:49NimEventerNew thread by Oyster: Diff lib?, see https://forum.nim-lang.org/t/8755
03:30:56nrds<Prestige99> is the "of" operator for type checking very expensive?
03:31:48FromDiscord<Elegantbeef> It's uses type information to see if it's of the other type
03:32:04FromDiscord<Elegantbeef> Presently in nim's new runtime it's relatively slow as it does uncached string comparisons
03:32:24nrds<Prestige99> ah, interesting. Thanks for the insight
03:51:11*vicecea quit (Remote host closed the connection)
03:51:42*vicecea joined #nim
03:53:09FromDiscord<Elegantbeef> @evoalg\: been thinking about it was that day 1 of aoc?
04:02:06FromDiscord<evoalg> yes it was
04:19:19*noeontheend quit (Ping timeout: 250 seconds)
04:22:09FromDiscord<evoalg> sent a code paste, see https://play.nim-lang.org/#ix=3K0o
04:22:31FromDiscord<evoalg> I dunno why I did that as a reply
04:23:51FromDiscord<evoalg> and it would have been better for me to have used `len` instead of `sum` in the 2nd eg
04:26:05FromDiscord<evoalg> it might be a bad eg for slicerator, specially the 1st eg
04:35:27*noeontheend joined #nim
04:40:04FromDiscord<Elegantbeef> I still dont know about `chain` thought of just adding more operations to it, but seems like it can get complicated quickly
04:41:44FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3K0r
04:43:57*noeontheend quit (Ping timeout: 240 seconds)
04:58:23*arkurious quit (Quit: Leaving)
05:12:41FromDiscord<dizzyliam> I'm passing an enum as a static argument to a macro, and when I use backticks to insert it into a `quote do` block, it turns into an int literal. Any ideas to get around this?
05:14:40FromDiscord<amadan> sent a code paste, see https://play.nim-lang.org/#ix=3K0v
05:15:48FromDiscord<dizzyliam> yeah i think i'll do the same. for some reason it doesn't feel very idiomatic but it works
05:16:32FromDiscord<amadan> sent a code paste, see https://play.nim-lang.org/#ix=3K0w
05:16:45FromDiscord<amadan> (edit) "https://play.nim-lang.org/#ix=3K0w" => "https://play.nim-lang.org/#ix=3K0x"
05:17:05FromDiscord<amadan> Keep forgetting that module exists
05:18:38FromDiscord<dizzyliam> first i've heard of it
05:18:46FromDiscord<Elegantbeef> It's new to 1.6.2
05:18:50FromDiscord<Elegantbeef> 1.6.0 \
05:18:52FromDiscord<Elegantbeef> I'm a dummy
05:20:15FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3K0y
05:29:25FromDiscord<dizzyliam> that one's nice as well
05:29:27FromDiscord<dizzyliam> lots of choice
05:30:05FromDiscord<Elegantbeef> genast is the better choice
05:40:51*kayabaNerve joined #nim
05:52:16FromDiscord<dizzyliam> @ElegantBeef I'm getting this error building something with nimscripter:
05:52:20FromDiscord<dizzyliam> `nimscripter.nim(1, 17) Error: cannot open file: compiler/nimeval`
05:52:40FromDiscord<Elegantbeef> Ah right i forgot to say add a `config.nims` with `--path:"$nim"`
05:53:24FromDiscord<dizzyliam> thanks
05:53:42FromDiscord<dizzyliam> the secret knowledge
05:59:41FromDiscord<evoalg> sent a long message, see http://ix.io/3K0E
06:00:58FromDiscord<Elegantbeef> I'd say to always avoid include, so that's all where you're wrong
06:08:56FromDiscord<dizzyliam> @ElegantBeef Is there a way in nimscripter to pass on an imported module to the nimscript during `loadScript`?
06:09:10FromDiscord<dizzyliam> similar to the way the first demo creates a "nimscript module"
06:09:37FromDiscord<Elegantbeef> If it's in your `stdlib` you can tell it to import the module by name
06:10:02FromDiscord<Elegantbeef> https://github.com/beef331/nimscripter/blob/master/src/nimscripter.nim#L52 `modules = ["mymodule"]` for instance
06:10:14FromDiscord<Elegantbeef> Or if it's next to the module
06:10:26FromDiscord<Elegantbeef> I assume you have a basic API in a file you want to import?
06:10:44FromDiscord<Elegantbeef> Or do you want to export an entire module?
06:11:54FromDiscord<gogolxdong (liuxiaodong)> How to rename files recursively in Nim?
06:12:02FromDiscord<dizzyliam> Yeah there's some type definitions and macros in a nim file that I want both the main module and nimscript to import
06:12:30FromDiscord<dizzyliam> if that makes sense
06:12:49FromDiscord<Elegantbeef> There's a few ways to doing this, you can add it as an addition or you can copy that file to the stdlib or next to the `.nims`
06:13:07FromDiscord<Elegantbeef> in the latter you'd use the `module = ...` i mentioned earlier
06:13:20FromDiscord<Elegantbeef> I'd suggest the latter
06:13:30FromDiscord<dizzyliam> ah yep that makes sense, thanks
06:13:58FromDiscord<Elegantbeef> Any functions declared in there will be used as pure nimscript and no Nim interop ofc
06:17:06FromDiscord<dizzyliam> yep
06:21:55FromDiscord<mattrb> When using the bitsize pragma to define bitfields, can you specify the type as an enum? It seems to be permitted by the compiler, but I'm seeing some unexpected behavior..
06:22:39FromDiscord<Elegantbeef> Code example?
06:25:57FromDiscord<mattrb> Lemme reduce this further in a sec, but this is a super quick attempt at reducing it :p https://gist.github.com/mattrberry/36ca21aaaffd67e7f63a6508c22223fe
06:26:15FromDiscord<mattrb> I'd expect the assertions to all pass
06:28:12FromDiscord<mattrb> In that example, DMACNT2 has enums for some fields. I'm setting both dmacnt and dmacnt2 to the value 0x8000, so I'd expect only the top bit of each to be set, i.e. the .enable field
06:28:29FromDiscord<mattrb> There's definitely a chance I'm just doing something stupid
06:28:52FromDiscord<Elegantbeef> Let's see
06:38:15FromDiscord<Elegantbeef> Yea this is very odd
06:44:28FromDiscord<codic> https://nitely.github.io/nim-regex/regex.html for toPattern this says "Deprecated: Use `re` instead"
06:44:34FromDiscord<codic> however, re compiles the regex at compile time
06:44:37FromDiscord<codic> I don't want this, I can't have this
06:44:44FromDiscord<codic> i must compile my regex with runtime data
06:44:44FromDiscord<Elegantbeef> Ah found the issue
06:44:51FromDiscord<Elegantbeef> Someone didnt annotated with `{.packed.}`
06:44:52FromDiscord<codic> so how do I do that if not with toPattern?
06:45:26FromDiscord<Elegantbeef> https://nitely.github.io/nim-regex/regex.html#re%2Cstring
06:45:49FromDiscord<codic> Oh I am stupid
06:45:53FromDiscord<codic> There is an overload for both lol
06:45:57FromDiscord<codic> Ok cool
06:46:17FromDiscord<Elegantbeef> @mattrb\: https://play.nim-lang.org/#ix=3K0P
06:46:28FromDiscord<Elegantbeef> Adding packed solves it but i also added `AddressControl`
06:46:46FromDiscord<Elegantbeef> I think it makes sense since it's probably adding unwanted pading for the enum types
06:50:35FromDiscord<mattrb> Ah, I didn't know about packed. I would have figured that the implication when using bitfields was that they're packed. Good find though! What does adding AddressControl do? Just ensure that the value maps to 2 bits?
06:50:50FromDiscord<mattrb> Had to step away from my computer so I can't play around with it this second :/
06:51:21FromDiscord<Elegantbeef> Well it gives you a small range so if you know you never assign a unsafe value
07:03:12FromDiscord<mattrb> I'll need to look at the generated code to see how it's actually behaving I guess. I initially assumed that when using the bitsize pragma, it would just mask effectively mask/shift those bits and cast them to the defined type. I definitely wouldn't have expected to have the size of the enum impact the size of the resulting struct
07:03:46FromDiscord<Elegantbeef> I think perhaps the enum isnt cased for packing without `packed`
07:03:50FromDiscord<Elegantbeef> Might be a compiler bug
07:03:56FromDiscord<mattrb> But I'm also not a c wizard. I remember doing something similar in c++ a long ways back that worked
07:04:36FromDiscord<mattrb> In curious now so I'll toy around with the target c code tomorrow to see if I can learn a little more about what's going on
07:04:50FromDiscord<mattrb> Thank you for the help with the `packed` tip!
07:06:01FromDiscord<Elegantbeef> Yea do update me with the C code once you toy with it
07:06:30FromDiscord<Elegantbeef> I'm thinking `bitsize` "works" with enums
08:09:43*tiorock joined #nim
08:09:43*tiorock quit (Changing host)
08:09:43*tiorock joined #nim
08:09:43*rockcavera is now known as Guest8765
08:09:43*Guest8765 quit (Killed (lithium.libera.chat (Nickname regained by services)))
08:09:43*tiorock is now known as rockcavera
08:44:17FromDiscord<evoalg> @ElegantBeef if I was going to have a grid of 1's & 0's or (true & false) then it's inefficient to use int's ... are bool's a good idea? (good idea in terms of mem & speed). Or would enums be the way to go?
08:45:27FromDiscord<Elegantbeef> Well if you want to be anal-retentive you'd use a packed bit collection
08:45:48FromDiscord<Elegantbeef> So if you know the range you could do `set[first..last]`
08:46:02FromDiscord<Elegantbeef> Though that only works for a 65k range
08:46:20FromDiscord<Elegantbeef> So if area is larger than 65k you'd need to make your own collection
08:46:50FromDiscord<Elegantbeef> Or use a bit array here https://nimble.directory/search?query=bit
08:47:15FromDiscord<Elegantbeef> The 65k is actually `uint16.high` if it's not clear
08:48:19FromDiscord<evoalg> ahhh so even though it's only 1 & 0, you're talking about the range of the size of the grid right?
08:48:26FromDiscord<evoalg> that makes sense
08:49:12FromDiscord<Elegantbeef> Yea the range is how many bits
08:49:26FromDiscord<Elegantbeef> for instance `set[0..10]` is 10 bits
08:49:37FromDiscord<Elegantbeef> 11 bits actually cause of inclusive range
08:49:49FromDiscord<evoalg> thanks for the link, I'll have a read. Ahhh ok number of bits! gotcha ok!
08:50:28FromDiscord<Elegantbeef> Nim's builtin set is limited to a range of `uint16.high` if you need anymore that's what the other libraries are for
08:50:48FromDiscord<Elegantbeef> So if your area isnt static or known beforehand you'll want the packages πŸ˜›
08:51:10FromDiscord<evoalg> gotcha yea they will grow ... but I'm confused by what a "packed bit collection" ... is that the `set[first..last]` thingy?
08:51:30FromDiscord<Elegantbeef> instead of storing "on" in a bool you store it in a bit
08:51:38FromDiscord<Elegantbeef> So you can fit 8 times as much data in the same memory
08:52:09FromDiscord<evoalg> ahhhhh gotcha yea I seen that sort of thing before. So do those packages use the same sort of trick?
08:52:14FromDiscord<Elegantbeef> In Nim unlike C++ `seq[bool]` has each element being 8 bits, so you're using 1/8th the amount of bytes you have
08:52:17FromDiscord<Elegantbeef> Yea they do
08:53:10FromDiscord<Elegantbeef> If you know the width of a column you also could use that with a sequence
08:54:49FromDiscord<evoalg> it sounds interesting to do it by hand rather than use packages, but I think it might be easier for me to use packages, unless I need good understanding of what's going on behind the scenes?
08:55:01FromDiscord<Elegantbeef> Indeed
08:56:54FromDiscord<evoalg> thank you Elegantbeef - that's all very interesting and helpful!
09:02:51FromDiscord<jord> is there any Nim implementation of the buffer-replace node.js package?
09:12:12FromDiscord<Elegantbeef> @evoalg\: you know me, i cant resist coding a silly implementation to show https://play.nim-lang.org/#ix=3K1m
09:12:38FromDiscord<evoalg> you're good!
09:12:48FromDiscord<Elegantbeef> Still not overly packed since all bits arent contiguous
09:13:11FromDiscord<evoalg> I'll try and understand it
09:13:26FromDiscord<Elegantbeef> It'd need to be whole bytes to be contiguous
09:13:38FromDiscord<Elegantbeef> So any multiple of 8 would be efficient for this thing
09:13:58FromDiscord<Elegantbeef> Otherwise you're losing memory due to not doing contiguous storage
09:15:21FromDiscord<Elegantbeef> The actual bitlists are better than that, it's just fun
09:17:13FromDiscord<evoalg> what would need to be a multiple of 8? ... the length of the `a` ?
09:17:32FromDiscord<Elegantbeef> `BitSeq[8]`
09:17:34FromDiscord<Elegantbeef> The width of the column
09:18:03FromDiscord<evoalg> ahhh right!
09:18:18FromDiscord<Elegantbeef> `set` takes up the amount of bits in the range so if you do o `0 .. 5 - 1` you're using 5 bits of 8 in a byte
09:19:20FromDiscord<Elegantbeef> And as such when you put them end to end you have 3 unused bits between them
09:19:29FromDiscord<Elegantbeef> It's the bool problem just slightly more efficient
09:19:57FromDiscord<Elegantbeef> Infact if you did `set[0..0]` you'd have the exact same compression as the bool method πŸ˜€
09:19:57FromDiscord<evoalg> gotcha ok ... that makes sense ... and btw it amazes me that you can do something like this so fast, and it works!
09:20:10FromDiscord<evoalg> ahhh true!
09:21:56FromDiscord<Elegantbeef> How else do i pretend i'm a programmer πŸ˜›β†΅(@evoalg)
09:23:04FromDiscord<evoalg> hehe ... you're funny ... and I know what Rika would say about now
09:23:19FromDiscord<Rika> You’re not fooling anyone
09:23:27FromDiscord<evoalg> bingo!
09:26:38FromDiscord<Elegantbeef> Rika sits perched just to jump down with the inane insults!
09:36:23FromDiscord<hmmm> yea rika is a predator that lurks in the dark that bites anything that is cute and fluffy
09:36:54FromDiscord<SecureThisShit> In reply to @Solitude "i dont get the": The solution was to declare the function1 with {.stdcall.}. That made it castable FYI.
09:41:59FromDiscord<Elegantbeef> @SecureThisShit\: i do have to ask are you doing a type conversion or actual `cast` when you say "castable"?
09:42:38FromDiscord<hmmm> In reply to @evoalg "Do you fold your": yo my boi thanks, nu I was thinking about ways to break horizontal long lines, I remember there were supposed to be rules on how to do that
09:43:15FromDiscord<evoalg> ahhh yea ... like after a comma, etc
09:43:26FromDiscord<Elegantbeef> Horizontally long lines are sinful! πŸ˜›
09:43:41FromDiscord<evoalg> lol
09:45:36FromDiscord<hmmm> yea lol
09:48:42FromDiscord<jord> is there any Nim implementation of the buffer-replace node.js package?
09:49:32FromDiscord<Elegantbeef> Is that just string replace?
09:49:50FromDiscord<Elegantbeef> If so https://nim-lang.org/docs/strutils.html#replace%2Cstring%2Cstring%2Cstring
09:54:12FromDiscord<evoalg> In reply to @hmmm "yo my boi thanks,": I found this https://nim-lang.org/docs/nep1.html#introduction-conventions-for-multiminusline-statements-and-expressions ... but I think there are others too
09:57:58*xet7 quit (Remote host closed the connection)
10:00:12*xet7 joined #nim
10:01:41*jjido joined #nim
10:01:53FromDiscord<hmmm> sent a code paste, see https://play.nim-lang.org/#ix=3K1s
10:02:04FromDiscord<hmmm> but it might have been python so I don't know lol
10:02:49FromDiscord<evoalg> maybe for nim it's like this: https://status-im.github.io/nim-style-guide/formatting.style.html
10:03:27FromDiscord<Rika> NEP 1
10:03:34FromDiscord<Rika> I don’t know where it’s located in the docs
10:04:09FromDiscord<evoalg> https://nim-lang.org/docs/nep1.html
10:04:34FromDiscord<hmmm> In reply to @NimEventer "New Nimble package! nimfmt": this looks juicy btw, anyone already tried it
10:05:41FromDiscord<Rika> It’s incomplete
10:06:47FromDiscord<hmmm> what's missing
10:07:52FromDiscord<Rika> It’s listed on the read me
10:12:32*xet7 quit (Remote host closed the connection)
10:14:34*xet7 joined #nim
11:15:58FromDiscord<qb> In reply to @Elegantbeef "Alternatively use `scanp`": `nimble publish` won't work if you have not `master` as default branch. `git config --global init.defaultBranch master` fixed it
11:16:31FromDiscord<qb> sent a code paste, see https://play.nim-lang.org/#ix=3K1O
11:32:01*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
11:34:17FromDiscord<dizzyliam> Settled on an OK nimscript syntax for my typesetting engine
11:34:37FromDiscord<dizzyliam> sent a code paste, see https://play.nim-lang.org/#ix=3K1S
11:36:34*jjido joined #nim
11:50:35FromDiscord<hmmm> hourly reminder that sequtils is awesome 🀩
12:07:26FromDiscord<planetis> is this a "dangerous" implicit conversion to cstring? `drawText(cameraDescriptions.cstring, 40, 140, 10, DarkGray)`
12:08:20FromDiscord<planetis> I think this warning must appear a lot in wrappers
12:11:30FromDiscord<evil> I keep accidentally running a key combo that runs the command "nim secret " in my terminal. does anyone know what the actual combination is? I would like to be able to use it not on accident
12:13:31NimEventerNew Nimble package! opussum - Wrapper around libopus, see https://github.com/ire4ever1190/opussum
14:31:59*arkurious joined #nim
14:40:52FromDiscord<Schelz> any lib for nim to check keypress ?
14:49:38FromDiscord<hmmm> I remember illwill had a getkey() proc, but the lin is about ncurses
14:50:27FromDiscord<enthus1ast> yes keypressen can be checked with illwill
14:50:33FromDiscord<enthus1ast> async keypresses i mean
14:50:49FromDiscord<enthus1ast> (but only ascii / en-us keys)
14:51:29FromDiscord<enthus1ast> for blocking checks have a look at std/terminal.nim
14:56:59FromDiscord<hmmm> yea terminal has getch()
14:58:08FromDiscord<hmmm> I remeber using it to make a proc to cover passwords with
14:58:26FromDiscord<hmmm> it was called dancingWithTheStars
14:58:46FromDiscord<hmmm> my proc names are legendary 🧐
15:09:15FromDiscord<Isofruit> ... nim even has an interpreter for on the fly code testing (inim) I am very happily surprised
15:11:10FromDiscord<Solitude> In reply to @Isofruit "... nim even has": nim has an interpreter, but inim isnt it.
15:11:27FromDiscord<Isofruit> I see I still fuck up the correct naming of stuff then
15:12:25FromDiscord<Isofruit> Either way, does not take away from the point: On the fly code testing, yay
15:16:49FromDiscord<qb> In reply to @Schelz "any lib for nim": windows, linux? x11?
15:49:08*neurocyte0132889 joined #nim
15:49:08*neurocyte0132889 quit (Changing host)
15:49:08*neurocyte0132889 joined #nim
16:29:42FromDiscord<n00nehere> what do you think is the best library for making games on linux?
16:30:09FromDiscord<n00nehere> i tried raylib and godot but i really don't like godot and raylib has gave me a lot of problems
16:30:39FromDiscord<enthus1ast> i currently use raylib and i think its great
16:31:10FromDiscord<n00nehere> it gave me problems like memleaks on test programs, randomly crashing, cant find dependencies etc...
16:31:16FromDiscord<n00nehere> all with test programs
16:31:49FromDiscord<enthus1ast> have not encountered these
16:46:53FromDiscord<sOkam!> sdl seems to be used a lot in nim
16:47:24FromDiscord<sOkam!> In reply to @n00nehere "what do you think": sdl seems to be used a lot in nim
16:49:49NimEventerNew Nimble package! NimbleImGui - ImGui Frontend for Nimble, see https://github.com/qb-0/NimbleImGui
16:55:08FromDiscord<sOkam!> In reply to @enthus1ast "i currently use raylib": any specific bindings that you recommend?
17:15:19*PMunch joined #nim
17:40:08FromDiscord<Shiba> can i use -d:release -d:danger when i do testing and debuginf
17:40:28PMunchI mean you can
17:40:30FromDiscord<planetis> memory leaks? do tell more n00nehere
17:41:04PMunchBut they remove debugging so you won't get as informative errors and such
18:03:28*neurocyte0132889 quit (Quit: The Lounge - https://thelounge.chat)
18:18:49*lumo_e joined #nim
18:22:35*neurocyte0132889 joined #nim
18:22:35*neurocyte0132889 quit (Changing host)
18:22:35*neurocyte0132889 joined #nim
18:34:43*xet7 quit (Remote host closed the connection)
18:35:55*xet7 joined #nim
18:56:36FromDiscord<frankzig> sent a code paste, see https://play.nim-lang.org/#ix=3K6d
18:56:37FromDiscord<frankzig> ?
19:00:21*lumo_e quit (Ping timeout: 245 seconds)
19:00:46FromDiscord<enthus1ast> i think they are
19:01:59FromDiscord<qb> sent a code paste, see https://play.nim-lang.org/#ix=3K6h
19:02:08FromDiscord<el__maco> I think they are asking about constructors
19:02:19FromDiscord<el__maco> maybe?
19:03:02FromDiscord<enthus1ast> ref objects are not afaik
19:09:07*xet7 quit (Remote host closed the connection)
19:18:24*xet7 joined #nim
19:20:49PMunchWell a ref object will be initialise to a null reference/null pointer
19:38:14*xet7 quit (Remote host closed the connection)
19:44:40*Gustavo6046 joined #nim
19:51:28FromDiscord<retkid> i know iterators are not unique to nim
19:51:38FromDiscord<retkid> but the way nim does them is such a strong thing
19:52:07FromDiscord<retkid> makes code a lot cleaner
19:52:45FromDiscord<retkid> im updating an old python repo and im really missing the convenience of Nim's iterators.
19:54:31FromDiscord<konsumlamm> umm, python has exactly the same style of iterators
19:54:48FromDiscord<konsumlamm> in fact, i'm pretty sure nim's iterators were inspired by python's
19:54:48FromDiscord<retkid> except they're bound to classes
19:54:54FromDiscord<konsumlamm> no?
19:55:01FromDiscord<retkid> NO!?!
19:55:10FromDiscord<konsumlamm> in python they'r ecalled generators
19:55:29FromDiscord<retkid> alright thats all i needed to know
19:55:33FromDiscord<konsumlamm> the iter stuff is bound to classes, bit you can also define nim style iterators
19:55:48FromDiscord<konsumlamm> (edit) "iter" => "`iter`" | "bit" => "but"
19:56:52FromDiscord<retkid> thank you, saint konsumlamm
19:57:55FromDiscord<konsumlamm> np
19:59:51FromDiscord<konsumlamm> (the reason most python iterators don't use generators is that they also define additional stuff)
20:56:29*lumo_e joined #nim
21:01:11*lumo_e quit (Ping timeout: 268 seconds)
21:04:00*lumo_e joined #nim
21:11:45FromDiscord<Isofruit> sent a code paste, see https://play.nim-lang.org/#ix=3K7d
21:12:23FromDiscord<Isofruit> (edit) "https://play.nim-lang.org/#ix=3K7d" => "https://play.nim-lang.org/#ix=3K7f"
22:29:21*lumo_e quit (Ping timeout: 250 seconds)
22:30:05FromDiscord<Isofruit> God why is it such a massive pain to deserialize DateTime into json
23:10:54*xet7 joined #nim
23:16:14*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
23:33:31FromDiscord<Elegantbeef> Really though you shouldn't use json and just use `format` from times
23:33:32FromDiscord<Elegantbeef> @Isofruit\: cause `timezone` has procedures, you can quickly use `jsonutils` to serialize it https://play.nim-lang.org/#ix=3K7K
23:33:32FromDiscord<Elegantbeef> Since timestamps are standard
23:47:32FromDiscord<Isofruit> sent a code paste, see https://play.nim-lang.org/#ix=3K7P
23:48:36FromDiscord<Isofruit> I'm sorely tempted to just move DateTime back into "string" and deal with the hassle that creates elsewhere if it allows me to avoid custom serializers
23:49:04FromDiscord<Isofruit> (edit) "move DateTime back into "string"" => "use `string` instead of `DateTime` in th model"
23:55:39FromDiscord<Elegantbeef> I mean https://play.nim-lang.org/#ix=3K7Q works
23:56:16FromDiscord<Elegantbeef> The only issue is you need to handle the times not set, but that's easy in the serializer
23:57:17FromDiscord<Isofruit> One sec, if I can get this to work I'll be so effin relieved