<< 04-06-2022 >>

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