<< 20-03-2022 >>

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:18FromDiscord<Alea> when doing ``for index, item in X`` are the index item keywords, or can they be anything?
01:41:33FromDiscord<ajusa> sent a code paste, see https://play.nim-lang.org/#ix=3SUU
01:41:46FromDiscord<ajusa> In reply to @Alea "when doing ``for index,": they can be anything
01:42:10FromDiscord<ynfle> Is there a way to access the folder that was originally compiled from when using `nim r`?
01:42:58FromDiscord<Elegantbeef> `getCurrentDir`?
01:43:09FromDiscord<Elegantbeef> The source dir isnt apart of the binary
01:43:42FromDiscord<Elegantbeef> You could make `items: ref Scheme` but yea need atleast a reference↵(@ajusa)
01:44:14FromDiscord<ajusa> Gotcha, thanks for confirming! trying to make (yet another) open API generator
01:44:40FromDiscord<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:45FromDiscord<Alea> In reply to @ajusa "they can be anything": will it always be index first then item?
01:45:14FromDiscord<ajusa> In reply to @Alea "will it always be": yes, as far as I am aware. eg, `for i, x in seq`
01:46:34FromDiscord<ynfle> In reply to @Elegantbeef "`getCurrentDir`?": That worked thanks
01:47:03FromDiscord<Elegantbeef> Yes the left hand of `in` with a for loop are for vars and can be any valid identifier
01:47:50FromDiscord<ajusa> any pretty printing libraries that work with table? treeform's seems to print out the internal structure for a table
01:49:56FromDiscord<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:50FromDiscord<Bubblie> Does nim have tools for strings regarding counting the number of chars and spaces?
01:55:23FromDiscord<Elegantbeef> Unicode aware or only ascii?
01:55:45FromDiscord<Bubblie> Either
01:56:26FromDiscord<Elegantbeef> `import std/strutils; myString.count({'A'..'Z', 'a'..'z'})`
01:56:39FromDiscord<Bubblie> Oooooo
01:56:43FromDiscord<Elegantbeef> count takes a `set[char]` so you can count whatever characters you want easily
01:56:53FromDiscord<Bubblie> Awesome
01:57:01FromDiscord<Elegantbeef> Strutils also defines a few sets you can use
01:57:08FromDiscord<Elegantbeef> https://nim-lang.org/docs/strutils.html#10
02:06:59FromDiscord<Bubblie> What does assert do in nim again exactly?
02:07:11FromDiscord<Bubblie> Checks for true and false right?
02:07:14FromDiscord<Elegantbeef> it's a runtime check that only happens in debug code
02:07:30FromDiscord<Bubblie> But why not use an if statement
02:07:33FromDiscord<Elegantbeef> Yes if the right hand is false it errors
02:07:45FromDiscord<Elegantbeef> Cause it's meant for ensuring bad things dont happen
02:08:07FromDiscord<Elegantbeef> You have your safety in debug but then in release you dont need it so it removes the expensive checks
02:16:04FromDiscord<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:31FromDiscord<ynfle> It's automatically imported
02:16:32FromDiscord<Elegantbeef> `import system/dyncalls`
02:18:18FromDiscord<ynfle> Beef, nothing is exported from there
02:18:26FromDiscord<ynfle> As far as I can tell
02:18:29FromDiscord<Elegantbeef> Then include it
02:19:01FromDiscord<ynfle> That's what system.nim does
02:20:00FromDiscord<Elegantbeef> That doesnt change anything
02:21:49FromDiscord<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:46FromDiscord<gibson> Specifically, importing dyncalls wants `LibHandle` to be defined, which is in `pure/dynlib`.
02:23:51FromDiscord<Elegantbeef> Yea i dont know what to say it's written in such a way it expects to be inside system
02:26:19FromDiscord<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:38FromDiscord<gibson> Thanks.
02:27:06FromDiscord<Bubblie> How do I use nim in html, would I have to compile nim to js first
02:27:09FromDiscord<Bubblie> How would it work
02:28:06FromDiscord<Bubblie> I am thinking whether I should use nim for something web based
02:28:11FromDiscord<Bubblie> Compared to js or ts
02:28:19FromDiscord<Bubblie> For front end
02:28:34FromDiscord<Elegantbeef> `nim js` then just use the js file
02:29:02FromDiscord<Bubblie> Oh
02:29:08FromDiscord<Bubblie> Thats actually very neat
02:29:24FromDiscord<Bubblie> Also I heard of karax
02:29:28FromDiscord<Bubblie> Seems cool as well
02:31:20FromDiscord<Bubblie> I kinda hate js so nim may come in handy
02:31:54FromDiscord<Bubblie> Or I might use wasm
02:40:23FromDiscord<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:37FromDiscord<Elegantbeef> Perhaps you should
03:15:20*ltriant joined #nim
03:19:19*Figworm quit (Quit: Figworm)
03:31:53FromDiscord<Bubblie> When im using c++ library with pointers, do I need to use nim pointers to use those variables?
03:32:33FromDiscord<Bubblie> (edit) "library" => "header"
03:34:29FromDiscord<Bubblie> Also to use a header would I also do .compile: “hello.h”
03:35:04FromDiscord<Elegantbeef> That'd just compile the header it doesnt expose any code to you
03:35:34FromDiscord<Elegantbeef> You'd need to import it somehow be it manually, c2nim, futhark what have you
03:36:39FromDiscord<Bubblie> Is there anything on manually importing
03:37:04FromDiscord<Elegantbeef> https://nim-lang.org/docs/manual.html#foreign-function-interface-importc-pragma
03:38:03FromDiscord<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:23FromDiscord<Bubblie> 👀
03:41:39*ltriant quit (Ping timeout: 256 seconds)
03:42:02*arkurious quit (Quit: Leaving)
03:42:02FromDiscord<Bubblie> For nim vulkan, it seems to just be statically linking against the dll for vulkan
03:42:14FromDiscord<Bubblie> Or dylib
03:42:22FromDiscord<Bubblie> Or of course so for linux
03:45:25ehmryBubblie: 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:06ehmry`distinct pointer` is pretty useful
03:46:20FromDiscord<Bubblie> Nice
03:55:28FromDiscord<Bubblie> For those who use nim opengl, do you use glfw nim bindings for it?
03:56:05FromDiscord<Elegantbeef> I use sdl2
03:57:08FromDiscord<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:46FromDiscord<Elegantbeef> Cant remember what was the issue with it, cant remember why `distinct pointer` was invalid for `importc`
03:58:10FromDiscord<Elegantbeef> It's an issue with distinct, which means i'm interested in fixing it, damn my affinity for distinct
03:58:24FromDiscord<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:35FromDiscord<Elegantbeef> The are glfw bindings of course
03:58:39ehmryI get confused by `byref`, because I'd rather not think about it
03:58:42FromDiscord<Elegantbeef> Nimgl has them
03:58:52nrds<Prestige99> beef how's that project going btw?
03:58:59FromDiscord<Elegantbeef> It's identical to what you wrote
03:59:04FromDiscord<Elegantbeef> What project?
03:59:10FromDiscord<Elegantbeef> Hoppy bird?
03:59:13nrds<Prestige99> Your game
03:59:31FromDiscord<Elegantbeef> Havent touched it much this is where i'm at
03:59:37FromDiscord<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:59FromDiscord<Bubblie> In reply to @Elegantbeef "Nimgl has them": oh so nimgl has them done already for me to use?
03:59:59FromDiscord<Elegantbeef> I was going to work on it, but some asshole mentioned a nimsuggest bug
04:00:25nrds<Prestige99> damn, what a dick :P
04:00:37FromDiscord<Elegantbeef> https://github.com/nimgl/nimgl/tree/309d6ed8164ad184ed5bbb171c9f3d9d1c11ff81/src/nimgl
04:00:40nrds<Prestige99> just blame it on whoever introduced the bug ;)
04:00:52FromDiscord<Bubblie> does nimgl use nim glfw bindings already made by someone else already they made their own
04:00:53FromDiscord<Elegantbeef> The fix was simple if you didnt see
04:01:05nrds<Prestige99> oh did you find a fix?
04:01:18nrds<Prestige99> https://github.com/nim-lang/Nim/pull/19624 nice thanks
04:01:18FromDiscord<Elegantbeef> The source is available bubblie you can use your eyeholes and look
04:01:33FromDiscord<Elegantbeef> Well it's a 'fix' it works around the issue that has appeared
04:01:55FromDiscord<Elegantbeef> The issue being `roota.base` points to a different type than `rootf.base` so they're not `==` but they're `sameType`
04:01:57FromDiscord<Bubblie> In reply to @Elegantbeef "The source is available": LOL
04:02:10nrds<Prestige99> Interesting
04:02:20FromDiscord<Elegantbeef> It's probably related to the fact nimsuggest does multiple compilations
04:02:29FromDiscord<Bubblie> yeah okay they use their own
04:03:06FromDiscord<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:28FromDiscord<Elegantbeef> The fix works and i think is more "correct"
04:03:54FromDiscord<Elegantbeef> we should not care if the types have the same pointer, we should only care if they're the same types
04:04:33FromDiscord<Elegantbeef> end of whatever the above is
04:05:14nrds<Prestige99> git blame and yell at someone
04:05:34FromDiscord<Elegantbeef> I dont know who caused it so i might aswell blame myself
04:06:42nrds<Prestige99> That's what `git blame` is for :P
04:06:57FromDiscord<Bubblie> time to spend hours making a fucking triangle lets go
04:07:11FromDiscord<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:25FromDiscord<Bubblie> what happened exactly if I may ask?
04:07:28FromDiscord<Elegantbeef> How does gitblame help, i dont even know what caused the issue
04:07:37FromDiscord<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:58FromDiscord<Elegantbeef> something causes a bug with nimsuggest on exported generic procedures
04:07:59nrds<Prestige99> Seems like that comparison is the issue
04:08:17FromDiscord<Elegantbeef> That comparison isnt new though
04:08:42FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/wW5
04:08:45nrds<Prestige99> Well, damn
04:08:52nrds<sorcerer99> yall should blame prestige, thats what i would
04:08:59nrds<Prestige99> Heh
04:09:03FromDiscord<Elegantbeef> i'd complain it couldnt find `doThing`, remove the export marker or explicitly call the proc with `[string]` it goes away
04:09:07FromDiscord<Elegantbeef> it'd
04:09:10nrds<sorcerer99> ;P
04:09:10nrds<Prestige99> I wonder if the other nimsuggest bug with base methods is unrelated...
04:09:22FromDiscord<Elegantbeef> It's possibly related
04:09:35FromDiscord<Elegantbeef> Got a link?
04:09:48FromDiscord<Elegantbeef> It better be an actual min repro this time
04:09:51nrds<Prestige99> I'm too tired tonight though, have brats cookin. Unless you want to open my existing project
04:09:51FromDiscord<Elegantbeef> If not i'll blame you
04:09:55FromDiscord<Bubblie> so this is a bug in nim right?
04:09:58*ltriant joined #nim
04:10:09FromDiscord<Elegantbeef> It's a bug in nimsuggest which by extension means nim
04:10:20FromDiscord<Bubblie> nimsuggest is an ide for nim right
04:10:21FromDiscord<Elegantbeef> Since nimsuggest is built on Nim
04:10:38FromDiscord<Bubblie> (edit) "is an" => "are" | "areide ... for" added "tools"
04:10:48FromDiscord<Elegantbeef> Nimsuggest is API for interacting with the compiler for ide tools
04:10:48FromDiscord<Elegantbeef> Yes
04:11:11FromDiscord<Elegantbeef> It basically uses the compiler as a library, though the compiler has some built in support
04:11:28FromDiscord<Elegantbeef> Like there are `when defined(nimsuggest)`
04:11:40FromDiscord<Bubblie> ah okay that's cool
04:11:53FromDiscord<Bubblie> is this a bug I should be concerned about?
04:12:31FromDiscord<Bubblie> if I were to use generics
04:13:47FromDiscord<Elegantbeef> if you were to use generics...?
04:14:31FromDiscord<Bubblie> I phrased that wrong
04:15:12*slowButPresent quit (Quit: leaving)
04:16:23FromDiscord<Bubblie> sent a code paste, see https://play.nim-lang.org/#ix=3SVg
04:16:30FromDiscord<Elegantbeef> nimsuggest has a false error the compiler doesnt
04:17:07FromDiscord<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:59FromDiscord<Elegantbeef> Yes or any tooling built using nimsuggest(almost all)
04:18:25FromDiscord<Bubblie> got it
04:19:08FromDiscord<Elegantbeef> It'd be a pretty shitty state to have the above not compile on a language tagged 1.x.x
04:20:25FromDiscord<Elegantbeef> Even Go's generics can handle the above 😜
04:21:39FromDiscord<Bubblie> Oh god
04:21:40FromDiscord<Bubblie> not go
04:21:41FromDiscord<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:53FromDiscord<Bubblie> Alright, definitely will
04:22:10FromDiscord<Bubblie> but sometimes I am not sure if it is my idiotic code or the compiler, usually its my bad code
04:22:15FromDiscord<Elegantbeef> I really should start recording/streaming it for posterity
04:22:40FromDiscord<Bubblie> I think the mere mention of the go language is enough to send me spiraling,
04:22:44FromDiscord<Bubblie> (edit) "spiraling," => "spiraling"
04:22:56FromDiscord<Bubblie> out of all the languages that exist, I truly hate go the most
04:23:34FromDiscord<Bubblie> (edit) "usually its" => "almost always it's"
04:24:51FromDiscord<Bubblie> that gopher is evil
04:25:50FromDiscord<Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/954958922605789214/image.png
04:25:54FromDiscord<Elegantbeef> Something is more evil
04:26:35FromDiscord<Bubblie> I didn't know nim had an animal mascot
04:26:40FromDiscord<Bubblie> I thought it was just the crown
04:26:51FromDiscord<Elegantbeef> It doesnt
04:26:57FromDiscord<Elegantbeef> That was an unofficial mascot
04:27:07FromDiscord<Bubblie> ah okay
04:27:37FromDiscord<Bubblie> oh shit nimgl has imgui bindings??
04:27:39FromDiscord<Bubblie> lets go
04:28:59FromDiscord<Bubblie> also does nimGL have support for the latest vulkan
04:29:02FromDiscord<Bubblie> that being 1.3 I think
04:29:08FromDiscord<Bubblie> cant find out if it does
04:29:24FromDiscord<Elegantbeef> Fuck if i know
04:29:27FromDiscord<Elegantbeef> I dont use nimgl
04:29:40FromDiscord<Bubblie> what do you use?
04:29:53FromDiscord<Bubblie> I thought you used nimgl this entire time LMAO
04:30:04FromDiscord<Elegantbeef> Dont recall atm
04:30:11FromDiscord<Bubblie> oh alright
04:30:29FromDiscord<Elegantbeef> I just use the `opengl` package it turns out
04:30:36FromDiscord<Elegantbeef> So https://github.com/nim-lang/opengl
04:31:20FromDiscord<Bubblie> oh thats the official wrapper?
04:32:56FromDiscord<Bubblie> cool
04:41:14FromDiscord<sheldon> nimble install error↵tables.nim(233) raiseKeyError↵Error: unhandled exception: key not found: url [KeyError]
04:41:53FromDiscord<Elegantbeef> What are you installing?
04:56:21FromDiscord<kiell> In reply to @Bubblie "that gopher is evil": why u hate the gopher man
04:57:09FromDiscord<Bubblie> I do not do well with Go
04:57:26FromDiscord<Bubblie> Go feels backwards in so many ways, I truly envy people who can get some joy out of it
04:57:53FromDiscord<Bubblie> if you can use Go and like it you are truly a different breed
04:58:13FromDiscord<kiell> i thought the error handling and stdlib were pretty neat
04:58:39FromDiscord<Bubblie> I don't want to be discouraging, if you like it please continue to use it
04:58:40FromDiscord<kiell> i stoppd using it as much though cause it felt like i was writing too much boilerplate code every time lol
04:58:53FromDiscord<kiell> oh na ur fine i was just curious
05:01:13FromDiscord<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:03FromDiscord<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:52FromDiscord<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:52FromDiscord<Elegantbeef> To late i've got my pitchfork and i'm picketing outsidie golang incorporated
05:03:56FromDiscord<Bubblie> LMAO
05:04:04FromDiscord<kiell> 💀
05:08:21FromDiscord<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:02FromDiscord<kiell> now that i found nim i wish i learned it first lol it feels a lot better
05:09:43FromDiscord<Bubblie> LOL
05:09:56FromDiscord<Bubblie> I also wish I found nim sooner
05:10:33FromDiscord<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:52FromDiscord<Bubblie> C++ is annoying, Rust is just hard for me to read
05:10:57FromDiscord<Bubblie> So it was a struggle to use either
05:11:53FromDiscord<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:00FromDiscord<Bubblie> And was like “hmmm okay”
05:12:16FromDiscord<Bubblie> I do think crystal is nice
05:12:32FromDiscord<Bubblie> But then I found nim and was like 👀
05:13:23FromDiscord<Bubblie> I also looked at zig, what immediately made me not use zig is because I couldnt have empty variables
05:13:50FromDiscord<Bubblie> Like, I cant have an un used var id need to set it equal to undefined
05:13:54FromDiscord<Bubblie> Which is incredibly stupid
05:14:15FromDiscord<Elegantbeef> zero init or default values is how to be
05:14:35FromDiscord<Elegantbeef> User defined defaults will be nice, especially for subrange types
05:14:42FromDiscord<Bubblie> Yes
05:15:08FromDiscord<kiell> i never heard of crystal or zig they look interesting 🤔
05:15:23FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3SVm
05:15:36FromDiscord<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:12FromDiscord<Bubblie> I never heard of odin
05:16:14FromDiscord<Elegantbeef> Nice bitsets, distinct types
05:16:41FromDiscord<Bubblie> sent a code paste, see https://play.nim-lang.org/#ix=3SVn
05:16:42FromDiscord<Bubblie> With the ..
05:17:12FromDiscord<kiell> i think so thats a slice right
05:17:14FromDiscord<Elegantbeef> It's a sub range type it limits the acceptable values to the range
05:17:28FromDiscord<kiell> oh i still have go brain lol
05:17:38FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3SVo
05:17:54FromDiscord<Elegantbeef> Nim's slices are called openArrays and they cannot presently be held in a variable
05:20:49FromDiscord<Elegantbeef> Subrange types work for all numbers so you can use them with chars, enums, integers, floats. Quite lovely actually
05:21:05FromDiscord<Bubblie> sent a code paste, see https://play.nim-lang.org/#ix=3SVr
05:21:32FromDiscord<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:47FromDiscord<Elegantbeef> Yea sub range types are checked for a given range
05:22:08FromDiscord<Bubblie> sent a code paste, see https://play.nim-lang.org/#ix=3SVs
05:22:10FromDiscord<Elegantbeef> Yes
05:22:26FromDiscord<Elegantbeef> Cause it should be defaulted to a valid value or error statically that it's un assigned
05:22:52FromDiscord<Elegantbeef> `a` should not be `== 0` but is presently due to zero initing in Nim
05:24:20FromDiscord<Bubblie> So, nim automatically sets it to 0 even though you defined the subrange?
05:24:39FromDiscord<Elegantbeef> Nim 0's all memory with very little exception
05:25:31FromDiscord<Bubblie> I see
05:25:36FromDiscord<Elegantbeef> Which is why i mentioned a user defined default feature
05:25:46FromDiscord<Elegantbeef> It'll make things like this much better for everyone
05:25:50FromDiscord<Bubblie> How would it look like in nim?
05:25:54FromDiscord<Bubblie> In reply to @Elegantbeef "It'll make things like": Also definitely
05:27:17FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/fMc
05:28:30FromDiscord<Elegantbeef> Though that doesnt work with non objects
05:28:41FromDiscord<Bubblie> Yeah
05:28:44FromDiscord<Bubblie> Was just about to say
05:28:59FromDiscord<Elegantbeef> There's an rfc for it somewhere
05:29:20FromDiscord<Elegantbeef> https://github.com/nim-lang/RFCs/issues/252
05:31:20FromDiscord<Bubblie> So im assuming this will be added at some point, hopefully soon
05:31:22FromDiscord<Bubblie> Right?
05:31:34FromDiscord<Elegantbeef> It's an accepted RFC
05:32:12FromDiscord<Bubblie> Ah cool
05:47:13FromDiscord<Bubblie> Is there a work around for possibly having a default?
05:47:43FromDiscord<Elegantbeef> What do you mean?
05:49:42FromDiscord<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:59FromDiscord<Elegantbeef> You initialize manually
05:50:09FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3SVx
05:50:20FromDiscord<Elegantbeef> Or `var a = MyType.init()`
05:50:23FromDiscord<Bubblie> Oh, okay that makes more sense
05:50:35FromDiscord<xflywind> In reply to @Bubblie "So im assuming this": It is planned for Nim 2.0.
05:50:52FromDiscord<Bubblie> Isnt nim on 1.6.4 though
05:51:17FromDiscord<Elegantbeef> Yes?
05:51:29FromDiscord<Bubblie> 2.0 would be a long time I would assume right
05:51:46FromDiscord<xflywind> In reply to @flywind "It is planned for": And https://github.com/nim-lang/Nim/pull/12378 is related.
05:55:04FromDiscord<Bubblie> Holy shit its 2 am and I still havent gotten the triangle working
05:55:10FromDiscord<Bubblie> Vulkan be like
05:55:19FromDiscord<Bubblie> Might as well sleep
05:56:14FromDiscord<Equinox> Damn I mean the Vulcan triangle is like a thousand lines of C++
05:56:25FromDiscord<Bubblie> yeah LMAOO
05:57:11FromDiscord<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:19FromDiscord<Bubblie> So its gonna take a bit
05:57:40FromDiscord<Bubblie> The reason the triangle render is so long is mostly due to how much it teaches you about vulkan
05:58:02FromDiscord<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:38FromDiscord<Bubblie> Because, if you were to render something with that many lines per render it would be bat shit insane
05:58:56FromDiscord<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:30FromDiscord<Bubblie> Pretty much
06:00:01FromDiscord<Bubblie> It is important to write it all out though because of course copying and pasting even the c++ code wont work
06:00:28FromDiscord<Bubblie> Also, for learning purposes its just better
06:00:39FromDiscord<Bubblie> Because you get a fundamental understanding of how it works
06:00:39FromDiscord<Equinox> In reply to @Bubblie "Also, for learning purposes": Yeah ofc
06:01:00FromDiscord<Equinox> I’ve been learning graphics programming with rust
06:01:04FromDiscord<Equinox> And wgpu
06:09:04FromDiscord<Bubblie> I have friends who use rust a lot
06:09:11FromDiscord<Bubblie> One of them is also using wgpu
06:09:23FromDiscord<Bubblie> Its pretty cool
06:37:22*neurocyte0917090 joined #nim
06:40:43nrds<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:48nrds<Prestige99> That's too bad
06:41:10FromDiscord<Elegantbeef> Overloadable enums are here now
06:41:15FromDiscord<Elegantbeef> And they're nicer
06:41:25nrds<Prestige99> What's that?
06:42:05FromDiscord<Elegantbeef> Type inference enabled on enums
06:42:24FromDiscord<Elegantbeef> So ambiguity is the only time you need `EnumName`
06:42:48FromDiscord<Elegantbeef> https://github.com/nim-lang/Nim/blob/06ff0e96249884f4ac6c49dadc96147be1c31097/tests/enum/toverloadable_enums.nim
06:43:15nrds<Prestige99> ah
06:43:27nrds<Prestige99> I just wanted to enforce the enum name prefix
06:43:40FromDiscord<Elegantbeef> Ah i hate you
06:43:43nrds<Prestige99> wonder if I can just write my own pragma that does what .pure. used to do
06:44:16FromDiscord<Elegantbeef> Nope
06:44:34nrds<Prestige99> no?
06:45:23FromDiscord<Elegantbeef> Something like the above is what you'd neeed
06:45:25FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3SVE
06:45:39FromDiscord<Elegantbeef> Well how do you emit something that allows dot exprs from inside a typedef, you cant
06:45:56FromDiscord<Elegantbeef> I dont get the wanting to enforce prefix, always seems odd to me
06:46:47nrds<Prestige99> Too bad it was removed as even an option
06:47:08FromDiscord<Elegantbeef> Use pure and write it as such
06:47:14nrds<Prestige99> So before the pure pragma was just some compiler hoopla that I can't recreate without changing the compiler?
06:47:32nrds<Prestige99> I mean I don't even need to add .pure. to do that, but I want to enforce it
06:47:41FromDiscord<Elegantbeef> You might be able to do it with a term rewriting macro
06:48:02*ltriant quit (Ping timeout: 240 seconds)
06:49:04nrds<Prestige99> I know not of these things you speak
06:50:03FromDiscord<Elegantbeef> They're magic that uses pattern matching to replace Nim code, that are subject to be removed
06:50:21nrds<Prestige99> well damn
06:53:23nrds<Prestige99> maybe I'll have to build my own enum system with something like you mentioned :P
06:55:10FromDiscord<Elegantbeef> What are you doing anywho?
06:56:45nrds<Prestige99> Just trying to use enums how I want to
06:56:57FromDiscord<Elegantbeef> Wrongly 😜
06:58:01nrds<Prestige99> Subjective
06:58:07nrds<Prestige99> But it's what I prefer
06:59:25FromDiscord<Elegantbeef> Well time to make an RFC
06:59:31FromDiscord<Elegantbeef> Just so i can downvote it 😛
07:00:20FromDiscord<Elegantbeef> The biggest issue I see is that it pollutes the entire API
07:00:34nrds<Prestige99> How does it?
07:00:40FromDiscord<Elegantbeef> You enforce the enum everywhere to be accessed through a namespace, which many people dislike
07:00:46NimEventerNew thread by RainbowAsteroids: Why doesn't echo have tag WriteIOEffect?, see https://forum.nim-lang.org/t/9024
07:01:00FromDiscord<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:43FromDiscord<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:14nrds<Prestige99> I dislike the inverse just the same
07:02:24FromDiscord<Elegantbeef> But the inverse isnt the same
07:02:35FromDiscord<Elegantbeef> You still can write `Direction.left`
07:02:41*acidsys joined #nim
07:02:46FromDiscord<Elegantbeef> And if you forget to it's kinda proof that you dont strongly hold to your conviction
07:03:30nrds<Prestige99> You want one thing and I want the opposite, is how the inverse is true
07:03:56FromDiscord<Elegantbeef> For it to make me happy it'd have to be a project setting that can be overridden on import
07:03:59nrds<Prestige99> And it doesn't matter if I understand my code, I need it to be readable to others
07:04:18FromDiscord<Elegantbeef> I mean the inverse is demonstrably not true though
07:04:20nrds<Prestige99> Like if I have a variable named `a` that doesn't help the reader much
07:04:43FromDiscord<Elegantbeef> Not enforcing namespace does not prevent you from using it
07:04:51FromDiscord<Elegantbeef> Enforcing namespaces prevents others from not using it
07:05:00nrds<Prestige99> Having it being a toggleable option would be fine with me
07:05:06nrds<Prestige99> But I want it enforceable in my projects
07:05:28FromDiscord<Elegantbeef> Well RFC it, though i doubt it'd be accepted
07:05:42FromDiscord<Elegantbeef> Nim programmers want less tedious enums not more tedious based off the overloadable enum response
07:05:59nrds<Prestige99> Probably not, although I did see dom and pmunch wanting the feature back when it was discussed
07:06:20FromDiscord<Elegantbeef> I still dont know the best way to toggle it on import
07:06:41FromDiscord<Elegantbeef> Dont even know if there would be a nice way
07:07:46nrds<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:00FromDiscord<Elegantbeef> Well the issue is that you cant do that both ways
07:08:37nrds<Prestige99> Wdym?
07:08:41FromDiscord<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:32nrds<Prestige99> Like it would be a problem if a dependency used it? Idk what your point is
07:09:39FromDiscord<Elegantbeef> Yes
07:09:58FromDiscord<Elegantbeef> If you import a module that uses unqualified but you're forcing qualified that's a compiler bug
07:10:04FromDiscord<Elegantbeef> Well error\: 😀
07:10:15nrds<Prestige99> Ah I see what you mean
07:10:22FromDiscord<Elegantbeef> Dont know if Nim tracks project specific settings or even capable of it
07:11:19FromDiscord<Elegantbeef> Actually yea that gets hellish quickly
07:11:57FromDiscord<Elegantbeef> The same module is imported by two seperate files one that doesnt enforce it, but then one that enforces it
07:12:39nrds<Prestige99> Wouldn't that just make it enforced?
07:12:55FromDiscord<Elegantbeef> Except the module was already sem'd by the first file
07:13:23FromDiscord<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:17FromDiscord<Elegantbeef> Atleast i think that'd be a fun hell
07:14:29FromDiscord<Elegantbeef> You could always recompile that module with the enforced flag if they differed
07:14:35FromDiscord<Elegantbeef> Who doesnt love more complex compilation!
07:15:55nrds<Prestige99> Or I can just write my own implementation of `enum` maybe
07:16:08FromDiscord<Elegantbeef> You dont even need your own implementation really
07:16:34FromDiscord<Elegantbeef> Make a enum then use exported `templates` like i showed above and you're done
07:17:04FromDiscord<Elegantbeef> You need a macro of course, but that's not too bad
07:17:06nrds<Prestige99> Hmm
07:17:07*ltriant joined #nim
07:17:19FromDiscord<Elegantbeef> was meaning to add enum support to micros, so this is a fine time to do it
07:48:38FromDiscord<Elegantbeef> prestige TIME! 😛
07:48:48nrds<Prestige99> Eh?
07:48:58FromDiscord<Elegantbeef> This has shown me issues with my API https://github.com/beef331/micros/blob/master/tests/test1.nim#L238-L259
07:49:08FromDiscord<Elegantbeef> But i wrapped the basic part of enums
07:49:38nrds<Prestige99> Nice!
07:49:45FromDiscord<Elegantbeef> Still have a lot to do for this library
07:50:29FromDiscord<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:55FromDiscord<Phil> motherducker, question into the round, does the compiler flag `--threads:on` generally not play nice with logging properly?
08:23:21FromDiscord<Elegantbeef> https://nim-lang.org/docs/logging.html#basic-usage-notes-when-using-multiple-threads
08:23:50FromDiscord<Phil> Shoooooot meeeeeeee
08:28:23FromDiscord<Elegantbeef> Dont read the docs they're only there to piss you off
08:30:08FromDiscord<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:18FromDiscord<Phil> (edit) "or" => "and"
08:30:35FromDiscord<Elegantbeef> Eh i was just joking no need to get defensive
08:30:47FromDiscord<Phil> Oh, sorry, that didn't translate well into text
08:31:12FromDiscord<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:15FromDiscord<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:36FromDiscord<Elegantbeef> \:fuckwit\:
08:32:37FromDiscord<Elegantbeef> Hmmm nope there is none
08:33:18FromDiscord<Phil> Well, off to ask xflywind in prologue how to set the log level for all the threads
08:33:25FromDiscord<Phil> Since I think prologue is the one instantiating them
08:33:36FromDiscord<Elegantbeef> Have fun
08:38:41FromDiscord<tandy> can nimscript access non files in a nimble package?
08:39:01FromDiscord<Elegantbeef> What do you mean?
08:39:17FromDiscord<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:33FromDiscord<Elegantbeef> you should be able to
08:39:49FromDiscord<tandy> mb meant to say non nim files here
08:39:54FromDiscord<tandy> il try
08:40:03FromDiscord<Elegantbeef> `staticRead` should work
08:40:11FromDiscord<Elegantbeef> I could be wrong
08:40:39FromDiscord<Elegantbeef> The NimVM's list of support functions is an oddcase of "it depends"
08:41:14FromDiscord<tandy> thing is i dont need the actual file
08:41:16FromDiscord<tandy> just its path
08:41:21FromDiscord<tandy> so i can exec something on it
08:41:41FromDiscord<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:20NimEventerNew thread by Mardiyah: Have C function static variable equivalent , see https://forum.nim-lang.org/t/9025
09:48:51NimEventerNew 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:02FromDiscord<Phil> The above is just one of my self-answered questions
09:57:24FromDiscord<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:45FromDiscord<hmmm> yay I got the base36 decoder working, or basewhatever dececoder
13:03:22FromDiscord<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:39FromDiscord<Daan B> can anybody help me with debugging a mem leak?
13:50:05FromDiscord<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:21FromDiscord<Rika> what leak
14:25:08*filip912 joined #nim
14:25:12*filip912 left #nim (#nim)
14:30:51FromDiscord<Aaron Lee> In reply to @hmmm "yay I got the": any github repo?
14:34:39FromDiscord<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:31FromDiscord<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:38FromDiscord<Shinyzenith> Does the include keyword execute the file i'm including too?
14:42:31FromDiscord<auxym> include works exactly like in C, it pastes the contents of the included file exactly where you tell it to
14:44:33FromDiscord<Shinyzenith> hmm Alright
14:49:22FromDiscord<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:24FromDiscord<Shinyzenith> and it worked so
14:49:26FromDiscord<Shinyzenith> :Shrug:
14:49:50FromDiscord<auxym> better figure out why you have those errors...
14:49:53FromDiscord<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:32FromDiscord<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:33FromDiscord<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:38FromDiscord<demotomohiro> In default, procs, types, variables and etc are not exported.
14:51:53FromDiscord<Shinyzenith> In reply to @demotomohiro "In default, procs, types,": now it makes sense why my import statements were throwing errors
14:52:14FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=3SXp
14:53:21FromDiscord<auxym> In reply to @Shinyzenith "Oh ok so i": yes, put the `` after the declared type name
14:53:35FromDiscord<Phil> I'm trying to comprehend renameHook and such but I'm not 100% if those are what I'm looking for
14:55:38FromDiscord<Shinyzenith> In reply to @auxym "yes, put the `*`": Alright! and for procs and templates, where should I put the ?
14:55:58FromDiscord<auxym> always after the (proc/template/type) name
14:56:14FromDiscord<Shinyzenith> Ok!
14:56:28FromDiscord<auxym> eg `proc foo(a, b: int): string = ...`
14:56:41FromDiscord<Shinyzenith> yep that works
14:56:43FromDiscord<Shinyzenith> thank you!
14:57:37FromDiscord<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:49FromDiscord<Phil> Turns out treeform is great and renameHook's actually do solve the problem
14:59:57FromDiscord<Phil> (edit) "renameHook's" => "renameHooks"
15:01:35FromDiscord<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:53FromDiscord<Jakraes> Quick question, is there any difference between import and include?
15:03:27FromDiscord<Phil> import respects private/public variable stuff as import means "only grab the stuff from module A that's public"
15:03:29FromDiscord<Rika> include is literal copy paste
15:03:32FromDiscord<Phil> include is stabling two files together
15:03:38FromDiscord<Phil> (edit) "stabling" => "stapling"
15:03:54FromDiscord<Phil> (edit) "together" => "together, which means you have access to all the private variables within the included file"
15:04:11FromDiscord<Jakraes> Oh gotcha, so import only imports what's marked with a ?
15:04:24FromDiscord<Phil> pretty much, it's also not code duplication the same way include is
15:05:10FromDiscord<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:22FromDiscord<Phil> (edit) "module," => "file,"
15:07:07FromDiscord<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:12FromDiscord<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:02FromDiscord<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:31FromDiscord<d4rckh> is there any easy way of selecting elements from a start index to an end index from a sequence?
16:05:13FromDiscord<Equinox> In reply to @d4rckh "is there any easy": I’m not very good at nim but I think: seqname[start..end]
16:08:54FromDiscord<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:46FromDiscord<Phil> It does a copy for primitive types at least
16:20:28FromDiscord<demotomohiro> Both `dstSeq = srcSeq` and `dstSeq = srcSeq[0..^1]` copy `srcSeq`.
16:22:17FromDiscord<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:46FromDiscord<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:06FromDiscord<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:52FromDiscord<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:26FromDiscord<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:56FromDiscord<demotomohiro> Nim pass seq to procs without copying it.
16:34:46FromDiscord<d4rckh> In reply to @Equinox "I’m not very good": Thanks, it worked
16:35:29FromDiscord<d4rckh> I am currently developing my nim program on windows with a friend who uses linux
16:35:39FromDiscord<Equinox> In reply to @d4rckh "Thanks, it worked": Nice
16:35:57FromDiscord<d4rckh> We finally finished implementing threads but when he runs the program it throws a lot of errors about memory leaking
16:36:12FromDiscord<d4rckh> While for me (on windows) it runs completely fine
16:37:31FromDiscord<Daan B> Yes, also when I run it on a windows vm it also works fine.
16:39:03FromDiscord<Daan B> image.png https://media.discordapp.net/attachments/371759389889003532/955143443666063431/image.png
16:43:19FromDiscord<Daan B> image.png https://media.discordapp.net/attachments/371759389889003532/955144520373268560/image.png
16:44:04FromDiscord<d4rckh> https://github.com/d4rckh/vaf/blob/vaf-threads/src/vaf.nim#L156
16:44:06FromDiscord<d4rckh> here is the code
17:27:28FromDiscord<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:38FromDiscord<Alea> it doesn't show this for types imported from other modules
17:27:41FromDiscord<Alea> any clues why?
17:28:56FromDiscord<Alea> that same variable imported into other modules doesn't have this issue
17:34:15FromDiscord<demotomohiro> Is that type has export mark ''?
17:35:47FromDiscord<demotomohiro> Are there same identifier? It is almost impossible to help you without reading your code.
17:43:59FromDiscord<Alea> a reload ended up fixing
17:44:10FromDiscord<Alea> guess its just usual nim extension instability
17:45:01FromDiscord<Generic> make sure to setup a project file
17:58:44FromDiscord<Require Support> how to link static libraries in nim
18:00:42FromDiscord<Daan Breur> :\(
18:01:24FromDiscord<demotomohiro> -
18:01:51FromDiscord<demotomohiro> `--passL:-lmystaticlibrary`
18:02:25FromDiscord<demotomohiro> Use that compiler option
18:05:29FromDiscord<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:46FromDiscord<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:40FromDiscord<Daan Breur> In reply to @d4rckh "https://github.com/d4rckh/vaf/blob/vaf-threads/src/": ??????
18:45:51FromDiscord<Daan Breur> (edit) "??????" => "? Whats wrong about this"
18:45:59FromDiscord<Daan Breur> windows works, linux not
18:47:02*fowl joined #nim
20:30:41FromDiscord<Phil> Hmmm
20:31:02FromDiscord<Phil> I'm trying to write what amounts to basically a generic delete API endpoint
20:32:01FromDiscord<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:48FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=3T1i
20:33:43FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=3T1j
20:34:39FromDiscord<Phil> Like, I'm pretty sure it prints out the complete AST of the function I generate above
20:34:44FromDiscord<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:51FromDiscord<huantian> Try noting the return type of the return proc to be Future[void]?
20:35:08FromDiscord<huantian> Actually hm
20:35:24FromDiscord<Phil> One is an "owned" Future[void], the other a Future[system.void]
20:35:43FromDiscord<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:56FromDiscord<Phil> I can't tell you what's the difference between a future and an owned future
20:36:05FromDiscord<Phil> Nor the difference between void and system.void
20:36:36FromDiscord<Alea> Ah gotta love nim's error messages :peepowtf:
20:37:16FromDiscord<huantian> void should be the same as system.void
20:37:23FromDiscord<huantian> I still have no idea what owner means
20:37:30FromDiscord<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:02FromDiscord<Alea> In reply to @Isofruit "To be fair, I'm": Eh, nim loves to spit our ridiculous errors even on simple issues
20:38:06FromDiscord<Phil> So if that scenario hasn't been covered I wouldn't be too surprised
20:38:33FromDiscord<Phil> In reply to @Alea "Eh, nim loves to": Hmmm fair
20:39:41FromDiscord<Phil> ~~I just want to generate controller procs because by god writing them is starting to get really fucking old~~
20:40:17FromDiscord<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:51FromDiscord<Generic> when you edit them
20:46:16FromDiscord<Alea> What do you need in the project file for that to work?
20:49:58FromDiscord<Phil> I feel tempted to do an alternate approach which is a massive template that writes an entire module of procs, hmmm
20:55:41FromDiscord<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:49FromDiscord<Generic> you need to edit the setting nim.project and add the file there
21:00:10FromDiscord<Phil> macros should be useable from within templates, right?
21:01:20FromDiscord<Generic> yes
21:04:12*enyc_ quit (Ping timeout: 240 seconds)
21:05:51FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=3T1q
21:08:04FromDiscord<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:33FromDiscord<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:37FromDiscord<Phil> (edit) "tempalte?" => "template?"
21:08:45*enyc joined #nim
21:19:31*zgasma quit (Remote host closed the connection)
21:30:25FromDiscord<Elegantbeef> `ctx {.inject.}: Context`
21:30:52FromDiscord<Elegantbeef> @Phil\: ^
21:32:14FromDiscord<Phil> Does that go into the template?
21:32:20FromDiscord<Elegantbeef> Yes
21:32:32FromDiscord<Elegantbeef> Nim templates are hygenic in that they do not inject any symbols
21:32:48FromDiscord<Elegantbeef> Well they do not inject accessible symbols
21:33:48FromDiscord<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:22FromDiscord<Elegantbeef> What i said will resolve that
21:35:14FromDiscord<Phil> Which lib was the inject pragma from again? macros?
21:35:40FromDiscord<Phil> Trying to figure out what I need to import
21:36:17FromDiscord<Elegantbeef> It's not from any
21:36:25FromDiscord<Elegantbeef> It's a compiler pragma
21:37:59FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=3T1v
21:38:12FromDiscord<Elegantbeef> How are you using it?
21:38:16FromDiscord<Phil> same when I put that inject line inside the deleteEntryController proc
21:38:23FromDiscord<Elegantbeef> Yea you're using it wron
21:38:46FromDiscord<Phil> `genericArticleControllerProcs(DiaryEntry)` This is what I use in the actual controller modules
21:38:52FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3T1w
21:38:57FromDiscord<Elegantbeef> It goes on the symbol you want to inject
21:41:29FromDiscord<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:58FromDiscord<Phil> Wait, no I'm dumb
21:42:01FromDiscord<Phil> I was importing from the wrong space
21:42:03FromDiscord<Elegantbeef> ok do yourself a favour and annotated the template `{.dirty.}`
21:42:31FromDiscord<Phil> Holy shit that actually all worked, just tested O.O
21:42:34FromDiscord<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:38FromDiscord<Elegantbeef> Nice
21:43:05FromDiscord<Phil> I'll likely throw 4-5 more procs into the template and have that be the "stock" set of controllers
21:43:25FromDiscord<Elegantbeef> Now the question i have to ask is why a template?
21:43:41FromDiscord<Phil> I originally wanted to write a proc that returns prologue controller procs
21:44:05FromDiscord<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:06FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3T1y
21:44:13FromDiscord<Elegantbeef> Why do you need a template for the above
21:45:09FromDiscord<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:16FromDiscord<Phil> this is the proc that handles said HTTP request
21:45:42FromDiscord<Elegantbeef> This sounds wildly unsafe given that you're going to quickly create ambiguity
21:46:34FromDiscord<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:06FromDiscord<Elegantbeef> But the procs are named the same, so this is going to create ambiguity
21:47:32FromDiscord<Phil> different modules though, so I'd go `diaryEntryControllers.deleteEntry()`
21:47:38FromDiscord<Phil> (edit) "`diaryEntryControllers.deleteEntry()`" => "`diaryEntryControllers.deleteEntryController()`"
21:47:59FromDiscord<Elegantbeef> God i hate that, but ok
21:48:09FromDiscord<Phil> And controller modules are explicitly something you never ever import 2 of at the same time
21:49:00FromDiscord<Phil> I mean, I'll gladly take your advice for a generic proc that returns such a controller proc 😄
21:49:44FromDiscord<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:57FromDiscord<Elegantbeef> Then you dont ever have ambiguity and dispatch based off type instead of module
21:50:36*sagax joined #nim
21:50:43FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=3T1A
21:51:23FromDiscord<Elegantbeef> async is a macro so you dont anotate it like that
21:51:37FromDiscord<Elegantbeef> i'd be a `iterator (): owned(FutureBase)` as the return type
21:51:47FromDiscord<Elegantbeef> You didnt annotate the return type with async
21:51:51FromDiscord<Elegantbeef> No clue if it works on proc ty
21:54:27FromDiscord<Elegantbeef> Eh yea nope i dont use async so dont know if you can make a proc generator for it
21:55:04FromDiscord<Phil> What the flying saucer
21:55:10FromDiscord<Phil> I think I found a solution (?)
21:55:24FromDiscord<Phil> Apparently prologue comes with its own type for these procs, it calls them `HandlerAsync`
21:55:41FromDiscord<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:19FromDiscord<Phil> And... if I annotate with that type it just works....
21:56:20FromDiscord<Phil> wtf
21:56:32FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=3T1B
21:57:03FromDiscord<Phil> I have written the code
21:57:09FromDiscord<Phil> I do not understand why this in particular works
21:57:35FromDiscord<Phil> And I know it works, I made an HTTP request and this deleted it exactly as you'd expect
21:58:22FromDiscord<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:47FromDiscord<Elegantbeef> Naming shit like it's java
22:00:12FromDiscord<Phil> Yeh, the name makes no sense here, but "decorator" which I'd classify this normally as, fits even less
22:00:28FromDiscord<Elegantbeef> You know you can always make that proc an async then just await inside it?
22:00:34FromDiscord<Elegantbeef> Then you dont return anything
22:00:58FromDiscord<Elegantbeef> Unless you need to pass it somewhere i guess
22:01:02FromDiscord<Phil> You mean the inner controller proc?
22:01:05FromDiscord<Phil> I need to pass it somewhere
22:01:10FromDiscord<Phil> In the end it looks like this
22:01:12FromDiscord<Elegantbeef> Ah ok
22:01:26FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=3T1E
22:01:32FromDiscord<Phil> app being the prologue server before you start it up
22:01:47FromDiscord<Elegantbeef> Jesus fucking christ that's java, you've written java
22:02:49FromDiscord<Elegantbeef> Dont need to use the module namespace anymore eh?
22:03:13FromDiscord<Phil> Strictly speaking no
22:03:33FromDiscord<Phil> I'll likely keep doing it though for clarity so I know where the hell I got these from
22:04:22FromDiscord<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:28FromDiscord<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:42FromDiscord<Elegantbeef> Shame
22:05:02FromDiscord<Phil> In exchange I no longer have to write the really dumb stuff
22:05:20FromDiscord<Phil> Only have to define a proc that spits out handlers for a given model type
22:05:28FromDiscord<Phil> (edit) "handlers" => "controller-procs"
22:06:01FromDiscord<Phil> I'll take a simpler approach if you've got one 😛
22:06:29FromDiscord<Elegantbeef> I'd say you should not do that mostly for modularity
22:06:39*sagax quit (Ping timeout: 256 seconds)
22:06:49FromDiscord<Elegantbeef> You cannot easily replace a module with another one with similar functionality, because the module names differ
22:07:24FromDiscord<Phil> You mean the name-spacing? Or the entire making factory procs for controllers?
22:07:58FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3T1F
22:08:22FromDiscord<Elegantbeef> This way you can override the behaviour with just replacing the module with one that exposes a type `GenericArticle` and `deleteEntryControllerFactory`
22:08:40FromDiscord<Elegantbeef> Hard coding the module name really makes it hard to easily compose modules for whatever reason
22:08:49FromDiscord<Elegantbeef> Atleast that's my view
22:09:48FromDiscord<Elegantbeef> Then again I only use module namespace for removing ambiguity, so I could just be misguided 😛
22:09:50FromDiscord<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:02FromDiscord<Phil> (edit) "name-spacing, I" => "name-spacing then. ↵I"
22:10:49FromDiscord<Elegantbeef> It probably doesnt matter for this code i guess
22:11:33FromDiscord<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:48FromDiscord<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:17pchhttps://github.com/kinkinkijkin/nimsgp already have a beta release
23:26:41pchlikely has a bug related to the nim type system being slightly aggravating at times
23:27:09FromDiscord<Elegantbeef> Where do y ou think the bug is?
23:27:39pchnamely, all of the attachment vector buffer sizes might have to be the same size as the tripoint vector buffer size
23:27:58pchwould be quick to fix but enh
23:28:17FromDiscord<Elegantbeef> That's the issue you ran into earlier right?
23:28:32pchyeah but now im not using generic attachments anymore
23:28:48pchbut i dont remember what all i removed that was related to trying to make generic attachments work
23:29:21FromDiscord<Elegantbeef> Ah well if you ever want to make them work I can work through it since the code is visible now
23:30:08pchwould be in the drawReadyElements functions in funcs2d and topdraw
23:30:31pchthe library setup is very quickly getting a lot worse
23:36:20pchmaybe not the best idea to be writing api reference while im up past twice my height in stress
23:36:22FromDiscord<Elegantbeef> So for `drawReadElements` you wanted to do what exactly?
23:36:30pchcompletely broked the professional styule
23:36:32pchuh
23:36:59pchit draws to buffer outbound using shader shad, after preparing attachments and data for it, and performing culling checks
23:37:52pchthe 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:03pchit might be a crash rn
23:38:24pchand v2buffer and v3buffer types are supposed to be of arbitrary, unchecked length
23:38:24FromDiscord<Bubblie> In reply to @pch "https://github.com/kinkinkijkin/nimsgp already have": 👀
23:38:29FromDiscord<Bubblie> This software rendering?
23:38:41pchyes
23:38:58FromDiscord<Elegantbeef> so make them `openArray[float32]`
23:39:21pchopenarrays are slightly annoying to deal with in performance-critical situations but i might
23:39:31FromDiscord<Elegantbeef> How are they annoying?
23:39:52FromDiscord<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:56pchincur 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:57FromDiscord<Elegantbeef> It's a pointer and length, you cant get much more efficient
23:40:51FromDiscord<Elegantbeef> Well you can also make a concept
23:40:55pchmuch prefer static arrays with unenforced lengths in this case
23:41:15FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3T1X
23:41:18FromDiscord<Elegantbeef> Well then use the conceept
23:41:42pchhuh, never seen this type before
23:41:48pchand never seen it in the docs
23:41:53pchnew feature?
23:42:00FromDiscord<Elegantbeef> They're 'experimental'
23:42:06FromDiscord<Jakraes> Quick question, how can I pass arrays as arguments in a proc?
23:42:10FromDiscord<Elegantbeef> https://nim-lang.org/docs/manual_experimental.html#concepts
23:42:17pchdo they exist in nim 1.4.2? that's the oldest version i have to care about rn
23:42:23FromDiscord<Elegantbeef> Yes
23:42:40FromDiscord<Elegantbeef> Ideally you use an openarray jakraes, what do you need though?
23:43:09FromDiscord<jfmonty2> Are concepts still going to be completely overhauled at some point, or is that no longer the plan?
23:43:11FromDiscord<Elegantbeef> `myArr: array[index, type]` is an alternative
23:43:22FromDiscord<Bubblie> I wonder if I should make a gui library in vulkan 👀
23:43:22FromDiscord<Elegantbeef> They're still going to be changed eventually and already have been somewhat
23:43:25FromDiscord<Jakraes> I want to pass a 2 dimensional array in a proc, but without a specified size
23:43:27FromDiscord<Bubblie> There is a lack of those
23:43:38FromDiscord<Jakraes> The type is char
23:43:58FromDiscord<Jakraes> I tried using open arrays but it gave me an error for some reason
23:44:14FromDiscord<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:14FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/09B
23:44:20FromDiscord<Elegantbeef> Yea nested openarrays dont make sense
23:45:10FromDiscord<Jakraes> Damn, well rip :/
23:45:13FromDiscord<Bubblie> I think I might be interrupting the current convo mb 😅
23:45:34FromDiscord<jfmonty2> I feel like multiple conversations going on is just a chatroom fact of life
23:45:47FromDiscord<Bubblie> Yeah
23:46:10FromDiscord<Bubblie> Wait so you can pass an array through a proc without a specified size?
23:46:15FromDiscord<Bubblie> (edit) "can" => "cant"
23:46:26FromDiscord<Jakraes> Actually, maybe I can try to mess around with using different files so I can import certain values
23:47:23FromDiscord<Bubblie> Well, you can get the size of an array from that existing array in nim right?
23:47:51FromDiscord<jfmonty2> Can't you declare a static generic and use that for the size of the array?
23:48:07FromDiscord<jfmonty2> like `proc[T: static int](array[int, T])` or whatever
23:48:09FromDiscord<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:37FromDiscord<Bubblie> In reply to @Jakraes "I'm just gonna define": I was thinking that
23:49:05*acidsys joined #nim
23:49:19FromDiscord<Jakraes> Yup, it works, nice
23:50:08FromDiscord<jfmonty2> like `proc[T: static int](a: array[T, int])` or whatever
23:50:30FromDiscord<Bubblie> That probably could work (I think)
23:50:42FromDiscord<Bubblie> is there any networking libraries for nim
23:50:43FromDiscord<Bubblie> btw
23:51:18FromDiscord<Jakraes> Yup
23:51:18FromDiscord<Jakraes> https://github.com/treeform/netty
23:51:21FromDiscord<Bubblie> 👀
23:51:23FromDiscord<Bubblie> lets go
23:51:25FromDiscord<Bubblie> thank you
23:51:29FromDiscord<Jakraes> Np homie
23:52:34FromDiscord<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:02FromDiscord<Bubblie> vulkan triangle hell