<< 23-07-2022 >>

00:08:08*pch quit (Quit: Leaving)
00:08:29*pch joined #nim
00:12:17FromDiscord<ghoom> omg why `std/deques` is plural but `std/heapqueue` is not??
00:12:26FromDiscord<ghoom> (edit) "omg why ... `std/deques`" added "is" | removed "is"
00:12:34FromDiscord<ghoom> OCD KICKING IN
00:15:19FromDiscord<Prestige> cuz you only need one heapqueue
00:15:51FromDiscord<ghoom> X_X
00:19:37*krux02 quit (Remote host closed the connection)
00:32:45FromDiscord<# Luke> this looks nice, even though no one but me will see it lmao https://media.discordapp.net/attachments/371759389889003532/1000198753493450932/unknown.png
00:33:26FromDiscord<Elegantbeef> Except the extra space on the uncode containing tables
00:33:53FromDiscord<# Luke> In reply to @Elegantbeef "Except the extra space": How
00:34:14FromDiscord<Elegantbeef> The tables are open on the right side
00:34:26FromDiscord<Elegantbeef> the `|` is one space too far
00:34:39FromDiscord<# Luke> Hmm idk why tho
00:34:50FromDiscord<# Luke> Because it's for looped so everything should be even
00:34:54FromDiscord<Elegantbeef> Could be it uses `len` and not `runeLen`
00:35:04FromDiscord<# Luke> Ah
00:35:07FromDiscord<Elegantbeef> Did you make this table? If so are you using `std/unicode`
00:35:18FromDiscord<# Luke> In reply to @Elegantbeef "Did you make this": No I used a library
00:35:32FromDiscord<# Luke> terminaltables
00:35:53FromDiscord<Elegantbeef> Well i wager they dont take unicode into account
00:36:05FromDiscord<# Luke> Ah so it's forking time
00:36:18FromDiscord<Elegantbeef> Oh it looks like they try to
00:36:21FromDiscord<Elegantbeef> `from unicode import runeLen` is at the top of it
00:36:28FromDiscord<# Luke> Oh
00:36:32FromDiscord<# Luke> Hmm
00:36:48FromDiscord<Elegantbeef> are you not doing `newUnicodeTable`?
00:37:04FromDiscord<# Luke> No I'm using it
00:37:33FromDiscord<creikey> In reply to @Elegantbeef "Custom emojis i assume": :troll:
00:37:51FromDiscord<Elegantbeef> I see that creikey
00:38:13FromDiscord<creikey> I spent an entire day making a game to win discord nitro in some platform's competition
00:38:17FromDiscord<Elegantbeef> IRC sees `<creikey> In reply to @Elegantbeef "Custom emojis i assume": :troll:`
00:38:19FromDiscord<creikey> now I have the troll emoji
00:39:00FromDiscord<Elegantbeef> For those that dont know the entirety of this chat is publicly accessible through https://irclogs.nim-lang.org/
00:46:11FromDiscord<# Luke> it looks normal now atleast https://media.discordapp.net/attachments/371759389889003532/1000202129388093480/unknown.png
00:50:46FromDiscord<sOkam!> `Nimerian`. Cool word ๐Ÿค”
01:02:12FromDiscord<!Patitotective> In reply to @Elegantbeef "For those that dont": time to ban everyone that mentioned rust in the past 2 years
01:05:05FromDiscord<!Patitotective> damn this is the worstโ†ตi compile my codeโ†ตit freezesโ†ตi use a profiler and it works fine
01:05:32FromDiscord<Prestige> Hmm
01:05:39FromDiscord<!Patitotective> oh, actually running the programin with sudo makes it works
01:05:41FromDiscord<!Patitotective> thats terribly bad
01:05:42FromDiscord<!Patitotective> damn
01:06:01FromDiscord<Elegantbeef> Why you ever would go "Oh run my program with sudo"
01:06:19FromDiscord<!Patitotective> cause if i dont run the profiler with sudo it fails so...
01:06:35FromDiscord<Elegantbeef> Why does your profiler need sudo
01:07:09FromDiscord<!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=45bf
01:09:14FromDiscord<ghoom> is there a `{.thingy.}` that i can disable "unused" warning with?
01:09:35FromDiscord<Elegantbeef> Those are called pragmas and yes it's `{.used.}`
01:10:05FromDiscord<ghoom> In reply to @Elegantbeef "Those are called pragmas": can i use for globally?
01:10:07FromDiscord<ghoom> (edit) "for" => "it"
01:10:14FromDiscord<๐Ÿ’๐Ÿง br4n_d0n> In reply to @Elegantbeef "Those are called pragmas": I think @ghoom 's `thingy` is a better name ๐Ÿ˜‹
01:10:23FromDiscord<ghoom> ๐Ÿ˜‹
01:10:34FromDiscord<ghoom> (edit) "๐Ÿ˜‹" => "๐Ÿ‘Œ๐Ÿ˜‹"
01:10:49FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=45bh
01:10:52FromDiscord<Elegantbeef> If you have unused code in your module what are you doing
01:11:05FromDiscord<ghoom> i'm writing a library
01:11:33FromDiscord<huantian> Then maybe you should export your stuff
01:11:43FromDiscord<huantian> That should remove the warning
01:11:51FromDiscord<ghoom> oh ok
01:11:55FromDiscord<ghoom> ๐Ÿธ๐Ÿ‘
01:13:14FromDiscord<!Patitotective> if anyone wants to risk their integrity and try to see whats wrong with my code to make it freeze if not ran with sudo here its a link https://github.com/Patitotective/ImClipโ†ต:p
01:15:29FromDiscord<Elegantbeef> Do you do any system calls that might cause issues if you dont have su permissions?
01:17:24FromDiscord<!Patitotective> absolutely notโ†ตi started calculating some texts width and it started freezing :/
01:18:02FromDiscord<ghoom> In reply to @Patitotective "if anyone wants to": ๐Ÿ‘Œ๐Ÿธ https://media.discordapp.net/attachments/371759389889003532/1000210149581013102/Screenshot_2022-07-23_021717.png
01:18:17FromDiscord<!Patitotective> literally all my repos lol
01:18:26FromDiscord<ghoom> nim disciple
01:18:39FromDiscord<ghoom> you're doing good my child
01:19:39FromDiscord<!Patitotective> actually ๐Ÿ’€ โ†ตbut its a wrapper https://media.discordapp.net/attachments/371759389889003532/1000210548643872808/unknown.png
01:19:55FromDiscord<ghoom> ๐Ÿ˜ญ
01:25:47FromDiscord<ghoom> @!Patitotective your code might be trying to access a file inside a user-dependent home directory
01:26:02FromDiscord<ghoom> try using absolute paths
01:26:22FromDiscord<ghoom> (edit) "try using absolute paths ... " added "if that's the case"
01:26:40FromDiscord<!Patitotective> well all my apps access `~/.cache` and they work
01:26:47FromDiscord<!Patitotective> it started failing for no apparent reason
01:27:13FromDiscord<ghoom> make sure that you have a file existence check
01:27:29FromDiscord<ghoom> and create it if not existent
01:27:56FromDiscord<!Patitotective> yea, niprefs does that
01:29:31FromDiscord<ghoom> niprefs lmao
01:41:58FromDiscord<ghoom> when should i use object cases?
01:42:07FromDiscord<ghoom> (edit) "cases?" => "cases instead of inheritance?"
01:42:28FromDiscord<Elegantbeef> Mostly for fixed shapes that do not need user expansion
01:42:52FromDiscord<ghoom> user expansion how?
01:43:14FromDiscord<# Luke> In reply to @ghoom "๐Ÿ‘Œ๐Ÿธ": Better if you have a docker/make file
01:43:26FromDiscord<Elegantbeef> A user can always implement their own type and procedures when you use inheritance, you cannot do that with object variants
01:43:49FromDiscord<!Patitotective> In reply to @ripluke "Better if you have": no
01:43:58FromDiscord<!Patitotective> nimble build
01:44:03FromDiscord<# Luke> In reply to @Patitotective "no": Yes :P
01:44:38FromDiscord<# Luke> In reply to @Patitotective "nimble build": Nahh I end up using nimble tasks and I can't get them to overwrite the existing build/run commands
01:45:36FromDiscord<ghoom> In reply to @Elegantbeef "Mostly for fixed shapes": one thing i don't like about unions is the space inefficiency
01:45:48FromDiscord<Prestige> wdym?
01:45:59FromDiscord<# Luke> In reply to @ripluke "Nahh I end up": Make is alot easier for most end users
01:46:22FromDiscord<ghoom> In reply to @Avahe "wdym?": if a property smaller than the biggest
01:46:28FromDiscord<ghoom> (edit) "if a" => "when the used"
01:46:30FromDiscord<Prestige> I'm in the `build.sh` group
01:46:30FromDiscord<j-james> In reply to @ghoom "when should i use": always, haha
01:46:32FromDiscord<ghoom> (edit) "In reply to @Avahe "wdym?": when the used property ... smaller" added "is"
01:46:32FromDiscord<Prestige> probably alone
01:47:09FromDiscord<# Luke> In reply to @Avahe "I'm in the `build.sh`": Big brain idea, have make call build.sh ๐Ÿคฃ
01:47:27FromDiscord<j-james> but they're particularly helpful when you need to have slightly different kinds of objects taken in by a single function
01:47:46FromDiscord<j-james> lets you sidestep generics and just do the pattern matching you were going to do anyway
01:49:36FromDiscord<Elegantbeef> The size is almost always better than a reference
01:50:02FromDiscord<Elegantbeef> Pointer indirection and lack of cache coherency is a bitch
01:50:20FromDiscord<ghoom> but most of the time, union sizes are greater than the size of pointers
01:50:44FromDiscord<Elegantbeef> Cool, now actually do something with that data, which is faster?
01:51:22FromDiscord<j-james> sent a code paste, see https://play.nim-lang.org/#ix=45bn
01:51:42FromDiscord<Prestige> Elegantbeef do you want to look at something for me, like a code review?
01:51:55FromDiscord<Rika> In reply to @ghoom "but most of the": Thatโ€™s not the point
01:51:58FromDiscord<Elegantbeef> I'm always to scream about someone's shit code!
01:52:04FromDiscord<Rika> Itโ€™s really slow doing a dereferencing
01:52:07FromDiscord<j-james> this way i can simply take a Node if i only need to access the position fields and just have to pattern match otherwise
01:52:07FromDiscord<Prestige> https://github.com/einheit-tech/shade/blob/master/src/shadepkg/math/collision/spatialgrid.nim <-- Have at it ๐Ÿ˜›
01:52:43FromDiscord<ghoom> In reply to @Rika "Itโ€™s really slow doing": how? dereferencing is cpu-level. it shouldn't be very slow
01:53:11FromDiscord<huantian> The heap will be slower than the stack
01:53:27FromDiscord<Elegantbeef> Cause if you have a `seq[ref int]` and you want to do `mySeq[i] += 1` you have to dereference each int which causes you to access randomly across the heap not caching welll
01:53:31FromDiscord<Elegantbeef> No the heap isnt slow than the stack
01:53:35FromDiscord<Elegantbeef> slower\
01:54:00FromDiscord<Elegantbeef> Minus allocating `seq[int]` and `array[N, int]` will be the same to iterator assuming same size
01:54:06FromDiscord<Elegantbeef> same to iterate\
01:54:21FromDiscord<Elegantbeef> The issue with references is that you lose cache coherency
01:54:28FromDiscord<ghoom> In reply to @j-james "this way i can": my major complaint about variants is that i can't define the same thing in multiple cases
01:54:33FromDiscord<Elegantbeef> Cause only the pointers are storned contiguously
01:54:37FromDiscord<Elegantbeef> stored\
01:55:25FromDiscord<Prestige> Also curious about your thoughts on this: I'm using a Table to back this grid, but I could use https://github.com/avahe-kellenberger/seq2d which is just a seq. I think it might be better to do that, since this is a fixed size anyway...
01:55:26FromDiscord<j-james> In reply to @ghoom "my major complaint about": really, that's weird
01:56:20FromDiscord<Elegantbeef> Is it fixed at runtime or compile time?
01:56:29FromDiscord<Rika> I just woke up dammit I canโ€™t follow this many conversations at once right now
01:56:31FromDiscord<j-james> like you can't have anything with the same name in multiple cases?
01:56:34FromDiscord<Prestige> uh compile time
01:56:42FromDiscord<Elegantbeef> So then why not `array`?
01:57:12FromDiscord<Prestige> I thought about it too late and already named this seq2d lmao
01:57:21FromDiscord<Prestige> uh maybe I can just do a rename
01:57:36FromDiscord<Snaky> Are there help channels here?
01:57:41FromDiscord<ghoom> In reply to @j-james "like you can't have": yes
01:57:42FromDiscord<Prestige> This is one
01:57:43FromDiscord<Elegantbeef> This one
01:57:55FromDiscord<Elegantbeef> Seq2D isnt compile time fixed
01:58:02FromDiscord<Prestige> Nah but it could be
01:58:04FromDiscord<Snaky> Ok, well how do I make web requestes?
01:58:12FromDiscord<Elegantbeef> `import std/httpclient`
01:58:27FromDiscord<Prestige> I wonder if there's a reason to actually have Seq2D over an Array2D
01:58:34FromDiscord<Elegantbeef> I mean you could always make a `arr2D` if yu wanted ๐Ÿ˜„
01:58:34FromDiscord<Snaky> that bot is a helper ๐Ÿค”
01:58:59FromDiscord<Prestige> Hm should I have both or just change Seq2D ๐Ÿค”
01:59:00FromDiscord<Elegantbeef> Seq is runtime typed and you might want that (consider my hoppity birb game)
01:59:06FromDiscord<huantian> Yeah beef is a magic bot
01:59:28FromDiscord<Snaky> lmfao
01:59:31FromDiscord<Snaky> nice webhook
01:59:34FromDiscord<Prestige> Perhaps I'll put them both in the same package
01:59:34FromDiscord<Elegantbeef> `addPhysicsBodyWithBounds` a template for no reason
01:59:36FromDiscord<Rika> In reply to @Elegantbeef "Seq is runtime typed": Typed?
01:59:52FromDiscord<Elegantbeef> I mean it's runtime specialised to a length
01:59:55FromDiscord<Rika> Lol
02:00:11FromDiscord<Elegantbeef> I'd consider sequences dynamically typed, if you dislike that ... yea
02:00:11FromDiscord<Rika> :inatehe:
02:00:57FromDiscord<Elegantbeef> You're actually doing a lot of extra work inside that template due to it being atemplate
02:01:03FromDiscord<Prestige> oh, really?
02:01:17FromDiscord<Elegantbeef> Ah nvm i misread which parameter was which
02:01:24FromDiscord<Prestige> oh ok
02:01:30FromDiscord<Elegantbeef> thought you where `incl` bounds
02:01:36FromDiscord<Elegantbeef> Eitherway i dont see why it's a template
02:01:55FromDiscord<Prestige> there's no reason, I was just thinking of having the code inlined instead of a proc call
02:02:39FromDiscord<Elegantbeef> Well given you only use it in a single place write it inlined ๐Ÿ˜›
02:03:44FromDiscord<Elegantbeef> Also why the hell are your AABB bounds references?
02:03:46FromDiscord<Prestige> meh I kinda like it broken up
02:04:24FromDiscord<Elegantbeef> A rectangle is a small data type, making it a ref is just.... odd
02:04:31FromDiscord<Prestige> So I could have my bounds invalidated on objects, but I suppose I could just use `Option`
02:04:50FromDiscord<Elegantbeef> Or just use a sentinel value
02:05:14FromDiscord<Elegantbeef> Bounds are invalid if bottomRight is on the left of top left
02:05:22FromDiscord<Elegantbeef> Or just if they're exactly ontop of eachother
02:05:38FromDiscord<Prestige> Hm maybe a good idea, could just have them all be zero'd out
02:05:45FromDiscord<Elegantbeef> Yes
02:06:46FromDiscord<Elegantbeef> It's really funny that you use `template` so much but have so many `ref`
02:07:10FromDiscord<Elegantbeef> It's kinda like trying to stop the titanic using a blowtorch
02:07:13FromDiscord<Prestige> Lol
02:07:20FromDiscord<Elegantbeef> You've got the ride attitude but you're going to need a bigger torch
02:07:23FromDiscord<Prestige> What else do you think I should not use ref for?
02:07:23FromDiscord<Elegantbeef> right\
02:07:25*CyberTailor quit (Remote host closed the connection)
02:07:35FromDiscord<Elegantbeef> Anything that's a value
02:08:10FromDiscord<Elegantbeef> The only reason you use ref is if you want a many to one relationship or have an expensive copy you really dont want to rely on orc/arc to optimize
02:08:42FromDiscord<Elegantbeef> If you dont need a pointer you use either a sentinel, option, or something else ๐Ÿ˜„
02:08:55FromDiscord<Elegantbeef> To spam this again, if you want static sentinels here's some inspiration https://github.com/beef331/nimtrest/blob/master/sentinels.nim
02:09:17FromDiscord<Elegantbeef> This lets you designate optional values without using more memory
02:09:19FromDiscord<Prestige> Interesting
02:10:55*CyberTailor joined #nim
02:11:08FromDiscord<Elegantbeef> Anyway anything that doesnt need the pointer semantics really should be a value type
02:11:27FromDiscord<Prestige> Cool I'll keep that in mind, changing the aabb stuff now
02:11:43FromDiscord<Elegantbeef> This can help your program be faster just due to making it so when you dereference the base object that holds the aabb you also can get the aabb data
02:12:18FromDiscord<Elegantbeef> Even though you already have pointer indirection it's best to minimise more pointer indirection
02:13:43FromDiscord<Elegantbeef> If i recall correctly a cacheline is generally 64-128bytes on modern CPUs, so you can imagine when you dereference a pointer you get that much data after the pointer easily accessible
02:14:35FromDiscord<Elegantbeef> The more data that sits in that cache, the less you have to go to the ram to get data, which means you program is significantly faster
02:15:47FromDiscord<Elegantbeef> Similar statement to the `CollisionShape`
02:16:43FromDiscord<Elegantbeef> And of course the shapes you have
02:17:26FromDiscord<Prestige> yeah aabb was just one of them
02:25:08FromDiscord<Prestige> I'm not sure how I should be initializing this Array2D type with a given size, since `array` takes a generic for the size
02:25:26FromDiscord<Elegantbeef> `Size: static int`
02:25:57FromDiscord<Prestige> uh I'll just share what I'm trying
02:25:58FromDiscord<Prestige> https://play.nim-lang.org/#ix=45br
02:26:17FromDiscord<Elegantbeef> `type Array2D[I: static int; T] = object`
02:26:19FromDiscord<Prestige> I don't want them to have to pass the size as a generic, but as width and height
02:26:45FromDiscord<Prestige> ah, that worked
02:31:41FromDiscord<Prestige> https://github.com/avahe-kellenberger/array2d
02:32:59FromDiscord<Elegantbeef> \but but what about 2D enum indexed arrays! ๐Ÿ˜› \
02:33:22FromDiscord<Prestige> >.>
02:34:34FromDiscord<Prestige> I think I'll use Array2D for my SpatialGrid now
02:34:39FromDiscord<Prestige> Should work just fine
02:34:58FromDiscord<Prestige> Then I can actually use the grid coords instead of hashing them and doing a table look up
02:35:11FromDiscord<Elegantbeef> All that pairing logic ๐Ÿ˜„
02:47:36FromDiscord<Prestige> I love my `nimtest` tool so much
02:53:30*rockcavera quit (Read error: Connection reset by peer)
02:54:34*rockcavera joined #nim
02:54:34*rockcavera quit (Changing host)
02:54:34*rockcavera joined #nim
02:58:03*CyberTailor quit (Read error: Connection reset by peer)
03:06:21*CyberTailor joined #nim
03:12:51FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=45bw
03:16:42FromDiscord<sOkam!> Actual context, in case its needed:โ†ตhttps://github.com/heysokam/osdf-game/blob/36f7ef4aea4bb6695b4def47a304f5d49342ebd5/ui/ui_main.c#L83
03:30:06*joshbaptiste1 quit (Ping timeout: 264 seconds)
03:31:39*joshbaptiste1 joined #nim
03:37:05*joshbaptiste1 quit (Ping timeout: 260 seconds)
03:38:47*joshbaptiste1 joined #nim
03:52:27NimEventerNew Nimble package! array2d - A 2D Array Implementation, see https://github.com/avahe-kellenberger/array2d
05:05:17FromDiscord<ghoom> how do i set a default value of object properties?
05:05:46FromDiscord<Rika> You set them in your initialiser procedure
05:06:12FromDiscord<ghoom> bruh i can define a constructor??
05:07:27FromDiscord<Nimion #เถž> In reply to @ghoom "bruh i can define": u can define a constructor yesโ†ตand whats cool about nim is u can have default arguments in procs
05:07:42FromDiscord<Nimion #เถž> (edit) "arguments in procs" => "values for the proc parameters"
05:09:38FromDiscord<Nimion #เถž> sent a code paste, see https://play.nim-lang.org/#ix=45bL
05:10:46FromDiscord<ghoom> ok i haven't thought of that for some reason
05:10:52FromDiscord<ghoom> js has spoiled me
05:11:02FromDiscord<ghoom> tamks
05:11:21FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=45bM
05:11:51FromDiscord<ghoom> or use `method`
05:12:01FromDiscord<ghoom> even cleaner
05:12:13FromDiscord<Nimion #เถž> do ppl actually use method?
05:12:21FromDiscord<ghoom> ยฏ\_(ใƒ„)_/ยฏ
05:12:42FromDiscord<Elegantbeef> Yes
05:12:49FromDiscord<Elegantbeef> People use method for dynamic dispatch
05:13:06FromDiscord<Elegantbeef> They wouldnt for constructors as it makes 0 sense
05:13:24FromDiscord<Nimion #เถž> In reply to @Elegantbeef "People use method for": ๐Ÿ˜ณ
05:13:27FromDiscord<ghoom> you're right
05:13:32FromDiscord<Nimion #เถž> I forgot RootObjects exists
05:13:38FromDiscord<Nimion #เถž> ๐Ÿ’€
05:14:41FromDiscord<Nimion #เถž> but true, as nim does't have `dyn concept` (e.g rust) that's the way for dynamic dispatch ๐Ÿค”
05:14:56FromDiscord<Elegantbeef> I mean you can make it have that but yes
05:15:21FromDiscord<Elegantbeef> I have two variations that are trait-like and there is iface
05:15:58FromDiscord<Rika> In reply to @Elegantbeef "For more style points": Just a question, why prefer a type parameter than a generic parameter
05:16:22FromDiscord<Elegantbeef> What?
05:16:32FromDiscord<Nimion #เถž> In reply to @Rika "Just a question, why": the point is to not be generic here
05:16:37FromDiscord<Rika> No
05:16:40FromDiscord<Rika> Thatโ€™s not my point
05:16:41FromDiscord<Elegantbeef> Oh nevermind
05:16:47FromDiscord<Nimion #เถž> do u mean [T: A] ?
05:16:54FromDiscord<Elegantbeef> The reason is `A.new` makes it appear to be type bound
05:17:18FromDiscord<Nimion #เถž> ah new(A)?
05:17:19FromDiscord<Rika> And otherwise doesnโ€™t?
05:17:24FromDiscord<Elegantbeef> `new[A]` appears freestanding, it's totally up to you
05:17:25FromDiscord<ghoom> does `include` check for duplicate includes?
05:17:34FromDiscord<Rika> In reply to @Elegantbeef "`new[A]` appears freestanding, it's": I donโ€™t see how
05:17:34FromDiscord<Elegantbeef> No clue, include ssucks
05:17:43FromDiscord<ghoom> damn
05:17:52FromDiscord<Elegantbeef> Eh rika i dont really care eitherway
05:17:56FromDiscord<Rika> Include literally doesnโ€™t check anything
05:18:01FromDiscord<ghoom> ok
05:18:22FromDiscord<Elegantbeef> Both support generic code better, so both are better than`newT()`
05:18:22FromDiscord<Rika> In reply to @Elegantbeef "Eh rika i dont": As long as it isnโ€™t type in the name ๐Ÿ‘Œ
05:20:16FromDiscord<Elegantbeef> Pretty much
05:21:26FromDiscord<ghoom> is there a way to expand an open array?
05:21:31FromDiscord<Elegantbeef> No
05:21:33FromDiscord<Rika> Also regards pico, Iโ€™m still unsure whether to go rip out CMake or to manually port
05:21:37FromDiscord<Elegantbeef> You want a `seq[T]` then
05:21:56FromDiscord<Rika> One issue with ripping out CMake is that then Iโ€™ll need to wrap everything and wow I donโ€™t feel like wrapping the register files
05:22:16FromDiscord<Rika> Would prolly be as much effort as porting
05:22:56FromDiscord<Elegantbeef> I dont know much of cmake or what's required, so i cant say anything really
05:23:39FromDiscord<Rika> Iโ€™ll let it simmer in my brain pot for now
05:24:02FromDiscord<Elegantbeef> Which ever you want i support you with all the pom poms i can find
05:24:18FromDiscord<Rika> Which is 0 hahaha
05:27:14FromDiscord<treeform> In reply to @Elegantbeef "Anyway brandon you can": sysinfo is really old lib, PRs welcome though.
05:27:29FromDiscord<treeform> Do you think linking with C is easier then reading files?
05:28:03FromDiscord<Elegantbeef> Sysinfo is a relatively primitive type, so atleast for memory info yea
05:28:20FromDiscord<Elegantbeef> The Cpu stuff does seem lacking a C-APi
05:28:27FromDiscord<treeform> I did not know it existed on linux
05:28:42FromDiscord<treeform> do you know how to get GPU name on linux?
05:29:29FromDiscord<Elegantbeef> I do not
05:30:19FromDiscord<treeform> mac does not have sysinfo but it has syctl https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man3/sysctl.3.html
05:31:04FromDiscord<treeform> looks like windows has `GetSystemInfo` https://docs.microsoft.com/en-us/windows/win32/api/sysinfoapi/nf-sysinfoapi-getsysteminfo
05:31:09FromDiscord<Elegantbeef> There is `glxinfo` for linux, but yea no clue about C
05:31:26FromDiscord<treeform> but thats only for open GL?
05:31:33FromDiscord<Elegantbeef> No
05:32:24FromDiscord<Elegantbeef> I guess it is
05:32:25FromDiscord<Elegantbeef> But it lists all the information
05:32:46FromDiscord<treeform> can a computer not have openGL but have gpu? via Vulcan
05:32:52FromDiscord<Elegantbeef> It does look like that information seems to be best got through files, unless there are some obscure undocumented APIs
05:33:01FromDiscord<Elegantbeef> No all modern GPUs support opengl and vulkan
05:33:29FromDiscord<Elegantbeef> Especially on linux given that older software used opengl
05:35:32*xet7 quit (Ping timeout: 268 seconds)
05:35:34FromDiscord<ghoom> how do i get the remote ip address?
05:35:40FromDiscord<Elegantbeef> Annoyingly everything I see says to use glxinfo or the internal opengl/vulkan APIs
05:37:25FromDiscord<huantian> In reply to @ghoom "how do i get": make a webrequest to one of the many services that tell you your ip
05:37:41FromDiscord<wiga> ipwhois.app
05:37:46FromDiscord<ghoom> why can they know but not me?
05:38:12FromDiscord<ghoom> surely i can know it without sending anything
05:38:18FromDiscord<wiga> there is a way to get your remote address by requesting a certain service on your router but i didnt found out how yet
05:38:41FromDiscord<huantian> you can get it from your router yes
05:38:51FromDiscord<huantian> but you have to figure out the specific query inteface for your router
05:39:00FromDiscord<wiga> yeah
05:39:04FromDiscord<ghoom> ๐Ÿธ
05:39:05FromDiscord<huantian> hm maybe you can use uPnP actually?
05:39:09FromDiscord<huantian> I have no idea how to upnp tho
05:39:30FromDiscord<ghoom> this is actually stupid
05:39:50FromDiscord<ghoom> ๐Ÿ˜ญ
05:40:05FromDiscord<huantian> https://gist.github.com/stefantalpalaru/b54bf0ee500d75d51fe6b35b3d82d0c5#file-miniupnpc-nim-L129-L142
05:40:07FromDiscord<huantian> maybe?
05:40:14FromDiscord<Elegantbeef> nah what's stupid is that sysinfo stuff, no apis to get cpu information or gpu information without system calls
05:40:18FromDiscord<Elegantbeef> Well shell calls
05:40:27FromDiscord<wiga> someone knows how can i thread my program?
05:40:34FromDiscord<Elegantbeef> Probably
05:40:43FromDiscord<wiga> like running a fonction on multiple threads at the same time
05:40:50FromDiscord<wiga> (edit) "fonction" => "function"
05:40:52FromDiscord<Elegantbeef> Do you even need threading, werent you doing sockets?
05:41:02FromDiscord<wiga> i need threading cuz its a scanner
05:41:09FromDiscord<wiga> and i need sped
05:41:19FromDiscord<wiga> the socket is to ping a service
05:41:26FromDiscord<wiga> (mc server)
05:41:30FromDiscord<Elegantbeef> You can use async and get speed
05:41:34FromDiscord<Elegantbeef> Async is made for it
05:41:42FromDiscord<huantian> how does lshw do it...
05:41:54FromDiscord<wiga> everytime i tried to use asyncnet and asyncdispatch i get tons of errors
05:41:55FromDiscord<Elegantbeef> Probably reads filesโ†ต(@huantian)
05:42:02FromDiscord<ghoom> @wiga https://nim-lang.org/docs/threads.html
05:42:16FromDiscord<wiga> even tho i do exactly whats its written in the doc
05:42:29FromDiscord<huantian> async != threading
05:42:36FromDiscord<wiga> In reply to @huantian "async != threading": fact
05:42:37FromDiscord<ghoom> @huantian i wish i could just catch the ip address from the sent ip header
05:43:17FromDiscord<wiga> you cant cuz its not out of your network yet
05:44:05FromDiscord<Elegantbeef> A landline doesnt know where it's calling from ๐Ÿ˜„
05:44:10FromDiscord<Elegantbeef> Nor does your internet
05:44:32FromDiscord<ghoom> i can get my ip in js like this `require('dns').lookup(require('os').hostname(), (_, a) => {myip = a})`
05:44:54FromDiscord<wiga> i want a function like this to thread https://media.discordapp.net/attachments/371759389889003532/1000277304255201320/unknown.png https://media.discordapp.net/attachments/371759389889003532/1000277304611721257/unknown.png
05:45:13FromDiscord<Elegantbeef> Refer to the thread docs
05:45:22FromDiscord<wiga> In reply to @Elegantbeef "Refer to the thread": i checked it
05:45:27FromDiscord<wiga> not useful
05:45:33FromDiscord<ghoom> bruh
05:45:40FromDiscord<Elegantbeef> Well start writing code so we can do the ibb and obb
05:46:04FromDiscord<wiga> the near i get in the doc is this but im not sure what it does https://media.discordapp.net/attachments/371759389889003532/1000277596921135105/unknown.png
05:46:18FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=45bR
05:46:41FromDiscord<ghoom> isn't `{.thread.}` necessary?
05:46:56FromDiscord<wiga> and to run it on a specific amount of thread?
05:47:09FromDiscord<huantian> In reply to @ghoom "i can get my": doesn't that just
05:47:14FromDiscord<huantian> ping your dns
05:47:20FromDiscord<huantian> which is still an outside request?
05:47:36FromDiscord<Elegantbeef> Noโ†ต(@ghoom)
05:49:43FromDiscord<Elegantbeef> The thread pragma does nothing but ensure it's gcsafe
05:49:55FromDiscord<Elegantbeef> Well wiga when you get a proper question worded i'll be more than happy to help
05:50:11FromDiscord<wiga> or something like this https://media.discordapp.net/attachments/371759389889003532/1000278633870524476/unknown.png
05:50:30FromDiscord<wiga> In reply to @Elegantbeef "Well wiga when you": dude its 1am im tired and im dumb
05:51:03FromDiscord<wiga> i just want my function to run on multiple threads
05:51:30FromDiscord<Elegantbeef> Well i told you how
05:51:42FromDiscord<Elegantbeef> Sleep on it then comeback tomorrow
05:51:47FromDiscord<wiga> bruh
05:51:57FromDiscord<wiga> sleep on what
05:52:06FromDiscord<Elegantbeef> The docs for threads
05:52:35FromDiscord<wiga> how am i suppose to run something like this with 500 threads? https://media.discordapp.net/attachments/371759389889003532/1000279238475264072/unknown.png
05:53:03FromDiscord<Elegantbeef> You change that array to be `seq[Thread[type]]`
05:56:40FromDiscord<wiga> what that does? https://media.discordapp.net/attachments/371759389889003532/1000280268453724270/unknown.png
05:56:46FromDiscord<wiga> (edit) "that" => "it"
05:56:55FromDiscord<Elegantbeef> It declares a tuple with named fields
05:57:04FromDiscord<wiga> ok and whats a tuple
05:57:24FromDiscord<Elegantbeef> https://nim-lang.org/docs/tut1.html
05:57:43FromDiscord<wiga> ...
06:02:33FromDiscord<wiga> how do i import the threading tho
06:02:51FromDiscord<Elegantbeef> > Note\: This is part of the system module. Do not import it directly. To activate thread support you need to compile with the --threads\:on command line switch.
06:03:01FromDiscord<wiga> that sucks
06:03:07FromDiscord<Nimion #เถž> why
06:03:15FromDiscord<wiga> cuz errors in vscode
06:03:23FromDiscord<Nimion #เถž> ah make a config.nims file
06:03:27FromDiscord<Nimion #เถž> in the root directory
06:03:32FromDiscord<Nimion #เถž> and write --threads:on there
06:03:50FromDiscord<wiga> ty
06:04:02FromDiscord<Nimion #เถž> when u run nimble run or nim it will take your root directories config.nims and apply it
06:04:39FromDiscord<Rika> This back read hurt my brain
06:04:48FromDiscord<Elegantbeef> Sorry rika i'll type less
06:04:57FromDiscord<Rika> It wasnโ€™t even you
06:05:09FromDiscord<Elegantbeef> I wasnt serious
06:05:21FromDiscord<wiga> uh https://media.discordapp.net/attachments/371759389889003532/1000282452142596096/unknown.png
06:05:36FromDiscord<Rika> In reply to @Elegantbeef "I wasnt serious": Oh shit you werenโ€™t?
06:06:01FromDiscord<Elegantbeef> I take it back i was
06:12:56FromDiscord<wiga> bruh httpclient is not gcsafe
06:13:01FromDiscord<wiga> im gonna break smth
06:14:08FromDiscord<Luckayla> Subpixel morphological temporal hell?
06:14:19FromDiscord<wiga> ???
06:22:00*wallabra_ joined #nim
06:24:06*wallabra quit (Ping timeout: 264 seconds)
06:24:06*wallabra_ is now known as wallabra
06:42:14FromDiscord<wiga> whats this again bruh https://media.discordapp.net/attachments/371759389889003532/1000291732992311357/unknown.png
06:43:22FromDiscord<Elegantbeef> `Thread[int]` means you need to pass a proc that takes an `int`
06:44:22FromDiscord<wiga> if i put void what i put at the end?
06:44:29FromDiscord<Elegantbeef> Nothing
06:46:39FromDiscord<wiga> but i still get errors ...
06:47:39FromDiscord<Elegantbeef> Provide the code if you will not read the errors
06:48:15FromDiscord<wiga> https://media.discordapp.net/attachments/371759389889003532/1000293244518797352/unknown.png
06:48:34FromDiscord<Elegantbeef> ...
06:48:48FromDiscord<wiga> very helpful ty
06:48:52FromDiscord<Elegantbeef> `Thread[int]` means you need to pass a `proc(i: int)`
06:49:00FromDiscord<Elegantbeef> Oh i'm very helpful but you're not asking for help well
06:49:10FromDiscord<wiga> In reply to @Elegantbeef "`Thread[int]` means you need": the https://media.discordapp.net/attachments/371759389889003532/1000293475427819610/unknown.png
06:49:22FromDiscord<Elegantbeef> You still have to index the array
06:49:27FromDiscord<wiga> djfghdfhg
06:49:37FromDiscord<Elegantbeef> You removed the index for no reason
06:50:00FromDiscord<wiga> what index
06:50:55FromDiscord<Elegantbeef> Please read through the tutorials that Nim offers
06:51:17FromDiscord<wiga> what index https://media.discordapp.net/attachments/371759389889003532/1000294012353253416/unknown.png
06:51:54FromDiscord<Elegantbeef> `thr[i]` ... indexes the array
06:53:20FromDiscord<wiga> bruh https://media.discordapp.net/attachments/371759389889003532/1000294526725935134/unknown.png
06:54:01FromDiscord<Rika> I will be honest
06:54:13FromDiscord<Rika> I do not think you are at a skill level sufficient enough to utilise threads
06:55:07FromDiscord<wiga> i just want this to be done idc
07:08:39FromDiscord<Luckayla> I gotta agree with Rika. You need to go back to the basics (perhaps the basics of English and communication as well).
07:12:52FromDiscord<wiga> hello im not english speaker
07:12:55FromDiscord<wiga> im french
07:13:00FromDiscord<wiga> quit this
07:13:44FromDiscord<Rika> English is fine
07:14:07FromDiscord<Rika> Your English is not bad at all really
07:14:22FromDiscord<wiga> then why bother
07:14:57FromDiscord<wiga> if i ask for definition give me the definition not the whole dictionnary
07:18:07FromDiscord<wiga> you guys are not helping at all
07:18:31FromDiscord<wiga> i ask for help i get barely assaulted
07:18:37FromDiscord<wiga> thats not very cool
07:21:32FromDiscord<Rika> You should know that it is also not very cool to expect us to spoon feed you
07:21:32FromDiscord<Luckayla> sent a long message, see http://ix.io/45c7
07:21:42FromDiscord<Luckayla> ^ tl;dr
07:22:21FromDiscord<Luckayla> There is no shame in putting a project that is too difficult for you at the moment to the side, to learn the foundations of ever will get you there first.
07:23:04FromDiscord<wiga> its not the shame the problem i want to get it done as soon as i can
07:23:08FromDiscord<Rika> Iโ€™ll at least hint you as to what happened
07:23:12FromDiscord<Luckayla> It is VERY frustrating to not get the answers you want immediately. โ†ตโ†ตIt's also VERY frustrating for you to both not understand the answers you are given AND then get angry at us for not helping you not.
07:23:26FromDiscord<Rika> A segmentation fault means that you tried accessing something that wasnโ€™t valid
07:23:36FromDiscord<Rika> So some value in your array perhaps was wrong in some way
07:23:37FromDiscord<Luckayla> In reply to @wiga "its not the shame": And the sooner you build your foundational knowledge the faster you'll get it done.
07:23:44FromDiscord<Rika> Maybe you didnโ€™t initialise the value? I donโ€™t know
07:23:47FromDiscord<Luckayla> Think of all you couldn't learned instead of sitting here arguing.
07:23:49FromDiscord<Rika> Itโ€™s up to you to figure that out sorry
07:23:52FromDiscord<Niki817> In reply to @Luckayla "There is no shame": i feel like ur the person if someone asks for emergency number you would tell them to google it
07:23:53FromDiscord<wiga> SIGSEGV: Illegal storage access. (Attempt to read from nil?)
07:23:57FromDiscord<wiga> this is my error
07:23:59FromDiscord<Luckayla> (edit) "couldn't" => "could've"
07:24:05FromDiscord<Rika> Yeah read what I said
07:24:11FromDiscord<Rika> I tried hinting you towards what it meant
07:24:20FromDiscord<wiga> uh
07:24:31FromDiscord<wiga> thing is i dont even know where the error came from
07:24:39FromDiscord<Luckayla> In reply to @Niki817 "i feel like ur": And I feel like you're just a troll trying to get a rise out of people on the Internet.
07:24:40FromDiscord<Rika> Do you have a stack trace
07:24:48FromDiscord<Rika> Is there more text above that line error
07:24:59FromDiscord<wiga> https://media.discordapp.net/attachments/371759389889003532/1000302492430647326/unknown.png
07:25:17FromDiscord<wiga> the whole bible is written in the traces damn
07:25:24FromDiscord<Niki817> In reply to @Luckayla "And I feel like": Nah its just one of my friends asked u a simple questions and ur making a whole paragraph of i dont want to help
07:25:44FromDiscord<Luckayla> Ooooh it's the friend.
07:25:46FromDiscord<wiga> In reply to @Niki817 "Nah its just one": yes
07:25:51FromDiscord<Luckayla> I'm starting to get the feeling y'all are really young
07:26:06FromDiscord<wiga> do we really need to get there?
07:26:13FromDiscord<Luckayla> Nailed it.
07:26:15FromDiscord<Rika> Can we not
07:26:26FromDiscord<wiga> In reply to @Rika "Can we not": yes
07:26:36FromDiscord<Luckayla> Aight well I'm not getting paid for that so I'm gonna leave this dumpster fire.
07:26:38*jmdaemon quit (Ping timeout: 255 seconds)
07:26:55FromDiscord<wiga> ๐Ÿ‘
07:27:02FromDiscord<wiga> fire keeps me warm
07:27:26FromDiscord<Rika> Well I have no idea where to go from there, look at your code and see if you forgot to set some value
07:27:32FromDiscord<Rika> Like the thread array
07:27:50FromDiscord<Rika> The default value for thread is probably going to give you a segmentation fault when you use it
07:27:51FromDiscord<wiga> do you want the code so you just check by yourself?
07:28:01FromDiscord<Rika> Maybe
07:28:03FromDiscord<wiga> if it can help you
07:28:26FromDiscord<Rika> Sure whatever Iโ€™m not doing anything right now
07:29:07FromDiscord<wiga> https://media.discordapp.net/attachments/371759389889003532/1000303533901484073/IPgen.nim
07:29:15FromDiscord<wiga> threading works
07:29:21FromDiscord<wiga> but idk if it really works
07:31:09FromDiscord<Rika> I donโ€™t know where the problem would be
07:31:15FromDiscord<Rika> How do you compile
07:31:34FromDiscord<Rika> There might be an answer there for why you donโ€™t get a stack trace
07:33:11FromDiscord<demotomohiro> Maybe you are compiling with -d:danger and no stack trace available.
07:33:24FromDiscord<Rika> Yes
07:34:15FromDiscord<wiga> In reply to @Rika "How do you compile": nim c -d:ssl -r IPgen.nim
07:34:22FromDiscord<Rika> Odd then
07:34:26FromDiscord<Rika> Might be the use of sockets then
07:34:47FromDiscord<wiga> single threaded i had a wierd thing with the socket
07:34:55FromDiscord<wiga> its for pinging mc servers
07:35:17FromDiscord<Rika> What was the weird thing
07:35:28FromDiscord<wiga> and when it tries to connect the timeout didnt matter
07:35:31FromDiscord<wiga> like its slow
07:35:41FromDiscord<wiga> idk if i explain well
07:35:43FromDiscord<Rika> Huh
07:35:53FromDiscord<wiga> single thread the thing and run it you'll see
07:35:59FromDiscord<Rika> I donโ€™t really know how to diagnose that
07:36:07FromDiscord<Rika> I canโ€™t because Iโ€™m not with a laptop
07:36:11FromDiscord<wiga> a
07:37:09FromDiscord<wiga> i made that same scanner in java but idk i need to thread it but i dont feel like it would be fast enough
07:40:40FromDiscord<Rika> I think itโ€™s weird that the time out is slow
07:40:47FromDiscord<Rika> I canโ€™t really help further right now
07:41:38FromDiscord<wiga> e
07:41:45FromDiscord<wiga> i'll go to sleep ty tho gn
07:50:23FromDiscord<sOkam!> I have a library, that is compiled from Nim to native dllโ†ตLets say I want the binary to access some data from the libraryโ†ตHow do I handle the memory management of that inside nim's code?
07:51:45FromDiscord<Rika> Which GC are you using
07:53:35FromDiscord<Rika> If youโ€™re using default thereโ€™s info here
07:53:37FromDiscord<Rika> https://nim-lang.org/docs/nimc.html#dll-generation
07:53:50FromDiscord<Rika> If it is ARC I believe you do not need to do any more changes
07:53:56FromDiscord<Rika> If it is ORC I am unsure
07:54:14FromDiscord<Rika> There is this forum post
07:54:18FromDiscord<Rika> https://forum.nim-lang.org/t/7478
07:55:58FromDiscord<sOkam!> In reply to @Rika "Which GC are you": I have never done a single thing with memory mangament, so I have no clue
07:56:43FromDiscord<sOkam!> The engine does have a memory management system, but I don't know what I need to do in the nim code, if it will be GC or will just be managed by the engine instead
07:56:47FromDiscord<Rika> Did you change any compiler flags
07:56:52FromDiscord<Rika> If you did then what are they
07:57:03FromDiscord<Rika> In reply to @sOkam! "The engine does have": I donโ€™t know what you mean
07:58:07FromDiscord<sOkam!> In reply to @Rika "I donโ€™t know what": The engine has a memory management system. I give it data, it expects pointers to that data, and it will do whatever it needs with that data during its lifetime
07:58:20FromDiscord<Rika> What is โ€œthe engineโ€
07:58:32FromDiscord<sOkam!> Not sure it will help much, its Q3arena
07:58:41FromDiscord<sOkam!> nobody knows anything about it, so
07:58:54FromDiscord<sOkam!> (edit) "it," => "its internals,"
07:59:39FromDiscord<sOkam!> the thing is: Is Nim's default GC running in the dll when its loaded?
08:01:50FromDiscord<sOkam!> In reply to @Rika "Did you change any": https://media.discordapp.net/attachments/371759389889003532/1000311763239174244/unknown.png
08:08:36FromDiscord<demotomohiro> If you don't set `--gc` or `--mm` option, you are using refc GC.
08:11:50FromDiscord<demotomohiro> What memory managent system Quake3arena uses?
08:16:45Guest2776Are you _all_ just on discord? :/
08:19:04FromDiscord<demotomohiro> There are some people use IRC or other service.
08:19:19FromDiscord<sOkam!> In reply to @demotomohiro "What memory managent system": https://github.com/heysokam/osdf-engine/blob/3aaa855eb1f0b71fe5527c6349620d7d39fdb48f/qcommon/common.c#L942
08:19:39FromDiscord<sOkam!> some type of block/zone allocator. I don't understand it, ngl
08:21:06FromDiscord<demotomohiro> I also dont understand it.
08:25:08FromDiscord<demotomohiro> Using the C library without knowing how to use memory is like using alian space ship without knowing how it work. If you push some buttons, it might travel to other planet, but you would not be able to return to earth again.
08:25:58FromDiscord<sOkam!> In reply to @demotomohiro "Using the C library": yes, that's pretty much q3arena engine in a nutshell. must live with it and get it down to earth slowly over time
08:26:13FromDiscord<sOkam!> it would be literally impossible to work with it otherwise
08:26:33FromDiscord<offbeat-stuff (offbeat-stuff)> any idea why this doesn't compile https://pastebin.com/Gkd2pLXt
08:26:35FromDiscord<sOkam!> you just trust that it works, and keep going, with learning along the way
08:26:51FromDiscord<offbeat-stuff (offbeat-stuff)> it says expected ")" closing
08:26:58FromDiscord<offbeat-stuff (offbeat-stuff)> but I don't see any error
08:27:38FromDiscord<Yardanico> you can't just use C includes like that
08:27:47FromDiscord<offbeat-stuff (offbeat-stuff)> why
08:27:52FromDiscord<Yardanico> because Nim is not C :)
08:28:04FromDiscord<offbeat-stuff (offbeat-stuff)> I dont see the point
08:28:09FromDiscord<Yardanico> you have to specify them in the `header` pragma for specific functions that you import from the C side
08:28:12FromDiscord<Yardanico> or in `emit`
08:28:19FromDiscord<offbeat-stuff (offbeat-stuff)> How should i use importc then
08:28:27FromDiscord<Yardanico> along with `header`
08:28:35FromDiscord<Yardanico> https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-header-pragma
08:29:07FromDiscord<Yardanico> and with emit you can do includes with the TYPESECTION - https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-emit-pragma (closer to the end of this section)
08:29:10FromDiscord<offbeat-stuff (offbeat-stuff)> I am using push header
08:29:17FromDiscord<Yardanico> err INCLUDESECTION
08:29:44FromDiscord<Yardanico> ah yeah I misread your code a bit
08:30:15FromDiscord<Yardanico> your code is erroring because `interface` is a keyword in Nim
08:30:22FromDiscord<offbeat-stuff (offbeat-stuff)> ok btw any good suggestion to lessen the amount of interop code
08:30:28FromDiscord<offbeat-stuff (offbeat-stuff)> okay
08:31:01FromDiscord<Elegantbeef> futhark/c2nim can reduce the amount of work you have to do, you also can look at j-james' bindings for wayland/wlroots
08:31:13FromDiscord<Elegantbeef> They're not fully done but you can always contribute
08:31:45FromDiscord<Elegantbeef> Futhark doesnt like some structs in wayland afaict
08:32:02FromDiscord<demotomohiro> In reply to @sOkam! "yes, that's pretty much": DuckDuckGo with "ZONE MEMORY ALLOCATION quake" find this article:โ†ตhttps://miuliano.me/blog/2016/04/22/Quake++-Memory/
08:32:57FromDiscord<offbeat-stuff (offbeat-stuff)> Thanks elegant
08:33:39FromDiscord<Elegantbeef> I think j-james' wlroots are 100% done but untested due to not having libwayland wrapped
08:37:23FromDiscord<offbeat-stuff (offbeat-stuff)> thanks found them took some time
08:38:24FromDiscord<Phil> For the mere fraction of a second I had a faint, vague hope that I could maybe disregard construction procs for my norm models alltogether.โ†ตThen I realized that a norm model referencing another norm model will instantiate that field as nil and norm doesn't work with that so that'd screw me over =/
08:39:35FromDiscord<Phil> I guess overall I still can't overstate how much work constructor is saving me
08:39:56FromDiscord<Elegantbeef> You're it's #1 fan
08:40:09FromDiscord<Phil> I have the tshirt and everything
08:40:16FromDiscord<Elegantbeef> If i had the means i'd ship you a shirt with that on it
08:43:39FromDiscord<Phil> sent a long message, see http://ix.io/45cj
08:44:27FromDiscord<Elegantbeef> make a constant for the flags you want then just replace `implDefaults(, myConstant)`
08:45:11FromDiscord<Elegantbeef> I know you can do that with vscode at the very least, or with a similar method
08:46:08FromDiscord<Elegantbeef> I was going to say, this makes me think the user should be able to set the default but i can see that going astray
08:46:47FromDiscord<Phil> Nah, it's good the way it is, this is just me stumbling into refactoring I can now do since norm has a feature I wanted before I'd do it
09:24:34FromDiscord<Phil> Alright, refactoring done, finally making use of norm's shiny `readOnly` pragma and got rid of all of my own constructor procs.โ†ตNow only beefs code is constructing objects for me. Delegating responsibility away from my own code has never been so nice
09:25:02FromDiscord<Elegantbeef> You know what i dont feel like maintaining constructor anymore, i'm going to hit this red "Delete repo" button
09:25:39FromDiscord<Phil> Time to maintain a fork!
09:25:50FromDiscord<Phil> ~~And by maintain I mean do nothing with it~~
09:26:20FromDiscord<Elegantbeef> Hey all my 1 users are happy as hell with constructor
09:27:39FromDiscord<Phil> Was more meant that overall constructor is pretty... finished. As in, I'm not sure if there's any feature you could add that would still be within the scope of the package
09:28:39FromDiscord<Phil> It does what it should do, generate you constructor procs with default parameters, where the general `new(typedesc)` and `init(typedesc)` don't give you what you need (mostly due to "new" throwing in "nil" for all ref type fields upon initialization, that's kinda meh)
09:28:57FromDiscord<Rika> Maybe I should take a look
09:29:05FromDiscord<Rika> I remember looking but ending up not using
09:29:10FromDiscord<Rika> I donโ€™t recall why
09:30:01FromDiscord<Phil> The only thing that could make it better if somehow I could be spared the "implDefaults" call
09:30:09FromDiscord<Phil> But I'll happily take that
09:31:43FromDiscord<Elegantbeef> It's a good solution until the initialisers RFC is in Nim
09:31:48FromDiscord<Elegantbeef> That'll be great
09:32:09FromDiscord<Phil> ?
09:32:31FromDiscord<Elegantbeef> There is an RFC that suggests basically what defaults does
09:32:45FromDiscord<Elegantbeef> Slightly different in that it doesnt allow non static expressions
09:32:58FromDiscord<Elegantbeef> But point being it'd allow you to set default values
09:34:36FromDiscord<Elegantbeef> https://github.com/nim-lang/RFCs/issues/252
09:34:38FromDiscord<Elegantbeef> For that RFC
09:38:39FromDiscord<Phil> In reply to @Elegantbeef "Slightly different in that": I think I'd be pretty alright with that. I like it!
09:50:35FromDiscord<jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=45cy
10:02:48FromDiscord<sOkam!> In reply to @demotomohiro "DuckDuckGo with "ZONE MEMORY": interesting read. not sure how it relates to the Nim interaction situation, though ๐Ÿค”โ†ตnot like it doesn't, if it does I just don't understand it
10:04:07FromDiscord<sOkam!> Like... if I create an object in Nim.... how can I be sure that the GC won't just get rid of it?
10:04:43FromDiscord<sOkam!> Or if a variable is global scope, does the GC ever touch it in the lifetime of the app?
10:06:10FromDiscord<sOkam!> I found an older version of nim's docs, that contain a gc page. But I can't find that in the latest docs, so don't know if I should not trust that info because it got removed ๐Ÿค”
10:08:35FromDiscord<demotomohiro> Objects in stack or global is not managed by the GC. But if these objects have pointers to heap memory, these heap are managed by the GC.
10:09:47FromDiscord<demotomohiro> https://internet-of-tomohiro.netlify.app/nim/faq.en.html#type-when-to-use-ref-object-vs-plain-object-qmark
10:13:29FromDiscord<Rika> You can register the object as being used
10:13:31FromDiscord<demotomohiro> GC_ref increments the reference count of ref type so that it doesnt get freed by GC while C code use it.โ†ตhttps://nim-lang.org/docs/system.html#GC_ref%2Cref.T
10:13:33FromDiscord<sOkam!> what's the diff between ptr and ref?
10:14:02FromDiscord<sOkam!> include pointer in that
10:14:07FromDiscord<demotomohiro> ref is managed by Nim's GC but ptr is not.
10:14:10FromDiscord<sOkam!> is pointer an alias for ptr, or are they different?
10:14:17FromDiscord<Rika> Pointer is void pointer
10:14:20FromDiscord<Rika> The other is typed
10:14:30FromDiscord<sOkam!> oh gotchu, that makes sense
10:14:58FromDiscord<sOkam!> you pointer is a separate type, and ptr makes the type listed after a pointer of that type
10:15:02FromDiscord<demotomohiro> https://nim-lang.org/docs/manual.html#types-reference-and-pointer-types
10:15:09FromDiscord<sOkam!> (edit) "you" => "so"
10:15:27FromDiscord<sOkam!> tyty. was searching for that โœ๏ธ
10:31:42*pch quit (Quit: Leaving)
10:42:13FromDiscord<sOkam!> In reply to @demotomohiro "GC_ref increments the reference": what would be the difference between doing `thing: ptr Type` and `thing: ref Type; thing.GC_ref`
10:44:03FromDiscord<sOkam!> I guess ptr cannot be back to being unref ever? ๐Ÿค”
10:51:04FromDiscord<Rika> You canโ€™t use the GC functions on a pointer
10:51:09FromDiscord<sOkam!> Also, based on this knowledge, should I never use `ptr`, and use `GC_ref`on ref types instead?
10:51:18FromDiscord<Rika> Pretty much
11:09:11FromDiscord<sOkam!> @treeform If I wanted to use Pixie for drawing with opengl on the gpu, in an engine that doesn't have support for it natively, what exactly would I need to code a backend to draw whatever pixie needs to do its thing?
11:15:31FromDiscord<sOkam!> Or maybe I don't need gpu. It's just for drawing in a UI library, not ingame ๐Ÿค”
11:21:23FromDiscord<Nimion #เถž> In reply to @sOkam! "<@107140179025735680> If I wanted": U can look at boxie
11:21:57FromDiscord<Nimion #เถž> (edit) "boxie" => "boxy"
11:26:22FromDiscord<sOkam!> @TryAngle In any of them, I still have the same questionโ†ตBasically, I'm using an unortodox engine, so I have to do things in weird waysโ†ตIn this case, I don't really know if I need to access the engine itself, or if I can just draw on screen normally from the dll that contains pixie/boxy code
11:30:00FromDiscord<sOkam!> Hence the question: what does pixie exactly need to draw?
12:52:17*vicecea joined #nim
13:11:59NimEventerNew thread by Planetis: How to compute a set[enum] with all possible values?, see https://forum.nim-lang.org/t/9318
13:41:57FromDiscord<sOkam!> Is it possible to read some type of log of nimlsp?โ†ตI have a crash happening all the time, but dunno what's triggering it
13:42:08FromDiscord<sOkam!> (edit) "nimlsp?โ†ตI" => "`nimlsp`?โ†ตI"
13:47:19FromDiscord<demotomohiro> Pixie has `Image` type that contains `seq` as color buffer and what you draw with pixie is written to `Image` type variable.
13:48:31FromDiscord<demotomohiro> Quake3arena engine doesn't draw scane with OpenGL?
13:53:53FromDiscord<sOkam!> In reply to @demotomohiro "Quake3arena engine doesn't draw": yes, it does. but I don't know how to connect it (yet)โ†ตso I wondered if it can draw by itself, or of it relies on something specific being available
14:02:18FromDiscord<Hamid_Bluri> I remember there was a feature which you could add `else` branch rather than `do` for your macro, but I don't remember how to use it
14:02:56FromDiscord<Hamid_Bluri> sent a code paste, see https://play.nim-lang.org/#ix=45dL
14:13:29FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=45dQ
14:16:13FromDiscord<TurtleP> sent a code paste, see https://play.nim-lang.org/#ix=45dS
14:31:45FromDiscord<demotomohiro> In reply to @sOkam! "yes, it does. but": If Quake3arena has a function that creates a window and create OpenGL context, you probably see what Quake3arena draws by calling the function.
14:33:48FromDiscord<sOkam!> In reply to @demotomohiro "If Quake3arena has a": Not sure that is available in the api. I highly doubt it, but definitely need to study it more to confirmโ†ตThe old ui system does it by registering images with some fixed-function-pipeline custom shader language
14:34:18FromDiscord<aruZeta> sent a code paste, see https://play.nim-lang.org/#ix=45e2
14:34:57FromDiscord<demotomohiro> !eval echo [2'u8, 5, 7, 24]
14:35:01NimBot[2, 5, 7, 24]
14:35:54FromDiscord<aruZeta> so just with the first one it should work
14:36:03FromDiscord<demotomohiro> yes
14:36:10FromDiscord<aruZeta> yh it does!
14:36:11FromDiscord<aruZeta> thanks
14:36:36FromDiscord<sOkam!> any clues what this is saying? https://media.discordapp.net/attachments/371759389889003532/1000411112245821490/unknown.png
14:39:30FromDiscord<flywind> Looks like a compiler bug.
14:40:44FromDiscord<sOkam!> its happening on loading the lsp
14:40:50FromDiscord<aruZeta> its an lsp bug
14:42:10FromDiscord<sOkam!> It's happening only on this project. I can run other projects fine, it seems
14:42:40FromDiscord<aruZeta> my lsp crashes randomly when I reach the part of a file where I created a macro
14:43:01FromDiscord<aruZeta> but now it doesn't want to crash lol
14:43:09FromDiscord<aruZeta> now it did
14:43:53FromDiscord<aruZeta> sent a code paste, see https://play.nim-lang.org/#ix=45eh
14:44:27FromDiscord<aruZeta> seems to be different bugs
14:46:04FromDiscord<sOkam!> I think its something in the `config.nims` file
14:46:51FromDiscord<sOkam!> yep, exactly there. if I remove the file, its all back to normal
14:47:50FromDiscord<aruZeta> can you show the contents?
14:48:27FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=45ej
14:49:08FromDiscord<aruZeta> more than `var`, why not a `let`
14:49:14FromDiscord<aruZeta> (edit) "more" => "better"
14:49:20FromDiscord<sOkam!> tru
14:50:23FromDiscord<aruZeta> sent a code paste, see https://play.nim-lang.org/#ix=45el
14:50:36FromDiscord<aruZeta> shouldn't it be `"-Wl", "--gc-sections"`
14:51:36FromDiscord<Rika> Not that I know, no
14:52:41FromDiscord<Rika> No, thatโ€™s correct
14:52:43FromDiscord<sOkam!> In reply to @aruZeta "shouldn't it be `"-Wl",": not at all, nope. it requires that syntax
14:52:48FromDiscord<aruZeta> ahh
14:53:15FromDiscord<sOkam!> i tried it, and got a bug that had to track down for a while... and it was the linker flag syntax I fucked up myself by tring to be smartypants ๐Ÿ˜„
14:53:24FromDiscord<aruZeta> xd
14:53:37FromDiscord<sOkam!> its something in the for loops
14:53:53FromDiscord<aruZeta> maybe the lsp does not like em
14:53:57FromDiscord<Rika> Separating them will add a space and thatโ€™s not desired
14:54:18FromDiscord<aruZeta> yh, now I get what they actually are
14:54:53FromDiscord<sOkam!> In reply to @Rika "Separating them will add": more like "not-desired"... the linker flag will stop working entirely ๐Ÿ™‚
15:02:35FromDiscord<sOkam!> sent a code paste, see https://paste.rs/AcF
15:04:42FromDiscord<demotomohiro> How about to just try it and see if it is applyed with --listcmd.
15:07:35FromDiscord<aruZeta> In reply to @sOkam! "Are switches allowed to": if it was a tuple it would look like `switch ("passC", "-Wall")`, notice the space
15:08:27FromDiscord<aruZeta> and without space it should be `switch(("passC", "-Wall"))`, but isn't, so they are normal arguments and not a tuple
15:09:07FromDiscord<demotomohiro> `switch` is just a procedure: https://nim-lang.org/docs/nimscript.html#switch,string,string
15:09:12FromDiscord<sOkam!> some of the flags is breaking the slp, pretty much
15:09:25FromDiscord<sOkam!> i tried without the for loops, and it breaks
15:14:32FromDiscord<sOkam!> honestly, ill just do my own config. tired of debugging it ๐Ÿ˜”
15:14:41FromDiscord<sOkam!> (edit) "config." => "build script."
15:48:21FromDiscord<wiga> i tried to create a little project and i have no error in the code but when i run i keep getting this and i have no idea where is it https://media.discordapp.net/attachments/371759389889003532/1000429168217030808/unknown.png
15:49:16FromDiscord<wiga> i think its because of the os.createDir("./somedir") but idk why its doing that
15:50:39FromDiscord<wiga> wait no its even before
15:50:49FromDiscord<wiga> but the only this i have before is an array
15:53:36FromDiscord<sOkam!> In reply to @wiga "i tried to create": something that is returning has not been discarded, so its warning you of a missing discard or return
15:53:54FromDiscord<wiga> but the main function has not been used yet in the code
15:54:12FromDiscord<wiga> its not even creating the directory
15:54:20FromDiscord<wiga> and i have no code being executed before
15:54:36FromDiscord<wiga> i cant really show here cuz its nsfw
15:55:14FromDiscord<sOkam!> you are thinking too high level, i thinkโ†ตthere is something that is returning, and hasn't been handled. even if you are not using it, the compiler processes the codeโ†ตso something is missing. but without any code snippet cant help past that
15:55:36FromDiscord<wiga> can i send in dm?
15:56:03FromDiscord<sOkam!> try to reproduce it in a shorter non-nsfw version in here
15:57:22FromDiscord<wiga> sent a code paste, see https://play.nim-lang.org/#ix=45jf
16:02:16FromDiscord<wiga> this language is so fast that i get errors faster than anything else
16:03:45FromDiscord<!Patitotective> In reply to @Patitotective "if anyone wants to": the problem was an infinite loop ._.โ†ตi dont get why sudo made it work
16:05:17FromDiscord<untoreh> sent a code paste, see https://play.nim-lang.org/#ix=45jM
16:10:27FromDiscord<wiga> sent a code paste, see https://play.nim-lang.org/#ix=45jP
16:10:32FromDiscord<!Patitotective> sent a code paste, see https://paste.rs/oT3
16:14:00FromDiscord<untoreh> to get `'hello'` instead of `&apos;hello&apos;`
16:14:09FromDiscord<untoreh> (edit) "to get `'hello'` instead of `&apos;hello&apos;` ... " added "@!Patitotective"
16:14:25FromDiscord<!Patitotective> what's file.html?
16:14:37FromDiscord<untoreh> I wrote it
16:14:47FromDiscord<untoreh> sent a code paste, see https://play.nim-lang.org/#ix=45jQ
16:15:03FromDiscord<!Patitotective> and what `tree` outputs?
16:15:21FromDiscord<untoreh> sent a code paste, see https://play.nim-lang.org/#ix=45jR
16:19:16FromDiscord<!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=45jS
16:19:40FromDiscord<untoreh> yes innertext is same
16:19:50FromDiscord<untoreh> but how do I dump it without html entities
16:20:03FromDiscord<!Patitotective> In reply to @untoreh "but how do I": dump it?
16:20:43FromDiscord<untoreh> the string conversion function
16:22:05FromDiscord<!Patitotective> i dont think you can, you need to access the `script` tag first
16:37:20FromDiscord<Rika> sent a code paste, see https://play.nim-lang.org/#ix=45k3
16:37:26FromDiscord<Rika> (edit) "https://play.nim-lang.org/#ix=45k3" => "https://play.nim-lang.org/#ix=45k4"
16:46:41FromDiscord<LePichu> Hello :octowo:
16:49:00FromDiscord<!Patitotective> Hi
16:50:09FromDiscord<LePichu> How does Nim handle memory? GC?
16:50:24FromDiscord<LePichu> I got recommended Nim by a friend of mine so I am here now
16:51:06FromDiscord<LePichu> @Bubblie :octowo:
16:53:37FromDiscord<!Patitotective> In reply to @LePichu "How does Nim handle": By default yes, but you can disable it to do it manually if you want
16:54:12FromDiscord<!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=45kb
16:56:33FromDiscord<Rika> Looks efficient to me, why not use enumerate?
16:56:44FromDiscord<!Patitotective> sure
16:56:53FromDiscord<Rika> https://nim-lang.org/docs/enumerate.html
16:59:00FromDiscord<!Patitotective> In reply to @Rika "Looks efficient to me,": ~~efficient enough to call it every frame~~
16:59:32FromDiscord<Rika> Measure the run time yourself, only you can deem whether itโ€™s good enough
17:01:21*jmdaemon joined #nim
17:17:28FromDiscord<ghoom> why is https://play.nim-lang.org/ offline?
17:24:23FromDiscord<kots> sent a code paste, see https://play.nim-lang.org/#ix=45ke
17:27:46FromDiscord<!Patitotective> In reply to @kots "You could try something": ๐Ÿ‘€
17:27:50FromDiscord<!Patitotective> smart, thanks
17:43:19FromDiscord<LePichu> W h a t https://media.discordapp.net/attachments/371759389889003532/1000458097992679494/unknown.png
17:43:22FromDiscord<LePichu> ESModules?
17:52:07FromDiscord<ghoom> is there a shorthand fpr `x: x`?
17:52:11FromDiscord<ghoom> (edit) "fpr" => "for"
17:52:22FromDiscord<ghoom> as in `Type(x: x)`
17:52:31FromDiscord<ghoom> (edit) "`Type(x:" => "`Object(x:"
17:56:46FromDiscord<!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=45kj
17:57:07FromDiscord<!Patitotective> In reply to @LePichu "ESModules?": ๐Ÿคจ
17:57:19FromDiscord<ghoom> In reply to @Patitotective "nope you should create": man i love the shorthand feature in js
17:57:31FromDiscord<!Patitotective> you can create a macro ;]
17:57:43FromDiscord<Prestige> shorthand feature in js?
17:57:52FromDiscord<LePichu> In reply to @Patitotective "๐Ÿคจ": ES6 Styled Modules
17:57:54FromDiscord<LePichu> are standard
17:58:18FromDiscord<LePichu> Even Node supports tho it even tho its own thing is CommonJS Modules
17:58:41FromDiscord<Prestige> probably simpler just to put everything in one file tbh
17:59:04FromDiscord<LePichu> its just like
18:00:09FromDiscord<LePichu> sent a code paste, see https://play.nim-lang.org/#ix=45kk
18:00:19FromDiscord<!Patitotective> PRs welcome
18:00:31FromDiscord<LePichu> aight time to do some compiler dev <a:dying_weary:877447427450363905>
18:05:24FromDiscord<flywind> In reply to @LePichu "its just like": See nodejs in nimble
18:05:24FromDiscord<# Luke> Can I hava a tuple of sequences
18:05:30FromDiscord<# Luke> (edit) "hava" => "have"
18:05:45FromDiscord<flywind> In reply to @flywind "See nodejs in nimble": https://github.com/juancarlospaco/nodejs
18:07:00FromDiscord<LePichu> In reply to @flywind "See nodejs in nimble": that is not the thing i am talking aboutt
18:07:03FromDiscord<LePichu> at all
18:09:50FromDiscord<!Patitotective> In reply to @ripluke "Can I have a": sure
18:12:48FromDiscord<flywind> In reply to @LePichu "that is not the": It supports jsExport https://github.com/juancarlospaco/nodejs/blob/6dfc2cc86014d108cd73b1ba86fed809484b31be/src/nodejs/jsugar.nim#L67 You can compile Nim to js and call the proc form js.
18:13:02FromDiscord<flywind> (edit) "form" => "from"
18:13:53FromDiscord<LePichu> neat then
18:15:36FromDiscord<!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=45kn
18:15:42FromDiscord<!Patitotective> i want to be able to pass `myMacro` object types :[
18:17:42FromDiscord<# Luke> With exec in a nimble task, how would it run on windows?
18:17:49FromDiscord<# Luke> Using CMD or PowerShell
18:18:19FromDiscord<!Patitotective> cmd
18:18:27FromDiscord<# Luke> Ok
18:19:34FromDiscord<!Patitotective> (edit)
18:23:18FromDiscord<ghoom> do i really need a constructor if i don't wanna specify the property names?
18:23:35FromDiscord<ghoom> (edit) "specify" => "write"
18:23:43FromDiscord<!Patitotective> In reply to @ghoom "do i really need": you can write a macro
18:24:07FromDiscord<ghoom> i feel like just by doing `Object(...)` you should be able to omit names
18:24:26FromDiscord<ghoom> with properties getting referred by order
18:24:26FromDiscord<LePichu> In reply to @ripluke "With exec in a": most likely it will pick up what shell you were using
18:24:45FromDiscord<Phil> In reply to @ghoom "do i really need": Allow me to introduce you to the constructor package my friend
18:25:53FromDiscord<Phil> Generates a constructor for you, nice and simple. Can be public, can be private, can have the name new<YourModelTypeName>() or new(YourModelType) (for ref types, for value types replace "new" with "init")
18:25:57FromDiscord<!Patitotective> https://github.com/beef331/constructor
18:26:38FromDiscord<Phil> There's an RFC to throw similar capabilities into nim, and it is being looked favorably upon, but it hasn't been built afaik
18:26:58FromDiscord<Phil> (edit) "afaik" => "into the core language afaik. The constructor package does a good job of tiding one over though."
18:27:15FromDiscord<ghoom> oo
18:29:30FromDiscord<Phil> If you're curious, you will in fact find beef linking that RFC sometime earlier today in the chat logs since I myself only learned of this RFC today
18:30:13FromDiscord<ghoom> oky
18:40:35FromDiscord<ghoom> whi isn't `randomize()` called automatically on import?
18:40:43FromDiscord<ghoom> (edit) "`randomize()`" => "`randomize`"
18:41:52FromDiscord<Rika> its not necessarily desirable i assume, but im unaware of such cases
18:48:32*jmdaemon quit (Ping timeout: 244 seconds)
18:51:07*jmdaemon joined #nim
19:13:16NimEventerNew thread by Cnerd: Implement api rate limiting with jester, see https://forum.nim-lang.org/t/9319
19:29:40FromDiscord<aruZeta> Seems like play.nim-lang.org is down
19:33:10FromDiscord<ghoom> mhm
19:35:30FromDiscord<Prestige> ah not again
19:35:43FromDiscord<Prestige> I need to help pmunch fix that issue...
19:36:09FromDiscord<aruZeta> What's "that" issue
19:36:37FromDiscord<Prestige> iirc it's a docker container and the memory usage creeps up till it no longer responds
19:37:27FromDiscord<aruZeta> Ahh
19:39:18FromDiscord<Rika> memory -> storage
19:39:27FromDiscord<Rika> death by logs
19:41:27FromDiscord<Prestige> If that's the problem it'd be pretty easy to solve
19:44:33FromDiscord<j-james> In reply to @ghoom "i feel like just": https://github.com/nim-lang/RFCs/issues/418
19:57:59FromDiscord<ghoom> what's the most efficient way to serialize nim objects?
19:58:13FromDiscord<ghoom> json's kind of a pain
19:58:16FromDiscord<ghoom> (edit) "json's kind of a pain ... " added "in nim"
19:59:01FromDiscord<eyecon> You can use jsony if you're working with json, seems to be well-written and fast
19:59:08FromDiscord<eyecon> Rather than the built-in one
19:59:26FromDiscord<ghoom> ok
19:59:35FromDiscord<eyecon> There's also frosty
19:59:49FromDiscord<eyecon> https://github.com/treeform/jsony
20:00:30FromDiscord<huantian> and also flatty โ†ตhttps://github.com/treeform/flatty
20:00:40FromDiscord<ghoom> ๐Ÿคฏ
20:00:46FromDiscord<eyecon> In reply to @huantian "and also flatty ": Thanks, I was trying to remember the other one
20:00:57FromDiscord<ghoom> easy on me guys
20:00:59FromDiscord<ghoom> XD
20:01:04FromDiscord<eyecon> These latter 2 are their own formats
20:01:08FromDiscord<eyecon> Use jsony if unsure
20:01:16FromDiscord<ghoom> ah
20:01:36FromDiscord<ghoom> i'll use the fastest
20:02:01FromDiscord<eyecon> That should also be jsony if you're planning to use a human-readable format
20:02:29FromDiscord<ghoom> flatty is faster
20:04:17FromDiscord<ghoom> btw, will `someObject.toFlatty()` automatically work?
20:04:34FromDiscord<huantian> one thing to note for flatty is that I don't think they ahve any object versioning
20:04:42FromDiscord<ghoom> wym?
20:04:46*krux02 joined #nim
20:05:36FromDiscord<huantian> if you edit the object you serialize, you'd probably have to keep the old version
20:05:49FromDiscord<ghoom> nah i don't need to
20:06:24FromDiscord<ghoom> i just want to maintain a database
20:06:32FromDiscord<ghoom> (edit) "i just want to maintain a ... database" added "simple"
20:07:13FromDiscord<eyecon> There's of course, like, SQLite and co.
20:07:48FromDiscord<ghoom> it's ok, sometimes you don't even need sqlite
20:07:55FromDiscord<ghoom> ๐Ÿ‘Œ๐Ÿธ
20:08:02FromDiscord<huantian> if you want a database just use sqlite
20:09:05FromDiscord<ajusa> Yeah, it'd be very cool if Futhark would work with ctrulib
20:09:27FromDiscord<ajusa> Have you tried it with libtonc @exelotl? Or busy with the game?
20:09:40FromDiscord<exelotl> no, I haven't tried futhark yet
20:09:46FromDiscord<ajusa> In reply to @ajusa "Yeah, it'd be very": To be clear I haven't tried it yet, so hopefully it could work
20:12:05FromDiscord<exelotl> can Futhark generate source files like c2nim or nimterop's toast? I prefer that rather than magic generated-on-the-fly bindings
20:12:32FromDiscord<Elegantbeef> Futhark does generate them but it doesnt store them in your project directory
20:12:32FromDiscord<Elegantbeef> You can always copy them to your project
20:12:47FromDiscord<exelotl> ah, neat
20:12:53FromDiscord<Elegantbeef> As such you can do things like https://github.com/beef331/miniaudio/blob/master/src/miniaudio.nim#L4-L10
20:13:08FromDiscord<Elegantbeef> The downside is that futhark's generate Nim sources are fucking awful to read
20:13:24FromDiscord<exelotl> ah, lol
20:13:29FromDiscord<Elegantbeef> https://github.com/beef331/miniaudio/blob/master/src/miniaudio/futharkminiaudio.nim if you want to see what it looks like
20:14:30FromDiscord<exelotl> oh boy ๐Ÿ˜…
20:15:13FromDiscord<IDF> even the github syntax highlighter just gave up
20:22:49FromDiscord<j-james> Elegantbeef\: nim-wayland now compiles
20:23:05FromDiscord<Prestige> :o
20:23:19FromDiscord<j-james> some things were definitely done incorrectly, though
20:23:43FromDiscord<j-james> i think i'm still `{.importc.}`ing inline functions
20:23:45FromDiscord<Elegantbeef> Tinynimwl time?!
20:24:44FromDiscord<!Patitotective> seems like glfw does not store image data in clipboard :[[[[
20:25:08FromDiscord<j-james> tinywl time indeed??
20:25:10FromDiscord<Elegantbeef> Was this cause of me saying your name a lot last night to that person asking about wayland bindings?
20:25:10FromDiscord<j-james> haha, maybe
20:25:10FromDiscord<Elegantbeef> I guess depending on your location that was today ๐Ÿ˜„
20:25:12FromDiscord<j-james> also just finally had some free time
20:25:41FromDiscord<Elegantbeef> To quote everyone's favourite plumber "letsa go"
20:27:13FromDiscord<Elegantbeef> Cmon! `Could not find a file with a .nimble extension inside the specified directory`
20:27:50FromDiscord<j-james> oops
20:38:04FromDiscord<treeform> In reply to @eyecon "Thanks, I was trying": flatty can easily be x10 faster then jsony
20:39:42FromDiscord<treeform> I mostly made flatty to be used for network messages with some thing like `netty`
20:39:56FromDiscord<treeform> that's why it does not have versioning
20:40:35FromDiscord<treeform> if you want to write something to a file and then read it 10 years later, jsony is probably better.
20:41:03FromDiscord<treeform> but if you want to send nim objects from one machine to another via network as fast as possible flatty is for that
20:45:10FromDiscord<Elegantbeef> Or a statically versioned type ๐Ÿ˜„
20:45:47FromDiscord<Elegantbeef> https://github.com/beef331/nimtrest/blob/master/vershun.nim#L80-L95 is an interesting way to version data that uses something like flatty or frosty
20:57:23FromDiscord<Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/1000506939836481627/image.png
20:57:26FromDiscord<Elegantbeef> some cursed code to convert here
21:06:02FromDiscord<Prestige> Wtf
21:09:24FromDiscord<Prestige> What even is the difference between the first three
21:09:35FromDiscord<Elegantbeef> Ask C developers
21:10:04FromDiscord<Elegantbeef> They thing `_` and capitals contain an important delimiting symbol
21:10:08FromDiscord<Elegantbeef> they thinK\
21:15:34NimEventerNew thread by JPLRouge: Problรจme db_sqlite 1.6.6 ??, see https://forum.nim-lang.org/t/9320
21:30:34*krux02 quit (Remote host closed the connection)
22:00:44FromDiscord<# Luke> I hate window
22:00:47FromDiscord<# Luke> (edit) "window" => "windows"
22:01:04FromDiscord<# Luke> I can't get choosenim to work
22:01:16FromDiscord<# Luke> So I have to get a binary
22:03:33FromDiscord<!Patitotective> In reply to @ripluke "I hate windows": yes
22:04:11FromDiscord<# Luke> Then again I also hate ubuntu >:D
22:04:34FromDiscord<Generic> Ubuntu is the worst
22:04:54FromDiscord<Generic> every package is like 10 years old
22:05:04FromDiscord<# Luke> Lmao yes
22:05:14FromDiscord<# Luke> I installed mint
22:05:27FromDiscord<# Luke> And it came with the lts kernel from 2019
22:05:36FromDiscord<# Luke> A 3 year old kernel lmfao
22:20:25FromDiscord<Elegantbeef> [j-james](https://matrix.to/#/@j-james:matrix.org)\: to save me a few seconds can you remove the `wayland.nim` inside `wlroots`? ๐Ÿ˜„
22:20:51FromDiscord<!Patitotective> In reply to @ripluke "Then again I also": no
22:21:07FromDiscord<Elegantbeef> You're a developer using a non rolling release, what's wrong with you! ๐Ÿ˜›
22:23:00FromDiscord<huantian> In reply to @Elegantbeef "https://github.com/beef331/nimtrest/blob/master/ver": wait this works with flatty? huh yeah that makes sense
22:23:18FromDiscord<Elegantbeef> I mean you'd have to make a hook to output the version before the type, but yea
22:25:20FromDiscord<huantian> definitely seems a good way to do verisoning
22:28:50FromDiscord<ajusa> Yeah flatty is great
22:29:07FromDiscord<ajusa> I've got a version of some 3DS/switch homebrew parsing stuff that uses it
22:29:24FromDiscord<ajusa> Even though that isn't what it's explicitly for, it handles fairly well
22:30:02FromDiscord<Elegantbeef> I'm partial to frost as it's more equivalent to serde which is quite nifty
22:30:06FromDiscord<Elegantbeef> frosty\
22:33:51FromDiscord<ajusa> I always find frosty's implementation to be a lot more complicated than flatt
22:33:54FromDiscord<ajusa> (edit) "flatt" => "flatty"
22:34:48FromDiscord<!Patitotective> In reply to @Elegantbeef "You're a developer using": what if i mess up and delete my files :[[
22:37:25FromDiscord<Elegantbeef> Well it also supports serializing to anything
22:37:26FromDiscord<Elegantbeef> Yea james we have more work before tinywl is doable ๐Ÿ˜„
22:37:28FromDiscord<Elegantbeef> Like i mean it's really simple to make your own hook for it
22:37:28FromDiscord<Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/1000532126061568113/image.png
22:37:29FromDiscord<j-james> Elegantbeef\: done
22:37:29FromDiscord<j-james> i think i'm going to remove the Wl prefixes and use `import wayland as wl` instead
22:37:44FromDiscord<Elegantbeef> You're a developer why do you have important files not backed up
22:37:50FromDiscord<j-james> oh yeah what's broken
22:38:03FromDiscord<Elegantbeef> You're one of the sub groups that should know the importance of backups
22:38:08FromDiscord<j-james> i would imagine a lot of things
22:38:17FromDiscord<Elegantbeef> Yep all of `util` doesnt work ๐Ÿ˜„
22:38:33FromDiscord<Elegantbeef> Also `Error: undeclared identifier: 'WlEventSource'`
22:38:40FromDiscord<Elegantbeef> Inside `backend` with wlroots
22:39:21FromDiscord<Elegantbeef> I'll throw my progress so you have a project to look at
22:41:12FromDiscord<Elegantbeef> https://github.com/beef331/tinynimwl here you go
22:41:30FromDiscord<Elegantbeef> https://github.com/beef331/tinynimwl/blob/master/src/nimtinywl.nim#L69 is just a travesty ๐Ÿ˜›
22:41:30FromDiscord<Prestige> Sweet
22:41:42FromDiscord<Elegantbeef> Prestige says sweet but nothing works!
22:42:07FromDiscord<Prestige> Progress.. sort of
22:42:24FromDiscord<Elegantbeef> We just get the wayland whip out until james gets us code that works
22:42:38FromDiscord<Elegantbeef> Then i make a proprietary composiitor and require james to pay me to use it
22:43:04FromDiscord<!Patitotective> In reply to @Elegantbeef "You're a developer why": where? google drive?
22:43:15FromDiscord<ghoom> can someone please tell me how to use flatty?
22:43:17FromDiscord<Elegantbeef> Local and remote backups
22:43:26FromDiscord<Elegantbeef> You literally write `toFlatty` after importing it
22:43:30FromDiscord<Elegantbeef> It's simple as hell
22:43:36FromDiscord<ghoom> how about fromFlatty?
22:43:49FromDiscord<Elegantbeef> `myStr.fromFlatty(MyType)`
22:44:00FromDiscord<!Patitotective> ok beef let me try to backup :]
22:45:38FromDiscord<ghoom> In reply to @Elegantbeef "`myStr.fromFlatty(MyType)`": thank uuuuuu
22:45:52FromDiscord<Prestige> In reply to @Patitotective "where? google drive?": GitHub?
22:46:36FromDiscord<!Patitotective> In reply to @Avahe "GitHub?": like upload my home folder to github? lol
22:47:09FromDiscord<Elegantbeef> Is your home folder filled with important files you cannot lose?
22:47:28FromDiscord<Elegantbeef> Personally i only really have one folder i dont want to lose and that's my photography
22:47:34FromDiscord<Prestige> I upload all my files that I care about to GitHub, mostly config files, scripts, etc
22:47:36FromDiscord<!Patitotective> hmm, i think most important stuff is already uploaded in github lol
22:47:55FromDiscord<!Patitotective> project folders i think are the most important
22:48:12FromDiscord<Elegantbeef> If you properly use git they really shouldnt be that important
22:48:38FromDiscord<Elegantbeef> I guess i also have the important password bank
22:48:41FromDiscord<ghoom> when is `()` necessary for a function call?
22:49:11FromDiscord<ghoom> i miss ruby's tolerance for no `()` whatsoever
22:49:19FromDiscord<Elegantbeef> Command syntax can be used everywhere
22:49:30FromDiscord<Elegantbeef> The only issue is nested command syntax can at most accept 2 parameters
22:49:54FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=45lq
22:51:50FromDiscord<!Patitotective> In reply to @Elegantbeef "If you properly use": properly means commiting every change? lol
22:51:58FromDiscord<!Patitotective> ill backup ubuntu iso ๐Ÿ˜Ž
22:52:07FromDiscord<Elegantbeef> Just use ventoy
22:52:12FromDiscord<Elegantbeef> It's 2022 ventoy exists use it
22:52:32FromDiscord<!Patitotective> ๐Ÿ‘€
22:53:01FromDiscord<Elegantbeef> You run the software to format the disk then you can just drop .iso files onto it and boot them
22:53:18FromDiscord<Elegantbeef> No more running unetbootin, rufus, or whatever other disk maker you use
22:56:39FromDiscord<!Patitotective> it was a joke, im not going to backup isos lmao
22:57:54FromDiscord<!Patitotective> also, i just realized all my imgui apps store their configuration at `.cache` instead of `.config` lolโ†ตim going to backup `.config`
22:58:09FromDiscord<j-james> \:thonk\:
22:58:24FromDiscord<j-james> that's what i would have expected to work as a baseline
22:58:36FromDiscord<!Patitotective> In reply to @j-james "\:thonk\:": insert thonk emoji
22:58:44FromDiscord<Elegantbeef> I mean `wlcontainerof` wasnt accessible to me
22:58:56FromDiscord<Elegantbeef> So think you have a bug
22:59:05FromDiscord<j-james> oh no i have `{.push dynlib: "libwlroots.so".}` in all of the wayland files
22:59:07FromDiscord<j-james> oh noooo
22:59:12FromDiscord<j-james> well that'd do it
23:04:26FromDiscord<j-james> wait, wayland-util doesn't have an equivalent `.so`
23:05:51FromDiscord<Elegantbeef> Well it doesnt need one afaict it's mostly just inline procedure
23:08:58FromDiscord<qb> Could I use more .cfg files for the compiler than one for one nim project? Like if I want to have different compiler options for different situations. How would I specify the correct nim file for the cfg which isn't named the same?
23:10:03FromDiscord<Elegantbeef> No you cannot use a config per module or anything like that
23:10:35FromDiscord<Elegantbeef> you can do `config.nims` and `nim.cfg` but those are not capable of supplying arguments for specific modules
23:10:52*arkurious quit (Quit: Leaving)
23:14:00FromDiscord<qb> Okay. Then I would need to define a own compiler switch. How can I ask for it on the cfg file again? `@if switch`?
23:14:24FromDiscord<Elegantbeef> You know you can just do `defined(myFlag)` and \`-d\:myFlag\`\`?
23:14:55FromDiscord<qb> Yea thats what I'm asking. Thanks ๐Ÿ™‚
23:15:28FromDiscord<Elegantbeef> you can use a `config.nims`
23:15:34FromDiscord<Elegantbeef> then it should just be `when defined(myFlag)`
23:45:12FromDiscord<ghoom> any std module for encryption?
23:45:27FromDiscord<# Luke> Probably something named crypto
23:45:32FromDiscord<# Luke> Or cryptography
23:47:03FromDiscord<# Luke> Found this, it looks promising โ†ตโ†ตhttps://github.com/cheatfate/nimcrypto
23:48:04FromDiscord<j-james> status-im has some useful crypto libraries
23:48:12FromDiscord<j-james> that one's by one of their developers