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