01:13:50 | * | arkurious quit (Quit: Leaving) |
01:56:16 | FromDiscord | <demotomohiro> In reply to @yttriy "Yes, but I am": https://nim-lang.org/docs/math.html#ceilDiv,T,T |
03:05:51 | FromDiscord | <!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3ZkJ |
03:06:15 | FromDiscord | <Elegantbeef> Cool |
03:07:00 | FromDiscord | <!Patitotective> is it coming on v2 or? |
03:07:17 | FromDiscord | <Elegantbeef> No clue |
03:08:12 | FromDiscord | <!Patitotective> can i define the default value of a type? |
03:08:31 | FromDiscord | <Elegantbeef> no |
03:08:47 | FromDiscord | <!Patitotective> :[ |
03:08:50 | FromDiscord | <!Patitotective> not even my own types? |
03:09:01 | FromDiscord | <Elegantbeef> https://github.com/beef331/constructor/#defaults |
03:11:50 | FromDiscord | <!Patitotective> :o |
05:08:16 | * | TakinOver joined #nim |
05:16:02 | * | kayabaNerve joined #nim |
06:24:15 | FromDiscord | <DevNugget> sent a code paste, see https://play.nim-lang.org/#ix=3Zlf |
06:24:24 | FromDiscord | <DevNugget> without using a loop |
06:25:21 | FromDiscord | <demotomohiro> why you cannot use loop? |
06:25:57 | FromDiscord | <DevNugget> Its not that I cannot↵I assumed that there would be some other way to do it |
06:27:55 | FromDiscord | <Rika> Join the sequence with an empty string then print that |
06:28:12 | FromDiscord | <Rika> I think you have to also map the sequence into a string sequence first |
06:32:09 | FromDiscord | <demotomohiro> join or map have loop inside of it.↵@DevNugget asking for it without using a loop. |
06:33:50 | FromDiscord | <demotomohiro> !eval import strutils; echo @[1,2,3,4].join |
06:33:53 | NimBot | 1234 |
06:36:38 | FromDiscord | <demotomohiro> !eval import sequtils; echo @[1,2,3,4].foldl(a & $b, "") |
06:36:40 | NimBot | 1234 |
06:37:33 | FromDiscord | <Zectbumo> hmm, I think it's too strict when I have a proc that takes an `int` and it won't take a `uint32` because it's the `"type mismatch"` I have to `.int` 😦 |
06:37:48 | FromDiscord | <Zectbumo> (edit) "the" => "a" |
06:38:01 | FromDiscord | <Zectbumo> (edit) "hmm, I think it's too strict when I have a proc that takes an `int` and it won't take a `uint32` because it's a `"type mismatch"` ... I" added "so" |
06:39:09 | FromDiscord | <demotomohiro> `int` can be 32bits in 32bit cpu. And passing `uint32` larger than 2^31 become negative value. |
06:39:39 | FromDiscord | <DevNugget> In reply to @demotomohiro "join or map have": that does it, thank you very much |
06:41:08 | FromDiscord | <Rika> In reply to @demotomohiro "join or map have": I think he means without explicit loop |
07:25:46 | FromDiscord | <Zectbumo> In reply to @demotomohiro "`int` can be 32bits": okay, this makes sense now looking at it from a 32 bit machine (or lower). there is so much to take into consideration. I'm glad I'm in good hands 🙂 |
08:02:47 | FromDiscord | <Zectbumo> In reply to @demotomohiro "`int` can be 32bits": okay, so I just ran into this issue. the proc() takes an `int` and I pass it a `uint8` and it gets a `type mismatch`. no excuses now 😅 |
08:03:28 | FromDiscord | <Zectbumo> I can chalk this one up to "consistency" |
08:04:17 | FromDiscord | <Rika> Conceptually those integer types are different |
08:04:29 | FromDiscord | <Rika> If you want them to convert implicitly, use a converter |
08:05:00 | FromDiscord | <Zectbumo> I heard about those converter things |
08:05:22 | FromDiscord | <Zectbumo> (looking it up now) |
08:07:04 | FromDiscord | <Zectbumo> okay. easy enough and good to know. I'll be `.int` again but one day I'll use a converter |
08:20:30 | FromDiscord | <d4rckh> https://github.com/prompt-toolkit/python-prompt-toolkit |
08:20:36 | FromDiscord | <d4rckh> is there any library similar to this for nim? |
08:20:43 | FromDiscord | <d4rckh> i want that cool auto completion |
08:21:02 | FromDiscord | <enthus1ast> you tried it last time |
08:21:08 | FromDiscord | <enthus1ast> i gave you the link |
08:21:40 | FromDiscord | <enthus1ast> https://github.com/jangko/nim-noise |
08:21:50 | FromDiscord | <d4rckh> ah im blind |
08:21:54 | FromDiscord | <d4rckh> thanks again |
08:31:44 | FromDiscord | <d4rckh> oh, i dont remember how i ran nim noise in a thread |
08:32:03 | FromDiscord | <enthus1ast> i think you had some troubles last time |
08:32:26 | FromDiscord | <d4rckh> yeah i think i ran the entire while loop in a thread |
08:32:27 | FromDiscord | <enthus1ast> think with overprinting |
08:33:02 | FromDiscord | <enthus1ast> i think what you wanted to do is easier in a gui library |
08:33:47 | FromDiscord | <enthus1ast> and or split the server and the control application |
08:34:09 | FromDiscord | <enthus1ast> so that the server can run stand alone, and you define an api where the control applications can connect |
08:36:13 | FromDiscord | <enthus1ast> but yeah does not help with your current issue i guess \:) |
08:36:23 | FromDiscord | <enthus1ast> but its worth a look |
08:36:26 | * | jmdaemon quit (Ping timeout: 272 seconds) |
08:42:09 | FromDiscord | <d4rckh> i already made some sort of an api, but its so much easier if the GUI is linked to the client |
08:42:16 | FromDiscord | <d4rckh> since i can just use the objects and things yk |
08:42:43 | FromDiscord | <enthus1ast> you can import the objects in multiple application |
08:42:54 | FromDiscord | <enthus1ast> import the nim modules that contains the objects i mean |
08:42:55 | * | jjido joined #nim |
09:14:29 | FromDiscord | <aph> you could also use std/terminal i think, though it's low-level |
09:18:50 | FromDiscord | <Zectbumo> sent a code paste, see https://paste.rs/HFv |
09:21:45 | FromDiscord | <Elegantbeef> `myStr = $myChar` |
09:22:06 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3ZlQ |
09:53:07 | FromDiscord | <californiatl> I'll help 10 individuals how to earn $20,000 in just 72 hours from the crypto market. But you will pay me 10% commission when you receive your profit. if interested send me a direct message via WhatsApp by asking me HOW for more details on how to get started↵+1 (2297781881 |
10:15:00 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
10:15:56 | * | xaltsc joined #nim |
10:22:30 | * | jjido joined #nim |
10:49:34 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
10:51:51 | NimEventer | New Nimble package! receq - Operator for comparing any recursive ref object, see https://github.com/choltreppe/nim_receq |
11:13:51 | * | wallabra quit (Ping timeout: 276 seconds) |
11:16:21 | * | wallabra joined #nim |
11:36:17 | FromDiscord | <Don-Swal> So I want to do a tightly integrated nim+sqlite project (I basically want to yugioh fusion card them and make an utterly maniacal query language). I was planning on a paper thin ORM anyway but from what I'm reading about nimv2 it seems like it would be better to build it out with https://github.com/arnetheduck/nim-sqlite3-abi to future proof it? If not could someone recommend a setup that probably won't require a ton of refactoring when |
11:49:10 | FromDiscord | <Bung> why math.square argument is float64 ? |
11:55:42 | FromDiscord | <Yepoleb> <@&371760044473319454> there's crypto spam 3 messages up and i don't know how to contact a matrix moderator |
11:59:32 | FromDiscord | <PMunch> @Yepoleb thank you, all moderators are moderators across the platforms, and the bots help with deleting things access bridges |
12:02:40 | NimEventer | New thread by Georgeethan: Are there open badges on the forum?, see https://forum.nim-lang.org/t/9200 |
12:10:24 | FromDiscord | <d4rckh> anything wrong with this? |
12:10:26 | FromDiscord | <d4rckh> sent a code paste, see https://play.nim-lang.org/#ix=3Zmu |
12:10:29 | FromDiscord | <d4rckh> trying to get nimnoise working in a thread |
12:10:36 | FromDiscord | <d4rckh> the error is |
12:10:37 | FromDiscord | <d4rckh> `Error: illegal capture 'noise' because 'noiseThread' has the calling convention: <nimcall>` |
12:12:11 | FromDiscord | <d4rckh> sent a code paste, see https://play.nim-lang.org/#ix=3Zmv |
12:15:16 | FromDiscord | <Rika> You need to capture noise, so it must be a closure, but you also need to thread it, so it must be a nimcall |
12:15:27 | FromDiscord | <Rika> Basically you can’t capture noise 🙂 |
12:15:33 | FromDiscord | <d4rckh> i put the noise object in the thread |
12:15:56 | FromDiscord | <Rika> Did it work? |
12:16:25 | FromDiscord | <d4rckh> yup |
12:16:29 | FromDiscord | <d4rckh> auto completion doesnt work tho |
12:24:51 | FromDiscord | <d4rckh> identical to the example code |
12:24:53 | FromDiscord | <d4rckh> sent a code paste, see https://paste.rs/z56 |
12:32:16 | FromDiscord | <d4rckh> can you await in a thread? |
12:35:02 | FromDiscord | <d4rckh> k |
12:44:21 | FromDiscord | <System64 ~ Flandre Scarlet> Is it normal my Method isn't accepted? https://media.discordapp.net/attachments/371759389889003532/982625857522782238/unknown.png |
12:44:53 | FromDiscord | <Rika> Yes it’s not a base method |
12:44:58 | FromDiscord | <Rika> Put pragma base |
12:45:14 | FromDiscord | <Rika> In reply to @d4rckh "can you await in": Threading is not async |
12:45:25 | FromDiscord | <Rika> What do you mean exactly |
12:46:10 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @Rika "Put pragma base": Still doesn't work https://media.discordapp.net/attachments/371759389889003532/982626314328621107/unknown.png |
12:46:27 | FromDiscord | <Rika> Compile it |
12:46:37 | FromDiscord | <Rika> Error from compilation? |
12:49:41 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @Rika "Error from compilation?": yes it throws an error |
12:49:49 | FromDiscord | <Rika> Yes what is it |
12:55:52 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @Rika "Yes what is it": The error I just posted |
12:57:44 | FromDiscord | <Rika> Your init field is missing the [] part of the set |
12:59:02 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @Rika "Your init field is": https://media.discordapp.net/attachments/371759389889003532/982629553996439613/unknown.png |
12:59:13 | FromDiscord | <Rika> Needs a type inside... |
12:59:27 | FromDiscord | <Rika> I dont know what type you need |
13:00:21 | FromDiscord | <System64 ~ Flandre Scarlet> wait↵I choose the wrong type |
13:01:38 | FromDiscord | <System64 ~ Flandre Scarlet> Ah I wanted a tuple, it works now |
13:05:34 | FromDiscord | <Generic> ah thousand people will have told you that already |
13:06:02 | FromDiscord | <Generic> but those unnecessary voids annoy me more than they should |
13:06:22 | FromDiscord | <Rika> Unnecessary is dependent on the programmer for this case |
13:07:34 | FromDiscord | <d4rckh> In reply to @Rika "Threading is not async": i want to call an async function in a thread |
13:07:53 | FromDiscord | <Rika> In reply to @d4rckh "i want to call": That’s gonna be very complicated but it’s possible |
13:08:08 | FromDiscord | <d4rckh> damn |
13:08:21 | FromDiscord | <d4rckh> i just want to use nim noise while i have other things running in async |
13:08:43 | FromDiscord | <d4rckh> and run my command functions |
13:08:44 | FromDiscord | <d4rckh> which are async |
13:10:35 | FromDiscord | <Rika> Why are you threading anyway |
13:10:48 | * | arkurious joined #nim |
13:11:32 | FromDiscord | <Yepoleb> you're only doing IO, so this is a perfect fit for async anyway |
13:11:59 | FromDiscord | <d4rckh> In reply to @Rika "Why are you threading": because i cant run nim noise in async |
13:13:10 | FromDiscord | <Yepoleb> wait, noise is a text editor? |
13:13:19 | FromDiscord | <d4rckh> https://github.com/jangko/nim-noise/ |
13:13:34 | FromDiscord | <d4rckh> pretty much |
13:15:36 | FromDiscord | <Yepoleb> hm, then you probably need a thread |
13:15:55 | FromDiscord | <d4rckh> yes |
13:15:58 | FromDiscord | <d4rckh> i am already using one |
13:16:04 | FromDiscord | <d4rckh> now i need to run the procs that handle commands |
13:16:06 | FromDiscord | <d4rckh> which are async' |
13:16:09 | FromDiscord | <d4rckh> (edit) "async'" => "async" |
13:16:51 | FromDiscord | <Yepoleb> i've looked into synchronizing threads and async in the last days and it does not look like that's easily possible |
13:17:33 | FromDiscord | <Yepoleb> because async doesn't have a set of synchronization primitives |
13:18:39 | FromDiscord | <Yepoleb> you always need a FD to await something |
13:19:00 | FromDiscord | <Yepoleb> but you can use a loopback socket to communicate with your thread |
13:27:15 | FromDiscord | <Yepoleb> socketpair and pipe both return linked file descriptors, maybe you can figure out a way to use them in an async loop↵https://manpages.debian.org/bullseye/manpages-dev/socketpair.2.en.html↵https://manpages.debian.org/bullseye/manpages-dev/pipe.2.en.html |
13:29:12 | FromDiscord | <Yepoleb> the read lines can be sent with a basic size + data packet format |
14:50:52 | FromDiscord | <System64 ~ Flandre Scarlet> Shouldn't this work? https://media.discordapp.net/attachments/371759389889003532/982657694500528148/unknown.png |
14:52:26 | FromDiscord | <Generic> you can try using `path[^5..^1]` |
14:52:40 | FromDiscord | <Rika> Delete modifies path, it does not return it |
14:53:07 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @Generic "you can try using": ah alright↵What I want to do is removing the extension (.tmx here) |
14:53:20 | FromDiscord | <Generic> better use the path functions from os for that |
14:53:47 | FromDiscord | <System64 ~ Flandre Scarlet> they're still strings? |
14:53:49 | FromDiscord | <Generic> yes |
14:53:53 | FromDiscord | <Generic> https://nim-lang.org/docs/os.html#changeFileExt%2Cstring%2Cstring |
14:56:43 | * | derpydoo joined #nim |
15:00:37 | FromDiscord | <System64 ~ Flandre Scarlet> ah seems it works, thanks |
15:30:10 | FromDiscord | <Ayy Lmao> What's more suitable for holding a list of draw commands that hold information: object variants or `object of Command`? Is there overhead when using `object of`? It seems like I can't use a case statement when it comes time to sort out the implementation draw commands later. |
15:32:27 | FromDiscord | <Ayy Lmao> Are case statements faster than a chain of if statements? |
15:35:37 | FromDiscord | <Rika> Not demonstrably I believe but they can be in certain circumstances |
15:48:17 | FromDiscord | <Ayy Lmao> In reply to @Rika "Not demonstrably I believe": What circumstances? Are there some optimizations based on the restrictions of case type? |
15:48:50 | FromDiscord | <Generic> case expressions are usually compiled to C switch stamentents |
15:49:12 | FromDiscord | <Generic> the compiler usually converts those into binary searches |
15:49:54 | FromDiscord | <Generic> you can technically do the same with nested ifs, but it'll look infinitely more ugly |
15:50:34 | FromDiscord | <Ayy Lmao> In reply to @Generic "the compiler usually converts": So would you say that object variants are superior to inheritance in my case? |
15:50:51 | FromDiscord | <Ayy Lmao> Since when it comes time to implement the draw calls I can use a case statement to differentiate them? |
15:52:13 | FromDiscord | <Generic> depends on a few things |
15:52:39 | FromDiscord | <Generic> are all the branches of the case object of similar size? |
15:53:32 | FromDiscord | <Ayy Lmao> In reply to @Generic "are all the branches": Usually but not guaranteed |
15:53:46 | FromDiscord | <Rika> Pre check: are you prematurely optimising |
15:54:30 | FromDiscord | <Generic> this sounds like something which could easily become a bottleneck |
15:54:43 | FromDiscord | <Ayy Lmao> In reply to @Rika "Pre check: are you": Sort of, but this is a situation where there is a clear fork in the road and I'm just figuring out the general best path |
15:54:53 | FromDiscord | <Generic> it was atleast once in one of my nim game engines |
15:55:20 | FromDiscord | <Generic> though that was also due to slow rtti dependend copies |
15:56:00 | FromDiscord | <Ayy Lmao> For context, I'm trying to write a wrapper around NanoVg where the function calls are held as commands in a list. |
15:56:27 | FromDiscord | <Ayy Lmao> The commands store the arguments to the draw calls and then you can render a command list |
15:56:31 | FromDiscord | <Rika> I’d personally always go the variant way |
15:56:39 | FromDiscord | <Generic> me too, except... |
15:56:53 | FromDiscord | <Generic> if the object sizes can vary a lot |
15:57:02 | FromDiscord | <Generic> or I want extensibilty |
15:57:57 | FromDiscord | <Ayy Lmao> The biggest variant would be a rounded rectangle, which has 8 floats, and the smallest is empty |
15:58:08 | FromDiscord | <Rika> That sounds large |
15:58:08 | FromDiscord | <Generic> that's ok |
15:58:14 | FromDiscord | <Rika> Really? |
15:58:33 | FromDiscord | <Generic> depends on what the average command is |
15:58:37 | FromDiscord | <Rika> 8 8 bytes difference |
15:58:55 | FromDiscord | <Generic> though the indirection of a ref object isn't free either |
15:59:05 | FromDiscord | <Generic> + the cost of the allocation |
15:59:16 | FromDiscord | <Generic> also in graphics usually singles are used |
15:59:50 | FromDiscord | <Ayy Lmao> I could go down to float32 if needed |
16:00:07 | FromDiscord | <Rika> You could do that if you do get issues with size |
16:00:10 | FromDiscord | <Generic> you almost never need to use doubles in graphics |
16:00:29 | FromDiscord | <Rika> Technically many applications of floats don’t need double size but eh |
16:00:41 | FromDiscord | <Ayy Lmao> Yeah all of the floats in NanoVg are 32 bit. I've just been using regular floats for convenience |
16:00:48 | FromDiscord | <Generic> also while consumer gpus support them, they're incredibly slow there |
16:01:08 | FromDiscord | <Generic> so you have to switch to singles anyway when the data gets to the gpu |
16:01:22 | FromDiscord | <Generic> (edit) "them," => "doubles," |
16:01:42 | FromDiscord | <Ayy Lmao> Yeah I've just been using 64 bit on all user-side nim code, and then it gets converted to 32 just before going to the gpu |
16:02:10 | FromDiscord | <System64 ~ Flandre Scarlet> Is there an XML parser? |
16:02:20 | FromDiscord | <Generic> https://nim-lang.org/docs/lib.html |
16:02:23 | FromDiscord | <Generic> ctrl+f |
16:02:50 | FromDiscord | <Rika> Is that a macro on your keyboard in case someone asks “is there an xxx” |
16:03:14 | FromDiscord | <Generic> no, but that sounds like a good idea |
16:09:08 | FromDiscord | <System64 ~ Flandre Scarlet> ah thanks |
16:10:47 | FromDiscord | <Generic> I hope this was not too rude, I sometimes just need to offload some snark |
16:12:24 | FromDiscord | <Ayy Lmao> In reply to @Generic "if the object sizes": Why does high size variance matter for object variants? I'm not familiar with what's going on behind the scenes. |
16:13:06 | FromDiscord | <Generic> case objects are also known as tagged union |
16:13:44 | FromDiscord | <Generic> in C land a union is an object where all the fields start at the same memory address |
16:14:30 | FromDiscord | <Generic> so the size of the union is the size of its largest field |
16:14:41 | FromDiscord | <Ayy Lmao> Ah that makes sense |
16:15:37 | FromDiscord | <Ayy Lmao> In reply to @Generic "though the indirection of": When you said this were you referring to inheritance? |
16:15:56 | FromDiscord | <Rika> If you have one large variant but rarely use it you’re gonna have lots of wasted space lol |
16:16:03 | FromDiscord | <Rika> In reply to @Ayy Lmao "When you said this": Yes |
16:16:17 | FromDiscord | <Ayy Lmao> What about inheritance without ref objects? |
16:17:03 | FromDiscord | <Rika> I don’t think you can store objects of “different type” in such case |
16:17:08 | FromDiscord | <Rika> In the same sequence |
16:17:22 | FromDiscord | <Ayy Lmao> Hmmm, I haven't really tested it but I guess I'll have to try |
16:17:44 | FromDiscord | <Generic> yes, that is true, because they might vary in size then |
16:19:33 | FromDiscord | <Ayy Lmao> The only reason I'm wanting to store the draw calls as commands is that they need to be reordered later. |
16:19:58 | FromDiscord | <Generic> yeah I did the exact same thing once |
16:20:48 | FromDiscord | <Ayy Lmao> In reply to @Generic "yeah I did the": I'm guessing you were going down a similar road to me. I'm messing around with writing my own simple IMGUI. |
16:25:11 | NimEventer | New thread by Jasonfi: Nexus Development Framework (initial commit), see https://forum.nim-lang.org/t/9201 |
16:29:23 | FromDiscord | <Generic> it was probably more than once |
16:29:46 | FromDiscord | <Generic> there was a time when I made a few attempts at making a general purpose game engine in Nim |
16:31:07 | FromDiscord | <Generic> only one of them ever got somewhere |
16:31:48 | FromDiscord | <Generic> it had an overcomplicated system for caching the dirtiniess of transform matrices |
16:40:04 | FromDiscord | <System64 ~ Flandre Scarlet> what does Nim supports better? XML? TOML? JSON? YALM? |
16:41:12 | FromDiscord | <System64 ~ Flandre Scarlet> Nipefs? |
16:41:18 | FromDiscord | <Rika> JSON is arguably the best supported |
16:41:28 | FromDiscord | <Rika> I personally would not recommend Niprefs |
16:41:54 | FromDiscord | <System64 ~ Flandre Scarlet> Ah alright, so I guess I should use JSON |
16:42:05 | FromDiscord | <Generic> depends on for what? |
16:42:11 | FromDiscord | <Rika> YAML support is good too though I believe |
16:42:18 | FromDiscord | <Generic> messagepack is also pretty good |
16:42:48 | FromDiscord | <Rika> Is this a configuration reader or what? What’s the use case |
16:44:04 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @Rika "Is this a configuration": I'm making a game, and I have concept of Rooms↵A Room has a configuration like the music to be played, the exits that leads to others rooms, scrolling, ... |
16:44:22 | FromDiscord | <Rika> If it’s configuration then JSON prolly is your best bet |
16:44:34 | FromDiscord | <Rika> XML has its uses but most of the time you don’t need it |
16:45:18 | FromDiscord | <Generic> JSON doesn't support comments though |
16:45:24 | FromDiscord | <Generic> or does Nim's implementation? |
16:46:35 | FromDiscord | <Rika> No |
16:46:38 | FromDiscord | <Rika> Not that I know |
16:46:48 | FromDiscord | <Rika> Or maybe actually I remember someone mentioning it |
16:49:15 | NimEventer | New thread by Georgeethan: Is there any typescript-like library for a Nim programming language?, see https://forum.nim-lang.org/t/9202 |
16:51:32 | FromDiscord | <Yardanico> anyone knows what they meant? |
16:51:54 | FromDiscord | <Ayy Lmao> @Generic What about something like this? https://play.nim-lang.org/#ix=3ZnA |
16:51:55 | FromDiscord | <huantian> Uhhh maybe they want Nim but even more types? |
16:52:00 | FromDiscord | <huantian> (edit) "types?" => "typing?" |
16:52:46 | FromDiscord | <Yardanico> 🤔 |
16:55:25 | FromDiscord | <Generic> In reply to @Ayy Lmao "<@249581140363575297> What about something": kind of pointless |
16:55:32 | FromDiscord | <huantian> maybe they mean es6 modules??? |
16:55:42 | FromDiscord | <huantian> that doesn't make sense |
16:56:19 | FromDiscord | <Generic> the seq is already 24 bytes long |
16:56:40 | FromDiscord | <Generic> so you're kind of combining the disadvantages of both approaches 😄 |
16:57:13 | FromDiscord | <Generic> because for all commands where the seq is not empty you'd still go through the indirection |
16:57:55 | FromDiscord | <Generic> there's another route to consider, if you want to go the really clever route |
16:58:08 | FromDiscord | <Generic> just lay out data and command type separately |
16:58:34 | FromDiscord | <Generic> though that doesn't work that well anymore if you sort the data |
16:58:37 | FromDiscord | <Generic> hm |
16:59:10 | FromDiscord | <Generic> as the saying goes, you can solve every problem by adding another layer of indirection |
16:59:16 | FromDiscord | <Ayy Lmao> In reply to @Generic "just lay out data": I think that's kind of how microui handles it but I could be wrong |
17:00:01 | FromDiscord | <Generic> this is really getting into micro optimisation territory, which could be worth it |
17:00:08 | FromDiscord | <Generic> but not now |
17:00:31 | FromDiscord | <Generic> I think the most straightforward implementation with a variant object should do fine |
17:00:53 | FromDiscord | <Ayy Lmao> In reply to @Generic "I think the most": Alright, I'll proceed with that for now and see how it goes. Thanks for all the help! |
17:07:13 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=3ZnF |
17:08:18 | FromDiscord | <Yardanico> Did you write to main by accident again? :P |
17:08:22 | FromDiscord | <Yardanico> Instead of #gamedev |
17:09:52 | FromDiscord | <System64 ~ Flandre Scarlet> ah yeah maybe #gamedev would be better |
17:09:55 | FromDiscord | <Yardanico> But I don't quite get your question - you have isCollidable in separate json objects |
17:10:03 | FromDiscord | <Yardanico> So why would they clash? |
17:10:24 | FromDiscord | <System64 ~ Flandre Scarlet> I have 3 layers, and I configure them |
17:11:03 | FromDiscord | <Yardanico> yes, and each layer has its own isCollidable as your json showes |
17:11:08 | FromDiscord | <Yardanico> (edit) "showes" => "shows" |
17:11:09 | FromDiscord | <System64 ~ Flandre Scarlet> yeah |
17:11:16 | FromDiscord | <Rika> So what’s the issue |
17:11:20 | FromDiscord | <Yardanico> so what is the issue there? |
17:11:54 | FromDiscord | <System64 ~ Flandre Scarlet> Here Nim don't know which one I'm using https://media.discordapp.net/attachments/371759389889003532/982693186789060618/unknown.png |
17:12:39 | FromDiscord | <Rika> ?? |
17:12:46 | FromDiscord | <Rika> What’s the node |
17:13:04 | FromDiscord | <System64 ~ Flandre Scarlet> I want this one https://media.discordapp.net/attachments/371759389889003532/982693479899619408/unknown.png |
17:13:14 | FromDiscord | <Yardanico> In reply to @System64 "Here Nim don't know": because you need to first get the layer itself |
17:13:17 | FromDiscord | <Rika> In the code what’s the node |
17:14:02 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://paste.rs/6gS |
17:14:14 | FromDiscord | <Yardanico> Have you read json docs? If your node is just this json parsed, you need to do `node["room"]["foreground"]["isCollidable"]` |
17:14:24 | FromDiscord | <Yardanico> json is a tree like structure |
17:15:01 | FromDiscord | <Yardanico> But a better idea would be to use json.to or jsony to parse your json into Nim objects |
17:15:41 | FromDiscord | <System64 ~ Flandre Scarlet> ah alright |
17:40:29 | FromDiscord | <Korven> In reply to @Rika "If it’s configuration then": TOML when 👀 |
17:41:07 | FromDiscord | <huantian> json config is 😔 |
17:41:18 | FromDiscord | <huantian> you gotta use a JSON5 parser if you want comments |
17:42:34 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=3ZnS |
17:43:51 | * | dtomato quit (Ping timeout: 276 seconds) |
17:45:20 | FromDiscord | <Prestige> compiler bug |
17:46:45 | FromDiscord | <System64 ~ Flandre Scarlet> Nice, what should I do then?? |
17:47:47 | FromDiscord | <System64 ~ Flandre Scarlet> I don't even have any coding error |
17:49:30 | FromDiscord | <huantian> what nim version are you on, and also do you know what code is causing the error? |
17:49:57 | FromDiscord | <System64 ~ Flandre Scarlet> No traceback |
17:50:15 | FromDiscord | <System64 ~ Flandre Scarlet> oh wait |
17:50:26 | FromDiscord | <System64 ~ Flandre Scarlet> forgot to link the lib, gotta try it |
17:51:21 | FromDiscord | <System64 ~ Flandre Scarlet> doesn't work even with lib linked wtf |
17:51:46 | FromDiscord | <System64 ~ Flandre Scarlet> 1.6.4 |
17:51:48 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=3ZnY |
17:54:04 | FromDiscord | <huantian> well there's not much you can do without figuring out which code is causing the issue |
18:02:24 | FromDiscord | <!Patitotective> is there a pretty object printer? |
18:03:19 | FromDiscord | <huantian> like uh treeform's `print`? |
18:03:32 | FromDiscord | <System64 ~ Flandre Scarlet> Okay I found something sussy |
18:03:58 | FromDiscord | <huantian> treeform print is awesome works on refs and ptrs so nice |
18:04:19 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=3Zo3 |
18:04:37 | FromDiscord | <!Patitotective> In reply to @huantian "like uh treeform's `print`?": really nice |
18:04:38 | FromDiscord | <Rika> Jesus that’s hard to read |
18:06:11 | FromDiscord | <Rika> Full error needed |
18:06:14 | FromDiscord | <System64 ~ Flandre Scarlet> I don't understand why it displays an error but this function returns something |
18:06:16 | FromDiscord | <Rika> Compile it |
18:07:47 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=3Zo4 |
18:10:23 | FromDiscord | <System64 ~ Flandre Scarlet> weird error |
18:22:06 | FromDiscord | <System64 ~ Flandre Scarlet> @Rika do you know why I have this error? |
18:22:11 | FromDiscord | <Rika> No |
18:23:43 | FromDiscord | <System64 ~ Flandre Scarlet> this error is sus wtf |
18:25:22 | FromDiscord | <Rika> its a compiler error |
18:27:42 | FromDiscord | <exelotl> You should try to make a minimal reproducible example and create a bug report |
18:28:15 | FromDiscord | <System64 ~ Flandre Scarlet> Okay I found the thing that causes the error |
18:28:29 | FromDiscord | <System64 ~ Flandre Scarlet> This commented line https://media.discordapp.net/attachments/371759389889003532/982712461826343043/unknown.png |
18:28:55 | FromDiscord | <System64 ~ Flandre Scarlet> it's very weird 'cause when I add it |
18:29:10 | FromDiscord | <System64 ~ Flandre Scarlet> I have that https://media.discordapp.net/attachments/371759389889003532/982712635151745034/unknown.png |
18:29:59 | FromDiscord | <Rika> `tuple` is incomplete, you must define its inner types i believe `tuple[field: type...]` |
18:31:19 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @Rika "`tuple` is incomplete, you": I thought a tuple could contain any type |
18:31:49 | FromDiscord | <Rika> In reply to @System64 "I thought a tuple": they can but you must specify them in type signatures |
18:32:09 | FromDiscord | <Rika> unless you want an implicit generic (applies to proc signatures) |
18:32:22 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @Rika "unless you want an": ah yeah it can work |
18:32:38 | FromDiscord | <System64 ~ Flandre Scarlet> I want the user to put the data he wants |
18:32:40 | FromDiscord | <Rika> no, you have a type definition that's a proc |
18:32:46 | FromDiscord | <Rika> thats not a proc signature |
18:32:54 | FromDiscord | <Rika> you cant use an implicit generic there |
18:33:38 | FromDiscord | <Rika> and generics mean that Room[tuple1] and Room[tuple2] cant be in the same seq |
18:33:41 | FromDiscord | <System64 ~ Flandre Scarlet> what should I do?↵This function is supposed to be executed when the room is initializing |
18:34:26 | FromDiscord | <Rika> i dont know what youre doing |
18:35:24 | FromDiscord | <System64 ~ Flandre Scarlet> I want to allow the user to define a custom proc when the room initialize |
18:44:08 | * | derpydoo quit (Quit: derpydoo) |
18:44:25 | * | vicfred joined #nim |
18:45:05 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://paste.rs/Asw |
18:51:36 | FromDiscord | <Rika> no |
18:51:39 | FromDiscord | <System64 ~ Flandre Scarlet> Ok fixed |
18:51:45 | FromDiscord | <System64 ~ Flandre Scarlet> I have to use parseFile |
18:56:15 | * | jmdaemon joined #nim |
19:37:19 | * | jjido joined #nim |
19:57:47 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=3Zor |
19:58:32 | FromDiscord | <huantian> is `room` null? |
19:59:28 | FromDiscord | <System64 ~ Flandre Scarlet> it creates a room |
19:59:47 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=3Zot |
20:00:03 | FromDiscord | <Rika> Room looks nil here |
20:00:11 | FromDiscord | <Rika> Create it first |
20:00:24 | FromDiscord | <System64 ~ Flandre Scarlet> This is the first line of the proc |
20:00:39 | FromDiscord | <br4n_d0n> Yeah, room is set to a Room type, but never has a value being assigned |
20:02:19 | FromDiscord | <br4n_d0n> Can you share the Room type? |
20:02:25 | FromDiscord | <huantian> I woujld probably `new(result)` and just modify the result |
20:02:34 | FromDiscord | <System64 ~ Flandre Scarlet> ah yeah I'm dumb lol |
20:02:45 | FromDiscord | <huantian> in that case `result.layers` will be default initialized so you don't have to touch it at all |
20:03:09 | FromDiscord | <System64 ~ Flandre Scarlet> Okay it boots now |
20:03:14 | FromDiscord | <huantian> or rather you don't have to do `var myArray: array[3, Background]; room.layers = myArray` |
20:05:54 | FromDiscord | <br4n_d0n> Who mostly handles the documentation side of things for Nim's website? |
20:06:08 | FromDiscord | <br4n_d0n> (edit) "for" => "on" |
20:07:29 | FromDiscord | <System64 ~ Flandre Scarlet> yeeees! https://media.discordapp.net/attachments/371759389889003532/982737374222106744/unknown.png |
20:22:58 | * | xet7 quit (Read error: Connection reset by peer) |
20:24:48 | * | xet7 joined #nim |
20:39:38 | * | pro joined #nim |
20:41:21 | * | pro quit (Client Quit) |
20:47:00 | FromDiscord | <pruno> sent a code paste, see https://play.nim-lang.org/#ix=3ZoG |
20:47:25 | FromDiscord | <jmgomez> heys guys can a pragma macro accept a parameter with a default value? |
20:47:39 | FromDiscord | <pruno> (edit) "https://play.nim-lang.org/#ix=3ZoG" => "https://play.nim-lang.org/#ix=3ZoH" |
20:57:36 | * | vicfred quit (Quit: Leaving) |
21:15:33 | * | om3ga joined #nim |
21:33:11 | FromDiscord | <abdu> sent a code paste, see https://play.nim-lang.org/#ix=3ZoY |
21:34:08 | FromDiscord | <abdu> In reply to @jmgomez "heys guys can a": Yes↵simply do like procedure |
21:38:12 | NimEventer | New thread by Mardiyah: The nimble package eg. c2nim location in Linux, see https://forum.nim-lang.org/t/9203 |
21:43:27 | * | tiorock joined #nim |
21:43:27 | * | tiorock quit (Changing host) |
21:43:27 | * | tiorock joined #nim |
21:43:27 | * | rockcavera is now known as Guest5048 |
21:43:27 | * | tiorock is now known as rockcavera |
21:46:59 | * | Guest5048 quit (Ping timeout: 255 seconds) |
21:50:56 | FromDiscord | <Yepoleb> In reply to @abdu "where c2nim put in": usually binaries are put in `~/.nimble/bin` |
21:51:04 | FromDiscord | <Yepoleb> maybe it's not installed properly |
21:54:34 | FromDiscord | <br4n_d0n> sent a code paste, see https://play.nim-lang.org/#ix=3Zp3 |
21:55:36 | FromDiscord | <br4n_d0n> sent a code paste, see https://play.nim-lang.org/#ix=3Zp4 |
21:55:41 | FromDiscord | <huantian> you can just do `var sq: seq[int]` |
21:56:55 | FromDiscord | <br4n_d0n> Oh yeah, I keep forgetting Nim will allow this and sets a default value |
21:57:03 | FromDiscord | <!Patitotective> or `newSeq[int]()` |
21:57:22 | FromDiscord | <huantian> just make sure you initialze your ref types explicitly |
21:57:34 | FromDiscord | <br4n_d0n> ? |
21:58:11 | FromDiscord | <huantian> sent a code paste, see https://paste.rs/HpV |
21:58:39 | FromDiscord | <huantian> (edit) "https://play.nim-lang.org/#ix=3Zp7" => "https://play.nim-lang.org/#ix=3Zp6" |
21:58:56 | FromDiscord | <br4n_d0n> What if I wanted x to equal nil in this instance? |
21:59:06 | FromDiscord | <huantian> then you're fine |
21:59:38 | FromDiscord | <br4n_d0n> I kind of feel like nil should be the default for all types unless defined |
22:00:04 | FromDiscord | <huantian> I'd prefer that `nil` is always abstracted away by `Option[]` 😛 |
22:00:39 | FromDiscord | <br4n_d0n> Care to elaborate on that? |
22:01:05 | FromDiscord | <huantian> but `nil` never exists for value types, but does for ref types since refs are just nicer pointers |
22:02:25 | FromDiscord | <huantian> In reply to @br4n_d0n "Care to elaborate on": if a variable is`Option[ref SomeObj]` would mean that it could be `nil`, and you as the programmer would be required to make sure it's not `nil`. If you didn't , you would get an error at compile time.↵Then if a variable is `ref SomeObj` you know it's not `nil`, and can do anything with it safely without a chance of a segfault |
22:02:42 | FromDiscord | <huantian> it's just compiletime enforcement of `nil` checking, which reduces runtime errors |
22:04:11 | FromDiscord | <br4n_d0n> Hmm, I'm slightly confused, but that's probably because I haven't gotten to Options in my learning of Nim |
22:04:47 | FromDiscord | <huantian> `Option` is just a way of notating that a varaiable might contain a value, or might not contain a value |
22:05:04 | FromDiscord | <br4n_d0n> Interesting |
22:05:08 | FromDiscord | <huantian> (edit) "varaiable" => "variable" |
22:05:41 | FromDiscord | <br4n_d0n> Could you then have an optional return value? |
22:06:15 | FromDiscord | <huantian> since it's a static type, there's less of a chance writing code that assumes that a variable must always contain a value, when in reality it sometimes doesn't, and in those cases crashes the program |
22:06:20 | FromDiscord | <huantian> In reply to @br4n_d0n "Could you then have": yeah |
22:06:38 | FromDiscord | <huantian> consdier uh |
22:08:04 | FromDiscord | <huantian> sent a code paste, see https://play.nim-lang.org/#ix=3Zpb |
22:08:18 | FromDiscord | <huantian> (edit) "https://play.nim-lang.org/#ix=3Zpb" => "https://play.nim-lang.org/#ix=3Zpc" |
22:10:01 | FromDiscord | <huantian> sent a code paste, see https://play.nim-lang.org/#ix=3Zpd |
22:11:27 | FromDiscord | <huantian> another usage would be to represent some value in JSON that might not be present: ↵if the value isn't there, isntead of setting it to the default value, you have an explicit "empty" state for that value |
22:11:58 | FromDiscord | <br4n_d0n> Thanks for the info |
22:12:39 | FromDiscord | <br4n_d0n> I'm still in the beginning parts of learning Nim so I'm not entirely familiar with all of the syntax, but I get the general gist of it |
23:11:29 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
23:34:29 | NimEventer | New thread by Georgeethan: Is there any Cms(Content management system) written in the Nim programming language?, see https://forum.nim-lang.org/t/9204 |
23:44:34 | FromDiscord | <ambient> Is ref type the go-to method ensuring data structure contents are never copied on function call? |
23:45:27 | FromDiscord | <ambient> I'm having severe implicit move-semantics anxiety |
23:58:28 | FromDiscord | <Yardanico> you can always make the compiler show an error if it does a copy |
23:58:33 | FromDiscord | <Yardanico> on a non-ref type |
23:58:39 | FromDiscord | <Yardanico> https://nim-lang.org/docs/destructors.html#lifetimeminustracking-hooks-nimeqcopy-hook |