00:00:39 | FromDiscord | <dizzyliam> oh nice, that could actually be really useful |
00:18:49 | FromDiscord | <Elegantbeef> Yep if you have any issues feel free to holler at me |
00:45:39 | FromDiscord | <dizzyliam> thanks |
00:50:54 | FromDiscord | <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:16 | FromDiscord | <TheAlex> for ``and`` I got ``10 other mismatching symbols have been suppressed; compile with --showAllMismatches:on to see them`` |
00:52:01 | FromDiscord | <TheAlex> for ``&&`` I get ``Error: undeclared identifier: '&&'`` |
00:54:35 | FromDiscord | <Rosen> Can you give some more context? Can you show the line it was throwing that first error at you at? |
00:56:25 | FromDiscord | <TheAlex> sent a code paste, see https://play.nim-lang.org/#ix=3JZC |
00:57:09 | FromDiscord | <TheAlex> (edit) "https://play.nim-lang.org/#ix=3JZC" => "https://play.nim-lang.org/#ix=3JZD" |
00:59:29 | FromDiscord | <Elegantbeef> `if i mod 3 == 0 and i mod 5 == 0` |
00:59:55 | FromDiscord | <Elegantbeef> or `i mod 3 and i mod 5 == 0` |
01:00:04 | FromDiscord | <Elegantbeef> Though that's bitwise `and` |
01:00:12 | FromDiscord | <TheAlex> ah so does ``%%`` not work in in nim? |
01:00:29 | FromDiscord | <Elegantbeef> I mean it works but it's not the operator for modulo |
01:00:50 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/system.html#%25%25%2Cint%2Cint |
01:00:51 | FromDiscord | <Elegantbeef> It's unsigned modulo |
01:01:25 | FromDiscord | <Elegantbeef> Nim being wirth inspired prefers word operators in many cases |
01:01:28 | FromDiscord | <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:35 | FromDiscord | <TheAlex> In reply to @Elegantbeef "Nim being wirth inspired": I see, thank you |
01:02:55 | FromDiscord | <Elegantbeef> `type Iterable[T] = (iterator: T) | Slice[T]` yea it's not |
01:02:55 | FromDiscord | <Elegantbeef> In this definition you need to do `seq.items` |
01:03:10 | FromDiscord | <dizzyliam> In reply to @Fish-Face "I am attempting to": https://nim-by-example.github.io/for_iterators/ |
01:04:36 | FromDiscord | <Fish-Face> @ElegantBeef ah I see that makes some sense. Confusingly a seq literal doesn't want to be `items`d |
01:04:44 | FromDiscord | <Fish-Face> @dizzyliam `Iterable`, not `iterator` π |
01:04:55 | FromDiscord | <dizzyliam> oops yeah i got confused |
01:05:14 | FromDiscord | <dizzyliam> where does `iterutils` come from? |
01:06:45 | FromDiscord | <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:06 | FromDiscord | <Fish-Face> https://hookrace.net/nim-iterutils/iterutils.html |
01:07:47 | FromDiscord | <dizzyliam> thanks |
01:07:57 | FromDiscord | <Fish-Face> it's on github too |
01:09:04 | FromDiscord | <Elegantbeef> And even then it might not work |
01:09:05 | FromDiscord | <Elegantbeef> Due to `items` being an inline iterator |
01:09:46 | FromDiscord | <Fish-Face> ah so I got confused |
01:09:54 | FromDiscord | <Fish-Face> `Iterable` is not `iterable` π |
01:10:01 | FromDiscord | <Elegantbeef> It's a nimble package |
01:10:24 | FromDiscord | <Elegantbeef> Like i said it's a inline iterator |
01:10:46 | FromDiscord | <Fish-Face> and `seq.items` is `iterable` (not `iterator`) so not one of the types in `Iterable` |
01:10:51 | FromDiscord | <Elegantbeef> Shameless https://github.com/beef331/slicerator/blob/master/src/slicerator.nim#L201-L204 |
01:11:16 | FromDiscord | <Elegantbeef> Yep |
01:11:33 | FromDiscord | <Elegantbeef> I have some silly macros i'm working on |
01:11:59 | FromDiscord | <Elegantbeef> But it's in progress |
01:12:01 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3JZL |
01:12:27 | FromDiscord | <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:42 | FromDiscord | <Fish-Face> huh |
01:13:31 | FromDiscord | <Fish-Face> So if you define an `inline` iterator that yields `T` that is not `iterator: T`? |
01:13:39 | FromDiscord | <Elegantbeef> Indeed |
01:13:49 | FromDiscord | <Fish-Face> `nimble` won't acknowledge the existence of `slicerator`, strangely |
01:13:52 | FromDiscord | <Fish-Face> I am on 1.6.2 |
01:13:57 | FromDiscord | <Elegantbeef> It's not in the repository |
01:13:59 | FromDiscord | <Elegantbeef> or registry |
01:14:00 | FromDiscord | <Fish-Face> but OK, this is not such a big deal atm |
01:14:01 | FromDiscord | <Fish-Face> ah |
01:14:13 | FromDiscord | <Elegantbeef> You need to install it using the git url presently as i havent got to publishing |
01:14:28 | FromDiscord | <Elegantbeef> I want to figure out that `chain` macro and document/clean everything up still |
01:15:07 | FromDiscord | <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:27 | FromDiscord | <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:54 | FromDiscord | <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:07 | FromDiscord | <Elegantbeef> So then slicerator will do better π |
01:26:02 | FromDiscord | <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:22 | FromDiscord | <Elegantbeef> It is published |
01:26:33 | FromDiscord | <Elegantbeef> You add `requires "https://github.com/beef331/slicerator"` to your nimble file and you did it |
01:27:08 | FromDiscord | <Elegantbeef> If you arent using a nimble file, i dont know what to say, use one |
01:27:30 | FromDiscord | <Fish-Face> and I already committed the other version some minutes ago π |
01:27:49 | FromDiscord | <Elegantbeef> Where are your solutions? |
01:28:14 | FromDiscord | <Fish-Face> https://github.com/fish-face/aoc2021/ |
01:28:30 | FromDiscord | <Fish-Face> but I will not be accepting Pull Requests for this π |
01:29:23 | nrds | <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:27 | FromDiscord | <Elegantbeef> fish face is using a shell script instead of using a nimble file |
01:30:30 | FromDiscord | <Elegantbeef> Jeez π |
01:31:29 | FromDiscord | <Elegantbeef> I dont think so prestige |
01:31:36 | nrds | <Prestige99> rip |
01:31:50 | FromDiscord | <Fish-Face> that's a Dockerfile, not a shell script π it does call `nimble` directly though yes |
01:32:35 | FromDiscord | <Elegantbeef> No it calls nim |
01:32:55 | FromDiscord | <Elegantbeef> Ah nvm you do call nimble in the docker file |
01:33:03 | FromDiscord | <Elegantbeef> You really made this more complicated than it needs be |
01:33:15 | FromDiscord | <Fish-Face> eh? |
01:33:22 | FromDiscord | <Fish-Face> I think you don't know what it needs to be |
01:33:44 | FromDiscord | <Fish-Face> the Dockerfile is a requirement. |
01:35:37 | FromDiscord | <Elegantbeef> Putting your deps in a docker install command instead of just in a root nimble file |
01:35:38 | FromDiscord | <Elegantbeef> You want a portable environment to build/time your solutions to play code racer with your friends |
01:35:43 | FromDiscord | <Elegantbeef> Anyway i'll shush |
01:35:46 | FromDiscord | <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:49 | NimEventer | New thread by Oyster: Diff lib?, see https://forum.nim-lang.org/t/8755 |
03:30:56 | nrds | <Prestige99> is the "of" operator for type checking very expensive? |
03:31:48 | FromDiscord | <Elegantbeef> It's uses type information to see if it's of the other type |
03:32:04 | FromDiscord | <Elegantbeef> Presently in nim's new runtime it's relatively slow as it does uncached string comparisons |
03:32:24 | nrds | <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:09 | FromDiscord | <Elegantbeef> @evoalg\: been thinking about it was that day 1 of aoc? |
04:02:06 | FromDiscord | <evoalg> yes it was |
04:19:19 | * | noeontheend quit (Ping timeout: 250 seconds) |
04:22:09 | FromDiscord | <evoalg> sent a code paste, see https://play.nim-lang.org/#ix=3K0o |
04:22:31 | FromDiscord | <evoalg> I dunno why I did that as a reply |
04:23:51 | FromDiscord | <evoalg> and it would have been better for me to have used `len` instead of `sum` in the 2nd eg |
04:26:05 | FromDiscord | <evoalg> it might be a bad eg for slicerator, specially the 1st eg |
04:35:27 | * | noeontheend joined #nim |
04:40:04 | FromDiscord | <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:44 | FromDiscord | <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:41 | FromDiscord | <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:40 | FromDiscord | <amadan> sent a code paste, see https://play.nim-lang.org/#ix=3K0v |
05:15:48 | FromDiscord | <dizzyliam> yeah i think i'll do the same. for some reason it doesn't feel very idiomatic but it works |
05:16:32 | FromDiscord | <amadan> sent a code paste, see https://play.nim-lang.org/#ix=3K0w |
05:16:45 | FromDiscord | <amadan> (edit) "https://play.nim-lang.org/#ix=3K0w" => "https://play.nim-lang.org/#ix=3K0x" |
05:17:05 | FromDiscord | <amadan> Keep forgetting that module exists |
05:18:38 | FromDiscord | <dizzyliam> first i've heard of it |
05:18:46 | FromDiscord | <Elegantbeef> It's new to 1.6.2 |
05:18:50 | FromDiscord | <Elegantbeef> 1.6.0 \ |
05:18:52 | FromDiscord | <Elegantbeef> I'm a dummy |
05:20:15 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3K0y |
05:29:25 | FromDiscord | <dizzyliam> that one's nice as well |
05:29:27 | FromDiscord | <dizzyliam> lots of choice |
05:30:05 | FromDiscord | <Elegantbeef> genast is the better choice |
05:40:51 | * | kayabaNerve joined #nim |
05:52:16 | FromDiscord | <dizzyliam> @ElegantBeef I'm getting this error building something with nimscripter: |
05:52:20 | FromDiscord | <dizzyliam> `nimscripter.nim(1, 17) Error: cannot open file: compiler/nimeval` |
05:52:40 | FromDiscord | <Elegantbeef> Ah right i forgot to say add a `config.nims` with `--path:"$nim"` |
05:53:24 | FromDiscord | <dizzyliam> thanks |
05:53:42 | FromDiscord | <dizzyliam> the secret knowledge |
05:59:41 | FromDiscord | <evoalg> sent a long message, see http://ix.io/3K0E |
06:00:58 | FromDiscord | <Elegantbeef> I'd say to always avoid include, so that's all where you're wrong |
06:08:56 | FromDiscord | <dizzyliam> @ElegantBeef Is there a way in nimscripter to pass on an imported module to the nimscript during `loadScript`? |
06:09:10 | FromDiscord | <dizzyliam> similar to the way the first demo creates a "nimscript module" |
06:09:37 | FromDiscord | <Elegantbeef> If it's in your `stdlib` you can tell it to import the module by name |
06:10:02 | FromDiscord | <Elegantbeef> https://github.com/beef331/nimscripter/blob/master/src/nimscripter.nim#L52 `modules = ["mymodule"]` for instance |
06:10:14 | FromDiscord | <Elegantbeef> Or if it's next to the module |
06:10:26 | FromDiscord | <Elegantbeef> I assume you have a basic API in a file you want to import? |
06:10:44 | FromDiscord | <Elegantbeef> Or do you want to export an entire module? |
06:11:54 | FromDiscord | <gogolxdong (liuxiaodong)> How to rename files recursively in Nim? |
06:12:02 | FromDiscord | <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:30 | FromDiscord | <dizzyliam> if that makes sense |
06:12:49 | FromDiscord | <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:07 | FromDiscord | <Elegantbeef> in the latter you'd use the `module = ...` i mentioned earlier |
06:13:20 | FromDiscord | <Elegantbeef> I'd suggest the latter |
06:13:30 | FromDiscord | <dizzyliam> ah yep that makes sense, thanks |
06:13:58 | FromDiscord | <Elegantbeef> Any functions declared in there will be used as pure nimscript and no Nim interop ofc |
06:17:06 | FromDiscord | <dizzyliam> yep |
06:21:55 | FromDiscord | <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:39 | FromDiscord | <Elegantbeef> Code example? |
06:25:57 | FromDiscord | <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:15 | FromDiscord | <mattrb> I'd expect the assertions to all pass |
06:28:12 | FromDiscord | <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:29 | FromDiscord | <mattrb> There's definitely a chance I'm just doing something stupid |
06:28:52 | FromDiscord | <Elegantbeef> Let's see |
06:38:15 | FromDiscord | <Elegantbeef> Yea this is very odd |
06:44:28 | FromDiscord | <codic> https://nitely.github.io/nim-regex/regex.html for toPattern this says "Deprecated: Use `re` instead" |
06:44:34 | FromDiscord | <codic> however, re compiles the regex at compile time |
06:44:37 | FromDiscord | <codic> I don't want this, I can't have this |
06:44:44 | FromDiscord | <codic> i must compile my regex with runtime data |
06:44:44 | FromDiscord | <Elegantbeef> Ah found the issue |
06:44:51 | FromDiscord | <Elegantbeef> Someone didnt annotated with `{.packed.}` |
06:44:52 | FromDiscord | <codic> so how do I do that if not with toPattern? |
06:45:26 | FromDiscord | <Elegantbeef> https://nitely.github.io/nim-regex/regex.html#re%2Cstring |
06:45:49 | FromDiscord | <codic> Oh I am stupid |
06:45:53 | FromDiscord | <codic> There is an overload for both lol |
06:45:57 | FromDiscord | <codic> Ok cool |
06:46:17 | FromDiscord | <Elegantbeef> @mattrb\: https://play.nim-lang.org/#ix=3K0P |
06:46:28 | FromDiscord | <Elegantbeef> Adding packed solves it but i also added `AddressControl` |
06:46:46 | FromDiscord | <Elegantbeef> I think it makes sense since it's probably adding unwanted pading for the enum types |
06:50:35 | FromDiscord | <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:50 | FromDiscord | <mattrb> Had to step away from my computer so I can't play around with it this second :/ |
06:51:21 | FromDiscord | <Elegantbeef> Well it gives you a small range so if you know you never assign a unsafe value |
07:03:12 | FromDiscord | <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:46 | FromDiscord | <Elegantbeef> I think perhaps the enum isnt cased for packing without `packed` |
07:03:50 | FromDiscord | <Elegantbeef> Might be a compiler bug |
07:03:56 | FromDiscord | <mattrb> But I'm also not a c wizard. I remember doing something similar in c++ a long ways back that worked |
07:04:36 | FromDiscord | <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:50 | FromDiscord | <mattrb> Thank you for the help with the `packed` tip! |
07:06:01 | FromDiscord | <Elegantbeef> Yea do update me with the C code once you toy with it |
07:06:30 | FromDiscord | <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:17 | FromDiscord | <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:27 | FromDiscord | <Elegantbeef> Well if you want to be anal-retentive you'd use a packed bit collection |
08:45:48 | FromDiscord | <Elegantbeef> So if you know the range you could do `set[first..last]` |
08:46:02 | FromDiscord | <Elegantbeef> Though that only works for a 65k range |
08:46:20 | FromDiscord | <Elegantbeef> So if area is larger than 65k you'd need to make your own collection |
08:46:50 | FromDiscord | <Elegantbeef> Or use a bit array here https://nimble.directory/search?query=bit |
08:47:15 | FromDiscord | <Elegantbeef> The 65k is actually `uint16.high` if it's not clear |
08:48:19 | FromDiscord | <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:26 | FromDiscord | <evoalg> that makes sense |
08:49:12 | FromDiscord | <Elegantbeef> Yea the range is how many bits |
08:49:26 | FromDiscord | <Elegantbeef> for instance `set[0..10]` is 10 bits |
08:49:37 | FromDiscord | <Elegantbeef> 11 bits actually cause of inclusive range |
08:49:49 | FromDiscord | <evoalg> thanks for the link, I'll have a read. Ahhh ok number of bits! gotcha ok! |
08:50:28 | FromDiscord | <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:48 | FromDiscord | <Elegantbeef> So if your area isnt static or known beforehand you'll want the packages π |
08:51:10 | FromDiscord | <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:30 | FromDiscord | <Elegantbeef> instead of storing "on" in a bool you store it in a bit |
08:51:38 | FromDiscord | <Elegantbeef> So you can fit 8 times as much data in the same memory |
08:52:09 | FromDiscord | <evoalg> ahhhhh gotcha yea I seen that sort of thing before. So do those packages use the same sort of trick? |
08:52:14 | FromDiscord | <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:17 | FromDiscord | <Elegantbeef> Yea they do |
08:53:10 | FromDiscord | <Elegantbeef> If you know the width of a column you also could use that with a sequence |
08:54:49 | FromDiscord | <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:01 | FromDiscord | <Elegantbeef> Indeed |
08:56:54 | FromDiscord | <evoalg> thank you Elegantbeef - that's all very interesting and helpful! |
09:02:51 | FromDiscord | <jord> is there any Nim implementation of the buffer-replace node.js package? |
09:12:12 | FromDiscord | <Elegantbeef> @evoalg\: you know me, i cant resist coding a silly implementation to show https://play.nim-lang.org/#ix=3K1m |
09:12:38 | FromDiscord | <evoalg> you're good! |
09:12:48 | FromDiscord | <Elegantbeef> Still not overly packed since all bits arent contiguous |
09:13:11 | FromDiscord | <evoalg> I'll try and understand it |
09:13:26 | FromDiscord | <Elegantbeef> It'd need to be whole bytes to be contiguous |
09:13:38 | FromDiscord | <Elegantbeef> So any multiple of 8 would be efficient for this thing |
09:13:58 | FromDiscord | <Elegantbeef> Otherwise you're losing memory due to not doing contiguous storage |
09:15:21 | FromDiscord | <Elegantbeef> The actual bitlists are better than that, it's just fun |
09:17:13 | FromDiscord | <evoalg> what would need to be a multiple of 8? ... the length of the `a` ? |
09:17:32 | FromDiscord | <Elegantbeef> `BitSeq[8]` |
09:17:34 | FromDiscord | <Elegantbeef> The width of the column |
09:18:03 | FromDiscord | <evoalg> ahhh right! |
09:18:18 | FromDiscord | <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:20 | FromDiscord | <Elegantbeef> And as such when you put them end to end you have 3 unused bits between them |
09:19:29 | FromDiscord | <Elegantbeef> It's the bool problem just slightly more efficient |
09:19:57 | FromDiscord | <Elegantbeef> Infact if you did `set[0..0]` you'd have the exact same compression as the bool method π |
09:19:57 | FromDiscord | <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:10 | FromDiscord | <evoalg> ahhh true! |
09:21:56 | FromDiscord | <Elegantbeef> How else do i pretend i'm a programmer πβ΅(@evoalg) |
09:23:04 | FromDiscord | <evoalg> hehe ... you're funny ... and I know what Rika would say about now |
09:23:19 | FromDiscord | <Rika> Youβre not fooling anyone |
09:23:27 | FromDiscord | <evoalg> bingo! |
09:26:38 | FromDiscord | <Elegantbeef> Rika sits perched just to jump down with the inane insults! |
09:36:23 | FromDiscord | <hmmm> yea rika is a predator that lurks in the dark that bites anything that is cute and fluffy |
09:36:54 | FromDiscord | <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:59 | FromDiscord | <Elegantbeef> @SecureThisShit\: i do have to ask are you doing a type conversion or actual `cast` when you say "castable"? |
09:42:38 | FromDiscord | <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:15 | FromDiscord | <evoalg> ahhh yea ... like after a comma, etc |
09:43:26 | FromDiscord | <Elegantbeef> Horizontally long lines are sinful! π |
09:43:41 | FromDiscord | <evoalg> lol |
09:45:36 | FromDiscord | <hmmm> yea lol |
09:48:42 | FromDiscord | <jord> is there any Nim implementation of the buffer-replace node.js package? |
09:49:32 | FromDiscord | <Elegantbeef> Is that just string replace? |
09:49:50 | FromDiscord | <Elegantbeef> If so https://nim-lang.org/docs/strutils.html#replace%2Cstring%2Cstring%2Cstring |
09:54:12 | FromDiscord | <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:53 | FromDiscord | <hmmm> sent a code paste, see https://play.nim-lang.org/#ix=3K1s |
10:02:04 | FromDiscord | <hmmm> but it might have been python so I don't know lol |
10:02:49 | FromDiscord | <evoalg> maybe for nim it's like this: https://status-im.github.io/nim-style-guide/formatting.style.html |
10:03:27 | FromDiscord | <Rika> NEP 1 |
10:03:34 | FromDiscord | <Rika> I donβt know where itβs located in the docs |
10:04:09 | FromDiscord | <evoalg> https://nim-lang.org/docs/nep1.html |
10:04:34 | FromDiscord | <hmmm> In reply to @NimEventer "New Nimble package! nimfmt": this looks juicy btw, anyone already tried it |
10:05:41 | FromDiscord | <Rika> Itβs incomplete |
10:06:47 | FromDiscord | <hmmm> what's missing |
10:07:52 | FromDiscord | <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:58 | FromDiscord | <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:31 | FromDiscord | <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:17 | FromDiscord | <dizzyliam> Settled on an OK nimscript syntax for my typesetting engine |
11:34:37 | FromDiscord | <dizzyliam> sent a code paste, see https://play.nim-lang.org/#ix=3K1S |
11:36:34 | * | jjido joined #nim |
11:50:35 | FromDiscord | <hmmm> hourly reminder that sequtils is awesome π€© |
12:07:26 | FromDiscord | <planetis> is this a "dangerous" implicit conversion to cstring? `drawText(cameraDescriptions.cstring, 40, 140, 10, DarkGray)` |
12:08:20 | FromDiscord | <planetis> I think this warning must appear a lot in wrappers |
12:11:30 | FromDiscord | <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:31 | NimEventer | New Nimble package! opussum - Wrapper around libopus, see https://github.com/ire4ever1190/opussum |
14:31:59 | * | arkurious joined #nim |
14:40:52 | FromDiscord | <Schelz> any lib for nim to check keypress ? |
14:49:38 | FromDiscord | <hmmm> I remember illwill had a getkey() proc, but the lin is about ncurses |
14:50:27 | FromDiscord | <enthus1ast> yes keypressen can be checked with illwill |
14:50:33 | FromDiscord | <enthus1ast> async keypresses i mean |
14:50:49 | FromDiscord | <enthus1ast> (but only ascii / en-us keys) |
14:51:29 | FromDiscord | <enthus1ast> for blocking checks have a look at std/terminal.nim |
14:56:59 | FromDiscord | <hmmm> yea terminal has getch() |
14:58:08 | FromDiscord | <hmmm> I remeber using it to make a proc to cover passwords with |
14:58:26 | FromDiscord | <hmmm> it was called dancingWithTheStars |
14:58:46 | FromDiscord | <hmmm> my proc names are legendary π§ |
15:09:15 | FromDiscord | <Isofruit> ... nim even has an interpreter for on the fly code testing (inim) I am very happily surprised |
15:11:10 | FromDiscord | <Solitude> In reply to @Isofruit "... nim even has": nim has an interpreter, but inim isnt it. |
15:11:27 | FromDiscord | <Isofruit> I see I still fuck up the correct naming of stuff then |
15:12:25 | FromDiscord | <Isofruit> Either way, does not take away from the point: On the fly code testing, yay |
15:16:49 | FromDiscord | <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:42 | FromDiscord | <n00nehere> what do you think is the best library for making games on linux? |
16:30:09 | FromDiscord | <n00nehere> i tried raylib and godot but i really don't like godot and raylib has gave me a lot of problems |
16:30:39 | FromDiscord | <enthus1ast> i currently use raylib and i think its great |
16:31:10 | FromDiscord | <n00nehere> it gave me problems like memleaks on test programs, randomly crashing, cant find dependencies etc... |
16:31:16 | FromDiscord | <n00nehere> all with test programs |
16:31:49 | FromDiscord | <enthus1ast> have not encountered these |
16:46:53 | FromDiscord | <sOkam!> sdl seems to be used a lot in nim |
16:47:24 | FromDiscord | <sOkam!> In reply to @n00nehere "what do you think": sdl seems to be used a lot in nim |
16:49:49 | NimEventer | New Nimble package! NimbleImGui - ImGui Frontend for Nimble, see https://github.com/qb-0/NimbleImGui |
16:55:08 | FromDiscord | <sOkam!> In reply to @enthus1ast "i currently use raylib": any specific bindings that you recommend? |
17:15:19 | * | PMunch joined #nim |
17:40:08 | FromDiscord | <Shiba> can i use -d:release -d:danger when i do testing and debuginf |
17:40:28 | PMunch | I mean you can |
17:40:30 | FromDiscord | <planetis> memory leaks? do tell more n00nehere |
17:41:04 | PMunch | But 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:36 | FromDiscord | <frankzig> sent a code paste, see https://play.nim-lang.org/#ix=3K6d |
18:56:37 | FromDiscord | <frankzig> ? |
19:00:21 | * | lumo_e quit (Ping timeout: 245 seconds) |
19:00:46 | FromDiscord | <enthus1ast> i think they are |
19:01:59 | FromDiscord | <qb> sent a code paste, see https://play.nim-lang.org/#ix=3K6h |
19:02:08 | FromDiscord | <el__maco> I think they are asking about constructors |
19:02:19 | FromDiscord | <el__maco> maybe? |
19:03:02 | FromDiscord | <enthus1ast> ref objects are not afaik |
19:09:07 | * | xet7 quit (Remote host closed the connection) |
19:18:24 | * | xet7 joined #nim |
19:20:49 | PMunch | Well 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:28 | FromDiscord | <retkid> i know iterators are not unique to nim |
19:51:38 | FromDiscord | <retkid> but the way nim does them is such a strong thing |
19:52:07 | FromDiscord | <retkid> makes code a lot cleaner |
19:52:45 | FromDiscord | <retkid> im updating an old python repo and im really missing the convenience of Nim's iterators. |
19:54:31 | FromDiscord | <konsumlamm> umm, python has exactly the same style of iterators |
19:54:48 | FromDiscord | <konsumlamm> in fact, i'm pretty sure nim's iterators were inspired by python's |
19:54:48 | FromDiscord | <retkid> except they're bound to classes |
19:54:54 | FromDiscord | <konsumlamm> no? |
19:55:01 | FromDiscord | <retkid> NO!?! |
19:55:10 | FromDiscord | <konsumlamm> in python they'r ecalled generators |
19:55:29 | FromDiscord | <retkid> alright thats all i needed to know |
19:55:33 | FromDiscord | <konsumlamm> the iter stuff is bound to classes, bit you can also define nim style iterators |
19:55:48 | FromDiscord | <konsumlamm> (edit) "iter" => "`iter`" | "bit" => "but" |
19:56:52 | FromDiscord | <retkid> thank you, saint konsumlamm |
19:57:55 | FromDiscord | <konsumlamm> np |
19:59:51 | FromDiscord | <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:45 | FromDiscord | <Isofruit> sent a code paste, see https://play.nim-lang.org/#ix=3K7d |
21:12:23 | FromDiscord | <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:05 | FromDiscord | <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:31 | FromDiscord | <Elegantbeef> Really though you shouldn't use json and just use `format` from times |
23:33:32 | FromDiscord | <Elegantbeef> @Isofruit\: cause `timezone` has procedures, you can quickly use `jsonutils` to serialize it https://play.nim-lang.org/#ix=3K7K |
23:33:32 | FromDiscord | <Elegantbeef> Since timestamps are standard |
23:47:32 | FromDiscord | <Isofruit> sent a code paste, see https://play.nim-lang.org/#ix=3K7P |
23:48:36 | FromDiscord | <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:04 | FromDiscord | <Isofruit> (edit) "move DateTime back into "string"" => "use `string` instead of `DateTime` in th model" |
23:55:39 | FromDiscord | <Elegantbeef> I mean https://play.nim-lang.org/#ix=3K7Q works |
23:56:16 | FromDiscord | <Elegantbeef> The only issue is you need to handle the times not set, but that's easy in the serializer |
23:57:17 | FromDiscord | <Isofruit> One sec, if I can get this to work I'll be so effin relieved |