<< 18-09-2023 >>

00:05:40FromDiscord<Elegantbeef> `nim js your.nim`
00:12:13*lumo_e quit (Quit: Quit)
01:08:08FromDiscord<.aingel.> In futhark how do I import multiple files
01:08:20FromDiscord<.aingel.> sent a code paste, see https://play.nim-lang.org/#ix=4GGy
01:08:21FromDiscord<.aingel.> Do I have to do it like this?
01:08:27FromDiscord<Elegantbeef> Single importc
01:08:35FromDiscord<Elegantbeef> move all the headers into a single importc
01:08:46FromDiscord<Elegantbeef> `importc` is really not much different to the C `include` keyword
01:10:47FromDiscord<.aingel.> Okay but I don't get the path and the second line separation really
01:11:04FromDiscord<Elegantbeef> Path is `-I` in C land
01:11:17FromDiscord<Elegantbeef> the second line is just `include "def.h"`
01:11:35FromDiscord<.aingel.> Oh okay
01:11:38FromDiscord<.aingel.> Gotcha
01:13:23FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4GGB
01:16:27FromDiscord<.aingel.> Right the issue I;m having though is that
01:16:33FromDiscord<.aingel.> in base.h , there's `#include "lexbor/core/base.h"`
01:16:47FromDiscord<.aingel.> And I get `Fatal: 'lexbor/core/def.h' file not found`
01:17:11FromDiscord<.aingel.> This works
01:17:13FromDiscord<.aingel.> sent a code paste, see https://play.nim-lang.org/#ix=4GGD
01:17:14FromDiscord<.aingel.> Or compules
01:17:25FromDiscord<.aingel.> (edit) "compules" => "compiles"
01:17:48FromDiscord<.aingel.> Inside base.h I have `#include "lexbor/core/base.h"` which is causing the problem
01:18:45FromDiscord<Elegantbeef> Why is the C file cyclica?
01:18:45FromDiscord<Elegantbeef> cyclical even
01:18:58FromDiscord<.aingel.> Oh I fixed it
01:19:04FromDiscord<.aingel.> This seems to work
01:19:05FromDiscord<.aingel.> sent a code paste, see https://play.nim-lang.org/#ix=4GGE
01:19:34FromDiscord<.aingel.> Oh it's not cyclical I think I said that wrong its like html/base includes core/base
01:19:52FromDiscord<Elegantbeef> Right you use the files like you would in C
01:19:52FromDiscord<.aingel.> Anyways regardless this method seems to work
01:19:55FromDiscord<.aingel.> Yeah
01:19:57FromDiscord<.aingel.> It makes sense
01:20:01FromDiscord<.aingel.> Thanks!
01:20:04FromDiscord<Elegantbeef> So adding both paths to include meant `base` was ambiguous
01:28:23FromDiscord<.aingel.> sent a code paste, see https://play.nim-lang.org/#ix=4GGF
01:28:29FromDiscord<.aingel.> When I add certain header files I get something like this
01:28:48*krux02 quit (Remote host closed the connection)
01:29:15FromDiscord<Elegantbeef> To be expected
01:29:26FromDiscord<Elegantbeef> Large headerfiles can cause many iterations
01:31:34FromDiscord<.aingel.> So I increase the number of iterations?
01:31:53FromDiscord<fowl.mouth> Cool looking library
01:32:14FromDiscord<fowl.mouth> Using clang to parse the headers
01:32:34FromDiscord<Elegantbeef> That's the only solution really
01:32:56FromDiscord<Elegantbeef> The VM prevents endless loops with that iteration count
01:33:06FromDiscord<.aingel.> Gotcha
01:33:09FromDiscord<.aingel.> Yeah increasing worked
01:33:19FromDiscord<Elegantbeef> Large convoluted header files will create large iterating programs
01:37:27FromDiscord<.aingel.> I see
01:38:11FromDiscord<.aingel.> Soo what do I do when it claims it can't find a function
01:38:18FromDiscord<.aingel.> But it's in a header file I included
01:38:33FromDiscord<Elegantbeef> Cry internally, though more realistically ensure it wasnt declared as `inline`
01:38:40FromDiscord<Elegantbeef> Unless it's C complaining it cannot find a function
01:38:52FromDiscord<Elegantbeef> If it's C complaining, link your library properly
01:38:56FromDiscord<.aingel.> It's nim
01:38:56FromDiscord<.aingel.> sent a code paste, see https://play.nim-lang.org/#ix=4GGI
01:39:04FromDiscord<.aingel.> Hmm might be inline yeah
01:39:53FromDiscord<.aingel.> Yeah it is inline
01:39:55FromDiscord<.aingel.> What do I do then
01:40:14FromDiscord<.aingel.> In this case you can pass -d:generateInline to generate function definitions for inline functions.
01:40:18FromDiscord<.aingel.> (edit)
01:40:36FromDiscord<.aingel.> It's not a dynamic library though
01:47:22FromDiscord<.aingel.> Wowwie it works
01:47:50FromDiscord<.aingel.> My lsp is going mad with errors though lol
01:59:59*rockcavera quit (Remote host closed the connection)
02:06:01*derpydoo joined #nim
02:31:30NimEventerNew Nimble package! nimbooru - Basic wrapper for APIs of various Boorus, see https://github.com/filvyb/nimbooru
02:36:49*Batzy_ joined #nim
02:38:56*Batzy quit (Ping timeout: 255 seconds)
03:47:15FromDiscord<millymox> Is there a way to interface nim with python like with js? Like use a python library in nim
03:53:44FromDiscord<michaelb.eth> In reply to @millymox "Is there a way": see: https://github.com/yglukhov/nimpy
04:15:41FromDiscord<sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#ix=4GH7
04:17:26FromDiscord<sOkam! 🫐> (edit) "https://play.nim-lang.org/#ix=4GH7" => "https://paste.rs/8y3fU"
05:33:11*Guest42 joined #nim
05:33:27*Guest42 quit (Client Quit)
05:35:18*advesperacit joined #nim
05:48:26*ntat joined #nim
06:01:00FromDiscord<Chronos [She/Her]> Interesting, thanks!
06:09:09*PMunch joined #nim
07:21:45*junaid_ joined #nim
07:29:22*junaid_ quit (Remote host closed the connection)
07:59:16FromDiscord<odexine> does anyone know of a runtime file templating library for nim?
08:04:40FromDiscord<odexine> seems like https://github.com/soasme/nim-mustache or https://github.com/onionhammer/nim-templates would fit my use case
08:15:13FromDiscord<sOkam! 🫐> @Langosta following from #tooling:↵I really like `illwill` personally. Really good to work with https://github.com/johnnovak/illwill
08:18:12*derpydoo quit (Ping timeout: 240 seconds)
08:33:29*krydos joined #nim
08:35:26FromDiscord<odexine> also has the same problem as nimwave with the lack of widgets
08:39:03*arkanoid quit (Server closed connection)
08:39:22*arkanoid joined #nim
08:50:04FromDiscord<prinova> In reply to @michaelb.eth "see: https://github.com/yglukhov/nimpy": I asked a question in GH about nimpy. I would like to use the Taichi Python package to compile functions in NIM into GPU/CUDA kernels. Taichi uses '@decorators' for annotating functions as Kernels or GPU funcs. How to use decorators in NIM with nimpy?↵Thank you
08:50:20FromDiscord<prinova> (edit) "nimpy." => "nimpy (not anwered so far)."
08:51:27PMunchodexine, isn't onionhammer templates compile-time?
08:51:52FromDiscord<odexine> i didnt read too much into it because i went with mustache
08:57:20*krydos left #nim (buy buy)
09:14:54FromDiscord<odexine> @Phil ya here? how would you name conversion procs so that in-place and return-style procs are easily distinguished without putting "inplace" for one of them
09:16:00FromDiscord<odexine> i was thinking "to" for inplace and "as" for return but that's not so clear
09:18:20PMunchHmm, I would've thought those where opposite
09:19:10PMunchOr maybe not..
09:19:11FromDiscord<odexine> exactly the issue lol
09:19:47ormiretprimova: decorators in python are just syntactic sugar for functions that take a function and return another one so you can just call them like any other function. But I think you'll have bigger problems than the decorators using taichi on nim functions - it is expecting a python function to transpile, with nimpy nim functions are still nim with an interface from python, I wouldn't expect taichi to be able to do anything useful with that
09:21:42FromDiscord<ieltan> Can someone who has messed with `quirky` pragma tell me how to use them properly, it seems like all it does is remove checks where proc might raise an exception and continue despite a raise happening in the code, how are you actually expected to handle error when they happen ? https://nim-lang.org/docs/manual_experimental.html#quirky-routines
09:22:29FromDiscord<odexine> i believe you dont
09:22:52FromDiscord<odexine> it's meant for procs that do not raise i think is the intention
09:23:01FromDiscord<ieltan> So, exceptions are discarded ?
09:23:34FromDiscord<odexine> In reply to @odexine "it's meant for procs": or rather procs that do not care about raised exceptions
09:23:35FromDiscord<ieltan> In reply to @odexine "it's meant for procs": can't you achieve that with `{.raises: [].}`
09:23:44FromDiscord<odexine> In reply to @ieltan "So, exceptions are discarded": exceptions are not handled at all i believe
09:23:47FromDiscord<odexine> In reply to @ieltan "can't you achieve that": different meaning
09:23:56FromDiscord<odexine> raises: [] means the proc cannot raise
09:24:05FromDiscord<odexine> quirky means the procs inside may raise but i dont care
09:24:12FromDiscord<ieltan> ok I think i understand now
09:24:14FromDiscord<odexine> (edit) "procs" => "calls"
09:24:21FromDiscord<ieltan> thanks 🙂
09:24:31FromDiscord<odexine> i dont know of much practical use but there might be one?
09:25:29FromDiscord<ieltan> It sounds like it's linked to the `-exceptions:quirky` flag
09:25:45FromDiscord<ieltan> But i dont know how much it relates to it
09:25:51FromDiscord<Elegantbeef> Quirky is goto but if you do not have try except it doesnt handle it
09:26:09FromDiscord<Elegantbeef> Quirky pretty much means "Only handled errors are handled" afaik
09:26:23FromDiscord<odexine> oh so it's exceptions without bubbling
09:26:28FromDiscord<ieltan> Alright I see
09:26:44FromDiscord<ieltan> Is it more cost effective or it is still the same ?
09:26:56FromDiscord<Elegantbeef> You don't have overhead for what you don't use
09:27:16FromDiscord<Elegantbeef> If you do not handle exceptions in a case it's faster, but the bad path is never taken if you do not use `try except`
09:27:43FromDiscord<ieltan> Ok, I think i fully understand now
09:27:55FromDiscord<ieltan> that's kinda awesome 🙂
09:30:19FromDiscord<Elegantbeef> Well it's the inverse of unhandled exceptions, so great care is needed to ensure the code works as intended and does not explode the program
10:04:38FromDiscord<Phil> In reply to @odexine "<@180601887916163073> ya here? how": Return style: map↵In place: merge
10:05:45FromDiscord<Phil> You map data from shape a to shadow shape b ↵You merge data packet a into data packet b
10:05:56FromDiscord<Phil> (edit) removed "shadow"
10:06:00FromDiscord<odexine> i'll prolly go with map and apply
10:06:03FromDiscord<odexine> that makes sense
10:11:08*krux02 joined #nim
10:36:38*ntat quit (Quit: leaving)
11:16:17*PMunch_ joined #nim
11:19:31*PMunch quit (Ping timeout: 255 seconds)
11:33:07*ntat joined #nim
11:52:50FromDiscord<Phil> Yeah, also fair wordings, I just like the alliteration
11:55:13FromDiscord<johnmartyr> Hello, is the nim language suitable for very high performance number crunching?
11:55:22FromDiscord<johnmartyr> mostly code running on the GPU
11:58:26PMunch_johnmartyr, yup
11:58:43FromDiscord<johnmartyr> thanks
11:59:36PMunch_johnmartyr, you can check out for example Laser: https://github.com/mratsim/laser
12:00:33FromDiscord<johnmartyr> In reply to @PMunch_ "<@1152266482043076658>, you can check": it looks that it is out of development
12:00:49PMunch_What do you mean?
12:01:26FromDiscord<johnmartyr> > The library is in heavy development. For now the CPU backend is being optimised.↵> last commit is in 2021
12:02:52FromDiscord<sOkam! 🫐> @mratsim 👆 is that still an accurate readme?
12:03:05PMunch_Hmm, yeah that doesn't look great
12:03:27PMunch_There is of course https://github.com/mratsim/Arraymancer by the same author
12:03:31FromDiscord<sOkam! 🫐> Wasn't mratsim who made weave/arraymancer?
12:03:38PMunch_Yup
12:03:40FromDiscord<Phil> yep
12:03:40FromDiscord<sOkam! 🫐> yeah probably why
12:32:37FromDiscord<mratsim> In reply to @heysokam "<@570268431522201601> 👆 is that": I don't have time for Laser/Arraymancer at the moment, I'm focusing on high perf cryptography
12:33:01FromDiscord<mratsim> In reply to @johnmartyr "Hello, is the nim": Yes, use: for scientific computing - https://github.com/can-lehmann/exprgrad
12:33:17FromDiscord<mratsim> for cryptography we can discuss
12:33:35FromDiscord<mratsim> In general, you can reach any speed achievable in C, C++ or Assembly in Nim
12:38:08FromDiscord<mratsim> In reply to @johnmartyr "it looks that it": I was focusing on writing a compiler for arrays/tensors/matrices kernels
12:38:59FromDiscord<mratsim> that was a time sink and I had too many so I had to pick. What came out of it is Weave at least, a high perf multithreading backend.↵↵And https://github.com/can-lehmann/exprgrad is actually similar to hwat I had in mind
12:39:32FromDiscord<mratsim> In reply to @johnmartyr "mostly code running on": And I'm personally writing GPU kernels for cryptography in Nim.
12:41:20FromDiscord<mratsim> Though I don't write the code in Nim, I JIT it directly from LLVM so I don't have to deal with -std=gnu++14 flag - https://github.com/mratsim/constantine/blob/master/tests/gpu/hello_world_nvidia.nim
12:54:11*PMunch joined #nim
12:57:38*PMunch_ quit (Ping timeout: 252 seconds)
12:59:28FromDiscord<johnmartyr> yeah i dont want to use these libraries that are "here today unmaintained by tomorrow"
12:59:31FromDiscord<johnmartyr> so nim sucks
12:59:36FromDiscord<johnmartyr> goodbye
13:01:31PMunchI guess we should've told him that Nim can also import C/C++ libraries..
13:02:01PMunchThe Python way of high-perf in C, glue in Python, could also be done with Nim
13:02:25PMunchThat way you could probably leverage some more mature calculation backend and write glue in Nim
13:10:11FromDiscord<wick3dr0se> I'm working on a small server and during startup I make this object serverData. It holds the socket. I want to pass a reference to this serverData object into a proc in another file so that it can be used to access the socket. Can anyone help me understnad what I should do?
13:10:42FromDiscord<mratsim> In reply to @johnmartyr "yeah i dont want": But what do you plan on writing?↵↵Even the Argonne National Lab iirc invested in Nim for GPU
13:11:03FromDiscord<mratsim> See talk at CERN: https://indico.cern.ch/event/432527/contributions/1072091/attachments/1320716/1980489/talk_jin_nim_qex.pdf
13:11:23FromDiscord<wick3dr0se> Nim is amazing. He's just hurt he couldn't figure something out
13:12:03FromDiscord<wick3dr0se> I'm too stupid to figure out shit all the time but can't blame the language
13:12:26FromDiscord<nnsee> In reply to @mratsim "But what do you": he's already gone, don't waste your time
13:13:00FromDiscord<mratsim> Not having off the shelvf library to do everything yourself is a fair criticism but for GPU, no language as everything readily available, it's usually domain specific
13:14:30FromDiscord<nnsee> i feel like it's a fair criticism of the ecosystem, but not the language itself
13:14:31*derpydoo joined #nim
13:15:23FromDiscord<nnsee> also in this case, the libraries _do_ exist and are functional
13:15:37FromDiscord<nnsee> i don't get this obsession with libraries having to be maintained
13:16:05FromDiscord<nnsee> oh, it hasn't seen a commit since 2021? so? has the code suddenly stopped working?
13:16:19FromDiscord<nnsee> i regularly use tools and libraries that haven't been updated since the 2000s
13:17:59FromDiscord<ezquerra> @mratsim, maybe update the README.md of all your libs (e.g. to increase the copyright year or something silly like that) to make them "upt to date"? 🙂
13:20:43*jmdaemon quit (Ping timeout: 264 seconds)
13:25:41*ntat quit (Quit: leaving)
13:28:39PMunchHmm, I wonder what the thing with the oldest last commit I currently have on my machine is..
13:29:31PMunchI guess I just wrapped MAPM and use it in a project, last commit there was 11 years ago when it was uploaded to GitHub. Last actual change was in 2010 I believe
13:31:42*xmachina quit (Quit: WeeChat 4.0.4)
13:36:13FromDiscord<mratsim> In reply to @ezquerra "<@570268431522201601>, maybe update the": meh >_>
14:03:35*rockcavera joined #nim
14:07:54*PMunch quit (Quit: Leaving)
14:12:01*edr joined #nim
14:25:49FromDiscord<Chronos [She/Her]> Anyone know a 2D physics library that'd be suited for making a top-down game? Literally bullseye view from above, I'm not sure if Chipmunk works for this really
14:26:47FromDiscord<Chronos [She/Her]> We need to be able to define walls obviously, but also be able to add a small amount of velocity to dropped items so that they slide a tiny bit (same with entities too)
14:32:25*junaid_ joined #nim
14:39:21*ntat joined #nim
14:43:49*disso-peach quit (Remote host closed the connection)
14:44:57FromDiscord<fowl.mouth> Chipmunk or box2d
14:53:00*disso-peach joined #nim
14:59:38FromDiscord<Chronos [She/Her]> I'll likely use Chipmunk then, as long as I can disable whatever makes entities fall because that just won't work in my game... though, it could? Maybe?
14:59:55FromDiscord<Chronos [She/Her]> But then that'd need a 3D engine which I don't want to do-
15:00:06FromDiscord<Chronos [She/Her]> Though it would be useful for making a puzzle game
15:00:10FromDiscord<Langosta> sent a long message, see http://ix.io/4GIW
15:02:22*disso-peach quit (Quit: Leaving)
15:06:07FromDiscord<Chronos [She/Her]> Boxy is for collisions, right? Would it be hard to implement friction or similar things? If not, I may implement it myself
15:06:15FromDiscord<Chronos [She/Her]> I don't need an engine, I've been getting the words wrong aha
15:06:21FromDiscord<Chronos [She/Her]> Just something to handle the bare minimum
15:09:53FromDiscord<fowl.mouth> In reply to @chronos.vitaqua "I'll likely use Chipmunk": You’re probably referring to the global gravity you can set on a space/world, you can just set it to 0,0
15:16:07FromDiscord<nnsee> In reply to @alendrik "Some people forget that": couldn't agree more
15:19:47FromDiscord<nnsee> as is the case with painting, you could keep adding little details, slightly reworking details you've already done, etc, but at one point you _have_ to consider it "done". I guess you _could_ keep doing that forever, but... why? Just for the sake of it. I don't see the point, especially if you're at the point where you simply don't find the project interesting anymore
15:20:35FromDiscord<fowl.mouth> I like to work on my projects until all the hard/fun parts are done then I start a new project and never look back 🙂 serial project starter
15:20:49FromDiscord<nnsee> In reply to @fowl.mouth "I like to work": I'm exactly the same way
15:23:52FromDiscord<odexine> who aint hahaha
15:28:10FromDiscord<Phil> In reply to @alendrik "Some people forget that": Your words are true, but there's an important addendum:↵"Not updated since X" often means "does not support shiny new feature that has since been developed which other libraries may rely on"
15:28:39FromDiscord<Phil> or that you yourself may want to use
15:30:43FromDiscord<Phil> A lib not working under arc/orc would be a prime example of you want to use it
15:30:56FromDiscord<Phil> (edit) "of" => "if"
15:45:26FromDiscord<sOkam! 🫐> In reply to @chronos.vitaqua "Just something to handle": saw bumpy yet? the architecture of the lib is quite good, easily extensible
15:45:34FromDiscord<Langosta> In reply to @isofruit "Your words are true,": Ohhhhh, that is very true. Just because it supports backwards comp, doesnt mean its optimized for modern use.
15:45:42FromDiscord<Langosta> great addendum
15:53:13*xmachina joined #nim
15:58:02FromDiscord<System64 ~ Flandre Scarlet> Uh oh I have a problem↵I installed Nim on WSL Kali Linux but it's 1.6.14↵How can I have Nim 2 please?
15:59:42FromDiscord<sOkam! 🫐> choosenim? 🤔
16:01:07FromDiscord<Langosta> ye, get choosenim
16:01:17FromDiscord<Phil> Choosenim install stable was the command I think
16:03:21FromDiscord<Phil> In reply to @odexine "who aint hahaha": .... way to make me feel excluded!
16:06:43FromDiscord<System64 ~ Flandre Scarlet> In reply to @heysokam "choosenim? 🤔": I nimble installed it, but it doesn't find the choosenim command
16:09:02FromDiscord<Phil> Actually what are makefiles in terms of the task they solve? Are they basically what I use nimscript for (build app, build docker image with the binary etc)?
16:31:58*jmdaemon joined #nim
16:35:22FromDiscord<System64 ~ Flandre Scarlet> In reply to @sys64 "I nimble installed it,": Oh god Nim 2 is shadowed by Nim 1.6↵What should I do?
16:37:56FromDiscord<Chronos [She/Her]> In reply to @heysokam "saw bumpy yet? the": Oh? I haven't actually, I'll look at it
16:41:47FromDiscord<nnsee> In reply to @sys64 "Oh god Nim 2": uninstall everything nim-related, then run `curl https://nim-lang.org/choosenim/init.sh -sSf | sh`
16:41:58FromDiscord<nnsee> if you don't mind me asking, why are you installing Nim on kali?
16:42:20FromDiscord<nnsee> kali doesn't really seem the best choice for developing software on
16:42:35FromDiscord<System64 ~ Flandre Scarlet> In reply to @nnsee "if you don't mind": Which distro should I choose? I use wsl
16:42:36FromDiscord<fowl.mouth> https://github.com/treeform this guy has some cool projects
16:43:44FromDiscord<nnsee> In reply to @sys64 "Which distro should I": I always go with Ubuntu on WSL because it just works without any hiccups
16:44:05FromDiscord<nnsee> Kali is meant specifically for pentesting and has some downsides if you're not doing that specifically
16:44:30FromDiscord<System64 ~ Flandre Scarlet> Oooh alright, gotta use Ubuntu then
16:45:05FromDiscord<nnsee> well, I say "always", but I haven't really used Windows (other than to test malware) for years now
16:46:39FromDiscord<.aingel.> Is IC going to come out by the end of the year?
16:52:12*junaid_ quit (Remote host closed the connection)
16:54:57FromDiscord<odexine> IC will come out when it is ready
17:15:02FromDiscord<.aingel.> Is there a way to change the theme of the command line print statements in nim
17:15:17FromDiscord<.aingel.> My strings are in green and I was wondering if I can change it
17:15:43FromDiscord<.aingel.> In reply to @odexine "IC will come out": Is there any clue to the status progress of it or eta?
17:20:01FromDiscord<Phil> In reply to @fowl.mouth "https://github.com/treeform this guy has": I mean, treeform is pretty well known for his all around solid packages
17:20:21FromDiscord<Phil> For the most part because he needs them for work so he codes stuff he can use for work and shares them with the world
17:23:43FromDiscord<nnsee> In reply to @.aingel. "Is there a way": something that works across languages is ANSI escape sequences to colour text
17:25:50FromDiscord<System64 ~ Flandre Scarlet> In reply to @nnsee "I always go with": It works on Ubuntu, thanks
17:38:01*derpydoo quit (Ping timeout: 244 seconds)
17:39:48FromDiscord<odexine> In reply to @nnsee "something that works across": It wouldn’t work for cmd.exe on windows but it will elsewhere
17:41:56FromDiscord<nnsee> In reply to @odexine "It wouldn’t work for": wait really?
17:42:07FromDiscord<nnsee> windows doesn't support ansi escape sequences?
17:42:20FromDiscord<nnsee> why is that funny and yet not that surprising at the same time
18:05:55FromDiscord<odexine> In reply to @nnsee "windows doesn't support ansi": Windows terminal (the new app) does
18:06:13FromDiscord<odexine> cmd.exe (the old-ass one) does not
18:13:19FromDiscord<nnsee> In reply to @odexine "cmd.exe (the old-ass one)": cmd.exe is just a "wrapper" for conhost.exe, so I imagine that's the one that doesn't support it?
18:15:00FromDiscord<aintea> Do you guys know if it is better to import standard library modules like this `import std/strformat` than like this `import strformat` ? And why ?
18:20:54FromDiscord<nnsee> In reply to @aintea "Do you guys know": the recommended method is `import std/[strformat, strutils]` with the std prefix
18:21:55FromDiscord<Chronos [She/Her]> I'm thinking of storing my map format using a PNG to store and represent data :p
18:22:13FromDiscord<Chronos [She/Her]> Then also just associating some JSON data with it
18:22:33FromDiscord<nnsee> In reply to @nnsee "the recommended method is": mostly because it's explicit and unambiguous
18:28:11FromDiscord<aintea> Okay thanks
18:32:44FromDiscord<Chronos [She/Her]> Not sure how Pixie handles transparency lol, does the alpha value go from 0 to 255 or 0 to 1?
18:37:56FromDiscord<Chronos [She/Her]> Okay yep docs say 0 to 1
18:43:02FromDiscord<Chronos [She/Her]> Is there an advantage to using a sprite sheet rather than many individual textures?
18:45:58FromDiscord<toma400> In reply to @chronos.vitaqua "Okay yep docs say": Ooh, so it does not handle semi-transparency?
18:46:26FromDiscord<toma400> That would give me some explanations why Drawfire had issues with it
18:46:42FromDiscord<Chronos [She/Her]> It does handle semi-transparency sorry aha
18:46:57FromDiscord<Chronos [She/Her]> At least, Chroma supports it
18:47:12FromDiscord<Chronos [She/Her]> Also oof no Raygui for Nim
18:47:22FromDiscord<Chronos [She/Her]> Naylib doesn't support it
18:53:02FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4GKc
18:56:15FromDiscord<Chronos [She/Her]> Sounds like something isn't working right
18:56:57FromDiscord<System64 ~ Flandre Scarlet> It works perfectly on Windows
18:58:32*ntat quit (Quit: leaving)
19:00:28FromDiscord<System64 ~ Flandre Scarlet> @Phil Is it normal Norm acts like this on Linux while I have no problems on Windows?
19:01:22FromDiscord<Phil> In reply to @aintea "Do you guys know": I generally recommend `std/` for stdlib, `pkg/` for normal libs, `./` for importing modules from this package
19:01:54FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4GKi
19:02:26FromDiscord<System64 ~ Flandre Scarlet> In reply to @isofruit "Have you consdeired taht": It created the game.db file
19:02:43FromDiscord<Phil> Because this seems like it's trying to write to disk, Linux checks permission for the user that is executing said process and then saying "nope"
19:03:37FromDiscord<Phil> `ls -l`on the dir
19:03:52FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4GKj
19:04:18FromDiscord<System64 ~ Flandre Scarlet> ``drwxrwxrwx 1 system64 system64 512 Sep 18 20:59 out``
19:04:37FromDiscord<Phil> Okay kinda nuts you have read write and execute permission for everyone but that means the issue shouldn't lie there.↵You're on wsl?
19:05:15FromDiscord<System64 ~ Flandre Scarlet> In reply to @isofruit "Okay kinda nuts you": yeah, wsl
19:05:29FromDiscord<Phil> You got the sqlite lib installed?
19:05:36FromDiscord<Phil> On ubuntu I mean
19:05:48FromDiscord<System64 ~ Flandre Scarlet> Yeah↵Sudo apt-get install sqlite I did
19:09:17FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4GKl
19:11:07FromDiscord<Phil> So that's a general sqlite issue on linux then
19:11:22FromDiscord<Phil> Wait, what path do you use?
19:11:30FromDiscord<Phil> Do you use different paths on linux and windows?
19:11:36FromDiscord<System64 ~ Flandre Scarlet> the same as the executable
19:11:49FromDiscord<Phil> No as in, does the path include backslahes / forward slashes
19:11:58FromDiscord<Phil> That might be a difference that I could think of
19:12:07FromDiscord<System64 ~ Flandre Scarlet> No
19:13:19FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4GKm
19:13:22FromDiscord<Phil> I mean, desperate play but do things change if you change the owner of the file?
19:13:37FromDiscord<System64 ~ Flandre Scarlet> the owner is me
19:14:17FromDiscord<Chronos [She/Her]> Anyone know what'd be a good GUI lib we can use in conjunction with Naylib, that also works on phones?
19:15:59FromDiscord<Elegantbeef> raygui
19:16:00FromDiscord<Phil> Yeah I got no clue.↵There's like 10 different problems this could be and I never encountered any of them.↵You'll want to google `unhandled exception: unable to open database file [DbError] ` since that's an sqlite error, that string does not originate from nim code and is very "googleable".
19:16:46FromDiscord<Phil> Some folks did stuff like turning journalmode off, but if that't the problem then honestly the system's fucked
19:16:54FromDiscord<Phil> (edit) "Some folks did stuff like turning journalmode off, but if that't the problem then honestly the system's fucked ... " added "because that's just so irregular"
19:17:10FromDiscord<System64 ~ Flandre Scarlet> Is that Linux's fault so?
19:17:23FromDiscord<Phil> I wouldn't be able to tell you where it fucks up
19:17:59FromDiscord<Phil> So I can't tell you who's at fault.↵Very high likelihood sth is misconfigured in your setup since this usecase is a common one so chances are it works perfectly fine normally and sth. about your setup is special
19:19:04FromDiscord<System64 ~ Flandre Scarlet> Works fine on 2 Windows machines, so might be with something in Linux
19:19:30FromDiscord<Phil> That's not necessarily how that determination works but it's a fair end-user perspective 😛
19:19:49*azimut joined #nim
19:25:38FromDiscord<System64 ~ Flandre Scarlet> I maybe can try to run it from Wine 🤣
19:25:39FromDiscord<raynei486> if I have a `distinct ptr` how do I check if it's null?
19:25:48FromDiscord<raynei486> `==` doesn't work
19:25:57FromDiscord<Elegantbeef> `(ptr T)(myPtr) != nil`
19:26:09FromDiscord<Elegantbeef> or `import std/typetraits` and `myPtr.distinctbase != nil`
19:26:28FromDiscord<Elegantbeef> The entire point of distinct is to remove all operations on the base and have a 'new type' with the same internal implementation
19:26:33FromDiscord<raynei486> In reply to @Elegantbeef "`(ptr T)(myPtr) != nil`": I almost thought that was C lol
19:26:43FromDiscord<raynei486> In reply to @Elegantbeef "The entire point of": hmmm true
19:26:54FromDiscord<Elegantbeef> This means you either need to use the often broken `borrow` pragma, or convert to the base
19:27:27FromDiscord<arathanis> sent a code paste, see https://play.nim-lang.org/#ix=4GKq
19:27:32FromDiscord<arathanis> I don't know if the parens are required or not
19:28:03FromDiscord<Elegantbeef> `as` is an infix operator that does nothing by default
19:28:17FromDiscord<raynei486> In reply to @Elegantbeef "The entire point of": but I guess it's okay if this conversion is only within the API and not exposed
19:28:27FromDiscord<Elegantbeef> It's only used for `import` and `except`
19:28:37FromDiscord<arathanis> hmm, i thought 'as' could be used for casting...
19:28:49FromDiscord<Elegantbeef> You'd be wrong
19:29:02FromDiscord<arathanis> must have been done in the project where I saw it
19:29:17FromDiscord<Elegantbeef> Yep Union and Godot-nim implement `as`
19:31:14FromDiscord<arathanis> sent a code paste, see https://play.nim-lang.org/#ix=4GKv
19:31:29FromDiscord<Elegantbeef> Arguably the conversion using as is worse anyway
19:31:52FromDiscord<arathanis> you mean over just using `cast`?
19:31:58FromDiscord<Elegantbeef> Yes
19:32:07FromDiscord<arathanis> its probably less explicit, yeah
19:32:14FromDiscord<Elegantbeef> `cast` isnt what you want 9/10 times
19:32:15FromDiscord<Elegantbeef> Hiding it inside `as` is just wrong
19:32:24FromDiscord<Elegantbeef> Since `10 as float` is innocuous
19:32:25FromDiscord<arathanis> is there a difference between `cast` and `(T)`
19:32:30FromDiscord<Elegantbeef> Yes
19:32:30FromDiscord<arathanis> (edit) "`cast`" => "`cast[T]`"
19:32:35FromDiscord<arathanis> does (T) unsafe?
19:32:39FromDiscord<arathanis> (edit) "does" => "is"
19:32:47FromDiscord<Elegantbeef> Cast is a direct bit conversion, the other is a type conversion
19:32:52FromDiscord<Elegantbeef> Cast is unsafe
19:32:56FromDiscord<Elegantbeef> If you use cast children in africa die
19:33:08FromDiscord<arathanis> oh ok, so prefer using (T) over cast?
19:33:17FromDiscord<Elegantbeef> Of cours
19:33:19FromDiscord<Elegantbeef> course\
19:33:19FromDiscord<arathanis> are there examples of the differences and danger, and where you would have to use `cast`?
19:33:30FromDiscord<Elegantbeef> When you want to change the type but keep the bits the same
19:33:48FromDiscord<Elegantbeef> It's a C++ reinterpret cast or a C cast
19:34:01*Lord_Nightmare quit (Quit: ZNC - http://znc.in)
19:34:08FromDiscord<Elegantbeef> It's wholly unsafe and should only be used when using protection like in the naked gun, and wearing a hardhat on top
19:34:14FromDiscord<raynei486> it's telling the compiler to reinterpret the bits
19:35:14FromDiscord<arathanis> so `cast[float](10)` says "interpret these bits as a float, i dont care if we step into memory outside the normal bounds of the original and also this means it wont be "10.0"↵↵`(float)10` will actually give me the float 10.0
19:35:46FromDiscord<raynei486> nah it'll stay in the bounds
19:35:56FromDiscord<raynei486> but memory representation of 10 may not be equal to 10.0
19:36:04FromDiscord<arathanis> it 100% wont
19:36:14FromDiscord<arathanis> will it stay in bounds?
19:36:27FromDiscord<arathanis> what will it do if I give it an object much smaller
19:37:00FromDiscord<Elegantbeef> Stop using cast where copymem is what you want
19:37:01*Lord_Nightmare joined #nim
19:37:02FromDiscord<raynei486> I'm not sure
19:37:27FromDiscord<arathanis> In reply to @Elegantbeef "Stop using cast where": im just trying to understand what is going on under the hood lol
19:38:18FromDiscord<raynei486> look at source code probably
19:38:32FromDiscord<raynei486> I know C++ bit cast has a size check that prevents casting to a larger object
19:38:38FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4GKz
19:38:55FromDiscord<Elegantbeef> It's a C style cast so smaller \> bigger is UB but I think there is a PR to make it safe just 0ing bits
19:39:22FromDiscord<Elegantbeef> Well safer
19:48:03*xmachina1 joined #nim
19:48:28*xmachina quit (Ping timeout: 248 seconds)
19:48:53*xmachina1 is now known as xmachina
20:03:03*xmachina quit (Ping timeout: 240 seconds)
20:17:24*xmachina joined #nim
20:27:34*jmdaemon quit (Ping timeout: 245 seconds)
20:33:18*jmdaemon joined #nim
20:43:29*rockcavera quit (Ping timeout: 252 seconds)
20:49:57*rockcavera joined #nim
20:49:58*rockcavera quit (Changing host)
20:49:58*rockcavera joined #nim
20:53:47*xmachina quit (Quit: WeeChat 4.0.4)
20:56:41*rockcavera quit (Ping timeout: 252 seconds)
21:02:31*xmachina joined #nim
21:35:30FromDiscord<.aingel.> Does anyone know about xml/html specs, how it seems that the javascript dom allows for nested p tags, but seems like the official spec doesn't?
21:37:30Amun-Rathere are no checks performed, you can construct bad html dom
21:38:52FromDiscord<.aingel.> In reply to @Amun-Ra "there are no checks": The diff is when I'm parsing it through javascript it allows the p tag as like a generic div tag which can be nested
21:39:12FromDiscord<.aingel.> But when I parse it through this lib called lexbor which I believe is spec compliant, it sort of breaks up the nested tags
21:39:16FromDiscord<.aingel.> The nested p tags
21:39:27Amun-Raright
21:39:29FromDiscord<.aingel.> I have a lot of xml files which use nested p tags
21:39:41FromDiscord<.aingel.> Do I really have to parse them with javascript then?
21:39:56FromDiscord<Elegantbeef> Or you could just parse it as xml instead of html since it's invalid html
21:39:59FromDiscord<.aingel.> I spent so much time getting this parser to work with nim lol so I could avoid doing in javascript
21:40:15FromDiscord<.aingel.> Oh
21:40:27FromDiscord<.aingel.> So xml allows nested p tags
21:40:33FromDiscord<.aingel.> Or it just doesn't care about p as something special?
21:40:37FromDiscord<Elegantbeef> Xml doesnt have `p tags`
21:40:43FromDiscord<.aingel.> Right
21:40:44FromDiscord<.aingel.> Ugh
21:41:09FromDiscord<.aingel.> This is kind of a disaster
21:41:13FromDiscord<Elegantbeef> Xml is a markup language of nested `<x ...>`
21:41:14FromDiscord<Elegantbeef> It does not designate nodes as special you do
21:41:18FromDiscord<.aingel.> since this is an html parser lib and not xml
21:41:25FromDiscord<Elegantbeef> HTML? Yes
21:41:29FromDiscord<.aingel.> I thought html would be fine or even better since html parsers are generally more lenient
21:41:43Amun-Rajust like browsers are
21:41:46FromDiscord<Elegantbeef> Nim has a xml parser in the stdlib and there are abundant amount xml parsers in the nimble repository
21:42:03FromDiscord<.aingel.> They are messed up
21:42:10FromDiscord<.aingel.> nimquery has a bug for example
21:42:21FromDiscord<.aingel.> I will report it but it breaks on tags that are case sensitive
21:42:31FromDiscord<.aingel.> And the other issue is that they don't have dom functions
21:43:01FromDiscord<Elegantbeef> What are you even doing?
21:43:12FromDiscord<.aingel.> Some stuff in xml
21:43:21FromDiscord<Elegantbeef> Oh really?! 😛
21:43:23FromDiscord<.aingel.> I guess I could use lxml
21:43:45FromDiscord<Elegantbeef> You have a group of incorrect html files you're attempting to parse and add to
21:43:58FromDiscord<Elegantbeef> Why do you need dom functions if it's XML?
21:44:20FromDiscord<.aingel.> No they are xml file
21:44:35FromDiscord<.aingel.> (edit) "file" => "files"
21:44:40FromDiscord<.aingel.> But they use p tags I guess thats just their convention
21:44:50FromDiscord<.aingel.> It honestly would work if I just replaced every p tag with div
21:44:58FromDiscord<.aingel.> I could do that with just text replacement really
21:45:01FromDiscord<Elegantbeef> But why would you do that?
21:45:22FromDiscord<Elegantbeef> You have XML, use an xml parser then do whatever you want with the parsed tree
21:45:25Amun-Raright, which is fine unless you have a xlst that forbids that
21:45:31FromDiscord<.aingel.> Then it would parse properly with my html parsing lib
21:45:55FromDiscord<Elegantbeef> That seems like a lot of work to avoid the 'proper' way
21:46:08FromDiscord<.aingel.> I have to check if libxml has dom functions
21:46:28FromDiscord<.aingel.> I need a dom for the xml stuff
21:46:30FromDiscord<.aingel.> Nim doesnt have that
21:46:38FromDiscord<Elegantbeef> But why do you need dom for xml?
21:46:40FromDiscord<Elegantbeef> I'm so lost
21:46:43FromDiscord<.aingel.> I just do
21:46:50FromDiscord<.aingel.> I need to move around nodes and stuff
21:47:17FromDiscord<Elegantbeef> So move them around using `[]` and friends
21:48:12FromDiscord<.aingel.> You can't even get like "innerhtml" or innerxml in the nim xml parsers
21:48:34FromDiscord<Elegantbeef> @JJ\: I only read this title on hacker news, and was like "How the hell does Zig make enum arrays more efficient". People need to stop using 'Enum' for tagged unions.
21:48:37FromDiscord<Elegantbeef> https://news.ycombinator.com/item?id=37555028
21:49:11FromDiscord<Elegantbeef> `innerText` exists
21:49:11FromDiscord<Elegantbeef> So... yes you can
21:49:25FromDiscord<.aingel.> nope that doesnt work
21:49:28FromDiscord<.aingel.> The way you think it does
21:49:39FromDiscord<.aingel.> It's not innerxml or innerhtml
21:49:47FromDiscord<.aingel.> It's only for a text object
21:49:55FromDiscord<.aingel.> I've used all of the nim xlm stuff
21:50:00FromDiscord<.aingel.> (edit) "xlm" => "xml"
21:50:27FromDiscord<.aingel.> (edit) "object" => "node"
21:52:07FromDiscord<jmgomez> In reply to @Elegantbeef "<@572634810917322773>\: I only read": talking about that, did someone started working on the RFC?
21:52:26FromDiscord<.aingel.> Yeah libxml can do this
21:52:42FromDiscord<.aingel.> I mean it obviously should be able to since it's like the standard for xml stuff
21:52:57FromDiscord<.aingel.> It's what people use for parsing html though too like nokogiri
21:53:46FromDiscord<.aingel.> I guess thats why I got confused with like html vs xml parsers I was like oh if html parsers dont break on malformed xml it must be more lenient so I'll be okay
21:54:03FromDiscord<.aingel.> Didn't realize about this nested p tag thing
21:54:11FromDiscord<.aingel.> I guess that's good to know
21:55:28FromDiscord<Elegantbeef> I mean it works on text and element nodes
21:55:28FromDiscord<Elegantbeef> > If n is xnElement, runs recursively on each child node and concatenates the results.
22:02:05FromDiscord<System64 ~ Flandre Scarlet> In reply to @isofruit "That's not necessarily how": Well, even on a real debien I have this problem
22:05:27FromDiscord<.aingel.> In reply to @Elegantbeef "I mean it works": It doesn't output the innerHTML (or equiv)
22:06:34FromDiscord<.aingel.> if you have `<p class="hello"><span>how are you <i>doing</i></span></p>` And you have the node with class hello, you can't get it to print all the stuff inside afaik
22:06:46FromDiscord<.aingel.> (edit) "class="hello"><span>how" => "class="hello">hey<span>how"
22:06:51FromDiscord<.aingel.> It will just print hey
22:07:05FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=4GL0
22:07:05FromDiscord<.aingel.> It will print text not like all the xml
22:07:27FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=4GL1
22:07:29FromDiscord<.aingel.> Yeah just text
22:07:36FromDiscord<.aingel.> Thats not what innerhtml is in javascript
22:07:45FromDiscord<Elegantbeef> Oh right inner html
22:07:53FromDiscord<.aingel.> You lose all the tags
22:07:55FromDiscord<Elegantbeef> So make a stringifcation proc
22:08:18FromDiscord<.aingel.> You also cannot replace tags like you want to remove one tag and replace it with another node
22:08:25FromDiscord<.aingel.> You have to do string manipulation and it breaks
22:08:38FromDiscord<Elegantbeef> You can replcae tages
22:08:42FromDiscord<Elegantbeef> replace tags
22:08:53FromDiscord<.aingel.> You can't even extract the code of a tag
22:09:23FromDiscord<.aingel.> So how can you replace it with something else
22:09:25FromDiscord<Elegantbeef> Yes you can
22:09:32FromDiscord<.aingel.> Well how then
22:10:11FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4GL3
22:10:53FromDiscord<.aingel.> I'm using the word tag wrong
22:13:33FromDiscord<varriount> In reply to @Elegantbeef "https://news.ycombinator.com/item?id=37555028": Doesn't Nim use enums for tagged unions?
22:13:41FromDiscord<.aingel.> @ElegantBeouf Is there an insert after proc
22:13:50FromDiscord<.aingel.> Or get index of tag
22:13:57FromDiscord<.aingel.> Otherwise how do you replace a tag
22:14:07FromDiscord<Elegantbeef> Nim has tagged unions delimited by enums
22:14:07FromDiscord<Elegantbeef> Nim does not use the term Enum for tagged unions
22:14:10FromDiscord<System64 ~ Flandre Scarlet> Did someone already tried to use SQLite with Nim on Linux?
22:14:48FromDiscord<Elegantbeef> You can use findall or `[]` to select XmlNodes
22:14:57FromDiscord<Elegantbeef> You also can write your procedures to do things that the stdlib does not provide
22:15:02FromDiscord<.aingel.> But to replace it I need to know the index of it
22:15:05*rockcavera joined #nim
22:15:05*rockcavera quit (Changing host)
22:15:05*rockcavera joined #nim
22:15:10FromDiscord<.aingel.> Or have an insertafter or insertbefore proc
22:15:17FromDiscord<.aingel.> This parser only gives insert at index
22:15:21FromDiscord<.aingel.> findall doesn't give you the index
22:16:09FromDiscord<.aingel.> I need the index with respect to just the children
22:16:12FromDiscord<.aingel.> Not to my tag search
22:17:23FromDiscord<Elegantbeef> You can implement all these operations you want with the Nim stdlib
22:17:23FromDiscord<Elegantbeef> It's not magic
22:17:26FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4GL6
22:19:18FromDiscord<.aingel.> I have to make so much then
22:19:26FromDiscord<.aingel.> I was doing a bunch of stuff like this but it was just getting dumb
22:19:38FromDiscord<.aingel.> Cause then I can't use css selectors
22:19:47FromDiscord<.aingel.> It's like might as well write a whole parser myself
22:19:53FromDiscord<.aingel.> That's exaggerating but still
22:20:10FromDiscord<Elegantbeef> I mean xml doesnt have css selectors 😄
22:20:19FromDiscord<.aingel.> It does though
22:20:32FromDiscord<.aingel.> I mean xml parsing libraries do have css selectors
22:20:43FromDiscord<.aingel.> Even a nim one does, but it has a bug
22:20:45FromDiscord<.aingel.> nimquery
22:21:03FromDiscord<Elegantbeef> Nimquery is an html parser
22:21:17FromDiscord<.aingel.> Okay
22:21:28FromDiscord<.aingel.> Well you can still use css selectors to an extent on xml
22:21:35FromDiscord<.aingel.> libxml allows you to I am pretty sure
22:22:11FromDiscord<Elegantbeef> Anywho I've said all I can, so I'll shush now
22:22:11*krux02 quit (Remote host closed the connection)
22:22:34FromDiscord<.aingel.> Thanks for the help
22:23:44FromDiscord<.aingel.> I think I am wrong about the css thing though you are right
22:23:53FromDiscord<.aingel.> Definitely learning this better haha
22:24:24FromDiscord<Elegantbeef> well CSS has no relation to XML in reality, you can shoehorn them together, but yea it's not required for any XML parser
22:24:26FromDiscord<.aingel.> xml and html is kinda confusing I guess, or rather I never learned fully how they're diff, apart from just thinking that html is less ttrict
22:24:33FromDiscord<.aingel.> Yeah, I think it's xpath
22:24:37FromDiscord<Elegantbeef> XML after all is a serialisation format
22:26:06FromDiscord<Elegantbeef> https://github.com/weskerfoot/NimPath there is this xpath/libpath wrapper
22:26:10FromDiscord<Elegantbeef> i mean libxml2
22:27:08FromDiscord<.aingel.> Oh cool!
22:27:48*advesperacit quit ()
22:34:07FromDiscord<JJ> In reply to @Elegantbeef "<@572634810917322773>\: I only read": heh i've flipped back to liking enum a bit really
22:34:20FromDiscord<Elegantbeef> It's such an awful term for tagged unions
22:34:29FromDiscord<JJ> enums are kinda static tagged unions
22:34:46FromDiscord<Elegantbeef> If you were hit upside the head maybe
22:34:58FromDiscord<JJ> unions is the more descriptive term, certainly
22:35:02FromDiscord<JJ> In reply to @Elegantbeef "If you were hit": lmao
22:35:33FromDiscord<Elegantbeef> I mean enumerate means to count or to list!
22:36:20FromDiscord<Elegantbeef> "A list of possible state of a sum type" is pretty silly, so fite me
22:36:41FromDiscord<JJ> one thing that does bother me about zig a bit is the comptime stuff
22:37:02FromDiscord<JJ> well okay two things bother me about zig
22:38:17FromDiscord<JJ> the keywords also really bother me. they're quite clunky and weirdly named. which is a shame cause i like a lot of other zig stuff
22:38:37FromDiscord<JJ> comptime is weird to me too because it's like, not that special? but touted as so
22:39:04FromDiscord<Elegantbeef> Yea, though some of comptime is wonderful
22:39:10FromDiscord<JJ> i need to refresh my memory but i'm fairly certain nim's static + const is just straight up more powerful
22:39:35FromDiscord<Elegantbeef> I do like that entire writeup is just a complicated "AoS exist"
22:39:39FromDiscord<JJ> and comptime is a bit of a gross way to do generics
22:40:13FromDiscord<Elegantbeef> Yea not needing to explicitly mark procs as `comptime` is an important part
22:41:01FromDiscord<Elegantbeef> I feel like this writeup is just asking me to make a writeup about my ECS since it's a AoS, although dynamically typed
22:43:33FromDiscord<Elegantbeef> @varriount Also I guess I should say that Nim object variants are delimited by ordinals, just to be 100% correct and pedantic 😄
23:09:45FromDiscord<bhunao> i'm trying to update the values on a few objects in a sequence, is there something specific i gotta do? i can't edit the object attributes
23:10:11FromDiscord<Elegantbeef> They're fields not attributes, secondly `for x in mySeq.mitems` to iterate mutable values
23:10:14FromDiscord<bhunao> sent a code paste, see https://play.nim-lang.org/#ix=4GLj
23:10:25FromDiscord<Elegantbeef> Assuming `mySeq` is `var mySeq`
23:10:32FromDiscord<bhunao> whats the difference between fields and attributes?
23:11:00FromDiscord<Elegantbeef> Attributes is ambiguous and not what Nim calls fields
23:11:09FromDiscord<bhunao> oh ok, thanks
23:11:14FromDiscord<Elegantbeef> In C# for instance attributes are used like pragmas
23:16:26FromDiscord<wick3dr0se> sent a code paste, see https://play.nim-lang.org/#ix=4GLo
23:17:21FromDiscord<wick3dr0se> (edit) "https://play.nim-lang.org/#ix=4GLo" => "https://play.nim-lang.org/#ix=4GLp"
23:21:34FromDiscord<wick3dr0se> Basically just trying to declare the object in helpers and define it otherwise.. Doesn't seem so simple
23:21:53FromDiscord<wick3dr0se> (edit) "otherwise.." => "elsewhere.."
23:25:46FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4GLs
23:27:42FromDiscord<Elegantbeef> How are you trying to use it?
23:28:38FromDiscord<wick3dr0se> sent a code paste, see https://play.nim-lang.org/#ix=4GLu
23:28:50FromDiscord<Elegantbeef> your module is not named `clientData` is it?
23:29:29FromDiscord<wick3dr0se> I just have a file I'm trying to import named helpers.nim and within was the code I pasted above
23:29:53FromDiscord<wick3dr0se> My main file is named server.nim
23:29:53FromDiscord<Elegantbeef> Well the above will work
23:29:53FromDiscord<Elegantbeef> What's the error
23:31:16FromDiscord<wick3dr0se> Well it doesn't throw errors this way but if I try to echo them after assignment, within a new file again importing helpers, they are empty
23:31:35FromDiscord<Elegantbeef> Are you sure you're `import`ing
23:31:46FromDiscord<wick3dr0se> sent a code paste, see https://play.nim-lang.org/#ix=4GLx
23:31:56FromDiscord<wick3dr0se> Those are the 3 files
23:32:04FromDiscord<Elegantbeef> You realise to level code runs at startup right?
23:32:24FromDiscord<Elegantbeef> So your imported code will run before the async is ran
23:32:58FromDiscord<wick3dr0se> I guess that's the only reason why lol
23:33:05FromDiscord<wick3dr0se> I hate how used to bash I am
23:35:30FromDiscord<wick3dr0se> In reply to @Elegantbeef "So your imported code": Thanks, I'm slow af sometimes