00:20:51 | * | lungaro quit (Read error: Connection reset by peer) |
01:21:39 | * | ltriant joined #nim |
01:25:56 | * | ltriant quit (Ping timeout: 250 seconds) |
01:32:36 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
01:41:18 | FromDiscord | <Alea> when doing ``for index, item in X`` are the index item keywords, or can they be anything? |
01:41:33 | FromDiscord | <ajusa> sent a code paste, see https://play.nim-lang.org/#ix=3SUU |
01:41:46 | FromDiscord | <ajusa> In reply to @Alea "when doing ``for index,": they can be anything |
01:42:10 | FromDiscord | <ynfle> Is there a way to access the folder that was originally compiled from when using `nim r`? |
01:42:58 | FromDiscord | <Elegantbeef> `getCurrentDir`? |
01:43:09 | FromDiscord | <Elegantbeef> The source dir isnt apart of the binary |
01:43:42 | FromDiscord | <Elegantbeef> You could make `items: ref Scheme` but yea need atleast a reference↵(@ajusa) |
01:44:14 | FromDiscord | <ajusa> Gotcha, thanks for confirming! trying to make (yet another) open API generator |
01:44:40 | FromDiscord | <ajusa> in my defense disruptek's is for openapi 2 (and requires conversion to JSON), and the other one generates less than idiomatic Nim imo |
01:44:45 | FromDiscord | <Alea> In reply to @ajusa "they can be anything": will it always be index first then item? |
01:45:14 | FromDiscord | <ajusa> In reply to @Alea "will it always be": yes, as far as I am aware. eg, `for i, x in seq` |
01:46:34 | FromDiscord | <ynfle> In reply to @Elegantbeef "`getCurrentDir`?": That worked thanks |
01:47:03 | FromDiscord | <Elegantbeef> Yes the left hand of `in` with a for loop are for vars and can be any valid identifier |
01:47:50 | FromDiscord | <ajusa> any pretty printing libraries that work with table? treeform's seems to print out the internal structure for a table |
01:49:56 | FromDiscord | <ajusa> huh, I swear it was printing out a bunch of stuff for a table, but it isn't anymore... well treeform's print library is excellent |
01:54:50 | FromDiscord | <Bubblie> Does nim have tools for strings regarding counting the number of chars and spaces? |
01:55:23 | FromDiscord | <Elegantbeef> Unicode aware or only ascii? |
01:55:45 | FromDiscord | <Bubblie> Either |
01:56:26 | FromDiscord | <Elegantbeef> `import std/strutils; myString.count({'A'..'Z', 'a'..'z'})` |
01:56:39 | FromDiscord | <Bubblie> Oooooo |
01:56:43 | FromDiscord | <Elegantbeef> count takes a `set[char]` so you can count whatever characters you want easily |
01:56:53 | FromDiscord | <Bubblie> Awesome |
01:57:01 | FromDiscord | <Elegantbeef> Strutils also defines a few sets you can use |
01:57:08 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/strutils.html#10 |
02:06:59 | FromDiscord | <Bubblie> What does assert do in nim again exactly? |
02:07:11 | FromDiscord | <Bubblie> Checks for true and false right? |
02:07:14 | FromDiscord | <Elegantbeef> it's a runtime check that only happens in debug code |
02:07:30 | FromDiscord | <Bubblie> But why not use an if statement |
02:07:33 | FromDiscord | <Elegantbeef> Yes if the right hand is false it errors |
02:07:45 | FromDiscord | <Elegantbeef> Cause it's meant for ensuring bad things dont happen |
02:08:07 | FromDiscord | <Elegantbeef> You have your safety in debug but then in release you dont need it so it removes the expensive checks |
02:16:04 | FromDiscord | <gibson> Is there a recommended way to import stuff in Nim's system/? For example, system/dyncalls. I'm trying to get access to all the excellent x-platform dynamic lib handling code already there. Currently, I'm copying/pasting pieces into my own code. |
02:16:31 | FromDiscord | <ynfle> It's automatically imported |
02:16:32 | FromDiscord | <Elegantbeef> `import system/dyncalls` |
02:18:18 | FromDiscord | <ynfle> Beef, nothing is exported from there |
02:18:26 | FromDiscord | <ynfle> As far as I can tell |
02:18:29 | FromDiscord | <Elegantbeef> Then include it |
02:19:01 | FromDiscord | <ynfle> That's what system.nim does |
02:20:00 | FromDiscord | <Elegantbeef> That doesnt change anything |
02:21:49 | FromDiscord | <gibson> I want to get access to those "private" declarations in dyncalls via `import system/dyncalls {.all.}` but even a standard `import system/dyncalls` complains about other missing definitions that are in `pure/dynlib` but I'm already importing `dynlib` so I don't know what it's complaining about. So thus why I'm trying to figure out how to import stuff because it seems non-obvious. |
02:22:46 | FromDiscord | <gibson> Specifically, importing dyncalls wants `LibHandle` to be defined, which is in `pure/dynlib`. |
02:23:51 | FromDiscord | <Elegantbeef> Yea i dont know what to say it's written in such a way it expects to be inside system |
02:26:19 | FromDiscord | <gibson> Rats. I think the answer is I need to either copy/write that code myself as I'm doing, or make a PR for dynlib and add the ability to use the other flags it's curiously excluding. |
02:26:38 | FromDiscord | <gibson> Thanks. |
02:27:06 | FromDiscord | <Bubblie> How do I use nim in html, would I have to compile nim to js first |
02:27:09 | FromDiscord | <Bubblie> How would it work |
02:28:06 | FromDiscord | <Bubblie> I am thinking whether I should use nim for something web based |
02:28:11 | FromDiscord | <Bubblie> Compared to js or ts |
02:28:19 | FromDiscord | <Bubblie> For front end |
02:28:34 | FromDiscord | <Elegantbeef> `nim js` then just use the js file |
02:29:02 | FromDiscord | <Bubblie> Oh |
02:29:08 | FromDiscord | <Bubblie> Thats actually very neat |
02:29:24 | FromDiscord | <Bubblie> Also I heard of karax |
02:29:28 | FromDiscord | <Bubblie> Seems cool as well |
02:31:20 | FromDiscord | <Bubblie> I kinda hate js so nim may come in handy |
02:31:54 | FromDiscord | <Bubblie> Or I might use wasm |
02:40:23 | FromDiscord | <gibson> Found it! It turns out you can `import system {.all.}` This does what I need, but I should still make a PR for dynlib... |
02:42:37 | FromDiscord | <Elegantbeef> Perhaps you should |
03:15:20 | * | ltriant joined #nim |
03:19:19 | * | Figworm quit (Quit: Figworm) |
03:31:53 | FromDiscord | <Bubblie> When im using c++ library with pointers, do I need to use nim pointers to use those variables? |
03:32:33 | FromDiscord | <Bubblie> (edit) "library" => "header" |
03:34:29 | FromDiscord | <Bubblie> Also to use a header would I also do .compile: “hello.h” |
03:35:04 | FromDiscord | <Elegantbeef> That'd just compile the header it doesnt expose any code to you |
03:35:34 | FromDiscord | <Elegantbeef> You'd need to import it somehow be it manually, c2nim, futhark what have you |
03:36:39 | FromDiscord | <Bubblie> Is there anything on manually importing |
03:37:04 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/manual.html#foreign-function-interface-importc-pragma |
03:38:03 | FromDiscord | <Elegantbeef> If it's something big c2nim and futhark are good choices, futhark is capable of easily importing entire C libraries verbatim into Nim(much like Zig) |
03:38:23 | FromDiscord | <Bubblie> 👀 |
03:41:39 | * | ltriant quit (Ping timeout: 256 seconds) |
03:42:02 | * | arkurious quit (Quit: Leaving) |
03:42:02 | FromDiscord | <Bubblie> For nim vulkan, it seems to just be statically linking against the dll for vulkan |
03:42:14 | FromDiscord | <Bubblie> Or dylib |
03:42:22 | FromDiscord | <Bubblie> Or of course so for linux |
03:45:25 | ehmry | Bubblie: with C/C++ pointers I use `type Foo {.importc: "Foo".} = ptr object …`, and if the pointers are to an opaque type, then I use a `type Foo = distinct pointer` |
03:46:06 | ehmry | `distinct pointer` is pretty useful |
03:46:20 | FromDiscord | <Bubblie> Nice |
03:55:28 | FromDiscord | <Bubblie> For those who use nim opengl, do you use glfw nim bindings for it? |
03:56:05 | FromDiscord | <Elegantbeef> I use sdl2 |
03:57:08 | FromDiscord | <Elegantbeef> Ehmry i still need to get `type Foo {.importc: "Foo".} = distinct pointer` to work, though that's a more elaborate `type Foo {.importc: "Foo", byref.} = object` |
03:57:46 | FromDiscord | <Elegantbeef> Cant remember what was the issue with it, cant remember why `distinct pointer` was invalid for `importc` |
03:58:10 | FromDiscord | <Elegantbeef> It's an issue with distinct, which means i'm interested in fixing it, damn my affinity for distinct |
03:58:24 | FromDiscord | <Bubblie> In reply to @Elegantbeef "I use sdl2": Oh alright, I was wondering if there were any glfw bindings for nim as this would make dealing with vulkan a lot easier |
03:58:35 | FromDiscord | <Elegantbeef> The are glfw bindings of course |
03:58:39 | ehmry | I get confused by `byref`, because I'd rather not think about it |
03:58:42 | FromDiscord | <Elegantbeef> Nimgl has them |
03:58:52 | nrds | <Prestige99> beef how's that project going btw? |
03:58:59 | FromDiscord | <Elegantbeef> It's identical to what you wrote |
03:59:04 | FromDiscord | <Elegantbeef> What project? |
03:59:10 | FromDiscord | <Elegantbeef> Hoppy bird? |
03:59:13 | nrds | <Prestige99> Your game |
03:59:31 | FromDiscord | <Elegantbeef> Havent touched it much this is where i'm at |
03:59:37 | FromDiscord | <Elegantbeef> drop-2022-03-15\_16.45.01.mp4 [drop-2022-03-15_16.45.01.mp4](https://t2bot.io/_matrix/media/r0/download/matrix.org/GzSaSWMsexExosUsxlNlMAUf) |
03:59:59 | FromDiscord | <Bubblie> In reply to @Elegantbeef "Nimgl has them": oh so nimgl has them done already for me to use? |
03:59:59 | FromDiscord | <Elegantbeef> I was going to work on it, but some asshole mentioned a nimsuggest bug |
04:00:25 | nrds | <Prestige99> damn, what a dick :P |
04:00:37 | FromDiscord | <Elegantbeef> https://github.com/nimgl/nimgl/tree/309d6ed8164ad184ed5bbb171c9f3d9d1c11ff81/src/nimgl |
04:00:40 | nrds | <Prestige99> just blame it on whoever introduced the bug ;) |
04:00:52 | FromDiscord | <Bubblie> does nimgl use nim glfw bindings already made by someone else already they made their own |
04:00:53 | FromDiscord | <Elegantbeef> The fix was simple if you didnt see |
04:01:05 | nrds | <Prestige99> oh did you find a fix? |
04:01:18 | nrds | <Prestige99> https://github.com/nim-lang/Nim/pull/19624 nice thanks |
04:01:18 | FromDiscord | <Elegantbeef> The source is available bubblie you can use your eyeholes and look |
04:01:33 | FromDiscord | <Elegantbeef> Well it's a 'fix' it works around the issue that has appeared |
04:01:55 | FromDiscord | <Elegantbeef> The issue being `roota.base` points to a different type than `rootf.base` so they're not `==` but they're `sameType` |
04:01:57 | FromDiscord | <Bubblie> In reply to @Elegantbeef "The source is available": LOL |
04:02:10 | nrds | <Prestige99> Interesting |
04:02:20 | FromDiscord | <Elegantbeef> It's probably related to the fact nimsuggest does multiple compilations |
04:02:29 | FromDiscord | <Bubblie> yeah okay they use their own |
04:03:06 | FromDiscord | <Elegantbeef> If you think about it, nimsuggest compiles it once, it errors it reports the error then it compiles it again, as such the types are different. As to why exporting causes this i dont have a scoobie |
04:03:28 | FromDiscord | <Elegantbeef> The fix works and i think is more "correct" |
04:03:54 | FromDiscord | <Elegantbeef> we should not care if the types have the same pointer, we should only care if they're the same types |
04:04:33 | FromDiscord | <Elegantbeef> end of whatever the above is |
04:05:14 | nrds | <Prestige99> git blame and yell at someone |
04:05:34 | FromDiscord | <Elegantbeef> I dont know who caused it so i might aswell blame myself |
04:06:42 | nrds | <Prestige99> That's what `git blame` is for :P |
04:06:57 | FromDiscord | <Bubblie> time to spend hours making a fucking triangle lets go |
04:07:11 | FromDiscord | <Elegantbeef> Something between 1.4.8 and 1.6.0 caused this to appear and i have code there so why not me |
04:07:25 | FromDiscord | <Bubblie> what happened exactly if I may ask? |
04:07:28 | FromDiscord | <Elegantbeef> How does gitblame help, i dont even know what caused the issue |
04:07:37 | FromDiscord | <Bubblie> In reply to @Elegantbeef "drop-2022-03-15\_16.45.01.mp4 [drop-2022-03-15_16.4": also this game looks great |
04:07:58 | FromDiscord | <Elegantbeef> something causes a bug with nimsuggest on exported generic procedures |
04:07:59 | nrds | <Prestige99> Seems like that comparison is the issue |
04:08:17 | FromDiscord | <Elegantbeef> That comparison isnt new though |
04:08:42 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/wW5 |
04:08:45 | nrds | <Prestige99> Well, damn |
04:08:52 | nrds | <sorcerer99> yall should blame prestige, thats what i would |
04:08:59 | nrds | <Prestige99> Heh |
04:09:03 | FromDiscord | <Elegantbeef> i'd complain it couldnt find `doThing`, remove the export marker or explicitly call the proc with `[string]` it goes away |
04:09:07 | FromDiscord | <Elegantbeef> it'd |
04:09:10 | nrds | <sorcerer99> ;P |
04:09:10 | nrds | <Prestige99> I wonder if the other nimsuggest bug with base methods is unrelated... |
04:09:22 | FromDiscord | <Elegantbeef> It's possibly related |
04:09:35 | FromDiscord | <Elegantbeef> Got a link? |
04:09:48 | FromDiscord | <Elegantbeef> It better be an actual min repro this time |
04:09:51 | nrds | <Prestige99> I'm too tired tonight though, have brats cookin. Unless you want to open my existing project |
04:09:51 | FromDiscord | <Elegantbeef> If not i'll blame you |
04:09:55 | FromDiscord | <Bubblie> so this is a bug in nim right? |
04:09:58 | * | ltriant joined #nim |
04:10:09 | FromDiscord | <Elegantbeef> It's a bug in nimsuggest which by extension means nim |
04:10:20 | FromDiscord | <Bubblie> nimsuggest is an ide for nim right |
04:10:21 | FromDiscord | <Elegantbeef> Since nimsuggest is built on Nim |
04:10:38 | FromDiscord | <Bubblie> (edit) "is an" => "are" | "areide ... for" added "tools" |
04:10:48 | FromDiscord | <Elegantbeef> Nimsuggest is API for interacting with the compiler for ide tools |
04:10:48 | FromDiscord | <Elegantbeef> Yes |
04:11:11 | FromDiscord | <Elegantbeef> It basically uses the compiler as a library, though the compiler has some built in support |
04:11:28 | FromDiscord | <Elegantbeef> Like there are `when defined(nimsuggest)` |
04:11:40 | FromDiscord | <Bubblie> ah okay that's cool |
04:11:53 | FromDiscord | <Bubblie> is this a bug I should be concerned about? |
04:12:31 | FromDiscord | <Bubblie> if I were to use generics |
04:13:47 | FromDiscord | <Elegantbeef> if you were to use generics...? |
04:14:31 | FromDiscord | <Bubblie> I phrased that wrong |
04:15:12 | * | slowButPresent quit (Quit: leaving) |
04:16:23 | FromDiscord | <Bubblie> sent a code paste, see https://play.nim-lang.org/#ix=3SVg |
04:16:30 | FromDiscord | <Elegantbeef> nimsuggest has a false error the compiler doesnt |
04:17:07 | FromDiscord | <Bubblie> oh, so its just giving an error but the compiler isn't so it would still go through just giving you that false error in the process if you are using nimsuggest |
04:17:59 | FromDiscord | <Elegantbeef> Yes or any tooling built using nimsuggest(almost all) |
04:18:25 | FromDiscord | <Bubblie> got it |
04:19:08 | FromDiscord | <Elegantbeef> It'd be a pretty shitty state to have the above not compile on a language tagged 1.x.x |
04:20:25 | FromDiscord | <Elegantbeef> Even Go's generics can handle the above 😜 |
04:21:39 | FromDiscord | <Bubblie> Oh god |
04:21:40 | FromDiscord | <Bubblie> not go |
04:21:41 | FromDiscord | <Elegantbeef> If you do hit a compiler bug send it my way, if it's small enough and in sem i'll look into fixing it, they're fun to fix! |
04:21:53 | FromDiscord | <Bubblie> Alright, definitely will |
04:22:10 | FromDiscord | <Bubblie> but sometimes I am not sure if it is my idiotic code or the compiler, usually its my bad code |
04:22:15 | FromDiscord | <Elegantbeef> I really should start recording/streaming it for posterity |
04:22:40 | FromDiscord | <Bubblie> I think the mere mention of the go language is enough to send me spiraling, |
04:22:44 | FromDiscord | <Bubblie> (edit) "spiraling," => "spiraling" |
04:22:56 | FromDiscord | <Bubblie> out of all the languages that exist, I truly hate go the most |
04:23:34 | FromDiscord | <Bubblie> (edit) "usually its" => "almost always it's" |
04:24:51 | FromDiscord | <Bubblie> that gopher is evil |
04:25:50 | FromDiscord | <Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/954958922605789214/image.png |
04:25:54 | FromDiscord | <Elegantbeef> Something is more evil |
04:26:35 | FromDiscord | <Bubblie> I didn't know nim had an animal mascot |
04:26:40 | FromDiscord | <Bubblie> I thought it was just the crown |
04:26:51 | FromDiscord | <Elegantbeef> It doesnt |
04:26:57 | FromDiscord | <Elegantbeef> That was an unofficial mascot |
04:27:07 | FromDiscord | <Bubblie> ah okay |
04:27:37 | FromDiscord | <Bubblie> oh shit nimgl has imgui bindings?? |
04:27:39 | FromDiscord | <Bubblie> lets go |
04:28:59 | FromDiscord | <Bubblie> also does nimGL have support for the latest vulkan |
04:29:02 | FromDiscord | <Bubblie> that being 1.3 I think |
04:29:08 | FromDiscord | <Bubblie> cant find out if it does |
04:29:24 | FromDiscord | <Elegantbeef> Fuck if i know |
04:29:27 | FromDiscord | <Elegantbeef> I dont use nimgl |
04:29:40 | FromDiscord | <Bubblie> what do you use? |
04:29:53 | FromDiscord | <Bubblie> I thought you used nimgl this entire time LMAO |
04:30:04 | FromDiscord | <Elegantbeef> Dont recall atm |
04:30:11 | FromDiscord | <Bubblie> oh alright |
04:30:29 | FromDiscord | <Elegantbeef> I just use the `opengl` package it turns out |
04:30:36 | FromDiscord | <Elegantbeef> So https://github.com/nim-lang/opengl |
04:31:20 | FromDiscord | <Bubblie> oh thats the official wrapper? |
04:32:56 | FromDiscord | <Bubblie> cool |
04:41:14 | FromDiscord | <sheldon> nimble install error↵tables.nim(233) raiseKeyError↵Error: unhandled exception: key not found: url [KeyError] |
04:41:53 | FromDiscord | <Elegantbeef> What are you installing? |
04:56:21 | FromDiscord | <kiell> In reply to @Bubblie "that gopher is evil": why u hate the gopher man |
04:57:09 | FromDiscord | <Bubblie> I do not do well with Go |
04:57:26 | FromDiscord | <Bubblie> Go feels backwards in so many ways, I truly envy people who can get some joy out of it |
04:57:53 | FromDiscord | <Bubblie> if you can use Go and like it you are truly a different breed |
04:58:13 | FromDiscord | <kiell> i thought the error handling and stdlib were pretty neat |
04:58:39 | FromDiscord | <Bubblie> I don't want to be discouraging, if you like it please continue to use it |
04:58:40 | FromDiscord | <kiell> i stoppd using it as much though cause it felt like i was writing too much boilerplate code every time lol |
04:58:53 | FromDiscord | <kiell> oh na ur fine i was just curious |
05:01:13 | FromDiscord | <Bubblie> yeah I was typing out how in Go you have to write quite a lot of boilerplate at times, that too package management is absolute hell, function overloading as well is not a feature last time I remember, it just lacks a lot of fundamental and key parts a language should have |
05:03:03 | FromDiscord | <Bubblie> In reply to @kiell "oh na ur fine": ah okay, see I try not to be too negative about languages I dislike because I don't want to discourage others from using a language they enjoy I feel like thats the worst thing one can do, so I usually try to re assure that I don't want to discourage anyone from using a language they have grown to like. |
05:03:52 | FromDiscord | <Bubblie> I have many friends who enjoy JS, while I absolutely suffer using it, I also know someone who genuinely likes php which is like how but you know if they like it they like it |
05:03:52 | FromDiscord | <Elegantbeef> To late i've got my pitchfork and i'm picketing outsidie golang incorporated |
05:03:56 | FromDiscord | <Bubblie> LMAO |
05:04:04 | FromDiscord | <kiell> 💀 |
05:08:21 | FromDiscord | <kiell> but yea im not a die-hard go fan i just started learning it for fun after coming from python. it was nice to try something new with static typing that looked clean as python |
05:09:02 | FromDiscord | <kiell> now that i found nim i wish i learned it first lol it feels a lot better |
05:09:43 | FromDiscord | <Bubblie> LOL |
05:09:56 | FromDiscord | <Bubblie> I also wish I found nim sooner |
05:10:33 | FromDiscord | <Bubblie> Because, I was only aware of C++ and Rust, I never was aware nim existed as an alternative in a way to these two |
05:10:52 | FromDiscord | <Bubblie> C++ is annoying, Rust is just hard for me to read |
05:10:57 | FromDiscord | <Bubblie> So it was a struggle to use either |
05:11:53 | FromDiscord | <Bubblie> Then I just did some diving into more alternatives, I stumbled across crystal which is pretty much low level or native ruby |
05:12:00 | FromDiscord | <Bubblie> And was like “hmmm okay” |
05:12:16 | FromDiscord | <Bubblie> I do think crystal is nice |
05:12:32 | FromDiscord | <Bubblie> But then I found nim and was like 👀 |
05:13:23 | FromDiscord | <Bubblie> I also looked at zig, what immediately made me not use zig is because I couldnt have empty variables |
05:13:50 | FromDiscord | <Bubblie> Like, I cant have an un used var id need to set it equal to undefined |
05:13:54 | FromDiscord | <Bubblie> Which is incredibly stupid |
05:14:15 | FromDiscord | <Elegantbeef> zero init or default values is how to be |
05:14:35 | FromDiscord | <Elegantbeef> User defined defaults will be nice, especially for subrange types |
05:14:42 | FromDiscord | <Bubblie> Yes |
05:15:08 | FromDiscord | <kiell> i never heard of crystal or zig they look interesting 🤔 |
05:15:23 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3SVm |
05:15:36 | FromDiscord | <Elegantbeef> If you like Nim you'll probably like Odin more than Zig due to odin being pascal inspired so overlaps with Nim a bit |
05:16:12 | FromDiscord | <Bubblie> I never heard of odin |
05:16:14 | FromDiscord | <Elegantbeef> Nice bitsets, distinct types |
05:16:41 | FromDiscord | <Bubblie> sent a code paste, see https://play.nim-lang.org/#ix=3SVn |
05:16:42 | FromDiscord | <Bubblie> With the .. |
05:17:12 | FromDiscord | <kiell> i think so thats a slice right |
05:17:14 | FromDiscord | <Elegantbeef> It's a sub range type it limits the acceptable values to the range |
05:17:28 | FromDiscord | <kiell> oh i still have go brain lol |
05:17:38 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3SVo |
05:17:54 | FromDiscord | <Elegantbeef> Nim's slices are called openArrays and they cannot presently be held in a variable |
05:20:49 | FromDiscord | <Elegantbeef> Subrange types work for all numbers so you can use them with chars, enums, integers, floats. Quite lovely actually |
05:21:05 | FromDiscord | <Bubblie> sent a code paste, see https://play.nim-lang.org/#ix=3SVr |
05:21:32 | FromDiscord | <Elegantbeef> So if i see anyone of you write `# X can only be in range 0 and 1` instead of doing `myFloat: 0f..1f` i'm coming after you |
05:21:47 | FromDiscord | <Elegantbeef> Yea sub range types are checked for a given range |
05:22:08 | FromDiscord | <Bubblie> sent a code paste, see https://play.nim-lang.org/#ix=3SVs |
05:22:10 | FromDiscord | <Elegantbeef> Yes |
05:22:26 | FromDiscord | <Elegantbeef> Cause it should be defaulted to a valid value or error statically that it's un assigned |
05:22:52 | FromDiscord | <Elegantbeef> `a` should not be `== 0` but is presently due to zero initing in Nim |
05:24:20 | FromDiscord | <Bubblie> So, nim automatically sets it to 0 even though you defined the subrange? |
05:24:39 | FromDiscord | <Elegantbeef> Nim 0's all memory with very little exception |
05:25:31 | FromDiscord | <Bubblie> I see |
05:25:36 | FromDiscord | <Elegantbeef> Which is why i mentioned a user defined default feature |
05:25:46 | FromDiscord | <Elegantbeef> It'll make things like this much better for everyone |
05:25:50 | FromDiscord | <Bubblie> How would it look like in nim? |
05:25:54 | FromDiscord | <Bubblie> In reply to @Elegantbeef "It'll make things like": Also definitely |
05:27:17 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/fMc |
05:28:30 | FromDiscord | <Elegantbeef> Though that doesnt work with non objects |
05:28:41 | FromDiscord | <Bubblie> Yeah |
05:28:44 | FromDiscord | <Bubblie> Was just about to say |
05:28:59 | FromDiscord | <Elegantbeef> There's an rfc for it somewhere |
05:29:20 | FromDiscord | <Elegantbeef> https://github.com/nim-lang/RFCs/issues/252 |
05:31:20 | FromDiscord | <Bubblie> So im assuming this will be added at some point, hopefully soon |
05:31:22 | FromDiscord | <Bubblie> Right? |
05:31:34 | FromDiscord | <Elegantbeef> It's an accepted RFC |
05:32:12 | FromDiscord | <Bubblie> Ah cool |
05:47:13 | FromDiscord | <Bubblie> Is there a work around for possibly having a default? |
05:47:43 | FromDiscord | <Elegantbeef> What do you mean? |
05:49:42 | FromDiscord | <Bubblie> I phrased that badly again, so to work around the fact that user defined defaults havent been added yet, we would just need to check for 0 right |
05:49:59 | FromDiscord | <Elegantbeef> You initialize manually |
05:50:09 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3SVx |
05:50:20 | FromDiscord | <Elegantbeef> Or `var a = MyType.init()` |
05:50:23 | FromDiscord | <Bubblie> Oh, okay that makes more sense |
05:50:35 | FromDiscord | <xflywind> In reply to @Bubblie "So im assuming this": It is planned for Nim 2.0. |
05:50:52 | FromDiscord | <Bubblie> Isnt nim on 1.6.4 though |
05:51:17 | FromDiscord | <Elegantbeef> Yes? |
05:51:29 | FromDiscord | <Bubblie> 2.0 would be a long time I would assume right |
05:51:46 | FromDiscord | <xflywind> In reply to @flywind "It is planned for": And https://github.com/nim-lang/Nim/pull/12378 is related. |
05:55:04 | FromDiscord | <Bubblie> Holy shit its 2 am and I still havent gotten the triangle working |
05:55:10 | FromDiscord | <Bubblie> Vulkan be like |
05:55:19 | FromDiscord | <Bubblie> Might as well sleep |
05:56:14 | FromDiscord | <Equinox> Damn I mean the Vulcan triangle is like a thousand lines of C++ |
05:56:25 | FromDiscord | <Bubblie> yeah LMAOO |
05:57:11 | FromDiscord | <Bubblie> Nim makes shit way less verbose so its a gift, but reading this c++ code and also transfering it to nim code is a process, im also docing it |
05:57:19 | FromDiscord | <Bubblie> So its gonna take a bit |
05:57:40 | FromDiscord | <Bubblie> The reason the triangle render is so long is mostly due to how much it teaches you about vulkan |
05:58:02 | FromDiscord | <Bubblie> Its pretty much the fundamentals of how you will use it in your other renders, and it probably wont be to the same extent |
05:58:38 | FromDiscord | <Bubblie> Because, if you were to render something with that many lines per render it would be bat shit insane |
05:58:56 | FromDiscord | <Equinox> I’m sure most of it is just setting up the render pipeline so you only really have to write a lot of that stuff once |
05:59:30 | FromDiscord | <Bubblie> Pretty much |
06:00:01 | FromDiscord | <Bubblie> It is important to write it all out though because of course copying and pasting even the c++ code wont work |
06:00:28 | FromDiscord | <Bubblie> Also, for learning purposes its just better |
06:00:39 | FromDiscord | <Bubblie> Because you get a fundamental understanding of how it works |
06:00:39 | FromDiscord | <Equinox> In reply to @Bubblie "Also, for learning purposes": Yeah ofc |
06:01:00 | FromDiscord | <Equinox> I’ve been learning graphics programming with rust |
06:01:04 | FromDiscord | <Equinox> And wgpu |
06:09:04 | FromDiscord | <Bubblie> I have friends who use rust a lot |
06:09:11 | FromDiscord | <Bubblie> One of them is also using wgpu |
06:09:23 | FromDiscord | <Bubblie> Its pretty cool |
06:37:22 | * | neurocyte0917090 joined #nim |
06:40:43 | nrds | <Prestige99> oh I didn't realize the pure pragma was basically disabled for enums, the docs still say "An enum type can be marked as pure. Then access of its fields always requires full qualification." |
06:40:48 | nrds | <Prestige99> That's too bad |
06:41:10 | FromDiscord | <Elegantbeef> Overloadable enums are here now |
06:41:15 | FromDiscord | <Elegantbeef> And they're nicer |
06:41:25 | nrds | <Prestige99> What's that? |
06:42:05 | FromDiscord | <Elegantbeef> Type inference enabled on enums |
06:42:24 | FromDiscord | <Elegantbeef> So ambiguity is the only time you need `EnumName` |
06:42:48 | FromDiscord | <Elegantbeef> https://github.com/nim-lang/Nim/blob/06ff0e96249884f4ac6c49dadc96147be1c31097/tests/enum/toverloadable_enums.nim |
06:43:15 | nrds | <Prestige99> ah |
06:43:27 | nrds | <Prestige99> I just wanted to enforce the enum name prefix |
06:43:40 | FromDiscord | <Elegantbeef> Ah i hate you |
06:43:43 | nrds | <Prestige99> wonder if I can just write my own pragma that does what .pure. used to do |
06:44:16 | FromDiscord | <Elegantbeef> Nope |
06:44:34 | nrds | <Prestige99> no? |
06:45:23 | FromDiscord | <Elegantbeef> Something like the above is what you'd neeed |
06:45:25 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3SVE |
06:45:39 | FromDiscord | <Elegantbeef> Well how do you emit something that allows dot exprs from inside a typedef, you cant |
06:45:56 | FromDiscord | <Elegantbeef> I dont get the wanting to enforce prefix, always seems odd to me |
06:46:47 | nrds | <Prestige99> Too bad it was removed as even an option |
06:47:08 | FromDiscord | <Elegantbeef> Use pure and write it as such |
06:47:14 | nrds | <Prestige99> So before the pure pragma was just some compiler hoopla that I can't recreate without changing the compiler? |
06:47:32 | nrds | <Prestige99> I mean I don't even need to add .pure. to do that, but I want to enforce it |
06:47:41 | FromDiscord | <Elegantbeef> You might be able to do it with a term rewriting macro |
06:48:02 | * | ltriant quit (Ping timeout: 240 seconds) |
06:49:04 | nrds | <Prestige99> I know not of these things you speak |
06:50:03 | FromDiscord | <Elegantbeef> They're magic that uses pattern matching to replace Nim code, that are subject to be removed |
06:50:21 | nrds | <Prestige99> well damn |
06:53:23 | nrds | <Prestige99> maybe I'll have to build my own enum system with something like you mentioned :P |
06:55:10 | FromDiscord | <Elegantbeef> What are you doing anywho? |
06:56:45 | nrds | <Prestige99> Just trying to use enums how I want to |
06:56:57 | FromDiscord | <Elegantbeef> Wrongly 😜 |
06:58:01 | nrds | <Prestige99> Subjective |
06:58:07 | nrds | <Prestige99> But it's what I prefer |
06:59:25 | FromDiscord | <Elegantbeef> Well time to make an RFC |
06:59:31 | FromDiscord | <Elegantbeef> Just so i can downvote it 😛 |
07:00:20 | FromDiscord | <Elegantbeef> The biggest issue I see is that it pollutes the entire API |
07:00:34 | nrds | <Prestige99> How does it? |
07:00:40 | FromDiscord | <Elegantbeef> You enforce the enum everywhere to be accessed through a namespace, which many people dislike |
07:00:46 | NimEventer | New thread by RainbowAsteroids: Why doesn't echo have tag WriteIOEffect?, see https://forum.nim-lang.org/t/9024 |
07:01:00 | FromDiscord | <Elegantbeef> So if you make a library and you used it you're making people that view that as tedious nonsense write tedious nonsense |
07:01:43 | FromDiscord | <Elegantbeef> It doesnt just touch your code, it touches all the code that depends on yours which is why I dont like the premise of adding it |
07:02:08 | * | acidsys quit (Excess Flood) |
07:02:14 | nrds | <Prestige99> I dislike the inverse just the same |
07:02:24 | FromDiscord | <Elegantbeef> But the inverse isnt the same |
07:02:35 | FromDiscord | <Elegantbeef> You still can write `Direction.left` |
07:02:41 | * | acidsys joined #nim |
07:02:46 | FromDiscord | <Elegantbeef> And if you forget to it's kinda proof that you dont strongly hold to your conviction |
07:03:30 | nrds | <Prestige99> You want one thing and I want the opposite, is how the inverse is true |
07:03:56 | FromDiscord | <Elegantbeef> For it to make me happy it'd have to be a project setting that can be overridden on import |
07:03:59 | nrds | <Prestige99> And it doesn't matter if I understand my code, I need it to be readable to others |
07:04:18 | FromDiscord | <Elegantbeef> I mean the inverse is demonstrably not true though |
07:04:20 | nrds | <Prestige99> Like if I have a variable named `a` that doesn't help the reader much |
07:04:43 | FromDiscord | <Elegantbeef> Not enforcing namespace does not prevent you from using it |
07:04:51 | FromDiscord | <Elegantbeef> Enforcing namespaces prevents others from not using it |
07:05:00 | nrds | <Prestige99> Having it being a toggleable option would be fine with me |
07:05:06 | nrds | <Prestige99> But I want it enforceable in my projects |
07:05:28 | FromDiscord | <Elegantbeef> Well RFC it, though i doubt it'd be accepted |
07:05:42 | FromDiscord | <Elegantbeef> Nim programmers want less tedious enums not more tedious based off the overloadable enum response |
07:05:59 | nrds | <Prestige99> Probably not, although I did see dom and pmunch wanting the feature back when it was discussed |
07:06:20 | FromDiscord | <Elegantbeef> I still dont know the best way to toggle it on import |
07:06:41 | FromDiscord | <Elegantbeef> Dont even know if there would be a nice way |
07:07:46 | nrds | <Prestige99> If there were a `qualified` pragma and you could disable it with a flag that'd be nice, but idk anything about the compiler |
07:08:00 | FromDiscord | <Elegantbeef> Well the issue is that you cant do that both ways |
07:08:37 | nrds | <Prestige99> Wdym? |
07:08:41 | FromDiscord | <Elegantbeef> You can always make qualified a disabled flag, but you cant enable it unless it's only for the code within a project. No clue if nim tracks that |
07:09:32 | nrds | <Prestige99> Like it would be a problem if a dependency used it? Idk what your point is |
07:09:39 | FromDiscord | <Elegantbeef> Yes |
07:09:58 | FromDiscord | <Elegantbeef> If you import a module that uses unqualified but you're forcing qualified that's a compiler bug |
07:10:04 | FromDiscord | <Elegantbeef> Well error\: 😀 |
07:10:15 | nrds | <Prestige99> Ah I see what you mean |
07:10:22 | FromDiscord | <Elegantbeef> Dont know if Nim tracks project specific settings or even capable of it |
07:11:19 | FromDiscord | <Elegantbeef> Actually yea that gets hellish quickly |
07:11:57 | FromDiscord | <Elegantbeef> The same module is imported by two seperate files one that doesnt enforce it, but then one that enforces it |
07:12:39 | nrds | <Prestige99> Wouldn't that just make it enforced? |
07:12:55 | FromDiscord | <Elegantbeef> Except the module was already sem'd by the first file |
07:13:23 | FromDiscord | <Elegantbeef> So now you have a sem'd module that you need to enforce that it's qualified, and Nim doesnt track enums as `a.b` it converts them into `b` in the compiler |
07:14:17 | FromDiscord | <Elegantbeef> Atleast i think that'd be a fun hell |
07:14:29 | FromDiscord | <Elegantbeef> You could always recompile that module with the enforced flag if they differed |
07:14:35 | FromDiscord | <Elegantbeef> Who doesnt love more complex compilation! |
07:15:55 | nrds | <Prestige99> Or I can just write my own implementation of `enum` maybe |
07:16:08 | FromDiscord | <Elegantbeef> You dont even need your own implementation really |
07:16:34 | FromDiscord | <Elegantbeef> Make a enum then use exported `templates` like i showed above and you're done |
07:17:04 | FromDiscord | <Elegantbeef> You need a macro of course, but that's not too bad |
07:17:06 | nrds | <Prestige99> Hmm |
07:17:07 | * | ltriant joined #nim |
07:17:19 | FromDiscord | <Elegantbeef> was meaning to add enum support to micros, so this is a fine time to do it |
07:48:38 | FromDiscord | <Elegantbeef> prestige TIME! 😛 |
07:48:48 | nrds | <Prestige99> Eh? |
07:48:58 | FromDiscord | <Elegantbeef> This has shown me issues with my API https://github.com/beef331/micros/blob/master/tests/test1.nim#L238-L259 |
07:49:08 | FromDiscord | <Elegantbeef> But i wrapped the basic part of enums |
07:49:38 | nrds | <Prestige99> Nice! |
07:49:45 | FromDiscord | <Elegantbeef> Still have a lot to do for this library |
07:50:29 | FromDiscord | <Elegantbeef> Thought i was being smart with the identdef stuff i did but all it made me do was make it more complicated |
08:22:55 | FromDiscord | <Phil> motherducker, question into the round, does the compiler flag `--threads:on` generally not play nice with logging properly? |
08:23:21 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/logging.html#basic-usage-notes-when-using-multiple-threads |
08:23:50 | FromDiscord | <Phil> Shoooooot meeeeeeee |
08:28:23 | FromDiscord | <Elegantbeef> Dont read the docs they're only there to piss you off |
08:30:08 | FromDiscord | <Phil> In reply to @Elegantbeef "Dont read the docs": Look, I read through the docs, I just don't... keep all of their contents in my head or skim through parts of it... |
08:30:18 | FromDiscord | <Phil> (edit) "or" => "and" |
08:30:35 | FromDiscord | <Elegantbeef> Eh i was just joking no need to get defensive |
08:30:47 | FromDiscord | <Phil> Oh, sorry, that didn't translate well into text |
08:31:12 | FromDiscord | <Phil> Imagine the tone of someone being mildly embarassed and pulling up very weak defensive statements to at least give the appearance that they're defending their damaged honor. |
08:32:15 | FromDiscord | <Phil> I don't think there's an emoji that really expresses when you know you've been an idiot and put up a token defence |
08:32:36 | FromDiscord | <Elegantbeef> \:fuckwit\: |
08:32:37 | FromDiscord | <Elegantbeef> Hmmm nope there is none |
08:33:18 | FromDiscord | <Phil> Well, off to ask xflywind in prologue how to set the log level for all the threads |
08:33:25 | FromDiscord | <Phil> Since I think prologue is the one instantiating them |
08:33:36 | FromDiscord | <Elegantbeef> Have fun |
08:38:41 | FromDiscord | <tandy> can nimscript access non files in a nimble package? |
08:39:01 | FromDiscord | <Elegantbeef> What do you mean? |
08:39:17 | FromDiscord | <tandy> in my web project's nimble package i have the file sass/index.sass which i want to access from a nimble file |
08:39:33 | FromDiscord | <Elegantbeef> you should be able to |
08:39:49 | FromDiscord | <tandy> mb meant to say non nim files here |
08:39:54 | FromDiscord | <tandy> il try |
08:40:03 | FromDiscord | <Elegantbeef> `staticRead` should work |
08:40:11 | FromDiscord | <Elegantbeef> I could be wrong |
08:40:39 | FromDiscord | <Elegantbeef> The NimVM's list of support functions is an oddcase of "it depends" |
08:41:14 | FromDiscord | <tandy> thing is i dont need the actual file |
08:41:16 | FromDiscord | <tandy> just its path |
08:41:21 | FromDiscord | <tandy> so i can exec something on it |
08:41:41 | FromDiscord | <Elegantbeef> `listFiles` + `listDirs` |
09:01:42 | * | jjido joined #nim |
09:02:38 | * | Gustavo6046 quit (Read error: Connection reset by peer) |
09:35:44 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
09:37:20 | NimEventer | New thread by Mardiyah: Have C function static variable equivalent , see https://forum.nim-lang.org/t/9025 |
09:48:51 | NimEventer | New question by Philipp Doerner: Prologue -Webframework - How to set thread-local variables for logging when compiling with `--threads:on` flag?, see https://stackoverflow.com/questions/71545667/prologue-webframework-how-to-set-thread-local-variables-for-logging-when-comp |
09:57:02 | FromDiscord | <Phil> The above is just one of my self-answered questions |
09:57:24 | FromDiscord | <Phil> (edit) "The above is just one of my self-answered questions ... " added "(shoutout to xflywind for throwing the answer in my face pretty much)" |
10:19:54 | * | jjido joined #nim |
10:34:21 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
11:05:08 | * | jjido joined #nim |
11:08:19 | * | xet7 quit (Quit: Leaving) |
11:11:26 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
11:12:48 | * | xet7 joined #nim |
11:53:46 | * | xet7 quit (Quit: Leaving) |
13:02:45 | FromDiscord | <hmmm> yay I got the base36 decoder working, or basewhatever dececoder |
13:03:22 | FromDiscord | <hmmm> we can now have our own int(string,base) like python |
13:40:03 | * | nimdata joined #nim |
13:44:35 | * | nimdata quit (Ping timeout: 256 seconds) |
13:44:39 | FromDiscord | <Daan B> can anybody help me with debugging a mem leak? |
13:50:05 | FromDiscord | <planetis> btw 8bytes i think there are always leaked with stacktraces or smth |
13:55:26 | * | krux02 quit (Read error: Connection reset by peer) |
13:55:31 | * | krux02_ joined #nim |
13:57:21 | FromDiscord | <Rika> what leak |
14:25:08 | * | filip912 joined #nim |
14:25:12 | * | filip912 left #nim (#nim) |
14:30:51 | FromDiscord | <Aaron Lee> In reply to @hmmm "yay I got the": any github repo? |
14:34:39 | FromDiscord | <hmmm> not yet I might setup a gist later but it's just a nim version of stuff found on stackow for other langs |
14:39:54 | * | vicecea quit (Remote host closed the connection) |
14:40:25 | * | vicecea joined #nim |
14:41:31 | FromDiscord | <auxym> ARC question: what happens if I have a cyclic reference, but the objects involved in the cycle have a lifetime of the whole program so never need to get GC'd? |
14:41:38 | FromDiscord | <Shinyzenith> Does the include keyword execute the file i'm including too? |
14:42:31 | FromDiscord | <auxym> include works exactly like in C, it pastes the contents of the included file exactly where you tell it to |
14:44:33 | FromDiscord | <Shinyzenith> hmm Alright |
14:49:22 | FromDiscord | <Shinyzenith> I actually didn't want to use include, i was just using plain import but that threw errors all over about undeclared identifier and I read on a stackoverflfow post to try include |
14:49:24 | FromDiscord | <Shinyzenith> and it worked so |
14:49:26 | FromDiscord | <Shinyzenith> :Shrug: |
14:49:50 | FromDiscord | <auxym> better figure out why you have those errors... |
14:49:53 | FromDiscord | <Shinyzenith> and now when I try to include the same file in multiple nim files, the compiler complains that I already have them declared in another file which makes sense now that I know how include works |
14:50:32 | FromDiscord | <auxym> for import, you know you have to mark things with a `` so that they are accessible from the module importing them? |
14:50:37 | * | arkurious joined #nim |
14:51:33 | FromDiscord | <Shinyzenith> Oh ok so i just need to append at the end of all the type declarations? https://media.discordapp.net/attachments/371759389889003532/955116390807908402/unknown.png |
14:51:38 | FromDiscord | <demotomohiro> In default, procs, types, variables and etc are not exported. |
14:51:53 | FromDiscord | <Shinyzenith> In reply to @demotomohiro "In default, procs, types,": now it makes sense why my import statements were throwing errors |
14:52:14 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=3SXp |
14:53:21 | FromDiscord | <auxym> In reply to @Shinyzenith "Oh ok so i": yes, put the `` after the declared type name |
14:53:35 | FromDiscord | <Phil> I'm trying to comprehend renameHook and such but I'm not 100% if those are what I'm looking for |
14:55:38 | FromDiscord | <Shinyzenith> In reply to @auxym "yes, put the `*`": Alright! and for procs and templates, where should I put the ? |
14:55:58 | FromDiscord | <auxym> always after the (proc/template/type) name |
14:56:14 | FromDiscord | <Shinyzenith> Ok! |
14:56:28 | FromDiscord | <auxym> eg `proc foo(a, b: int): string = ...` |
14:56:41 | FromDiscord | <Shinyzenith> yep that works |
14:56:43 | FromDiscord | <Shinyzenith> thank you! |
14:57:37 | FromDiscord | <auxym> you also need to mark object fields with if you need to access them outside the module. that allows you to decide which fields of an object are part of the public API, or a private implementation detail |
14:59:06 | * | slowButPresent joined #nim |
14:59:49 | FromDiscord | <Phil> Turns out treeform is great and renameHook's actually do solve the problem |
14:59:57 | FromDiscord | <Phil> (edit) "renameHook's" => "renameHooks" |
15:01:35 | FromDiscord | <Shinyzenith> In reply to @auxym "you also need to": That was going to be my next question ahaha my server kept complaining that .backend didn't exist |
15:02:53 | FromDiscord | <Jakraes> Quick question, is there any difference between import and include? |
15:03:27 | FromDiscord | <Phil> import respects private/public variable stuff as import means "only grab the stuff from module A that's public" |
15:03:29 | FromDiscord | <Rika> include is literal copy paste |
15:03:32 | FromDiscord | <Phil> include is stabling two files together |
15:03:38 | FromDiscord | <Phil> (edit) "stabling" => "stapling" |
15:03:54 | FromDiscord | <Phil> (edit) "together" => "together, which means you have access to all the private variables within the included file" |
15:04:11 | FromDiscord | <Jakraes> Oh gotcha, so import only imports what's marked with a ? |
15:04:24 | FromDiscord | <Phil> pretty much, it's also not code duplication the same way include is |
15:05:10 | FromDiscord | <Phil> I think the usecase for include is mostly if you have something that should be a single module, but it's too much code for a single module, so you split it out into separate files that you include together into a single module and that's the module you import elsewhere for actual use |
15:05:22 | FromDiscord | <Phil> (edit) "module," => "file," |
15:07:07 | FromDiscord | <Jakraes> Oh nice, that's exactly that I was going for, too much code for one file so I decided to organize it a little bit |
15:07:12 | FromDiscord | <Jakraes> I might use include for that |
15:07:26 | * | Doraemon joined #nim |
15:09:53 | * | acidsys_ joined #nim |
15:11:45 | * | Onionhammer4 joined #nim |
15:12:03 | * | redj_ joined #nim |
15:12:04 | * | redj quit (Ping timeout: 240 seconds) |
15:12:05 | * | acidsys quit (Ping timeout: 240 seconds) |
15:12:05 | * | NeoCron quit (Ping timeout: 240 seconds) |
15:12:05 | * | cornfeedhobo quit (Read error: Connection reset by peer) |
15:13:02 | * | Onionhammer quit (Ping timeout: 240 seconds) |
15:13:02 | * | Onionhammer4 is now known as Onionhammer |
15:18:02 | FromDiscord | <Phil> @treeform I could hug you for your foresight of having renameHooks. |
15:18:45 | * | cornfeedhobo joined #nim |
15:27:22 | * | kayabaNerve_ joined #nim |
15:27:38 | * | cornfeedhobo quit (Ping timeout: 250 seconds) |
15:27:38 | * | kayabaNerve quit (Read error: Connection reset by peer) |
15:29:36 | * | Lord_Nightmare2 joined #nim |
15:30:19 | * | enyc quit (Ping timeout: 250 seconds) |
15:30:19 | * | Lord_Nightmare quit (Ping timeout: 250 seconds) |
15:30:25 | * | enyc_ joined #nim |
15:30:30 | * | NimEventer quit (Ping timeout: 250 seconds) |
15:30:39 | * | NimEventer joined #nim |
15:32:20 | * | Lord_Nightmare2 is now known as Lord_Nightmare |
15:35:23 | * | cornfeedhobo joined #nim |
15:36:44 | * | Lord_Nightmare quit (Remote host closed the connection) |
15:42:28 | * | Lord_Nightmare joined #nim |
15:43:08 | * | redj_ is now known as redj |
16:02:31 | FromDiscord | <d4rckh> is there any easy way of selecting elements from a start index to an end index from a sequence? |
16:05:13 | FromDiscord | <Equinox> In reply to @d4rckh "is there any easy": I’m not very good at nim but I think: seqname[start..end] |
16:08:54 | FromDiscord | <Phil> It's as you wrote Equinox, it gives you the entries from index start to end, including the indexes itself.↵I'm not sure if it does a copy on those or not though. |
16:09:46 | FromDiscord | <Phil> It does a copy for primitive types at least |
16:20:28 | FromDiscord | <demotomohiro> Both `dstSeq = srcSeq` and `dstSeq = srcSeq[0..^1]` copy `srcSeq`. |
16:22:17 | FromDiscord | <Phil> In reply to @demotomohiro "Both `dstSeq = srcSeq`": Out of curiosity, what would I do if I had a pretty large sequence and didn't want a copy? |
16:22:46 | FromDiscord | <Phil> Or is this where memory safety issues come into play and for the sake of my sanity I really should be doing copy? |
16:26:06 | FromDiscord | <demotomohiro> If you have a large seq and don't want to copy it, just don't copy it.↵If you are going to modify `srcSeq` but need to keep current state of `srcSeq`, you would need to copy it. |
16:26:52 | FromDiscord | <auxym> one trick I read from beef on here (yesterday I think)? https://nim-lang.org/docs/system.html#toOpenArray%2Cseq%5BT%5D%2Cint%2Cint |
16:28:26 | FromDiscord | <demotomohiro> There is also https://nim-lang.org/docs/system.html#shallowCopy,T,T and https://nim-lang.org/docs/system.html#shallow,seq%5BT%5D. |
16:32:56 | FromDiscord | <demotomohiro> Nim pass seq to procs without copying it. |
16:34:46 | FromDiscord | <d4rckh> In reply to @Equinox "I’m not very good": Thanks, it worked |
16:35:29 | FromDiscord | <d4rckh> I am currently developing my nim program on windows with a friend who uses linux |
16:35:39 | FromDiscord | <Equinox> In reply to @d4rckh "Thanks, it worked": Nice |
16:35:57 | FromDiscord | <d4rckh> We finally finished implementing threads but when he runs the program it throws a lot of errors about memory leaking |
16:36:12 | FromDiscord | <d4rckh> While for me (on windows) it runs completely fine |
16:37:31 | FromDiscord | <Daan B> Yes, also when I run it on a windows vm it also works fine. |
16:39:03 | FromDiscord | <Daan B> image.png https://media.discordapp.net/attachments/371759389889003532/955143443666063431/image.png |
16:43:19 | FromDiscord | <Daan B> image.png https://media.discordapp.net/attachments/371759389889003532/955144520373268560/image.png |
16:44:04 | FromDiscord | <d4rckh> https://github.com/d4rckh/vaf/blob/vaf-threads/src/vaf.nim#L156 |
16:44:06 | FromDiscord | <d4rckh> here is the code |
17:27:28 | FromDiscord | <Alea> I'm importing this object from another module but it shows error type for some reason https://media.discordapp.net/attachments/371759389889003532/955155630056964166/unknown.png |
17:27:38 | FromDiscord | <Alea> it doesn't show this for types imported from other modules |
17:27:41 | FromDiscord | <Alea> any clues why? |
17:28:56 | FromDiscord | <Alea> that same variable imported into other modules doesn't have this issue |
17:34:15 | FromDiscord | <demotomohiro> Is that type has export mark ''? |
17:35:47 | FromDiscord | <demotomohiro> Are there same identifier? It is almost impossible to help you without reading your code. |
17:43:59 | FromDiscord | <Alea> a reload ended up fixing |
17:44:10 | FromDiscord | <Alea> guess its just usual nim extension instability |
17:45:01 | FromDiscord | <Generic> make sure to setup a project file |
17:58:44 | FromDiscord | <Require Support> how to link static libraries in nim |
18:00:42 | FromDiscord | <Daan Breur> :\( |
18:01:24 | FromDiscord | <demotomohiro> - |
18:01:51 | FromDiscord | <demotomohiro> `--passL:-lmystaticlibrary` |
18:02:25 | FromDiscord | <demotomohiro> Use that compiler option |
18:05:29 | FromDiscord | <demotomohiro> `--passL`send a specified option to gcc. If you want to know more about link options: https://gcc.gnu.org/onlinedocs/gcc-11.2.0/gcc/Link-Options.html#Link-Options |
18:19:46 | FromDiscord | <Require Support> thanks |
18:40:20 | * | Doraemon quit (Quit: Leaving) |
18:42:09 | * | fowl quit (Quit: cya pals) |
18:44:03 | * | fowl joined #nim |
18:45:23 | * | fowl quit (Client Quit) |
18:45:40 | FromDiscord | <Daan Breur> In reply to @d4rckh "https://github.com/d4rckh/vaf/blob/vaf-threads/src/": ?????? |
18:45:51 | FromDiscord | <Daan Breur> (edit) "??????" => "? Whats wrong about this" |
18:45:59 | FromDiscord | <Daan Breur> windows works, linux not |
18:47:02 | * | fowl joined #nim |
20:30:41 | FromDiscord | <Phil> Hmmm |
20:31:02 | FromDiscord | <Phil> I'm trying to write what amounts to basically a generic delete API endpoint |
20:32:01 | FromDiscord | <Phil> So I have a proc that generates Prologue controller procs, but the error I'm getting is a bit beyond my understanding |
20:32:48 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=3T1i |
20:33:43 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=3T1j |
20:34:39 | FromDiscord | <Phil> Like, I'm pretty sure it prints out the complete AST of the function I generate above |
20:34:44 | FromDiscord | <Alea> In reply to @Generic "make sure to setup": What would a project file do to help this issue? (If you were talking to me) |
20:34:51 | FromDiscord | <huantian> Try noting the return type of the return proc to be Future[void]? |
20:35:08 | FromDiscord | <huantian> Actually hm |
20:35:24 | FromDiscord | <Phil> One is an "owned" Future[void], the other a Future[system.void] |
20:35:43 | FromDiscord | <Phil> I'm super out of my depth here, I haven't even touched nim's futures, though I assume they act like JS Promises as I've been repeatedly assured |
20:35:56 | FromDiscord | <Phil> I can't tell you what's the difference between a future and an owned future |
20:36:05 | FromDiscord | <Phil> Nor the difference between void and system.void |
20:36:36 | FromDiscord | <Alea> Ah gotta love nim's error messages :peepowtf: |
20:37:16 | FromDiscord | <huantian> void should be the same as system.void |
20:37:23 | FromDiscord | <huantian> I still have no idea what owner means |
20:37:30 | FromDiscord | <Phil> In reply to @Alea "Ah gotta love nim's": To be fair, I'm not necessarily doing anything simple there, it's a factory function to spit out functions that make use of generics |
20:38:02 | FromDiscord | <Alea> In reply to @Isofruit "To be fair, I'm": Eh, nim loves to spit our ridiculous errors even on simple issues |
20:38:06 | FromDiscord | <Phil> So if that scenario hasn't been covered I wouldn't be too surprised |
20:38:33 | FromDiscord | <Phil> In reply to @Alea "Eh, nim loves to": Hmmm fair |
20:39:41 | FromDiscord | <Phil> ~~I just want to generate controller procs because by god writing them is starting to get really fucking old~~ |
20:40:17 | FromDiscord | <Generic> In reply to @Alea "What would a project": then there's only a single nimsuggest instance which gets all the changes in all files |
20:40:51 | FromDiscord | <Generic> when you edit them |
20:46:16 | FromDiscord | <Alea> What do you need in the project file for that to work? |
20:49:58 | FromDiscord | <Phil> I feel tempted to do an alternate approach which is a massive template that writes an entire module of procs, hmmm |
20:55:41 | FromDiscord | <Generic> In reply to @Alea "What do you need": the project file is just your "main" Nim file you pass to the compiler when compiling the project |
20:56:49 | FromDiscord | <Generic> you need to edit the setting nim.project and add the file there |
21:00:10 | FromDiscord | <Phil> macros should be useable from within templates, right? |
21:01:20 | FromDiscord | <Generic> yes |
21:04:12 | * | enyc_ quit (Ping timeout: 240 seconds) |
21:05:51 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=3T1q |
21:08:04 | FromDiscord | <Phil> It explodes in the line of the "result" spot in `respDefault` .↵The macro appears to try and fetch `ctx` from the caller-context but can't appear to find it. Does this mean the macro looks for ctx in `genericArticleControllers.nim`, which it can't find because there's nothing there and the actual code is in `diaryEntryControllers.nim` ? |
21:08:33 | FromDiscord | <Phil> (edit) "?" => "?↵If that's the case how do I tell the respDefault macro to look for `ctx` in the place that calls the tempalte?" |
21:08:37 | FromDiscord | <Phil> (edit) "tempalte?" => "template?" |
21:08:45 | * | enyc joined #nim |
21:19:31 | * | zgasma quit (Remote host closed the connection) |
21:30:25 | FromDiscord | <Elegantbeef> `ctx {.inject.}: Context` |
21:30:52 | FromDiscord | <Elegantbeef> @Phil\: ^ |
21:32:14 | FromDiscord | <Phil> Does that go into the template? |
21:32:20 | FromDiscord | <Elegantbeef> Yes |
21:32:32 | FromDiscord | <Elegantbeef> Nim templates are hygenic in that they do not inject any symbols |
21:32:48 | FromDiscord | <Elegantbeef> Well they do not inject accessible symbols |
21:33:48 | FromDiscord | <Phil> Wait, right, I actually want the template to basically copy paste itself into a module and make all the procs defined inside it available |
21:34:22 | FromDiscord | <Elegantbeef> What i said will resolve that |
21:35:14 | FromDiscord | <Phil> Which lib was the inject pragma from again? macros? |
21:35:40 | FromDiscord | <Phil> Trying to figure out what I need to import |
21:36:17 | FromDiscord | <Elegantbeef> It's not from any |
21:36:25 | FromDiscord | <Elegantbeef> It's a compiler pragma |
21:37:59 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=3T1v |
21:38:12 | FromDiscord | <Elegantbeef> How are you using it? |
21:38:16 | FromDiscord | <Phil> same when I put that inject line inside the deleteEntryController proc |
21:38:23 | FromDiscord | <Elegantbeef> Yea you're using it wron |
21:38:46 | FromDiscord | <Phil> `genericArticleControllerProcs(DiaryEntry)` This is what I use in the actual controller modules |
21:38:52 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3T1w |
21:38:57 | FromDiscord | <Elegantbeef> It goes on the symbol you want to inject |
21:41:29 | FromDiscord | <Phil> Alright! That compiles the template!↵When I use it in `diaryEntryControllers.nim` and then import that module into another module `diaryEntryRoutes.nim` I don't appear to have access to a `deleteEntryController` proc though |
21:41:58 | FromDiscord | <Phil> Wait, no I'm dumb |
21:42:01 | FromDiscord | <Phil> I was importing from the wrong space |
21:42:03 | FromDiscord | <Elegantbeef> ok do yourself a favour and annotated the template `{.dirty.}` |
21:42:31 | FromDiscord | <Phil> Holy shit that actually all worked, just tested O.O |
21:42:34 | FromDiscord | <Elegantbeef> Dirty makes the template non hygienic as the name implies and would make all symbols available in scope |
21:42:35 | * | wyrd quit (Ping timeout: 240 seconds) |
21:42:38 | FromDiscord | <Elegantbeef> Nice |
21:43:05 | FromDiscord | <Phil> I'll likely throw 4-5 more procs into the template and have that be the "stock" set of controllers |
21:43:25 | FromDiscord | <Elegantbeef> Now the question i have to ask is why a template? |
21:43:41 | FromDiscord | <Phil> I originally wanted to write a proc that returns prologue controller procs |
21:44:05 | FromDiscord | <Phil> The error message I got back was something about how the proc it created was one with a Future instead of an owned future |
21:44:06 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3T1y |
21:44:13 | FromDiscord | <Elegantbeef> Why do you need a template for the above |
21:45:09 | FromDiscord | <Phil> Because the signature must be `proc someName(ctx: Context) {.async.} =`, prologue needs a proc with exactly that signature to pass it an incoming HTTP request |
21:45:16 | FromDiscord | <Phil> this is the proc that handles said HTTP request |
21:45:42 | FromDiscord | <Elegantbeef> This sounds wildly unsafe given that you're going to quickly create ambiguity |
21:46:34 | FromDiscord | <Phil> Otherwise I'm writing the same controller 15 times with the only difference being that I write "deleteEntry(entryId, DiaryEntry)", "deleteEntry(entryId, Location)", "deleteEntry(entryId, Character)" etc. |
21:47:06 | FromDiscord | <Elegantbeef> But the procs are named the same, so this is going to create ambiguity |
21:47:32 | FromDiscord | <Phil> different modules though, so I'd go `diaryEntryControllers.deleteEntry()` |
21:47:38 | FromDiscord | <Phil> (edit) "`diaryEntryControllers.deleteEntry()`" => "`diaryEntryControllers.deleteEntryController()`" |
21:47:59 | FromDiscord | <Elegantbeef> God i hate that, but ok |
21:48:09 | FromDiscord | <Phil> And controller modules are explicitly something you never ever import 2 of at the same time |
21:49:00 | FromDiscord | <Phil> I mean, I'll gladly take your advice for a generic proc that returns such a controller proc 😄 |
21:49:44 | FromDiscord | <Elegantbeef> You can have a proc that returns the given proc of course then you can just do `deleteEntryController(myType)(myContext)` |
21:49:44 | * | wyrd joined #nim |
21:49:57 | FromDiscord | <Elegantbeef> Then you dont ever have ambiguity and dispatch based off type instead of module |
21:50:36 | * | sagax joined #nim |
21:50:43 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=3T1A |
21:51:23 | FromDiscord | <Elegantbeef> async is a macro so you dont anotate it like that |
21:51:37 | FromDiscord | <Elegantbeef> i'd be a `iterator (): owned(FutureBase)` as the return type |
21:51:47 | FromDiscord | <Elegantbeef> You didnt annotate the return type with async |
21:51:51 | FromDiscord | <Elegantbeef> No clue if it works on proc ty |
21:54:27 | FromDiscord | <Elegantbeef> Eh yea nope i dont use async so dont know if you can make a proc generator for it |
21:55:04 | FromDiscord | <Phil> What the flying saucer |
21:55:10 | FromDiscord | <Phil> I think I found a solution (?) |
21:55:24 | FromDiscord | <Phil> Apparently prologue comes with its own type for these procs, it calls them `HandlerAsync` |
21:55:41 | FromDiscord | <Phil> So I can annotate with that and that already saves me the hassle of having to think if there goes a pragma somewhere |
21:56:19 | FromDiscord | <Phil> And... if I annotate with that type it just works.... |
21:56:20 | FromDiscord | <Phil> wtf |
21:56:32 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=3T1B |
21:57:03 | FromDiscord | <Phil> I have written the code |
21:57:09 | FromDiscord | <Phil> I do not understand why this in particular works |
21:57:35 | FromDiscord | <Phil> And I know it works, I made an HTTP request and this deleted it exactly as you'd expect |
21:58:22 | FromDiscord | <Phil> Given that this works, I'll likely stick with these factory procs (if you've got a better name I'll take it) |
21:59:47 | FromDiscord | <Elegantbeef> Naming shit like it's java |
22:00:12 | FromDiscord | <Phil> Yeh, the name makes no sense here, but "decorator" which I'd classify this normally as, fits even less |
22:00:28 | FromDiscord | <Elegantbeef> You know you can always make that proc an async then just await inside it? |
22:00:34 | FromDiscord | <Elegantbeef> Then you dont return anything |
22:00:58 | FromDiscord | <Elegantbeef> Unless you need to pass it somewhere i guess |
22:01:02 | FromDiscord | <Phil> You mean the inner controller proc? |
22:01:05 | FromDiscord | <Phil> I need to pass it somewhere |
22:01:10 | FromDiscord | <Phil> In the end it looks like this |
22:01:12 | FromDiscord | <Elegantbeef> Ah ok |
22:01:26 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=3T1E |
22:01:32 | FromDiscord | <Phil> app being the prologue server before you start it up |
22:01:47 | FromDiscord | <Elegantbeef> Jesus fucking christ that's java, you've written java |
22:02:49 | FromDiscord | <Elegantbeef> Dont need to use the module namespace anymore eh? |
22:03:13 | FromDiscord | <Phil> Strictly speaking no |
22:03:33 | FromDiscord | <Phil> I'll likely keep doing it though for clarity so I know where the hell I got these from |
22:04:22 | FromDiscord | <Phil> And yeah, some of it is heavily java inspired. I'm more or less starting to use modules similar to how java uses objects, just without fields |
22:04:28 | FromDiscord | <Phil> (edit) "And yeah, some of it is heavily java inspired. I'm more or less starting to use modules similar to how java uses objects, just without fields ... " added "within the modules" |
22:04:42 | FromDiscord | <Elegantbeef> Shame |
22:05:02 | FromDiscord | <Phil> In exchange I no longer have to write the really dumb stuff |
22:05:20 | FromDiscord | <Phil> Only have to define a proc that spits out handlers for a given model type |
22:05:28 | FromDiscord | <Phil> (edit) "handlers" => "controller-procs" |
22:06:01 | FromDiscord | <Phil> I'll take a simpler approach if you've got one 😛 |
22:06:29 | FromDiscord | <Elegantbeef> I'd say you should not do that mostly for modularity |
22:06:39 | * | sagax quit (Ping timeout: 256 seconds) |
22:06:49 | FromDiscord | <Elegantbeef> You cannot easily replace a module with another one with similar functionality, because the module names differ |
22:07:24 | FromDiscord | <Phil> You mean the name-spacing? Or the entire making factory procs for controllers? |
22:07:58 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3T1F |
22:08:22 | FromDiscord | <Elegantbeef> This way you can override the behaviour with just replacing the module with one that exposes a type `GenericArticle` and `deleteEntryControllerFactory` |
22:08:40 | FromDiscord | <Elegantbeef> Hard coding the module name really makes it hard to easily compose modules for whatever reason |
22:08:49 | FromDiscord | <Elegantbeef> Atleast that's my view |
22:09:48 | FromDiscord | <Elegantbeef> Then again I only use module namespace for removing ambiguity, so I could just be misguided 😛 |
22:09:50 | FromDiscord | <Phil> Ah, mostly regarding the name-spacing, I was curious for a second there whether that was directed in general against this hyper-generic approach which makes an entire controller-service-repository stack into on generic piece of code |
22:10:02 | FromDiscord | <Phil> (edit) "name-spacing, I" => "name-spacing then. ↵I" |
22:10:49 | FromDiscord | <Elegantbeef> It probably doesnt matter for this code i guess |
22:11:33 | FromDiscord | <Phil> Nah, it's a fair point, I might just remove it, I'm not 100% convinced of the usefullness anyway since strictly speaking a module where you declare routes only ever imports 1 controller module |
22:11:48 | FromDiscord | <Phil> or 2, if one of the modules is the one with the controller factory procs |
22:29:48 | * | ltriant quit (Ping timeout: 240 seconds) |
22:29:58 | * | ltriant joined #nim |
23:08:16 | * | Gustavo6046 joined #nim |
23:09:33 | * | Gustavo6046 quit (Remote host closed the connection) |
23:09:52 | * | Gustavo6046 joined #nim |
23:20:59 | * | xet7 joined #nim |
23:26:17 | pch | https://github.com/kinkinkijkin/nimsgp already have a beta release |
23:26:41 | pch | likely has a bug related to the nim type system being slightly aggravating at times |
23:27:09 | FromDiscord | <Elegantbeef> Where do y ou think the bug is? |
23:27:39 | pch | namely, all of the attachment vector buffer sizes might have to be the same size as the tripoint vector buffer size |
23:27:58 | pch | would be quick to fix but enh |
23:28:17 | FromDiscord | <Elegantbeef> That's the issue you ran into earlier right? |
23:28:32 | pch | yeah but now im not using generic attachments anymore |
23:28:48 | pch | but i dont remember what all i removed that was related to trying to make generic attachments work |
23:29:21 | FromDiscord | <Elegantbeef> Ah well if you ever want to make them work I can work through it since the code is visible now |
23:30:08 | pch | would be in the drawReadyElements functions in funcs2d and topdraw |
23:30:31 | pch | the library setup is very quickly getting a lot worse |
23:36:20 | pch | maybe not the best idea to be writing api reference while im up past twice my height in stress |
23:36:22 | FromDiscord | <Elegantbeef> So for `drawReadElements` you wanted to do what exactly? |
23:36:30 | pch | completely broked the professional styule |
23:36:32 | pch | uh |
23:36:59 | pch | it draws to buffer outbound using shader shad, after preparing attachments and data for it, and performing culling checks |
23:37:52 | pch | the current version, multielementbuffer is supposed to be able to be empty but is supposed to be a runtime operation culling check, not a crash |
23:38:03 | pch | it might be a crash rn |
23:38:24 | pch | and v2buffer and v3buffer types are supposed to be of arbitrary, unchecked length |
23:38:24 | FromDiscord | <Bubblie> In reply to @pch "https://github.com/kinkinkijkin/nimsgp already have": 👀 |
23:38:29 | FromDiscord | <Bubblie> This software rendering? |
23:38:41 | pch | yes |
23:38:58 | FromDiscord | <Elegantbeef> so make them `openArray[float32]` |
23:39:21 | pch | openarrays are slightly annoying to deal with in performance-critical situations but i might |
23:39:31 | FromDiscord | <Elegantbeef> How are they annoying? |
23:39:52 | FromDiscord | <Bubblie> Thats so awesome, see ive been trying to find actual proper reference on software rendering because people usually just use existing graphics apis rather than rendering from the software itself |
23:39:56 | pch | incur a very slight overhead that can end up meaning something if you're referencing a lot of them with a lot of elements |
23:39:57 | FromDiscord | <Elegantbeef> It's a pointer and length, you cant get much more efficient |
23:40:51 | FromDiscord | <Elegantbeef> Well you can also make a concept |
23:40:55 | pch | much prefer static arrays with unenforced lengths in this case |
23:41:15 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3T1X |
23:41:18 | FromDiscord | <Elegantbeef> Well then use the conceept |
23:41:42 | pch | huh, never seen this type before |
23:41:48 | pch | and never seen it in the docs |
23:41:53 | pch | new feature? |
23:42:00 | FromDiscord | <Elegantbeef> They're 'experimental' |
23:42:06 | FromDiscord | <Jakraes> Quick question, how can I pass arrays as arguments in a proc? |
23:42:10 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/manual_experimental.html#concepts |
23:42:17 | pch | do they exist in nim 1.4.2? that's the oldest version i have to care about rn |
23:42:23 | FromDiscord | <Elegantbeef> Yes |
23:42:40 | FromDiscord | <Elegantbeef> Ideally you use an openarray jakraes, what do you need though? |
23:43:09 | FromDiscord | <jfmonty2> Are concepts still going to be completely overhauled at some point, or is that no longer the plan? |
23:43:11 | FromDiscord | <Elegantbeef> `myArr: array[index, type]` is an alternative |
23:43:22 | FromDiscord | <Bubblie> I wonder if I should make a gui library in vulkan 👀 |
23:43:22 | FromDiscord | <Elegantbeef> They're still going to be changed eventually and already have been somewhat |
23:43:25 | FromDiscord | <Jakraes> I want to pass a 2 dimensional array in a proc, but without a specified size |
23:43:27 | FromDiscord | <Bubblie> There is a lack of those |
23:43:38 | FromDiscord | <Jakraes> The type is char |
23:43:58 | FromDiscord | <Jakraes> I tried using open arrays but it gave me an error for some reason |
23:44:14 | FromDiscord | <Bubblie> Also, I forked nimgl because I think bindings for vulkan 1.3 dont exist yet which isn’t an issue, but I might add them myself at some point if the nimgl team doesnt add them themselves |
23:44:14 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/09B |
23:44:20 | FromDiscord | <Elegantbeef> Yea nested openarrays dont make sense |
23:45:10 | FromDiscord | <Jakraes> Damn, well rip :/ |
23:45:13 | FromDiscord | <Bubblie> I think I might be interrupting the current convo mb 😅 |
23:45:34 | FromDiscord | <jfmonty2> I feel like multiple conversations going on is just a chatroom fact of life |
23:45:47 | FromDiscord | <Bubblie> Yeah |
23:46:10 | FromDiscord | <Bubblie> Wait so you can pass an array through a proc without a specified size? |
23:46:15 | FromDiscord | <Bubblie> (edit) "can" => "cant" |
23:46:26 | FromDiscord | <Jakraes> Actually, maybe I can try to mess around with using different files so I can import certain values |
23:47:23 | FromDiscord | <Bubblie> Well, you can get the size of an array from that existing array in nim right? |
23:47:51 | FromDiscord | <jfmonty2> Can't you declare a static generic and use that for the size of the array? |
23:48:07 | FromDiscord | <jfmonty2> like `proc[T: static int](array[int, T])` or whatever |
23:48:09 | FromDiscord | <Jakraes> I'm just gonna define the size as a variable and export it to another file |
23:48:32 | * | acidsys_ quit (Excess Flood) |
23:48:37 | FromDiscord | <Bubblie> In reply to @Jakraes "I'm just gonna define": I was thinking that |
23:49:05 | * | acidsys joined #nim |
23:49:19 | FromDiscord | <Jakraes> Yup, it works, nice |
23:50:08 | FromDiscord | <jfmonty2> like `proc[T: static int](a: array[T, int])` or whatever |
23:50:30 | FromDiscord | <Bubblie> That probably could work (I think) |
23:50:42 | FromDiscord | <Bubblie> is there any networking libraries for nim |
23:50:43 | FromDiscord | <Bubblie> btw |
23:51:18 | FromDiscord | <Jakraes> Yup |
23:51:18 | FromDiscord | <Jakraes> https://github.com/treeform/netty |
23:51:21 | FromDiscord | <Bubblie> 👀 |
23:51:23 | FromDiscord | <Bubblie> lets go |
23:51:25 | FromDiscord | <Bubblie> thank you |
23:51:29 | FromDiscord | <Jakraes> Np homie |
23:52:34 | FromDiscord | <Bubblie> Since a networking library exists, this may make it easy to make a multiplayer space ship game example in vulkan after I finish this triangle one |
23:53:02 | FromDiscord | <Bubblie> vulkan triangle hell |