00:05:40 | FromDiscord | <Elegantbeef> `nim js your.nim` |
00:12:13 | * | lumo_e quit (Quit: Quit) |
01:08:08 | FromDiscord | <.aingel.> In futhark how do I import multiple files |
01:08:20 | FromDiscord | <.aingel.> sent a code paste, see https://play.nim-lang.org/#ix=4GGy |
01:08:21 | FromDiscord | <.aingel.> Do I have to do it like this? |
01:08:27 | FromDiscord | <Elegantbeef> Single importc |
01:08:35 | FromDiscord | <Elegantbeef> move all the headers into a single importc |
01:08:46 | FromDiscord | <Elegantbeef> `importc` is really not much different to the C `include` keyword |
01:10:47 | FromDiscord | <.aingel.> Okay but I don't get the path and the second line separation really |
01:11:04 | FromDiscord | <Elegantbeef> Path is `-I` in C land |
01:11:17 | FromDiscord | <Elegantbeef> the second line is just `include "def.h"` |
01:11:35 | FromDiscord | <.aingel.> Oh okay |
01:11:38 | FromDiscord | <.aingel.> Gotcha |
01:13:23 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4GGB |
01:16:27 | FromDiscord | <.aingel.> Right the issue I;m having though is that |
01:16:33 | FromDiscord | <.aingel.> in base.h , there's `#include "lexbor/core/base.h"` |
01:16:47 | FromDiscord | <.aingel.> And I get `Fatal: 'lexbor/core/def.h' file not found` |
01:17:11 | FromDiscord | <.aingel.> This works |
01:17:13 | FromDiscord | <.aingel.> sent a code paste, see https://play.nim-lang.org/#ix=4GGD |
01:17:14 | FromDiscord | <.aingel.> Or compules |
01:17:25 | FromDiscord | <.aingel.> (edit) "compules" => "compiles" |
01:17:48 | FromDiscord | <.aingel.> Inside base.h I have `#include "lexbor/core/base.h"` which is causing the problem |
01:18:45 | FromDiscord | <Elegantbeef> Why is the C file cyclica? |
01:18:45 | FromDiscord | <Elegantbeef> cyclical even |
01:18:58 | FromDiscord | <.aingel.> Oh I fixed it |
01:19:04 | FromDiscord | <.aingel.> This seems to work |
01:19:05 | FromDiscord | <.aingel.> sent a code paste, see https://play.nim-lang.org/#ix=4GGE |
01:19:34 | FromDiscord | <.aingel.> Oh it's not cyclical I think I said that wrong its like html/base includes core/base |
01:19:52 | FromDiscord | <Elegantbeef> Right you use the files like you would in C |
01:19:52 | FromDiscord | <.aingel.> Anyways regardless this method seems to work |
01:19:55 | FromDiscord | <.aingel.> Yeah |
01:19:57 | FromDiscord | <.aingel.> It makes sense |
01:20:01 | FromDiscord | <.aingel.> Thanks! |
01:20:04 | FromDiscord | <Elegantbeef> So adding both paths to include meant `base` was ambiguous |
01:28:23 | FromDiscord | <.aingel.> sent a code paste, see https://play.nim-lang.org/#ix=4GGF |
01:28:29 | FromDiscord | <.aingel.> When I add certain header files I get something like this |
01:28:48 | * | krux02 quit (Remote host closed the connection) |
01:29:15 | FromDiscord | <Elegantbeef> To be expected |
01:29:26 | FromDiscord | <Elegantbeef> Large headerfiles can cause many iterations |
01:31:34 | FromDiscord | <.aingel.> So I increase the number of iterations? |
01:31:53 | FromDiscord | <fowl.mouth> Cool looking library |
01:32:14 | FromDiscord | <fowl.mouth> Using clang to parse the headers |
01:32:34 | FromDiscord | <Elegantbeef> That's the only solution really |
01:32:56 | FromDiscord | <Elegantbeef> The VM prevents endless loops with that iteration count |
01:33:06 | FromDiscord | <.aingel.> Gotcha |
01:33:09 | FromDiscord | <.aingel.> Yeah increasing worked |
01:33:19 | FromDiscord | <Elegantbeef> Large convoluted header files will create large iterating programs |
01:37:27 | FromDiscord | <.aingel.> I see |
01:38:11 | FromDiscord | <.aingel.> Soo what do I do when it claims it can't find a function |
01:38:18 | FromDiscord | <.aingel.> But it's in a header file I included |
01:38:33 | FromDiscord | <Elegantbeef> Cry internally, though more realistically ensure it wasnt declared as `inline` |
01:38:40 | FromDiscord | <Elegantbeef> Unless it's C complaining it cannot find a function |
01:38:52 | FromDiscord | <Elegantbeef> If it's C complaining, link your library properly |
01:38:56 | FromDiscord | <.aingel.> It's nim |
01:38:56 | FromDiscord | <.aingel.> sent a code paste, see https://play.nim-lang.org/#ix=4GGI |
01:39:04 | FromDiscord | <.aingel.> Hmm might be inline yeah |
01:39:53 | FromDiscord | <.aingel.> Yeah it is inline |
01:39:55 | FromDiscord | <.aingel.> What do I do then |
01:40:14 | FromDiscord | <.aingel.> In this case you can pass -d:generateInline to generate function definitions for inline functions. |
01:40:18 | FromDiscord | <.aingel.> (edit) |
01:40:36 | FromDiscord | <.aingel.> It's not a dynamic library though |
01:47:22 | FromDiscord | <.aingel.> Wowwie it works |
01:47:50 | FromDiscord | <.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:30 | NimEventer | New 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:15 | FromDiscord | <millymox> Is there a way to interface nim with python like with js? Like use a python library in nim |
03:53:44 | FromDiscord | <michaelb.eth> In reply to @millymox "Is there a way": see: https://github.com/yglukhov/nimpy |
04:15:41 | FromDiscord | <sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#ix=4GH7 |
04:17:26 | FromDiscord | <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:00 | FromDiscord | <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:16 | FromDiscord | <odexine> does anyone know of a runtime file templating library for nim? |
08:04:40 | FromDiscord | <odexine> seems like https://github.com/soasme/nim-mustache or https://github.com/onionhammer/nim-templates would fit my use case |
08:15:13 | FromDiscord | <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:26 | FromDiscord | <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:04 | FromDiscord | <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:20 | FromDiscord | <prinova> (edit) "nimpy." => "nimpy (not anwered so far)." |
08:51:27 | PMunch | odexine, isn't onionhammer templates compile-time? |
08:51:52 | FromDiscord | <odexine> i didnt read too much into it because i went with mustache |
08:57:20 | * | krydos left #nim (buy buy) |
09:14:54 | FromDiscord | <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:00 | FromDiscord | <odexine> i was thinking "to" for inplace and "as" for return but that's not so clear |
09:18:20 | PMunch | Hmm, I would've thought those where opposite |
09:19:10 | PMunch | Or maybe not.. |
09:19:11 | FromDiscord | <odexine> exactly the issue lol |
09:19:47 | ormiret | primova: 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:42 | FromDiscord | <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:29 | FromDiscord | <odexine> i believe you dont |
09:22:52 | FromDiscord | <odexine> it's meant for procs that do not raise i think is the intention |
09:23:01 | FromDiscord | <ieltan> So, exceptions are discarded ? |
09:23:34 | FromDiscord | <odexine> In reply to @odexine "it's meant for procs": or rather procs that do not care about raised exceptions |
09:23:35 | FromDiscord | <ieltan> In reply to @odexine "it's meant for procs": can't you achieve that with `{.raises: [].}` |
09:23:44 | FromDiscord | <odexine> In reply to @ieltan "So, exceptions are discarded": exceptions are not handled at all i believe |
09:23:47 | FromDiscord | <odexine> In reply to @ieltan "can't you achieve that": different meaning |
09:23:56 | FromDiscord | <odexine> raises: [] means the proc cannot raise |
09:24:05 | FromDiscord | <odexine> quirky means the procs inside may raise but i dont care |
09:24:12 | FromDiscord | <ieltan> ok I think i understand now |
09:24:14 | FromDiscord | <odexine> (edit) "procs" => "calls" |
09:24:21 | FromDiscord | <ieltan> thanks 🙂 |
09:24:31 | FromDiscord | <odexine> i dont know of much practical use but there might be one? |
09:25:29 | FromDiscord | <ieltan> It sounds like it's linked to the `-exceptions:quirky` flag |
09:25:45 | FromDiscord | <ieltan> But i dont know how much it relates to it |
09:25:51 | FromDiscord | <Elegantbeef> Quirky is goto but if you do not have try except it doesnt handle it |
09:26:09 | FromDiscord | <Elegantbeef> Quirky pretty much means "Only handled errors are handled" afaik |
09:26:23 | FromDiscord | <odexine> oh so it's exceptions without bubbling |
09:26:28 | FromDiscord | <ieltan> Alright I see |
09:26:44 | FromDiscord | <ieltan> Is it more cost effective or it is still the same ? |
09:26:56 | FromDiscord | <Elegantbeef> You don't have overhead for what you don't use |
09:27:16 | FromDiscord | <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:43 | FromDiscord | <ieltan> Ok, I think i fully understand now |
09:27:55 | FromDiscord | <ieltan> that's kinda awesome 🙂 |
09:30:19 | FromDiscord | <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:38 | FromDiscord | <Phil> In reply to @odexine "<@180601887916163073> ya here? how": Return style: map↵In place: merge |
10:05:45 | FromDiscord | <Phil> You map data from shape a to shadow shape b ↵You merge data packet a into data packet b |
10:05:56 | FromDiscord | <Phil> (edit) removed "shadow" |
10:06:00 | FromDiscord | <odexine> i'll prolly go with map and apply |
10:06:03 | FromDiscord | <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:50 | FromDiscord | <Phil> Yeah, also fair wordings, I just like the alliteration |
11:55:13 | FromDiscord | <johnmartyr> Hello, is the nim language suitable for very high performance number crunching? |
11:55:22 | FromDiscord | <johnmartyr> mostly code running on the GPU |
11:58:26 | PMunch_ | johnmartyr, yup |
11:58:43 | FromDiscord | <johnmartyr> thanks |
11:59:36 | PMunch_ | johnmartyr, you can check out for example Laser: https://github.com/mratsim/laser |
12:00:33 | FromDiscord | <johnmartyr> In reply to @PMunch_ "<@1152266482043076658>, you can check": it looks that it is out of development |
12:00:49 | PMunch_ | What do you mean? |
12:01:26 | FromDiscord | <johnmartyr> > The library is in heavy development. For now the CPU backend is being optimised.↵> last commit is in 2021 |
12:02:52 | FromDiscord | <sOkam! 🫐> @mratsim 👆 is that still an accurate readme? |
12:03:05 | PMunch_ | Hmm, yeah that doesn't look great |
12:03:27 | PMunch_ | There is of course https://github.com/mratsim/Arraymancer by the same author |
12:03:31 | FromDiscord | <sOkam! 🫐> Wasn't mratsim who made weave/arraymancer? |
12:03:38 | PMunch_ | Yup |
12:03:40 | FromDiscord | <Phil> yep |
12:03:40 | FromDiscord | <sOkam! 🫐> yeah probably why |
12:32:37 | FromDiscord | <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:01 | FromDiscord | <mratsim> In reply to @johnmartyr "Hello, is the nim": Yes, use: for scientific computing - https://github.com/can-lehmann/exprgrad |
12:33:17 | FromDiscord | <mratsim> for cryptography we can discuss |
12:33:35 | FromDiscord | <mratsim> In general, you can reach any speed achievable in C, C++ or Assembly in Nim |
12:38:08 | FromDiscord | <mratsim> In reply to @johnmartyr "it looks that it": I was focusing on writing a compiler for arrays/tensors/matrices kernels |
12:38:59 | FromDiscord | <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:32 | FromDiscord | <mratsim> In reply to @johnmartyr "mostly code running on": And I'm personally writing GPU kernels for cryptography in Nim. |
12:41:20 | FromDiscord | <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:28 | FromDiscord | <johnmartyr> yeah i dont want to use these libraries that are "here today unmaintained by tomorrow" |
12:59:31 | FromDiscord | <johnmartyr> so nim sucks |
12:59:36 | FromDiscord | <johnmartyr> goodbye |
13:01:31 | PMunch | I guess we should've told him that Nim can also import C/C++ libraries.. |
13:02:01 | PMunch | The Python way of high-perf in C, glue in Python, could also be done with Nim |
13:02:25 | PMunch | That way you could probably leverage some more mature calculation backend and write glue in Nim |
13:10:11 | FromDiscord | <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:42 | FromDiscord | <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:03 | FromDiscord | <mratsim> See talk at CERN: https://indico.cern.ch/event/432527/contributions/1072091/attachments/1320716/1980489/talk_jin_nim_qex.pdf |
13:11:23 | FromDiscord | <wick3dr0se> Nim is amazing. He's just hurt he couldn't figure something out |
13:12:03 | FromDiscord | <wick3dr0se> I'm too stupid to figure out shit all the time but can't blame the language |
13:12:26 | FromDiscord | <nnsee> In reply to @mratsim "But what do you": he's already gone, don't waste your time |
13:13:00 | FromDiscord | <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:30 | FromDiscord | <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:23 | FromDiscord | <nnsee> also in this case, the libraries _do_ exist and are functional |
13:15:37 | FromDiscord | <nnsee> i don't get this obsession with libraries having to be maintained |
13:16:05 | FromDiscord | <nnsee> oh, it hasn't seen a commit since 2021? so? has the code suddenly stopped working? |
13:16:19 | FromDiscord | <nnsee> i regularly use tools and libraries that haven't been updated since the 2000s |
13:17:59 | FromDiscord | <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:39 | PMunch | Hmm, I wonder what the thing with the oldest last commit I currently have on my machine is.. |
13:29:31 | PMunch | I 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:13 | FromDiscord | <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:49 | FromDiscord | <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:47 | FromDiscord | <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:57 | FromDiscord | <fowl.mouth> Chipmunk or box2d |
14:53:00 | * | disso-peach joined #nim |
14:59:38 | FromDiscord | <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:55 | FromDiscord | <Chronos [She/Her]> But then that'd need a 3D engine which I don't want to do- |
15:00:06 | FromDiscord | <Chronos [She/Her]> Though it would be useful for making a puzzle game |
15:00:10 | FromDiscord | <Langosta> sent a long message, see http://ix.io/4GIW |
15:02:22 | * | disso-peach quit (Quit: Leaving) |
15:06:07 | FromDiscord | <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:15 | FromDiscord | <Chronos [She/Her]> I don't need an engine, I've been getting the words wrong aha |
15:06:21 | FromDiscord | <Chronos [She/Her]> Just something to handle the bare minimum |
15:09:53 | FromDiscord | <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:07 | FromDiscord | <nnsee> In reply to @alendrik "Some people forget that": couldn't agree more |
15:19:47 | FromDiscord | <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:35 | FromDiscord | <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:49 | FromDiscord | <nnsee> In reply to @fowl.mouth "I like to work": I'm exactly the same way |
15:23:52 | FromDiscord | <odexine> who aint hahaha |
15:28:10 | FromDiscord | <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:39 | FromDiscord | <Phil> or that you yourself may want to use |
15:30:43 | FromDiscord | <Phil> A lib not working under arc/orc would be a prime example of you want to use it |
15:30:56 | FromDiscord | <Phil> (edit) "of" => "if" |
15:45:26 | FromDiscord | <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:34 | FromDiscord | <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:42 | FromDiscord | <Langosta> great addendum |
15:53:13 | * | xmachina joined #nim |
15:58:02 | FromDiscord | <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:42 | FromDiscord | <sOkam! 🫐> choosenim? 🤔 |
16:01:07 | FromDiscord | <Langosta> ye, get choosenim |
16:01:17 | FromDiscord | <Phil> Choosenim install stable was the command I think |
16:03:21 | FromDiscord | <Phil> In reply to @odexine "who aint hahaha": .... way to make me feel excluded! |
16:06:43 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @heysokam "choosenim? 🤔": I nimble installed it, but it doesn't find the choosenim command |
16:09:02 | FromDiscord | <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:22 | FromDiscord | <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:56 | FromDiscord | <Chronos [She/Her]> In reply to @heysokam "saw bumpy yet? the": Oh? I haven't actually, I'll look at it |
16:41:47 | FromDiscord | <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:58 | FromDiscord | <nnsee> if you don't mind me asking, why are you installing Nim on kali? |
16:42:20 | FromDiscord | <nnsee> kali doesn't really seem the best choice for developing software on |
16:42:35 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @nnsee "if you don't mind": Which distro should I choose? I use wsl |
16:42:36 | FromDiscord | <fowl.mouth> https://github.com/treeform this guy has some cool projects |
16:43:44 | FromDiscord | <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:05 | FromDiscord | <nnsee> Kali is meant specifically for pentesting and has some downsides if you're not doing that specifically |
16:44:30 | FromDiscord | <System64 ~ Flandre Scarlet> Oooh alright, gotta use Ubuntu then |
16:45:05 | FromDiscord | <nnsee> well, I say "always", but I haven't really used Windows (other than to test malware) for years now |
16:46:39 | FromDiscord | <.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:57 | FromDiscord | <odexine> IC will come out when it is ready |
17:15:02 | FromDiscord | <.aingel.> Is there a way to change the theme of the command line print statements in nim |
17:15:17 | FromDiscord | <.aingel.> My strings are in green and I was wondering if I can change it |
17:15:43 | FromDiscord | <.aingel.> In reply to @odexine "IC will come out": Is there any clue to the status progress of it or eta? |
17:20:01 | FromDiscord | <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:21 | FromDiscord | <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:43 | FromDiscord | <nnsee> In reply to @.aingel. "Is there a way": something that works across languages is ANSI escape sequences to colour text |
17:25:50 | FromDiscord | <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:48 | FromDiscord | <odexine> In reply to @nnsee "something that works across": It wouldn’t work for cmd.exe on windows but it will elsewhere |
17:41:56 | FromDiscord | <nnsee> In reply to @odexine "It wouldn’t work for": wait really? |
17:42:07 | FromDiscord | <nnsee> windows doesn't support ansi escape sequences? |
17:42:20 | FromDiscord | <nnsee> why is that funny and yet not that surprising at the same time |
18:05:55 | FromDiscord | <odexine> In reply to @nnsee "windows doesn't support ansi": Windows terminal (the new app) does |
18:06:13 | FromDiscord | <odexine> cmd.exe (the old-ass one) does not |
18:13:19 | FromDiscord | <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:00 | FromDiscord | <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:54 | FromDiscord | <nnsee> In reply to @aintea "Do you guys know": the recommended method is `import std/[strformat, strutils]` with the std prefix |
18:21:55 | FromDiscord | <Chronos [She/Her]> I'm thinking of storing my map format using a PNG to store and represent data :p |
18:22:13 | FromDiscord | <Chronos [She/Her]> Then also just associating some JSON data with it |
18:22:33 | FromDiscord | <nnsee> In reply to @nnsee "the recommended method is": mostly because it's explicit and unambiguous |
18:28:11 | FromDiscord | <aintea> Okay thanks |
18:32:44 | FromDiscord | <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:56 | FromDiscord | <Chronos [She/Her]> Okay yep docs say 0 to 1 |
18:43:02 | FromDiscord | <Chronos [She/Her]> Is there an advantage to using a sprite sheet rather than many individual textures? |
18:45:58 | FromDiscord | <toma400> In reply to @chronos.vitaqua "Okay yep docs say": Ooh, so it does not handle semi-transparency? |
18:46:26 | FromDiscord | <toma400> That would give me some explanations why Drawfire had issues with it |
18:46:42 | FromDiscord | <Chronos [She/Her]> It does handle semi-transparency sorry aha |
18:46:57 | FromDiscord | <Chronos [She/Her]> At least, Chroma supports it |
18:47:12 | FromDiscord | <Chronos [She/Her]> Also oof no Raygui for Nim |
18:47:22 | FromDiscord | <Chronos [She/Her]> Naylib doesn't support it |
18:53:02 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4GKc |
18:56:15 | FromDiscord | <Chronos [She/Her]> Sounds like something isn't working right |
18:56:57 | FromDiscord | <System64 ~ Flandre Scarlet> It works perfectly on Windows |
18:58:32 | * | ntat quit (Quit: leaving) |
19:00:28 | FromDiscord | <System64 ~ Flandre Scarlet> @Phil Is it normal Norm acts like this on Linux while I have no problems on Windows? |
19:01:22 | FromDiscord | <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:54 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4GKi |
19:02:26 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @isofruit "Have you consdeired taht": It created the game.db file |
19:02:43 | FromDiscord | <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:37 | FromDiscord | <Phil> `ls -l`on the dir |
19:03:52 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4GKj |
19:04:18 | FromDiscord | <System64 ~ Flandre Scarlet> ``drwxrwxrwx 1 system64 system64 512 Sep 18 20:59 out`` |
19:04:37 | FromDiscord | <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:15 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @isofruit "Okay kinda nuts you": yeah, wsl |
19:05:29 | FromDiscord | <Phil> You got the sqlite lib installed? |
19:05:36 | FromDiscord | <Phil> On ubuntu I mean |
19:05:48 | FromDiscord | <System64 ~ Flandre Scarlet> Yeah↵Sudo apt-get install sqlite I did |
19:09:17 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4GKl |
19:11:07 | FromDiscord | <Phil> So that's a general sqlite issue on linux then |
19:11:22 | FromDiscord | <Phil> Wait, what path do you use? |
19:11:30 | FromDiscord | <Phil> Do you use different paths on linux and windows? |
19:11:36 | FromDiscord | <System64 ~ Flandre Scarlet> the same as the executable |
19:11:49 | FromDiscord | <Phil> No as in, does the path include backslahes / forward slashes |
19:11:58 | FromDiscord | <Phil> That might be a difference that I could think of |
19:12:07 | FromDiscord | <System64 ~ Flandre Scarlet> No |
19:13:19 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4GKm |
19:13:22 | FromDiscord | <Phil> I mean, desperate play but do things change if you change the owner of the file? |
19:13:37 | FromDiscord | <System64 ~ Flandre Scarlet> the owner is me |
19:14:17 | FromDiscord | <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:59 | FromDiscord | <Elegantbeef> raygui |
19:16:00 | FromDiscord | <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:46 | FromDiscord | <Phil> Some folks did stuff like turning journalmode off, but if that't the problem then honestly the system's fucked |
19:16:54 | FromDiscord | <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:10 | FromDiscord | <System64 ~ Flandre Scarlet> Is that Linux's fault so? |
19:17:23 | FromDiscord | <Phil> I wouldn't be able to tell you where it fucks up |
19:17:59 | FromDiscord | <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:04 | FromDiscord | <System64 ~ Flandre Scarlet> Works fine on 2 Windows machines, so might be with something in Linux |
19:19:30 | FromDiscord | <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:38 | FromDiscord | <System64 ~ Flandre Scarlet> I maybe can try to run it from Wine 🤣 |
19:25:39 | FromDiscord | <raynei486> if I have a `distinct ptr` how do I check if it's null? |
19:25:48 | FromDiscord | <raynei486> `==` doesn't work |
19:25:57 | FromDiscord | <Elegantbeef> `(ptr T)(myPtr) != nil` |
19:26:09 | FromDiscord | <Elegantbeef> or `import std/typetraits` and `myPtr.distinctbase != nil` |
19:26:28 | FromDiscord | <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:33 | FromDiscord | <raynei486> In reply to @Elegantbeef "`(ptr T)(myPtr) != nil`": I almost thought that was C lol |
19:26:43 | FromDiscord | <raynei486> In reply to @Elegantbeef "The entire point of": hmmm true |
19:26:54 | FromDiscord | <Elegantbeef> This means you either need to use the often broken `borrow` pragma, or convert to the base |
19:27:27 | FromDiscord | <arathanis> sent a code paste, see https://play.nim-lang.org/#ix=4GKq |
19:27:32 | FromDiscord | <arathanis> I don't know if the parens are required or not |
19:28:03 | FromDiscord | <Elegantbeef> `as` is an infix operator that does nothing by default |
19:28:17 | FromDiscord | <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:27 | FromDiscord | <Elegantbeef> It's only used for `import` and `except` |
19:28:37 | FromDiscord | <arathanis> hmm, i thought 'as' could be used for casting... |
19:28:49 | FromDiscord | <Elegantbeef> You'd be wrong |
19:29:02 | FromDiscord | <arathanis> must have been done in the project where I saw it |
19:29:17 | FromDiscord | <Elegantbeef> Yep Union and Godot-nim implement `as` |
19:31:14 | FromDiscord | <arathanis> sent a code paste, see https://play.nim-lang.org/#ix=4GKv |
19:31:29 | FromDiscord | <Elegantbeef> Arguably the conversion using as is worse anyway |
19:31:52 | FromDiscord | <arathanis> you mean over just using `cast`? |
19:31:58 | FromDiscord | <Elegantbeef> Yes |
19:32:07 | FromDiscord | <arathanis> its probably less explicit, yeah |
19:32:14 | FromDiscord | <Elegantbeef> `cast` isnt what you want 9/10 times |
19:32:15 | FromDiscord | <Elegantbeef> Hiding it inside `as` is just wrong |
19:32:24 | FromDiscord | <Elegantbeef> Since `10 as float` is innocuous |
19:32:25 | FromDiscord | <arathanis> is there a difference between `cast` and `(T)` |
19:32:30 | FromDiscord | <Elegantbeef> Yes |
19:32:30 | FromDiscord | <arathanis> (edit) "`cast`" => "`cast[T]`" |
19:32:35 | FromDiscord | <arathanis> does (T) unsafe? |
19:32:39 | FromDiscord | <arathanis> (edit) "does" => "is" |
19:32:47 | FromDiscord | <Elegantbeef> Cast is a direct bit conversion, the other is a type conversion |
19:32:52 | FromDiscord | <Elegantbeef> Cast is unsafe |
19:32:56 | FromDiscord | <Elegantbeef> If you use cast children in africa die |
19:33:08 | FromDiscord | <arathanis> oh ok, so prefer using (T) over cast? |
19:33:17 | FromDiscord | <Elegantbeef> Of cours |
19:33:19 | FromDiscord | <Elegantbeef> course\ |
19:33:19 | FromDiscord | <arathanis> are there examples of the differences and danger, and where you would have to use `cast`? |
19:33:30 | FromDiscord | <Elegantbeef> When you want to change the type but keep the bits the same |
19:33:48 | FromDiscord | <Elegantbeef> It's a C++ reinterpret cast or a C cast |
19:34:01 | * | Lord_Nightmare quit (Quit: ZNC - http://znc.in) |
19:34:08 | FromDiscord | <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:14 | FromDiscord | <raynei486> it's telling the compiler to reinterpret the bits |
19:35:14 | FromDiscord | <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:46 | FromDiscord | <raynei486> nah it'll stay in the bounds |
19:35:56 | FromDiscord | <raynei486> but memory representation of 10 may not be equal to 10.0 |
19:36:04 | FromDiscord | <arathanis> it 100% wont |
19:36:14 | FromDiscord | <arathanis> will it stay in bounds? |
19:36:27 | FromDiscord | <arathanis> what will it do if I give it an object much smaller |
19:37:00 | FromDiscord | <Elegantbeef> Stop using cast where copymem is what you want |
19:37:01 | * | Lord_Nightmare joined #nim |
19:37:02 | FromDiscord | <raynei486> I'm not sure |
19:37:27 | FromDiscord | <arathanis> In reply to @Elegantbeef "Stop using cast where": im just trying to understand what is going on under the hood lol |
19:38:18 | FromDiscord | <raynei486> look at source code probably |
19:38:32 | FromDiscord | <raynei486> I know C++ bit cast has a size check that prevents casting to a larger object |
19:38:38 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4GKz |
19:38:55 | FromDiscord | <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:22 | FromDiscord | <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:30 | FromDiscord | <.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:30 | Amun-Ra | there are no checks performed, you can construct bad html dom |
21:38:52 | FromDiscord | <.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:12 | FromDiscord | <.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:16 | FromDiscord | <.aingel.> The nested p tags |
21:39:27 | Amun-Ra | right |
21:39:29 | FromDiscord | <.aingel.> I have a lot of xml files which use nested p tags |
21:39:41 | FromDiscord | <.aingel.> Do I really have to parse them with javascript then? |
21:39:56 | FromDiscord | <Elegantbeef> Or you could just parse it as xml instead of html since it's invalid html |
21:39:59 | FromDiscord | <.aingel.> I spent so much time getting this parser to work with nim lol so I could avoid doing in javascript |
21:40:15 | FromDiscord | <.aingel.> Oh |
21:40:27 | FromDiscord | <.aingel.> So xml allows nested p tags |
21:40:33 | FromDiscord | <.aingel.> Or it just doesn't care about p as something special? |
21:40:37 | FromDiscord | <Elegantbeef> Xml doesnt have `p tags` |
21:40:43 | FromDiscord | <.aingel.> Right |
21:40:44 | FromDiscord | <.aingel.> Ugh |
21:41:09 | FromDiscord | <.aingel.> This is kind of a disaster |
21:41:13 | FromDiscord | <Elegantbeef> Xml is a markup language of nested `<x ...>` |
21:41:14 | FromDiscord | <Elegantbeef> It does not designate nodes as special you do |
21:41:18 | FromDiscord | <.aingel.> since this is an html parser lib and not xml |
21:41:25 | FromDiscord | <Elegantbeef> HTML? Yes |
21:41:29 | FromDiscord | <.aingel.> I thought html would be fine or even better since html parsers are generally more lenient |
21:41:43 | Amun-Ra | just like browsers are |
21:41:46 | FromDiscord | <Elegantbeef> Nim has a xml parser in the stdlib and there are abundant amount xml parsers in the nimble repository |
21:42:03 | FromDiscord | <.aingel.> They are messed up |
21:42:10 | FromDiscord | <.aingel.> nimquery has a bug for example |
21:42:21 | FromDiscord | <.aingel.> I will report it but it breaks on tags that are case sensitive |
21:42:31 | FromDiscord | <.aingel.> And the other issue is that they don't have dom functions |
21:43:01 | FromDiscord | <Elegantbeef> What are you even doing? |
21:43:12 | FromDiscord | <.aingel.> Some stuff in xml |
21:43:21 | FromDiscord | <Elegantbeef> Oh really?! 😛 |
21:43:23 | FromDiscord | <.aingel.> I guess I could use lxml |
21:43:45 | FromDiscord | <Elegantbeef> You have a group of incorrect html files you're attempting to parse and add to |
21:43:58 | FromDiscord | <Elegantbeef> Why do you need dom functions if it's XML? |
21:44:20 | FromDiscord | <.aingel.> No they are xml file |
21:44:35 | FromDiscord | <.aingel.> (edit) "file" => "files" |
21:44:40 | FromDiscord | <.aingel.> But they use p tags I guess thats just their convention |
21:44:50 | FromDiscord | <.aingel.> It honestly would work if I just replaced every p tag with div |
21:44:58 | FromDiscord | <.aingel.> I could do that with just text replacement really |
21:45:01 | FromDiscord | <Elegantbeef> But why would you do that? |
21:45:22 | FromDiscord | <Elegantbeef> You have XML, use an xml parser then do whatever you want with the parsed tree |
21:45:25 | Amun-Ra | right, which is fine unless you have a xlst that forbids that |
21:45:31 | FromDiscord | <.aingel.> Then it would parse properly with my html parsing lib |
21:45:55 | FromDiscord | <Elegantbeef> That seems like a lot of work to avoid the 'proper' way |
21:46:08 | FromDiscord | <.aingel.> I have to check if libxml has dom functions |
21:46:28 | FromDiscord | <.aingel.> I need a dom for the xml stuff |
21:46:30 | FromDiscord | <.aingel.> Nim doesnt have that |
21:46:38 | FromDiscord | <Elegantbeef> But why do you need dom for xml? |
21:46:40 | FromDiscord | <Elegantbeef> I'm so lost |
21:46:43 | FromDiscord | <.aingel.> I just do |
21:46:50 | FromDiscord | <.aingel.> I need to move around nodes and stuff |
21:47:17 | FromDiscord | <Elegantbeef> So move them around using `[]` and friends |
21:48:12 | FromDiscord | <.aingel.> You can't even get like "innerhtml" or innerxml in the nim xml parsers |
21:48:34 | FromDiscord | <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:37 | FromDiscord | <Elegantbeef> https://news.ycombinator.com/item?id=37555028 |
21:49:11 | FromDiscord | <Elegantbeef> `innerText` exists |
21:49:11 | FromDiscord | <Elegantbeef> So... yes you can |
21:49:25 | FromDiscord | <.aingel.> nope that doesnt work |
21:49:28 | FromDiscord | <.aingel.> The way you think it does |
21:49:39 | FromDiscord | <.aingel.> It's not innerxml or innerhtml |
21:49:47 | FromDiscord | <.aingel.> It's only for a text object |
21:49:55 | FromDiscord | <.aingel.> I've used all of the nim xlm stuff |
21:50:00 | FromDiscord | <.aingel.> (edit) "xlm" => "xml" |
21:50:27 | FromDiscord | <.aingel.> (edit) "object" => "node" |
21:52:07 | FromDiscord | <jmgomez> In reply to @Elegantbeef "<@572634810917322773>\: I only read": talking about that, did someone started working on the RFC? |
21:52:26 | FromDiscord | <.aingel.> Yeah libxml can do this |
21:52:42 | FromDiscord | <.aingel.> I mean it obviously should be able to since it's like the standard for xml stuff |
21:52:57 | FromDiscord | <.aingel.> It's what people use for parsing html though too like nokogiri |
21:53:46 | FromDiscord | <.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:03 | FromDiscord | <.aingel.> Didn't realize about this nested p tag thing |
21:54:11 | FromDiscord | <.aingel.> I guess that's good to know |
21:55:28 | FromDiscord | <Elegantbeef> I mean it works on text and element nodes |
21:55:28 | FromDiscord | <Elegantbeef> > If n is xnElement, runs recursively on each child node and concatenates the results. |
22:02:05 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @isofruit "That's not necessarily how": Well, even on a real debien I have this problem |
22:05:27 | FromDiscord | <.aingel.> In reply to @Elegantbeef "I mean it works": It doesn't output the innerHTML (or equiv) |
22:06:34 | FromDiscord | <.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:46 | FromDiscord | <.aingel.> (edit) "class="hello"><span>how" => "class="hello">hey<span>how" |
22:06:51 | FromDiscord | <.aingel.> It will just print hey |
22:07:05 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#ix=4GL0 |
22:07:05 | FromDiscord | <.aingel.> It will print text not like all the xml |
22:07:27 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#ix=4GL1 |
22:07:29 | FromDiscord | <.aingel.> Yeah just text |
22:07:36 | FromDiscord | <.aingel.> Thats not what innerhtml is in javascript |
22:07:45 | FromDiscord | <Elegantbeef> Oh right inner html |
22:07:53 | FromDiscord | <.aingel.> You lose all the tags |
22:07:55 | FromDiscord | <Elegantbeef> So make a stringifcation proc |
22:08:18 | FromDiscord | <.aingel.> You also cannot replace tags like you want to remove one tag and replace it with another node |
22:08:25 | FromDiscord | <.aingel.> You have to do string manipulation and it breaks |
22:08:38 | FromDiscord | <Elegantbeef> You can replcae tages |
22:08:42 | FromDiscord | <Elegantbeef> replace tags |
22:08:53 | FromDiscord | <.aingel.> You can't even extract the code of a tag |
22:09:23 | FromDiscord | <.aingel.> So how can you replace it with something else |
22:09:25 | FromDiscord | <Elegantbeef> Yes you can |
22:09:32 | FromDiscord | <.aingel.> Well how then |
22:10:11 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4GL3 |
22:10:53 | FromDiscord | <.aingel.> I'm using the word tag wrong |
22:13:33 | FromDiscord | <varriount> In reply to @Elegantbeef "https://news.ycombinator.com/item?id=37555028": Doesn't Nim use enums for tagged unions? |
22:13:41 | FromDiscord | <.aingel.> @ElegantBeouf Is there an insert after proc |
22:13:50 | FromDiscord | <.aingel.> Or get index of tag |
22:13:57 | FromDiscord | <.aingel.> Otherwise how do you replace a tag |
22:14:07 | FromDiscord | <Elegantbeef> Nim has tagged unions delimited by enums |
22:14:07 | FromDiscord | <Elegantbeef> Nim does not use the term Enum for tagged unions |
22:14:10 | FromDiscord | <System64 ~ Flandre Scarlet> Did someone already tried to use SQLite with Nim on Linux? |
22:14:48 | FromDiscord | <Elegantbeef> You can use findall or `[]` to select XmlNodes |
22:14:57 | FromDiscord | <Elegantbeef> You also can write your procedures to do things that the stdlib does not provide |
22:15:02 | FromDiscord | <.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:10 | FromDiscord | <.aingel.> Or have an insertafter or insertbefore proc |
22:15:17 | FromDiscord | <.aingel.> This parser only gives insert at index |
22:15:21 | FromDiscord | <.aingel.> findall doesn't give you the index |
22:16:09 | FromDiscord | <.aingel.> I need the index with respect to just the children |
22:16:12 | FromDiscord | <.aingel.> Not to my tag search |
22:17:23 | FromDiscord | <Elegantbeef> You can implement all these operations you want with the Nim stdlib |
22:17:23 | FromDiscord | <Elegantbeef> It's not magic |
22:17:26 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4GL6 |
22:19:18 | FromDiscord | <.aingel.> I have to make so much then |
22:19:26 | FromDiscord | <.aingel.> I was doing a bunch of stuff like this but it was just getting dumb |
22:19:38 | FromDiscord | <.aingel.> Cause then I can't use css selectors |
22:19:47 | FromDiscord | <.aingel.> It's like might as well write a whole parser myself |
22:19:53 | FromDiscord | <.aingel.> That's exaggerating but still |
22:20:10 | FromDiscord | <Elegantbeef> I mean xml doesnt have css selectors 😄 |
22:20:19 | FromDiscord | <.aingel.> It does though |
22:20:32 | FromDiscord | <.aingel.> I mean xml parsing libraries do have css selectors |
22:20:43 | FromDiscord | <.aingel.> Even a nim one does, but it has a bug |
22:20:45 | FromDiscord | <.aingel.> nimquery |
22:21:03 | FromDiscord | <Elegantbeef> Nimquery is an html parser |
22:21:17 | FromDiscord | <.aingel.> Okay |
22:21:28 | FromDiscord | <.aingel.> Well you can still use css selectors to an extent on xml |
22:21:35 | FromDiscord | <.aingel.> libxml allows you to I am pretty sure |
22:22:11 | FromDiscord | <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:34 | FromDiscord | <.aingel.> Thanks for the help |
22:23:44 | FromDiscord | <.aingel.> I think I am wrong about the css thing though you are right |
22:23:53 | FromDiscord | <.aingel.> Definitely learning this better haha |
22:24:24 | FromDiscord | <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:26 | FromDiscord | <.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:33 | FromDiscord | <.aingel.> Yeah, I think it's xpath |
22:24:37 | FromDiscord | <Elegantbeef> XML after all is a serialisation format |
22:26:06 | FromDiscord | <Elegantbeef> https://github.com/weskerfoot/NimPath there is this xpath/libpath wrapper |
22:26:10 | FromDiscord | <Elegantbeef> i mean libxml2 |
22:27:08 | FromDiscord | <.aingel.> Oh cool! |
22:27:48 | * | advesperacit quit () |
22:34:07 | FromDiscord | <JJ> In reply to @Elegantbeef "<@572634810917322773>\: I only read": heh i've flipped back to liking enum a bit really |
22:34:20 | FromDiscord | <Elegantbeef> It's such an awful term for tagged unions |
22:34:29 | FromDiscord | <JJ> enums are kinda static tagged unions |
22:34:46 | FromDiscord | <Elegantbeef> If you were hit upside the head maybe |
22:34:58 | FromDiscord | <JJ> unions is the more descriptive term, certainly |
22:35:02 | FromDiscord | <JJ> In reply to @Elegantbeef "If you were hit": lmao |
22:35:33 | FromDiscord | <Elegantbeef> I mean enumerate means to count or to list! |
22:36:20 | FromDiscord | <Elegantbeef> "A list of possible state of a sum type" is pretty silly, so fite me |
22:36:41 | FromDiscord | <JJ> one thing that does bother me about zig a bit is the comptime stuff |
22:37:02 | FromDiscord | <JJ> well okay two things bother me about zig |
22:38:17 | FromDiscord | <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:37 | FromDiscord | <JJ> comptime is weird to me too because it's like, not that special? but touted as so |
22:39:04 | FromDiscord | <Elegantbeef> Yea, though some of comptime is wonderful |
22:39:10 | FromDiscord | <JJ> i need to refresh my memory but i'm fairly certain nim's static + const is just straight up more powerful |
22:39:35 | FromDiscord | <Elegantbeef> I do like that entire writeup is just a complicated "AoS exist" |
22:39:39 | FromDiscord | <JJ> and comptime is a bit of a gross way to do generics |
22:40:13 | FromDiscord | <Elegantbeef> Yea not needing to explicitly mark procs as `comptime` is an important part |
22:41:01 | FromDiscord | <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:33 | FromDiscord | <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:45 | FromDiscord | <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:11 | FromDiscord | <Elegantbeef> They're fields not attributes, secondly `for x in mySeq.mitems` to iterate mutable values |
23:10:14 | FromDiscord | <bhunao> sent a code paste, see https://play.nim-lang.org/#ix=4GLj |
23:10:25 | FromDiscord | <Elegantbeef> Assuming `mySeq` is `var mySeq` |
23:10:32 | FromDiscord | <bhunao> whats the difference between fields and attributes? |
23:11:00 | FromDiscord | <Elegantbeef> Attributes is ambiguous and not what Nim calls fields |
23:11:09 | FromDiscord | <bhunao> oh ok, thanks |
23:11:14 | FromDiscord | <Elegantbeef> In C# for instance attributes are used like pragmas |
23:16:26 | FromDiscord | <wick3dr0se> sent a code paste, see https://play.nim-lang.org/#ix=4GLo |
23:17:21 | FromDiscord | <wick3dr0se> (edit) "https://play.nim-lang.org/#ix=4GLo" => "https://play.nim-lang.org/#ix=4GLp" |
23:21:34 | FromDiscord | <wick3dr0se> Basically just trying to declare the object in helpers and define it otherwise.. Doesn't seem so simple |
23:21:53 | FromDiscord | <wick3dr0se> (edit) "otherwise.." => "elsewhere.." |
23:25:46 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4GLs |
23:27:42 | FromDiscord | <Elegantbeef> How are you trying to use it? |
23:28:38 | FromDiscord | <wick3dr0se> sent a code paste, see https://play.nim-lang.org/#ix=4GLu |
23:28:50 | FromDiscord | <Elegantbeef> your module is not named `clientData` is it? |
23:29:29 | FromDiscord | <wick3dr0se> I just have a file I'm trying to import named helpers.nim and within was the code I pasted above |
23:29:53 | FromDiscord | <wick3dr0se> My main file is named server.nim |
23:29:53 | FromDiscord | <Elegantbeef> Well the above will work |
23:29:53 | FromDiscord | <Elegantbeef> What's the error |
23:31:16 | FromDiscord | <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:35 | FromDiscord | <Elegantbeef> Are you sure you're `import`ing |
23:31:46 | FromDiscord | <wick3dr0se> sent a code paste, see https://play.nim-lang.org/#ix=4GLx |
23:31:56 | FromDiscord | <wick3dr0se> Those are the 3 files |
23:32:04 | FromDiscord | <Elegantbeef> You realise to level code runs at startup right? |
23:32:24 | FromDiscord | <Elegantbeef> So your imported code will run before the async is ran |
23:32:58 | FromDiscord | <wick3dr0se> I guess that's the only reason why lol |
23:33:05 | FromDiscord | <wick3dr0se> I hate how used to bash I am |
23:35:30 | FromDiscord | <wick3dr0se> In reply to @Elegantbeef "So your imported code": Thanks, I'm slow af sometimes |