<< 20-09-2021 >>

00:47:04FromDiscord<tomsen> noob question\: when making a type, can it inherit from an imported type with "ref object of ImportedType"?
00:54:34FromDiscord<Yardanico> In reply to @tomsen "noob question\: when making": yes, but only if that ImportedType inherits from RootObj
00:57:07FromDiscord<tomsen> I got a misleading error, before I realized that the type members need to be public as well. Then it worked, luckily it inherited from RootObj. Good to know about that. thanks!
01:01:05FromDiscord<Elegantbeef> What was the error/code?
01:01:17nrds<Prestige99> Hmm so I have a generic proc using T: SomeNumber, I check if T is SomeFloat and that returns true, even thought typeof(T) is `int`. Am I missing something here?
01:01:32FromDiscord<Elegantbeef> Code?
01:02:10nrds<Prestige99> 1 min
01:03:33nrds<Prestige99> https://play.nim-lang.org/#ix=3zou
01:04:06FromDiscord<Elegantbeef> use `when`
01:04:33nrds<Prestige99> ah, thanks
01:04:33FromDiscord<Elegantbeef> if is runtime, when is compile time and the proper tool here since you dont want the emitted int branch
01:52:25FromDiscord<fae> Is it bad practice to define arithmetic operators for non numeric types? eg `list += item` instead of `list.add(item)`
01:59:22FromDiscord<impbox [ftsf]> i'd say it's a personal preference thing, some people don't like it, some do
02:02:40FromDiscord<impbox [ftsf]> `&=` might be more nimic for appending than `+=` though
02:03:06FromDiscord<impbox [ftsf]> but i'm you'll piss off someone either way, but go with whatever you like
02:03:22FromDiscord<leorize> isn't `&=` already exist?
02:03:46FromDiscord<leorize> !eval var x = @[0]; x &= 10; echo x
02:03:48NimBot@[0, 10]
02:04:21FromDiscord<treeform> In reply to @fae "Is it bad practice": I would not do it if you are making open source libs some one needs to read. But if its private stuff I doubt any one cares...
02:04:35FromDiscord<impbox [ftsf]> yep, `&=` is already defined!
02:04:41FromDiscord<treeform> normal regular code any one can understand is the best
02:05:33FromDiscord<impbox [ftsf]> i've only seen & used for strings, but makes sense it works for any seq
02:05:35FromDiscord<fae> I agree, but Nim is very powerful and tempts you to do things like that haha
02:14:31FromDiscord<fae> In reply to @leorize "isn't `&=` already exist?": Yea the list was just for example sake. What I was actually thinking of was something like `entity += Position()`
02:14:55FromDiscord<Elegantbeef> Do not go gentle into that good night πŸ˜›
02:15:03FromDiscord<fae> And β€˜var p= entity[Position]` to fetch component by type
02:15:08FromDiscord<Elegantbeef> Making a non idiomatic library just means someone that uses your code needs to wrap it idiomatically
02:15:12FromDiscord<fae> (edit) "β€˜var" => "`var"
02:22:10FromDiscord<Varriount> In reply to @Elegantbeef "Making a non idiomatic": Sometimes. There are cases where a non-idiomatic API makes more sense.
02:22:30FromDiscord<Varriount> My favorite example being this Python library: https://github.com/kolypto/py-good
02:22:33nrds<R2D299> itHub: 7"Slim yet handsome validation library."
02:23:06FromDiscord<Elegantbeef> There are always exceptions to rules
02:25:14*arkurious quit (Quit: Leaving)
02:25:24FromDiscord<Gumber> @fae I don't think it's a bad idea at all
02:25:31FromDiscord<Gumber> operator overloading is a thing for a reason πŸ™‚
02:25:43FromDiscord<Gumber> and syntactic sugar is sugar πŸ™‚
02:26:11FromDiscord<Gumber> plus it's YOUR code as long as it works and it's consistent
02:26:18FromDiscord<impbox [ftsf]> and then there's shit like `cout << "hello world!";`
02:26:25FromDiscord<Gumber> no
02:26:28FromDiscord<Gumber> that's just nonsense
02:26:32FromDiscord<Gumber> list += item isn't
02:26:38FromDiscord<impbox [ftsf]> operator overloading can be used for good or evil
02:26:40FromDiscord<Gumber> oh for sure
02:26:44FromDiscord<Gumber> like use common sense
02:26:58FromDiscord<Gumber> `|` would have been sooooo much better than `<<`
02:26:59FromDiscord<impbox [ftsf]> `entity += Position()` to add a Position component to an entity seems pretty confusing to me
02:27:01FromDiscord<Varriount> sent a code paste, see https://play.nim-lang.org/#ix=3zoJ
02:27:06FromDiscord<Gumber> I agree
02:27:19FromDiscord<Gumber> plus you don't really add entities to copmonents like that
02:27:22FromDiscord<Gumber> or components to entities rather
02:27:31FromDiscord<Gumber> entities are usually just Ids
02:27:36FromDiscord<Gumber> if you're doing it right
02:27:45FromDiscord<Gumber> or some type of handle
02:28:08FromDiscord<impbox [ftsf]> nothing to say it isn't in this case
02:28:18FromDiscord<Gumber> true but it leads one to believe it's some sort of container
02:28:26FromDiscord<impbox [ftsf]> it's an abstraction
02:28:45FromDiscord<Gumber> it's just not as obvious as list += item I think
02:28:47FromDiscord<Gumber> at least not to me
02:29:17FromDiscord<impbox [ftsf]> `entity.addComponent(Position())` is a lot more clear to me than `entity += Position()`
02:29:26FromDiscord<Gumber> I agree 100%
02:30:29FromDiscord<impbox [ftsf]> or `entity[Position] = Position()` depending on if you allow multiple of the same type of component per entity
03:07:32FromDiscord<fae> yea entities in my implementation are a fairly simple object, just an id and ref back to the world. procs for entities are just thing wrappers over world calls
03:08:02FromDiscord<fae> sent a code paste, see https://play.nim-lang.org/#ix=3zoS
03:08:32FromDiscord<fae> so the plan was to have like `addComponent(world: World, entity: Entity, component: T)`
03:08:44FromDiscord<fae> but define some shorter procs for entity which would delegate down to those
03:09:22FromDiscord<fae> idk something like that roughly
03:09:24FromDiscord<fae> sent a code paste, see https://play.nim-lang.org/#ix=3zoT
03:13:14FromDiscord<Gumber> 🀷 I'm just going to wrap entt πŸ™‚
03:13:26nrds<Prestige99> entt seems nice
03:13:44nrds<Prestige99> I still haven't ever gotten ECS working well (in any language) lol
03:13:45FromDiscord<Gumber> yeah someone already wrapped it I think there are bindings for it out there somewhere
03:13:58FromDiscord<Gumber> well - I think I'm about to drop a bomb on the nim game programing community
03:14:03FromDiscord<Gumber> in or around a months time
03:14:10nrds<Prestige99> sounds interesting
03:14:16FromDiscord<Gumber> not something usable - but something to make everyone drool
03:14:31FromDiscord<Gumber> usable for me but not anyone else is what I meant to say
03:15:11FromDiscord<Gumber> now to figure out where in my 18 layers of Nim and C/C++ code I have something incorrect
03:17:39FromDiscord<fae> trying to write your own stuff is a great way to learn the language when you're a noob though
03:18:12FromDiscord<fae> I tried doing some wrapping stuff but I dont know either Nim or c/c++ very well so I had difficulty with anything but the simplest of libs
03:18:29FromDiscord<Gumber> yeah I mean you're not going to do what I'm doing if you don't know C++ well
03:18:31FromDiscord<Gumber> or C
03:18:46FromDiscord<Gumber> for what I'm doing you need to know how to write a C interface for a C++ library
03:19:13FromDiscord<fae> whats the point of doing that btw? is it so you can avoid the cpp backend?
03:19:20FromDiscord<fae> or just easier interop with Nim?
03:19:37FromDiscord<Gumber> no it's because the library is using C++20/latest features
03:19:57FromDiscord<Gumber> and Nim's C++ backend can't handle it unless you do a lot of work
03:20:12FromDiscord<Gumber> like if you use C++20's `span` for instance Nim wil go bonkers
03:20:17nrds<Prestige99> Ye interop with C is much better than c++ for nim
03:20:41FromDiscord<Gumber> C++ interop with Nim is wonky - like you have to abuse the ever living F out of importcpp
03:20:55FromDiscord<Gumber> make it your bitch
03:21:10FromDiscord<Gumber> with C it's very very straightforward
03:21:25FromDiscord<Gumber> but that's because C has no types and is loose
03:21:42FromDiscord<Gumber> and generating correct C code is much easier than generating correct C++ code
03:22:04FromDiscord<Gumber> because C++'s spec is bananas
03:22:07FromDiscord<fae> but you still need to use the c++ backend?
03:22:12FromDiscord<Gumber> to do what?
03:22:19FromDiscord<fae> to use the underlying c++ lib, even with a c wrapper
03:22:23FromDiscord<Gumber> no
03:22:25FromDiscord<fae> oh okay
03:22:30FromDiscord<Gumber> but I do use the cpp backend
03:22:33FromDiscord<fae> what if you want to static link
03:22:37FromDiscord<Gumber> doesn't matter
03:22:40FromDiscord<fae> gotcha
03:22:44FromDiscord<Gumber> do you know what static linking is?
03:22:53FromDiscord<fae> including the lib in the executable?
03:22:59FromDiscord<fae> as opposed to a separate file
03:23:01FromDiscord<Yardanico> In reply to @fae "what if you want": take cimgui for example - it offers a C interface for a imgui which is a C++ library
03:23:02FromDiscord<Gumber> not really that's a side effectg
03:23:08FromDiscord<Gumber> (edit) "effectg" => "effect"
03:23:12FromDiscord<Yardanico> you can use nim's C backend with cimgui just fine and have it all statically compiled into a single binary
03:23:18FromDiscord<fae> like not having to dynamically load it in at runtime
03:23:21FromDiscord<Gumber> static linking means that the symbol resolution to the library occurs at compile time
03:23:22FromDiscord<Gumber> right
03:23:40FromDiscord<fae> so in what cases do you _need_ to use the c++ backend?
03:23:41*Pyautogui joined #nim
03:23:55FromDiscord<Gumber> if you want to compile C++ code or load symbols from C++ libraries
03:23:55FromDiscord<Yardanico> when you need direct source code C++ interop
03:24:10FromDiscord<fae> because ive actually been avoiding trying to wrap any c++ libs thinking i would be forced to use the cpp backend
03:24:20FromDiscord<Gumber> why are you so scared of the cpp backend?
03:24:25FromDiscord<Gumber> that's the better question
03:24:31FromDiscord<fae> i just figured the c backend is more portable
03:24:35FromDiscord<fae> and has better support
03:24:53FromDiscord<fae> but im not basing that on anything concrete
03:25:03FromDiscord<Gumber> I mean yes C is a more portable language
03:25:13FromDiscord<Yardanico> i mean that's true because C backend is the default so it's tested much more and C is more portable
03:25:13FromDiscord<Gumber> the C++ backend's support is fine'
03:25:16FromDiscord<Gumber> (edit) "fine'" => "fine"
03:25:28FromDiscord<Gumber> like it's not worked on but it's not broken
03:25:30FromDiscord<Gumber> it is what it is
03:25:34FromDiscord<fae> got it
03:25:37FromDiscord<Gumber> like I said you have to abuse importcpp
03:25:39FromDiscord<Yardanico> there's a higher chance to encounter a codegen bug with the C++ backend than with C but that's about it
03:25:44FromDiscord<Gumber> but like - if you stick to C++11/14
03:25:53FromDiscord<Gumber> you shouldn't really have any issues with portability
03:26:01FromDiscord<fae> okay
03:26:03FromDiscord<Gumber> golden rule of thumb with C++ is wait at least 4 years
03:26:05FromDiscord<fae> thats comforting to know
03:26:08FromDiscord<Gumber> before you start using any modern spec in production
03:26:33FromDiscord<Gumber> but I mean - I'm using vulkan and writing for PC and maybe linux
03:26:36FromDiscord<Gumber> but very doubtful
03:26:54FromDiscord<Gumber> because cross platform floating point determinism is not fun to try to solve
03:27:14FromDiscord<Gumber> I mean you can't solve it you can only deal with it
03:27:39FromDiscord<Gumber> so C++20 is fine - inconsequential for me
03:27:42FromDiscord<fae> well many exceptions to rules come down to programmer skill and you have a lot of experience with c++ so i can understand why you feel comfortable dropping down or doing more advanced things
03:27:54FromDiscord<Gumber> eh I don't really write C++ because the language is lol
03:28:03FromDiscord<Gumber> but I know it and can grok it and can wrap it
03:28:05FromDiscord<fae> i had never figured out how to properly use a linker until a couple months ago lol
03:28:12FromDiscord<Gumber> yeah I mean baby steps dude
03:28:15FromDiscord<fae> spent a day trying to get tcc working on my mac
03:28:18FromDiscord<Gumber> I've been using Nim for 6 years
03:28:21FromDiscord<fae> just to find out there are platform bugs
03:28:22FromDiscord<Gumber> sorry for calling you dude
03:28:25FromDiscord<Gumber> person lol
03:28:43FromDiscord<Gumber> oh yeah I've never used Nim + tcc before
03:28:44FromDiscord<fae> np i'm a dude but yea good to use inclusive language lol
03:28:48FromDiscord<Gumber> yes I try
03:29:14FromDiscord<Gumber> I want to embed dascript in my game
03:29:16FromDiscord<Gumber> but we'll see
03:29:29FromDiscord<Gumber> I already have a whole plugin system architecture working in several prototypes
03:29:53FromDiscord<Gumber> but right now I'm not bothering with an fancy engine architecture... I'm writing my renderer because that's the thing I need next
03:30:10FromDiscord<Gumber> I already have steamworks wrapped and all of the matchmaking and lobby code fleshed out (needs a lot of features but the minimum is there)
03:30:29FromDiscord<fae> any reason to pick dascript over lua or even wren or something like that? the performance definitely seems like a selling point, but resources for lua are abound
03:30:30FromDiscord<Gumber> so I'm like 80-90% there in terms of being ready to start writing gameplay code and more plumbing for asset loading
03:30:46FromDiscord<fae> btw dascript really is cool, ive been peeking at it the past few days
03:30:47FromDiscord<Gumber> already have my fiber based job system prototyped - but I might just end up using that C++ task scheduling library that intel has
03:30:52FromDiscord<Gumber> yeah it looks very neat
03:31:09FromDiscord<Gumber> okay so yea lua is the golden child of the game scripting language world
03:31:16FromDiscord<Gumber> but the thing about lua is it was invented for non-programmers
03:31:31FromDiscord<Elegantbeef> I'm scared of the C++ backend cause my Nim compiler fixes cause issues with it πŸ˜›
03:31:32FromDiscord<Gumber> so you have to deal with funky shit like everything is 1 based for indexing instead of zero based
03:31:34arfylua's interesting.
03:31:54FromDiscord<Gumber> it's also dynamically typed so you don't have, well, types
03:31:56FromDiscord<impbox [ftsf]> lua's lack of type safety sucks
03:32:05FromDiscord<impbox [ftsf]> that's the main reason i'd choose dascript
03:32:10FromDiscord<fae> has anyone looked at <https://github.com/marcobambini/gravity>
03:32:27FromDiscord<Gumber> no but I'd pick dascript over that 100 times out of 100
03:32:42FromDiscord<impbox [ftsf]> "dynamic typing"
03:32:45FromDiscord<impbox [ftsf]> no thanks
03:32:51FromDiscord<Gumber> A) dascript is made by dajin the folks that make war thunder
03:32:57FromDiscord<Gumber> so they're probably dogfooding it
03:33:04FromDiscord<Gumber> B) dascript is strongly and statically typed
03:33:08FromDiscord<Gumber> two huge wins
03:33:27FromDiscord<Gumber> C) dascript is hot reloadable - which to my knowledge it's the only scripting language that is strongly, statically typed and hot reloadable
03:33:30FromDiscord<fae> so basically no to anything dynamically typed
03:33:36FromDiscord<Yardanico> In reply to @Gumber "A) dascript is made": they also have a couple of newer projects ongoing, but that's more for #offtopic or #gaming :)
03:33:37FromDiscord<Gumber> I mean if you don't like type safety
03:33:39FromDiscord<Gumber> go for it
03:33:50FromDiscord<fae> isn't v lang hot reloadable? πŸ™‚
03:33:50FromDiscord<Yardanico> i've been liking their new f2p game called Enlisted
03:33:55FromDiscord<Gumber> you're trolling right?
03:34:07FromDiscord<Gumber> not you yard
03:34:08FromDiscord<Gumber> fae
03:34:09FromDiscord<impbox [ftsf]> i used to do a lot of lua, but so many errors that could have been caught at compile time
03:34:12FromDiscord<fae> no
03:34:22FromDiscord<Gumber> you know V is vaporware right?
03:34:26FromDiscord<impbox [ftsf]> also 1 indexing
03:34:27FromDiscord<Gumber> V stands for vapoware
03:34:35FromDiscord<Gumber> (edit) "vapoware" => "vaporware"
03:34:36arfyperl6! lol
03:34:38FromDiscord<fae> <https://github.com/vlang/v/tree/master/examples/hot_reload>
03:34:44FromDiscord<Gumber> yo
03:34:48FromDiscord<Gumber> don't ever talk about V in here again
03:34:54FromDiscord<Gumber> lol I"m kidding
03:34:55FromDiscord<Gumber> but
03:34:56FromDiscord<fae> lol
03:35:01FromDiscord<Gumber> like V is kind of a joke in here
03:35:02FromDiscord<fae> it does work tho 🀷
03:35:05FromDiscord<fae> oh i know
03:35:09FromDiscord<Gumber> I mean sure
03:35:20FromDiscord<Gumber> so does compiling C code and calling it a new programming language
03:35:29FromDiscord<Gumber> and then making money from that claim
03:35:36FromDiscord<fae> In reply to @impbox "i used to do": have you looked at the typescript to lua project?
03:35:59FromDiscord<Gumber> adding typescript to my project so I can compile to lua
03:36:06FromDiscord<Gumber> doesn't sound like a win to me
03:36:19FromDiscord<Gumber> sounds like I should just use a good language
03:36:26FromDiscord<fae> TS is a popular language with stellar IDE support though
03:36:30FromDiscord<Yardanico> there are multiple languages that compile to lua too, some of them statically typed afaik
03:36:42FromDiscord<Gumber> mmm
03:36:47FromDiscord<fae> and it actually works quite nicely if you're using a framework like love2d or engine like defold
03:36:54FromDiscord<Gumber> ooph
03:37:09FromDiscord<Yardanico> that said, dascript looks cool :)
03:37:12FromDiscord<fae> not all of us are triple A, sometimes we just want types with our lua haha
03:37:16FromDiscord<Gumber> I'm not AAA either
03:37:18FromDiscord<Yardanico> it should be possible to use it outside of games too I guess
03:38:10FromDiscord<Yardanico> also it apparently has syntax skins that nim once had
03:39:50FromDiscord<Gumber> I guess like for 2d games I find using something like defold or love2d kind of excessive
03:40:19FromDiscord<Gumber> and a lot of the times it's slower than just not using them
03:40:30FromDiscord<Gumber> IMO and experience anyway
03:40:59FromDiscord<Gumber> even for 3d I don't like using engines
03:41:01FromDiscord<fae> love is a pretty light framework imo, about as light as they come
03:41:09FromDiscord<Gumber> not if I have to bolt on typescript
03:41:17FromDiscord<fae> haha
03:41:20FromDiscord<Gumber> but I mean you could use Nim with it if you can use Typescript with it so
03:41:29FromDiscord<Gumber> I just really really dislike web technologies
03:41:44FromDiscord<fae> I work all day in web tech so it’s familiar to me
03:41:48FromDiscord<Gumber> I do too
03:41:50FromDiscord<Gumber> I still hate it
03:41:58FromDiscord<Gumber> I code in Elixir for work
03:42:23FromDiscord<fae> But like I’ve said before, one of the reasons Nim has captivated me is that it’s made these traditionally scary things more accessible
03:42:40FromDiscord<Gumber> yeah I mean don't be scared by anything
03:42:41FromDiscord<Gumber> it's not scary
03:43:13FromDiscord<Gumber> Nim gives you a reason to explore them
03:43:36FromDiscord<Gumber> because trust me - I worked in web dev for a decade without really touching or exploring C/C++ and it was always a pipe dream
03:43:51FromDiscord<Gumber> once I found Nim it gave me an avenue to get good at C/C++
03:45:21FromDiscord<fae> Sounds like I may follow in a similar trajectory. Because I had always been intimidated by things like defines and macros, templates, etc. But since picking up Nim it’s given me a reason to dive into that stuff in learn it.
03:45:41FromDiscord<Gumber> defines are templates in Nim
03:46:04FromDiscord<Gumber> they exist in C and C++ and are referred to as preprocessor directives
03:46:18FromDiscord<Gumber> the preprocessor is a phase of the compiler that runs before the actual compilation happens
03:46:37FromDiscord<Gumber> it basically scans the code for preprocessor directives and looks for their invocations
03:46:42FromDiscord<Gumber> it's code substitution
03:46:58FromDiscord<Gumber> but there's some nuances like hygiene that come into play and are more advanced topics
03:46:59FromDiscord<fae> yes I’ve been doing a lot of reading on templates/macros in Nim
03:47:03FromDiscord<Gumber> good
03:47:10FromDiscord<Gumber> I"m trying to establish the context with C++
03:47:12FromDiscord<fae> My ecs is using them pretty heavily
03:47:16FromDiscord<Gumber> nice
03:47:34FromDiscord<Gumber> I'd say the most difficult part of learning how to interop with C++ and Nim
03:47:40FromDiscord<Gumber> is how to build C++ code
03:47:53FromDiscord<fae> Lol yea all these build systems are a pain
03:48:06FromDiscord<Gumber> I mean that's been C++'s story since day one
03:48:10FromDiscord<Gumber> bad build systems and bad compile times
03:48:15FromDiscord<Gumber> the latter can be alleviated to some egree
03:48:17FromDiscord<Gumber> (edit) "egree" => "degree"
03:48:22FromDiscord<Gumber> the former is a never ending plague
03:48:47FromDiscord<Gumber> C++ has a lot of other warts too
03:48:56FromDiscord<Gumber> I dunno if you saw my little forest gump movie thing earlier
03:49:07FromDiscord<fae> Alright gotta afk bathtime with babies
03:49:14FromDiscord<Gumber> but all those things mentioned were real
03:49:15FromDiscord<Gumber> k
04:06:02*supakeen quit (Quit: WeeChat 3.2.1)
04:06:31*supakeen joined #nim
04:09:36FromDiscord<Rika> In reply to @Gumber "you know V is": It isn't by the way, it's just very limited; I've seen some fairly complex v code already
04:16:16FromDiscord<Gumber> you're not going to convince me that V is ever going to be anything other than a meme though
04:16:40FromDiscord<Gumber> you can write code in a lot of buggy, horribly implemented, broken languages
04:16:58FromDiscord<Gumber> the fact is the author wrote a compiler that could compile C code
04:17:08FromDiscord<Gumber> and billed it as a new programming language with all of these advanced features
04:17:16FromDiscord<Gumber> and took money from people for it
04:17:31FromDiscord<Rika> I'm not gonna tell you it's good
04:17:31FromDiscord<Gumber> when in reality it didn't even have a backend
04:17:43FromDiscord<Rika> I'm just gonna tell you it at least isn't vaporware
04:17:44FromDiscord<Gumber> it's easy to build a facade
04:17:45FromDiscord<Gumber> or easier I guess
04:17:50FromDiscord<xflywind> https://github.com/vlang/v/discussions/11048
04:17:54FromDiscord<Gumber> I guess it's depends on your definition of vaporware
04:18:03FromDiscord<xflywind> it is just incomplete
04:18:11FromDiscord<Gumber> of course you have to have enough product to keep the con going
04:18:18FromDiscord<Gumber> if you want to pull the long con
04:18:51FromDiscord<Gumber> and at this point it has pour souls contributing their free time to its "development"
04:18:59FromDiscord<Gumber> but I highly doubt it's a real functioning software project
04:19:18FromDiscord<Gumber> with someone that is guiding it towards some fruitful end goal
04:19:37FromDiscord<Gumber> it is much more likely someone raking in money trying to deceive people into thinking the project has legs
04:20:29FromDiscord<xflywind> v lang keep lying and boosting by hype
04:20:33FromDiscord<xflywind> https://media.discordapp.net/attachments/371759389889003532/889365388247302204/unknown.png
04:20:54FromDiscord<xflywind> Now it changed object is freed by RC to GC.
04:21:07FromDiscord<Gumber> I mean the whole thing is a sham
04:21:14FromDiscord<Gumber> I'm surprised they even update the website
04:22:00FromDiscord<Gumber> I just remember when they had like rotating matrix style 3d doom models
04:22:11FromDiscord<Gumber> like their programming language is a game engine too lol
04:22:42FromDiscord<xflywind> (edit) "Now it changed object is freed by ... RC" added "from"
04:22:44FromDiscord<Gumber> just like how can we make this thing more shiny and attractive to people who don't really understand how computers work
04:22:48FromDiscord<Gumber> and take their money
04:23:21FromDiscord<Gumber> oh here we go
04:23:35FromDiscord<Gumber> https://media.discordapp.net/attachments/371759389889003532/889366149903564830/unknown.png
04:23:45FromDiscord<Gumber> I guess no rotation
04:23:53FromDiscord<Gumber> and it's not matrix style it's wireframe
04:24:19FromDiscord<Gumber> let's look at `tetris.v`
04:24:33FromDiscord<Yardanico> who registered nim-lang.dev lol
04:24:42FromDiscord<Yardanico> it redirects to http://qinmishu.github.io/
04:24:59FromDiscord<Gumber> https://github.com/vlang/v/blob/master/examples/tetris/tetris.v
04:25:30FromDiscord<Gumber> so they're building opengl libraries into their stdlib
04:25:35FromDiscord<Gumber> this sounds like a really really good idea
04:26:14FromDiscord<Yardanico> In reply to @Gumber "so they're building opengl": wait until you learn that their compiler has an SQL parser in it
04:26:20FromDiscord<Gumber> lol
04:26:27FromDiscord<Gumber> I mean I"m not surprised at all
04:26:40FromDiscord<Yardanico> they also had to special-case it in the codegen
04:26:45FromDiscord<Gumber> the surprising thing is that people give this person almost $1000 a month on patreon
04:26:49FromDiscord<xflywind> json, ORM in compiler too
04:27:10FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/889367054627524608/unknown.png
04:27:14FromDiscord<Gumber> no one gives me $1000 a month for being an idiot
04:27:23FromDiscord<Gumber> I guess I just need to build a fancy website
04:27:32FromDiscord<Gumber> and throw random technologies together
04:27:36FromDiscord<Yardanico> and about codegen - https://github.com/vlang/v/blob/master/vlib/v/gen/c/sql.v
04:27:38FromDiscord<Gumber> I've been doing it wrong all these years
04:28:07FromDiscord<Gumber> mmph such a pretty looking language
04:28:12FromDiscord<Gumber> thank god my compiler can parse sql
04:28:20FromDiscord<Gumber> what would I have done before vlang?
04:28:32FromDiscord<xflywind> https://github.com/vlang/v/blob/master/vlib/v/gen/c/json.v
04:28:39FromDiscord<Yardanico> LOL
04:29:03FromDiscord<Yardanico> they _still_ don't have a native (written in V) json parser?
04:29:10FromDiscord<Gumber> fuck me sidweays
04:29:15FromDiscord<Gumber> (edit) "sidweays" => "sideways"
04:29:34FromDiscord<xflywind> In reply to @Yardanico "they _still_ don't have": And they benchmarking json parser in C wrapper.
04:29:57*LyndsySimon quit (*.net *.split)
04:29:57*euantorano quit (*.net *.split)
04:30:03FromDiscord<Yardanico> i'm pretty sure there are pure-v json parser impls, so why are they using cjson in the language itself for json
04:30:13FromDiscord<xflywind> yeah, json2
04:30:19FromDiscord<Gumber> well I mean they started V by writing a C compiler
04:30:21FromDiscord<Gumber> so.....
04:30:38FromDiscord<xflywind> https://github.com/vlang/v/tree/master/vlib/x/json2
04:30:44FromDiscord<Gumber> with a different frontend
04:30:48FromDiscord<xflywind> > The name json2 was chosen to avoid any unwanted potential conflicts with the existing codegen tailored for the main json module which is powered by CJSON.
04:30:53*LyndsySimon joined #nim
04:30:55FromDiscord<Gumber> lol
04:30:55*euantorano joined #nim
04:31:03FromDiscord<Gumber> creative and lazy
04:32:06FromDiscord<Yardanico> ok let's not talk about it that much :D
04:32:19FromDiscord<Gumber> so much fun tho
04:32:28FromDiscord<Yardanico> we already have https://github.com/belamenso/v
04:32:31nrds<R2D299> itHub: 7"Write Nim only with 'v'"
04:32:36FromDiscord<Gumber> @fae started it
04:33:03FromDiscord<Gumber> lol
04:38:04*Pyautogui quit (Quit: Connection closed)
04:38:16*Pyautogui joined #nim
04:41:38*koltrast quit (*.net *.split)
04:41:38*ehmry quit (*.net *.split)
04:42:03*ehmry joined #nim
04:42:45*koltrast joined #nim
04:54:07*Pyautogui quit (Ping timeout: 252 seconds)
05:25:41nrds<Prestige99> hm welp I coded myself into a corner with generics, tried something weird, got a compiler crash lol
05:26:51FromDiscord<Rika> so what did you do
05:27:44nrds<Prestige99> Was using SomeNumber for generics, and wanted a Table[string, Foo[SomeNumber]] but I can't do that for obvious reasons. So I tried Foo[int|float], and the compiler exploded
05:27:58nrds<Prestige99> Error: internal error: getTypeDescAux(tyVoid)
05:28:11nrds<Prestige99> I just need to restructure this whole thing, back to square one
05:29:40FromDiscord<Elegantbeef> Nah you dont need to restructure it
05:30:16FromDiscord<Elegantbeef> Well you can probably use union for this
05:30:17nrds<Prestige99> Want to take a look? Could paste the file or, maybe voice/screen share would be helpful
05:30:22FromDiscord<Rika> ah yes the internal error basically everyone sees
05:30:22nrds<Prestige99> Yeah
05:30:36FromDiscord<Elegantbeef> Share the code
05:31:03nrds<Prestige99> https://play.nim-lang.org/#ix=3zpk
05:31:07FromDiscord<Elegantbeef> Yea that compiler error is due to someone not doing the check at semantic checking and it gets deferred to cgen, it's fun πŸ˜€
05:31:21nrds<Prestige99> Line 16
05:31:46FromDiscord<Elegantbeef> Yea just use union or a tagged union
05:31:46nrds<Prestige99> Basically trying to add AnimationTracks with ints and floats
05:32:18FromDiscord<Elegantbeef> Heterogeneous collections are fun, and leroize's union gives one of the better APIs
05:32:19nrds<Prestige99> i.e. that union lib?
05:32:39FromDiscord<Elegantbeef> Manually write a tagged union, use Union or use my sumtypes
05:32:44FromDiscord<Elegantbeef> The latter is probably the least good
05:33:20FromDiscord<Rika> beef why do you suck smh
05:33:31FromDiscord<Elegantbeef> I'm just a bad human
05:33:45FromDiscord<Elegantbeef> Too bad recalls do not happen
05:34:33nrds<Prestige99> Any docs on tagged unions? I'm not familiar
05:34:48FromDiscord<Elegantbeef> Object variants
05:34:55nrds<Prestige99> same thing?
05:34:59FromDiscord<Elegantbeef> https://nim-lang.org/docs/manual.html#types-object-variants
05:35:11FromDiscord<Elegantbeef> An object variant is just the nim way of doing tagged unions
05:35:19nrds<Prestige99> ah, cool thanks
05:35:35FromDiscord<impbox [ftsf]> can object variants have stuff shared across branches yet?
05:35:46FromDiscord<Elegantbeef> Nope
05:36:23FromDiscord<Elegantbeef> Do you mean shared names or repetitive statements?
05:36:59nrds<Prestige99> Hmm so this means I'll have to pass in some object variant object instead of e.g. 1.3...
05:37:16FromDiscord<Elegantbeef> Well you can make a converter/generator
05:40:18nrds<Prestige99> True
05:40:36FromDiscord<impbox [ftsf]> ahh you can have stuff common to all branches, but not common to a subset of branches
05:40:53FromDiscord<impbox [ftsf]> https://play.nim-lang.org/#ix=3zpm
05:41:01FromDiscord<impbox [ftsf]> `common` works but `bar` doesn't
05:41:55FromDiscord<Elegantbeef> Yea fairly certain araq is against allowing duplicate symbols in branches
05:43:43FromDiscord<Elegantbeef> If you only need to support 2 types prestige https://play.nim-lang.org/#ix=3zpn
05:43:47nrds<Prestige99> Idk this feels very messy
05:44:22FromDiscord<Elegantbeef> I mean you want to hold two values of different types welcome to heterogeneous collections
05:44:43nrds<Prestige99> I think there's probably a better solution, I just don't know what it is
05:45:04nrds<Prestige99> I don't really need them in the same collection, I just need access to the data
05:45:12FromDiscord<impbox [ftsf]> seq of float keys and seq of int keys?
05:45:38FromDiscord<Elegantbeef> Impbox dont know if you've looked as of late but this is the RFC https://github.com/nim-lang/RFCs/issues/368
05:45:41nrds<Prestige99> That would work, but then I'd need to find out which one I'm supposed to look in
05:46:29FromDiscord<impbox [ftsf]> @ElegantBeef nah, cool
05:47:50nrds<Prestige99> Atm I'm using a string (animation name) as a lookup into a table, where the value is an AnimationTrack (one animated property, either an int or a float)
05:48:09nrds<Prestige99> I could use two maps, but then would potentially need to do 2 lookups to find the right animation
05:48:16FromDiscord<impbox [ftsf]> Prestige, otherwise your option is dynamic dispatch
05:48:43FromDiscord<Elegantbeef> the OOP method might be the simplest and least ugly
05:48:43nrds<Prestige99> How would that be used here?
05:49:14*kayabaNerve quit (Ping timeout: 268 seconds)
05:49:38FromDiscord<impbox [ftsf]> sent a code paste, see https://play.nim-lang.org/#ix=3zpq
05:50:19nrds<Prestige99> oh then store a collection of KeyFrame... not a bad idea
05:50:32FromDiscord<impbox [ftsf]> yup
05:50:40nrds<Prestige99> Thanks, I'll give that a shot
05:51:28FromDiscord<impbox [ftsf]> I guess the object variant style is more performant though, but if performance isn't an issue this should be easy
05:51:48FromDiscord<Elegantbeef> Well the inheritance style is also more flexible
05:51:50FromDiscord<impbox [ftsf]> i wish there was a way to write OOP style and have it transformed into object variant style
05:52:33FromDiscord<Elegantbeef> God damn it impbox i hate you πŸ˜›
05:52:50nrds<Prestige99> I'd like to get the object variant style working without the API needing to know about the object variant existing
05:53:18FromDiscord<Elegantbeef> I say i hate you cause that's not impossible to implement but would require tagging everything
05:54:04*kayabaNerve joined #nim
05:54:38FromDiscord<impbox [ftsf]> aww i was expecting you to jump in with a playground link to a super complex macro
05:54:43FromDiscord<Elegantbeef> God damn it am i going to make a dynamic dispatch macro for object variants?!
05:55:40FromDiscord<Rika> beef about to hack nim
05:56:08FromDiscord<Elegantbeef> Not really hack it as much as make my own "vtable"
06:11:32nrds<Prestige99> Is there a way I could just cast that tuple seq to a seq[KeyFrame] without having to use `toKeyFrame` manually on the first element?
06:11:53FromDiscord<Elegantbeef> Does `var a: seq[Keyframe]` work?
06:12:20nrds<Prestige99> Nope
06:21:28nrds<Prestige99> This also seems to not prevent some type checking at compile time, hmm. Going to have to keep thinking this over
06:36:43FromDiscord<Varriount> Anyone know if there's a way to tell the compiler to not resolve a type for a NimNode before being passed into a macro? `untyped` doesn't seem to be doing the trick here.
06:36:48FromDiscord<Varriount> https://play.nim-lang.org/#ix=3zpy
06:37:24FromDiscord<Varriount> In reply to @nrds "<Prestige> Is there a": Converter procedures?
06:38:45FromDiscord<Elegantbeef> Here we go my MVP for variant Vtables πŸ˜› https://play.nim-lang.org/#ix=3zpz
06:38:56FromDiscord<Elegantbeef> @impbox [ftsf]\: and prestige you guys probably will be interested
06:39:06FromDiscord<impbox [ftsf]> nah i was just joking =p
06:39:15FromDiscord<impbox [ftsf]> haha no that'd be super cool checks
06:39:30FromDiscord<Varriount> `result = impl[2][2][0][0][0]` - gesundheit
06:39:39FromDiscord<Elegantbeef> Yea that was done hastily
06:39:52FromDiscord<Elegantbeef> It's not about doing it properly, it's about sending a message
06:39:55FromDiscord<Elegantbeef> Quite literally
06:40:24FromDiscord<Varriount> _imagines @ElegantBeef threatening the compiler with a spanner_
06:40:28nrds<Prestige99> :o
06:40:36FromDiscord<Elegantbeef> Varriount you're doing `static[Grammar]` and passing in a var
06:40:49FromDiscord<Elegantbeef> change to a constant and doneskii
06:40:53FromDiscord<Varriount> Yes. Do I need to pass in a const?
06:41:06FromDiscord<Elegantbeef> `static` is a compile time constant
06:41:07FromDiscord<Elegantbeef> So yes
06:41:20FromDiscord<Elegantbeef> Remove static and it also works
06:41:29FromDiscord<Elegantbeef> Well it will work if you emit a call instead of calling it at compile time
06:42:00FromDiscord<Varriount> Yay! One tiny step done for NPeg 2.0
06:43:15FromDiscord<Varriount> The idea is to perform minimal transformation of the PEG DSL, and "run" it with a grammar object in order to record a PEG AST.
06:43:27FromDiscord<Elegantbeef> The cool thing with that vtable thing is if you uncomment one of the procs it gives you a sort of proper error message πŸ˜›
06:44:05FromDiscord<Elegantbeef> But this does bounce around a lot so i figure it might not be the best for compile time, but alas it works
06:44:23FromDiscord<Varriount> Elegantbeef: Honestly, proper vtables (especially ones that work with concepts) is one of the few things I think the standard library/language needs.
06:45:00*PMunch joined #nim
06:45:12FromDiscord<Elegantbeef> I've toyed with interfaces with the new concepts but i havent looked into implementing vtables
06:45:32FromDiscord<Elegantbeef> The macro cache is quite powerful though so it makes life fun
06:46:22FromDiscord<Elegantbeef> And nah i just threaten it by suggesting i'd put more of my code inside of it↡(@Varriount)
06:46:26FromDiscord<Elegantbeef> Makes it run atleast 10% faster
06:46:45*max22- joined #nim
06:54:53ZevvVarriout: whazup
06:55:19ZevvVarriount, that is
06:57:20FromDiscord<Archion> Hi
06:57:28FromDiscord<Elegantbeef> Hello
06:57:35FromDiscord<Archion> I have a good question for you
06:57:56FromDiscord<Elegantbeef> Just for me?
06:58:10FromDiscord<Archion> Which is good and why is it good for you? Linux or windows
06:58:16FromDiscord<Archion> In reply to @Elegantbeef "Just for me?": For everyone
06:58:39FromDiscord<Rika> depends on your usecasd
06:58:40FromDiscord<Rika> (edit) "usecasd" => "usecase"
06:58:58FromDiscord<Archion> Because linux is a poop for me
06:59:05FromDiscord<cabboose> I need to use windows because my projects are all deployed on windows
06:59:06FromDiscord<Archion> Or the teacher teaching badly
06:59:13FromDiscord<Elegantbeef> Well most nim users are linux users afaik
06:59:52FromDiscord<xflywind> why?
07:00:36FromDiscord<Rika> why to who
07:00:48FromDiscord<Elegantbeef> Who to why
07:00:57FromDiscord<cabboose> WhY tO lIfE
07:01:21FromDiscord<Rika> ok
07:01:44FromDiscord<cabboose> Why to who
07:02:37FromDiscord<xflywind> https://media.discordapp.net/attachments/371759389889003532/889406169507061790/13.png
07:02:52FromDiscord<xflywind> https://nim-lang.org/blog/2021/01/20/community-survey-results-2020.html
07:03:03FromDiscord<impbox [ftsf]> I use windows, but i prefer linux
07:03:18FromDiscord<Elegantbeef> Quick everyone burn down the vim using windows user
07:03:20FromDiscord<Rika> "damn those on ios are hardcore huh must be hard developing on an iphone"
07:03:23FromDiscord<Rika> (i am joking)
07:03:35FromDiscord<Rika> proceeds to burn beef
07:03:36FromDiscord<impbox [ftsf]> i do everything in vim and bash on windows
07:12:48*Vladar joined #nim
07:46:25*neurocyte013 joined #nim
07:46:25*neurocyte013 quit (Changing host)
07:46:25*neurocyte013 joined #nim
08:05:58*pro joined #nim
08:06:08*pro quit (Client Quit)
08:15:19*neurocyte013 quit (Quit: The Lounge - https://thelounge.chat)
08:18:28*neurocyte013 joined #nim
08:18:28*neurocyte013 quit (Changing host)
08:18:28*neurocyte013 joined #nim
08:20:43FromDiscord<Varriount> Sublime Text + PyCharm
08:30:03*kayabaNerve quit (Remote host closed the connection)
08:30:28*kayabaNerve joined #nim
08:38:56*neurocyte013 quit (Quit: The Lounge - https://thelounge.chat)
08:54:07FromDiscord<hmmm> Not surprised VScode is so popular, you get most of the essential functionality for a tiny fraction of vim / emacs learning curve
09:00:34NimEventerNew thread by Alexeypetrushin: JsonNode should be Any, see https://forum.nim-lang.org/t/8441
09:01:20FromDiscord<Rika> What?
09:32:01*stkrdknmibalz quit (Quit: WeeChat 3.0.1)
09:37:36FromDiscord<haxscramper> In reply to @Rika "What?": 10^10 IQ developers here, don't be surprised
09:43:38FromDiscord<fae> messing around seeing if i can compile the compiler with emscripten and run it in the browser
09:44:10FromDiscord<fae> https://media.discordapp.net/attachments/371759389889003532/889446829186502718/Screen_Shot_2021-09-20_at_2.43.13_AM.png
09:44:15FromDiscord<fae> it works
09:45:27FromDiscord<fae> now to figure out how to feed it input and get output
09:45:37FromDiscord<impbox [ftsf]> awesome
09:45:52FromDiscord<Yardanico> In reply to @fae "messing around seeing if": yeah I've tried doing this in the past as well but didn't quite succeed
09:46:11FromDiscord<Yardanico> like I couldn't get it to actually compile, this is just it outputting help
09:46:19FromDiscord<Yardanico> it was showing some weird crashes when actually compiling code
09:46:36FromDiscord<fae> yea im sure there is still a decent amount of work to do
09:46:51FromDiscord<fae> but i think it would be cool if we had a playground that ran fully in the browser
09:46:56FromDiscord<enthus1ast> maybe compile to js works, or nimscript
09:47:32FromDiscord<fae> i tried compiling with js backend first, lots of errors from things not being defined, or throwing errors when trying to be used, like things related to fs
09:47:41FromDiscord<impbox [ftsf]> i've been meaning to set up nico+nimscript in the browser so you can play around with it live
09:47:54FromDiscord<impbox [ftsf]> js backend is pretty limited
09:47:54FromDiscord<fae> that would be very cool
09:48:18FromDiscord<impbox [ftsf]> beef made a nice script to auto gen nimscript bindings
09:48:28FromDiscord<impbox [ftsf]> https://github.com/beef331/nimscripter
09:48:29nrds<R2D299> itHub: 7"Quick and easy Nim <-> Nimscript interop"
09:48:32FromDiscord<Yardanico> In reply to @enthus1ast "maybe compile to js": nah, that won't really work
09:48:46FromDiscord<Yardanico> I mean that it'll be a lot of work to make Nim compiler compile with the JS backend
09:48:53FromDiscord<Yardanico> a lot
09:49:19FromDiscord<enthus1ast> compiler/vmconv needs some love
09:49:33FromDiscord<fae> yea i started to go thru stuff and stub out missing defines and removing some error pragmas and stuff but i didnt really know what i was doing lol
10:05:59*clemens3 quit (Quit: WeeChat 2.7)
10:23:23FromDiscord<tandy> are there any plans for it to eventualy get done?↡(@Yardanico)
10:23:50FromDiscord<Yardanico> don't think so, haven't seen any discussions about that
10:39:49*clemens3 joined #nim
10:51:35*pro joined #nim
10:56:22*pro quit (Client Quit)
11:00:41*max22- quit (Ping timeout: 264 seconds)
11:33:06PMunchHow should I wrap `extern` variables from C?
11:33:21PMunchI can't do `extern` in Nim because that's apparently something else..
11:43:32*rockcavera quit (Ping timeout: 265 seconds)
11:51:52*neurocyte013 joined #nim
11:55:22*rockcavera joined #nim
11:58:25*max22- joined #nim
11:59:25*neurocyte013 quit (Quit: The Lounge - https://thelounge.chat)
12:01:00*neurocyte013 joined #nim
12:06:01*supakeen quit (Quit: WeeChat 3.3)
12:06:31*supakeen joined #nim
12:16:54FromDiscord<deech> In reply to @PMunch "I can't do `extern`": {.exportc.} externs for you.
12:29:56arfyhmmm. getting an error here.
12:30:29arfytrying to use the when statement to set an init function based on platform, and it's giving me an expression error.
12:30:49FromDiscord<Rika> can you elaborate more
12:30:56FromDiscord<Rika> preferably with code
12:31:24arfyhttps://play.nim-lang.org/#ix=3zrf
12:32:22FromDiscord<Rika> whats the error?
12:32:51arfyoh... wait...
12:33:00*arfy slaps head.
12:33:04FromDiscord<Rika> ?
12:33:07FromDiscord<Rika> xd
12:33:11arfytype mismatches between nim and C code.
12:37:20arfyyay
12:37:32PMunch@deech, it does?
12:37:32arfyon to the second file now. progress
12:37:42PMunchLike extern the C keyword
12:45:24FromDiscord<haxscramper> C extern must be defined in the Nim code actually
12:45:49FromDiscord<haxscramper> Or it is defined in the c librarary somewhere else
12:49:40*arkurious joined #nim
12:49:53*max22- quit (Ping timeout: 264 seconds)
12:55:55*neurocyte013 quit (Ping timeout: 252 seconds)
13:01:24FromDiscord<auxym> if there's no other way, via {.emit.} I guess? Like the volatile templates: https://github.com/nim-lang/Nim/blob/version-1-4/lib/pure/volatile.nim#L23
13:02:08*kayabaNerve_ joined #nim
13:04:43*kayabaNerve quit (Ping timeout: 252 seconds)
13:05:35*neurocyte013 joined #nim
13:05:35*neurocyte013 quit (Changing host)
13:05:35*neurocyte013 joined #nim
13:07:30*neurocyte013 quit (Client Quit)
13:09:09*neurocyte013 joined #nim
13:09:09*neurocyte013 quit (Changing host)
13:09:09*neurocyte013 joined #nim
13:09:43*neurocyte013 quit (Client Quit)
13:11:34*neurocyte013 joined #nim
13:11:34*neurocyte013 quit (Changing host)
13:11:34*neurocyte013 joined #nim
13:17:41*max22- joined #nim
13:25:53FromDiscord<levovix> sent a code paste, see https://play.nim-lang.org/#ix=3zrw
13:27:15*pro joined #nim
13:27:23FromDiscord<ynfle (ynfle)> I don't think so unless the whole thing is passed in to the macro. But you can use for loop macros to insert it before the for loop
13:33:32arfyyay! code refactor successfull
13:35:08FromDiscord<haxscramper> In reply to @auxym "if there's no other": `emit` is an `exportc`, but then you would have to actually import the variable in order to use it nim
13:36:15FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3zrB
13:36:21*rockcavera quit (Remote host closed the connection)
13:36:30FromDiscord<haxscramper> Alternative would be `var count {.exportc.}: cint` (i suppose)
13:54:54*pro quit (Quit: WeeChat 3.2.1)
14:09:04FromDiscord<isd> Does anyone know how to use registry module to write a key in REG_DWORD ? I can't see to find a way to write anything other than REG_SZ
14:13:13*PMunch quit (Quit: Leaving)
14:15:06*Pyautogui joined #nim
14:33:28*pro joined #nim
14:41:50*Pyautogui quit (Ping timeout: 246 seconds)
14:45:09*pro quit (Quit: WeeChat 3.2.1)
14:52:42FromDiscord<isd> oh there is nim-registry as well, it seems to have that functionality
15:08:02*neurocyte013 quit (Quit: The Lounge - https://thelounge.chat)
15:27:43*neurocyte013 joined #nim
15:27:43*neurocyte013 quit (Changing host)
15:27:43*neurocyte013 joined #nim
15:27:44*neurocyte013 quit (Client Quit)
15:28:43*neurocyte013 joined #nim
15:28:43*neurocyte013 quit (Changing host)
15:28:43*neurocyte013 joined #nim
15:51:52FromDiscord<KnorrFG> Hey, how do i convert a string into a set of chracters, but the built in one, not the hashset
15:52:06FromDiscord<KnorrFG> i couldnt find any conversion function
15:53:30FromDiscord<Rika> what do you mean?
15:54:00FromDiscord<KnorrFG> there are two types of sets, the built in one, which is a bitset, and the Hashset in sets. toSet actually converts to a hashSet
15:54:43FromDiscord<KnorrFG> but I want to have the bitset, because I'll only have 8 valid sets, and want to write a case statement, and use the set literals in there
15:58:00FromDiscord<KnorrFG> sent a code paste, see https://play.nim-lang.org/#ix=3zsD
16:00:11*neurocyte013 quit (Ping timeout: 265 seconds)
16:02:34FromDiscord<Archion> sent a code paste, see https://play.nim-lang.org/#ix=3zsJ
16:02:41FromDiscord<KnorrFG> no, its supposed to be nim ^^
16:02:47FromDiscord<Archion> Ohk
16:03:08FromDiscord<Archion> If you talk about nim language i feel that i'm dumb
16:06:32FromDiscord<KnorrFG> nvim `Error: selector must be of an ordinal type, float or string`
16:07:13FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3zsL
16:07:15FromDiscord<haxscramper> And do the same for other part
16:07:17FromDiscord<KnorrFG> sent a code paste, see https://play.nim-lang.org/#ix=3zsM
16:08:08FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3zsN
16:08:14FromDiscord<haxscramper> A little repetetive on the `in letters` part though
16:08:18nrds<Prestige99> Is there a way to write a converter for a seq? I want to convert a seq[(int, float)] to a seq[(float, float)]. My attempts have failed
16:09:06FromDiscord<KnorrFG> sent a code paste, see https://play.nim-lang.org/#ix=3zsP
16:11:32nrds<Prestige99> Or do I have to manually build a new seq, iterating over each tuple
16:12:16FromDiscord<Krypton> I wanted ask a stupid quesrion
16:12:30FromDiscord<Krypton> Does nim have support for pointers
16:12:39FromDiscord<Krypton> (edit) "Does nim have support for pointers ... " added "?"
16:12:54FromDiscord<Rika> yes
16:13:23FromDiscord<Krypton> Its like dream come true
16:13:31FromDiscord<Krypton> Python + C
16:13:39FromDiscord<Krypton> (edit) "Python + C ... " added "= Nim"
16:13:47FromDiscord<Rika> nim does not try to work like python
16:13:51FromDiscord<Rika> it only looks like it
16:14:08FromDiscord<fae> pointers are untraced, must be managed manually. refs are also stack allocated but traced by gc
16:14:19FromDiscord<fae> (edit) "stack" => "heap"
16:14:22FromDiscord<Krypton> yea , by python , i only mean the small amounts of line you have to code like python
16:14:33FromDiscord<Rika> i guess so
16:14:47FromDiscord<fae> (edit) "pointers" => "`pointer`s" | "refs" => "`ref`s"
16:14:56FromDiscord<Krypton> In reply to @fae "`pointer`s are untraced, must": Gc ? , well manually managing pointers is ok for me cause i know C
16:15:15FromDiscord<fae> yes Nim has a few built in gc strategies
16:15:16FromDiscord<Rika> even if you know C its still recommended to use the GC and red
16:15:17FromDiscord<Rika> (edit) "red" => "ref"
16:15:26FromDiscord<Krypton> Ok
16:15:36FromDiscord<Krypton> In reply to @fae "yes Nim has a": Ok
16:15:38FromDiscord<Rika> it doesnt have much of a performance impact if youre worried about that
16:15:58FromDiscord<fae> https://nim-lang.org/docs/gc.html
16:16:17FromDiscord<Krypton> Well , truth to be said , i dont know nim , i had this question so , i guess i am gonna see youtube videos tutorials abt it
16:16:23FromDiscord<Krypton> In reply to @fae "https://nim-lang.org/docs/gc.html": Thanks
16:16:56FromDiscord<Krypton> I heard nim was used in a malware ?
16:19:49FromDiscord<Archion> ~~Go use assembly~~
16:20:10FromDiscord<Krypton> apparently C is too hard for and seg faults make me go rant
16:20:21FromDiscord<Krypton> (edit) "apparently C is too hard for ... and" added "me"
16:20:29FromDiscord<Archion> i like c# and javascript :)
16:20:45FromDiscord<Krypton> i hate .net framework
16:20:58FromDiscord<Krypton> just a personal opinion
16:21:30FromDiscord<Archion> In reply to @Krypton "*i hate .net framework*": I need to learn that in school lol
16:22:13FromDiscord<Krypton> In reply to @Archion "I need to learn": Yea , like we have to learn Office 365 for 10 years in school
16:22:27FromDiscord<Archion> Wha-?
16:22:45FromDiscord<Krypton> In reply to @Archion "Wha-?": Yea
16:22:49FromDiscord<Krypton> It was hell
16:23:00FromDiscord<Archion> Epic
16:23:07FromDiscord<Krypton> Epic ?
16:23:10FromDiscord<Krypton> πŸ˜‚
16:23:17FromDiscord<Archion> Yes :)
16:23:25FromDiscord<Krypton> No , not epic
16:23:35FromDiscord<Archion> Sometime i am being rude or idk
16:23:41FromDiscord<Krypton> https://tenor.com/view/its-time-to-stop-stop-clock-time-gif-5001372
16:23:57FromDiscord<Krypton> In reply to @Archion "Sometime i am being": They are doing this for 30 years now
16:24:01FromDiscord<Archion> Imagine the iimagination of image perm
16:24:11FromDiscord<Archion> (edit) "iimagination" => "imagination"
16:24:20FromDiscord<Archion> In reply to @Krypton "They are doing this": πŸ€·β€β™‚οΈ
16:24:29FromDiscord<Rika> In reply to @Krypton "*apparently C is too": if you get segfaults easily then yes i recommend using the GC
16:24:30FromDiscord<Rika> lol
16:24:32FromDiscord<Krypton> We cant do anything
16:24:46FromDiscord<Archion> In reply to @Rika "if you get segfaults": Using group chat?
16:24:48FromDiscord<Archion> Oki
16:24:55FromDiscord<Krypton> In reply to @Rika "if you get segfaults": Not easily , but lets just say , i get the hardest ones
16:25:13FromDiscord<Krypton> Fucking sucks to be a C programmer
16:25:26FromDiscord<Archion> In reply to @Rika "if you get segfaults": Segfaults word made me laugh
16:25:38FromDiscord<Rika> its not that bad but theres a lot of features you're just absolutely used to in higher level languages
16:25:44FromDiscord<Rika> a lot of missing features
16:25:56FromDiscord<Archion> I have a question
16:26:01FromDiscord<Rika> i mean of course since it's a language probably older than both of you two
16:26:01FromDiscord<Krypton> I wonder if you can create polymorphic engines in C
16:26:15FromDiscord<Krypton> In reply to @Rika "i mean of course": true
16:26:17FromDiscord<Archion> If i want to make a 3d game then C or C++ or C# should i use?
16:26:22FromDiscord<Krypton> (edit) "C" => "nim"
16:26:23FromDiscord<Rika> if you can make it in one lang you can make it in C, just depends on how much time youre willing to invest
16:26:46FromDiscord<Rika> this is a nim server and channel, i wont answer general programming questions like that
16:26:46FromDiscord<Krypton> In reply to @Archion "If i want to": Unreal Engine
16:26:51FromDiscord<Krypton> Or else forget
16:27:18FromDiscord<Archion> In reply to @Krypton "Unreal Engine": I want to use Unity :-)
16:27:21FromDiscord<Krypton> In reply to @Rika "this is a nim": Ok i guess , i was asking if its possible to create polymorphic engines in Nim
16:27:32FromDiscord<Krypton> In reply to @Archion "I want to use": Your choice
16:27:44FromDiscord<Krypton> Self modifying code
16:27:54FromDiscord<Krypton> I am interested in that
16:28:02FromDiscord<Archion> Hack discord with Nim
16:28:04FromDiscord<Archion> Imagine
16:28:15FromDiscord<Rika> In reply to @Krypton "Ok i guess ,": i meant that for archion
16:28:24FromDiscord<Krypton> In reply to @Rika "i meant that for": Oh ok
16:28:31FromDiscord<Rika> In reply to @Archion "Hack discord with Nim": if you are developing malware then i shall not entertain your questions
16:28:51FromDiscord<Archion> I won't make a malware
16:28:56FromDiscord<Krypton> In reply to @Rika "if you are developing": Malware ? i shall no do such a thing
16:29:01FromDiscord<Krypton> Never
16:29:22FromDiscord<Rika> im suspicious of you two but i feel like neither of you could do it anyway so /shrug
16:29:22FromDiscord<Archion> Maybe i will try to make something and get free nitro forever
16:29:36FromDiscord<Archion> In reply to @Rika "im suspicious of you": Β―\\_(ツ)\_/Β―
16:29:49FromDiscord<Krypton> In reply to @Rika "im suspicious of you": I made a bootloader in asm and a r , leave that
16:29:58FromDiscord<Krypton> (edit) "," => ".....,"
16:30:27FromDiscord<Krypton> are you sure ?
16:30:48FromDiscord<Archion> In reply to @Krypton "I made a bootloader": What is asm? πŸ˜†
16:31:00FromDiscord<Krypton> In reply to @Archion "What is asm? πŸ˜†": x86 Assembly
16:31:12FromDiscord<Archion> :l
16:31:17FromDiscord<linux user> bruh
16:31:22FromDiscord<Archion> Ok you are too smart
16:31:38FromDiscord<Krypton> In reply to @Archion "Ok you are too": It was joke ?
16:31:46FromDiscord<Krypton> Dont take it seriously pls ?
16:31:55FromDiscord<Archion> Ok?
16:32:01FromDiscord<Krypton> Thanka
16:32:10FromDiscord<Archion> But they are smart
16:32:16FromDiscord<Krypton> In reply to @Archion "But they are smart": Who ?
16:32:31FromDiscord<Krypton> I mean
16:32:48FromDiscord<Archion> Rika#2434 for example
16:32:56FromDiscord<Krypton> I can write assembly and have written a bootloader in assembly , :)
16:33:20FromDiscord<Archion> Imagine making own operating system
16:33:36FromDiscord<Krypton> In reply to @Archion "*Imagine making own operating": I am trying
16:33:38FromDiscord<Krypton> https://github.com/Krypton279/Blakernel
16:33:40nrds<R2D299> itHub: 7"A kernel built by 2 strangers"
16:33:42FromDiscord<Archion> In reply to @Archion "*Imagine making own operating": Ok its impossible for my small brain
16:34:17FromDiscord<Krypton> In reply to @Archion "Ok its impossible for": It seems impossible for me aswell but i am making small progress , memory management sucks , you know ?
16:34:53FromDiscord<Krypton> @linux user is that fidel castro or che guevara or richard stallman in your pfp ?
16:36:36FromDiscord<@bracketmaster-5a708063d73408ce4> is there a way to conditionally import something in nim at compiletime?
16:37:00FromDiscord<Rika> yes
16:37:04FromDiscord<Rika> depends on your condition
16:37:21FromDiscord<Smarc> sent a code paste, see https://play.nim-lang.org/#ix=3zt1
16:37:32FromDiscord<Recruit_main707> In reply to @Rika "depends on your condition": thats how conditions work :p
16:37:46FromDiscord<Rika> thats not what i mean by depends
16:37:51FromDiscord<linux user> In reply to @Krypton "<@751471979282038954> is that fidel": ricahrdstallmen
16:37:59FromDiscord<Krypton> In reply to @richard stallmen(crazy GNU guy) "ricahrdstallmen": Ok
16:38:06FromDiscord<Rika> In reply to @Smarc "Hey, I have the": prolly compile with --app:gui
16:38:07FromDiscord<Recruit_main707> In reply to @Rika "thats not what i": i know i know, dont worry
16:38:35FromDiscord<@bracketmaster-5a708063d73408ce4> @\_discord\_259277943275126785\:t2bot.io - my condition can be evaluated at compiletime
16:38:48FromDiscord<Rika> okay
16:38:55FromDiscord<Rika> `when condition: import xxx`
16:38:57FromDiscord<Smarc> In reply to @Rika "prolly compile with ": does not change anything :/
16:39:10FromDiscord<@bracketmaster-5a708063d73408ce4> ok thx
16:39:15FromDiscord<Rika> huh i thought --app:gui doesnt keep the terminal open
16:39:27FromDiscord<Rika> or did i misunderstand something
16:39:36FromDiscord<Rika> are you running the binary by doubleclicking on it or w/e
16:39:40FromDiscord<Rika> not on the terminal is what i mean
16:39:53FromDiscord<Rika> OH
16:39:54FromDiscord<Rika> wait
16:39:56FromDiscord<Smarc> What I want is the program to play a sound anytime a key is pressed, systemwide
16:40:07FromDiscord<Rika> you need to swap how you manage keypresses then
16:40:33FromDiscord<Rika> idk windows so sorry
16:40:38FromDiscord<Smarc> I figured that getch() is the bottleneck here. I tried playing around with illwill, but I did not make it wait for a keypress, it just runs the loops
16:40:43FromDiscord<Smarc> I'm a Linux user
16:40:50FromDiscord<Rika> oh its linux?
16:40:54FromDiscord<Rika> getch is only on the term
16:41:14FromDiscord<Smarc> so I need to somehow hook keypresses or sth, right?
16:41:26FromDiscord<Rika> yeah pretty much
16:41:43FromDiscord<Smarc> You got some hints for that maybe? Never worked on that lowlevel
16:42:20FromDiscord<Rika> XKB
16:42:36FromDiscord<Rika> prolly
16:42:37FromDiscord<Rika> /usr/share/X11/xkb/
16:42:50FromDiscord<Rika> or evdev?
16:42:57FromDiscord<Rika> https://en.wikipedia.org/wiki/Evdev
16:43:41FromDiscord<Rika> evdev if you want to go really really low but make it work no matter the display server i guess
16:44:15*rockcavera joined #nim
16:44:16*rockcavera quit (Changing host)
16:44:16*rockcavera joined #nim
16:58:01*neurocyte013 joined #nim
16:58:01*neurocyte013 quit (Changing host)
16:58:01*neurocyte013 joined #nim
16:59:02FromDiscord<fae> yea you need system wide keypresses which is a pain to do cross platform
17:05:11FromDiscord<Smarc> well I'm fine if it is just linux
17:05:29FromDiscord<Smarc> I found some nim "keyloggers", but most of them are pretty windows-y
17:18:48FromDiscord<fae> In reply to @Smarc "I found some nim": some googling revealed https://github.com/kwhat/libuiohook which seems promising
17:18:50nrds<R2D299> itHub: 7"A multi-platform C library to provide global keyboard and mouse hooks from userland."
17:23:07FromDiscord<Smarc> Thank you for your effort, but I fear translating/importing that to nim is way above my competence
17:25:54FromDiscord<fae> the API is relatively minimal, it would be a good opportunity to learn some FFI πŸ™‚ Nim makes FFI really easy
17:26:28FromDiscord<fae> and there are a dozens of nim wrapped c libraries for reference
17:28:45FromDiscord<frankzig> are there `seq`'s with custom indexing? arrays are unfortunately only stack allocated and compile time
17:28:55FromDiscord<frankzig> (as far as I understand)
17:32:33FromDiscord<Rika> No
17:33:52NimEventerNew question by victorzki: Nim: `Unable to process type: nnkBracketExpr` when unmarshal to type with Table[string, seq[string]], see https://stackoverflow.com/questions/69258617/nim-unable-to-process-type-nnkbracketexpr-when-unmarshal-to-type-with-table
17:34:23FromDiscord<Alea> In reply to @frankzig "are there `seq`'s with": Can't you just transform your custom indexing into standard indexing before using it in the seq?
17:38:11*jemt joined #nim
17:41:27jemthi, would this be a valid definition of a "dictionary" in Nim: Table[string, seq[string]] ? I'm trying to unmarshal a json object using to() but getting an exception "Unable to process type: nnkBracketExpr"
17:56:44FromDiscord<krisppurg> jemt, what is the json data?
17:57:12FromDiscord<krisppurg> (edit) "data?" => "data that you are trying unmarshalize"
18:00:51FromDiscord<Gumber> Unmatshalize πŸ˜‚
18:01:03FromDiscord<Gumber> (edit) "Unmatshalize" => "Unmarshalize"
18:01:44FromDiscord<Gumber> Bet that was autocorrect
18:02:27FromDiscord<Gumber> I would expect that to unmarshal into a map and list
18:02:43FromDiscord<Gumber> Well a map with a string key and a list value
18:03:24FromDiscord<Gumber> But unable to process type and NK bracket expression sounds to me like the serialized to Jason macro is having difficulty with something in your data type
18:03:38FromDiscord<Gumber> And since it's a standard library data type I don't know
18:03:51FromDiscord<Gumber> What version of nim are you on
18:04:14jemtkrisppurg it's something like this: "features": { "featureA": ["a","b"], "featureB": [] ... }
18:04:22FromDiscord<Gumber> (edit) "serialized" => "serialize" | "Jason" => "Json"
18:04:39jemtthank's for the clarification of the spelling guys haha
18:04:44FromDiscord<fae> jemt check out this minimal example https://play.nim-lang.org/#ix=3ztB
18:04:57FromDiscord<fae> is this something like you mean?
18:05:27FromDiscord<fae> and can you post some example code
18:05:30FromDiscord<Gumber> I'd be very surprised if this didn't work and it wasn't user error
18:05:45FromDiscord<Gumber> Unless there's some super nasty regression in the Jason module
18:06:01FromDiscord<Gumber> Sorry I'm using text to speech on my phone so there's like no grammar or proper punctuation
18:06:05jemtfae sure, I'll create a snippet.. hold on
18:06:51FromDiscord<fae> also i havent really used std/json much, i've been using treeforms jsony lib
18:11:56FromDiscord<Gumber> If I have the time and bandwidth at work I'm going to see if I can find a way to speed up Jason's serialization using Nim by calling into it from elixir
18:12:31jemtfae here you go: https://play.nim-lang.org/#ix=3ztG - that works though, that's strange...
18:12:45FromDiscord<Gumber> There's a C ibrary already for elixir that has a interface composed of NIFs or native implemented functions which is elixirs form of interop
18:12:45jemtturned out that my nim version is 0.17.2
18:13:05FromDiscord<Gumber> And it's faster than the library we use which is a pure elixir implementation
18:13:26FromDiscord<Gumber> But since Nim was approved at work I'm going to see if I can speed up Json serealization with it
18:13:37FromDiscord<Gumber> That's a really really old version of Nim
18:13:43FromDiscord<Gumber> How did you install that
18:13:49FromDiscord<Gumber> Your operating systems package manager
18:13:52FromDiscord<Gumber> ?
18:14:02jemtyep... apt-get
18:14:35FromDiscord<Gumber> Yeah I don't do that
18:14:46FromDiscord<Gumber> (edit) removed "I"
18:14:53jemtnote to self that I shouldn't do that either
18:14:55*neurocyte013 quit (Ping timeout: 252 seconds)
18:14:57jemthehe
18:15:05FromDiscord<Gumber> Either building install from source or download or use choose Nim but never install from package managers
18:15:20FromDiscord<Gumber> (edit) "building" => "build and"
18:16:17FromDiscord<Gumber> There's no obligation from the maintainers of the package distribution list to make sure the latest version of NIM is on them and name supports almost every operating system and platform under the sun so the only way Nim distributions get updated is if someone uses them and wants them updated
18:16:40FromDiscord<Gumber> (edit) "name" => "Nim"
18:16:46FromDiscord<Gumber> In other words ain't nobody got time for that
18:17:00jemtAh, alright
18:17:44FromDiscord<Gumber> Depending on your level of experience with compilers programming languages build systems operating systems etc the route you install them that is optimal will differ
18:17:51FromDiscord<Gumber> If you are new you should use choose Nim
18:18:05FromDiscord<Gumber> If you know your way around your operating systems environment downloading binaries and distributions is probably the easiest route to go
18:18:32FromDiscord<Gumber> If you are comfortable with the terminal command line C and C++ compilers and everything else that name relies on manual building from source is probably the best route
18:19:08*neurocyte013 joined #nim
18:19:08*neurocyte013 quit (Changing host)
18:19:08*neurocyte013 joined #nim
18:19:58FromDiscord<Gumber> Also if you plan on hacking on the name compiler or anything like that then you would want to manually build an install too
18:20:20FromDiscord<Gumber> Name == Nim my phone is just stupid
18:20:40FromDiscord<fae> Gumber is specifically talking about the CLI tool `choosenim` if that wasn't clear, text to speech doesnt do programmer talk very well lol
18:20:52FromDiscord<Gumber> Not at all
18:20:55FromDiscord<fae> (edit) "Gumber is specifically talking about the CLI tool `choosenim` if that wasn't clear, ... text" added "speech to" | removed "to speech"
18:21:01FromDiscord<Gumber> Google's NLP is weak sauce
18:21:23jemthaha
18:21:32jemtthanks for helping out guys
18:22:14FromDiscord<Goel> sent a long message, see http://ix.io/3ztK
18:22:22FromDiscord<fae> while you're at it though do also look into jsony if you're comfortable using things outside of stdlib, it's much faster
18:22:27jemtI guess I'll go for the binaries, I just started to play around with nim this afternoon so no hacking on the compiler in sight for me in a while I guess
18:22:47jemtoh ok, I'll check that out! thanks
18:23:07FromDiscord<Goel> (edit) "long message," => "code paste," | "http://ix.io/3ztK" => "https://play.nim-lang.org/#ix=3ztM"
18:24:34*jemt quit (Quit: Leaving)
18:24:41*max22- quit (Ping timeout: 264 seconds)
18:49:20*PMunch joined #nim
18:52:08FromDiscord<Gumber> Yeah don't get me wrong choose nim is fine but it does mean installing an additional binary on your machine and it expects a certain directory structure to be present on your machine to work
18:52:36FromDiscord<Gumber> The main advantage of it is being able to seamlessly switch between multiple installations of NIM and install new versions via the CLI
18:52:51FromDiscord<Gumber> But if you're not going to take advantage of any of that it's probably overkill
18:53:39FromDiscord<Gumber> Also learning how to install NIM manually and learning about some of the tooling that comes with an install isn't a bad idea because if you ever run into a compiler crash and need to gather debug information understanding how koch temp works is important
18:58:30*max22- joined #nim
19:02:21FromDiscord<fae> In reply to @Goel "Is there a procedure": like https://nim-lang.org/docs/sequtils.html#count%2CopenArray%5BT%5D%2CT ?
19:14:23FromDiscord<Kiloneie> Does anyone use IntelliJ IDEA for Nim ?
19:14:39FromDiscord<Gumber> better question is
19:14:49FromDiscord<Gumber> does anyone like intellij ide?
19:15:01FromDiscord<Kiloneie> idk, i only used pycharm from them before
19:15:13FromDiscord<Gumber> those IDEs are only useful if you're using them with the languages they're inteded to be used with
19:15:22FromDiscord<Gumber> and I mean PyCharm is about as useful as notepad
19:15:38FromDiscord<Gumber> I guess the one feature that was nice for pycharm was being able to attach to the python process running inside of a docker container
19:15:41FromDiscord<Gumber> even remotely
19:15:57FromDiscord<Gumber> but that was probably the only feature I found useful that I couldn't replicate in an editor
19:16:12FromDiscord<Gumber> other than that - I think people who use IDEs like intellij for languages like Nim are a bit silly
19:16:23FromDiscord<Gumber> they must like wasting gigabytes of ram for no real reason
19:16:50FromDiscord<Kiloneie> Fair enough
19:17:11FromDiscord<Kiloneie> used to be IDEs for everyone before VS Code and the likes
19:17:19FromDiscord<Kiloneie> very laggy
19:17:31FromDiscord<Gumber> huh?
19:17:35FromDiscord<Gumber> no it didn't
19:17:45FromDiscord<Gumber> people have been using vim and emacs to write code for decades
19:17:49FromDiscord<Gumber> not quite sure what you're talking about
19:18:21FromDiscord<Kiloneie> well sure, but i used videos to learn back then and NOBODY used a code editor in the ones i watched
19:18:26FromDiscord<Gumber> IDEs got popular around the same time object oriented programming did
19:18:46FromDiscord<Gumber> probably because you watched videos about programming from people who were new to programming
19:18:57FromDiscord<Gumber> and thought using an IDE was a good idea / mandatory or something
19:19:18FromDiscord<Gumber> unless someone is like trying to make money teaching or something, good programmers don't generally spend their time making youtube videos
19:19:28FromDiscord<Gumber> they generally spend their time programming πŸ™‚
19:20:10FromDiscord<fae> every time i open up xcode i die
19:20:26FromDiscord<Gumber> oh yeah xcode is a effing nightmare
19:20:32FromDiscord<Gumber> it's like - hey visual studio wasn't bad enough
19:20:43FromDiscord<Gumber> let's see if we can ramp this UI hell up
19:21:03FromDiscord<fae> VS was sooo expensive back then too
19:21:05FromDiscord<Gumber> like anyone who prefers an IDE to an editor is crazy to me
19:21:09FromDiscord<Gustavo6046> inb4 Nim for DOS
19:21:22FromDiscord<fae> i remember my dad having a subscription to msdn in the 90s and it costing an arm and a leg
19:21:26FromDiscord<Gumber> you really like navigating overly complex user iterfaces and clicking on buttons to do everything?
19:21:41FromDiscord<Gumber> memorizing a billion applicaton specific shortcuts is fun to you?
19:21:43FromDiscord<Gumber> okay!
19:21:59FromDiscord<Gumber> In reply to @Gustavo6046 "inb4 Nim for DOS": what does that have to do with anything?
19:22:06FromDiscord<fae> i actually really like vscode 🀷
19:22:07FromDiscord<Gustavo6046> it'd be fun
19:22:10FromDiscord<Gumber> we're talking about IDEs and operating systems
19:22:13FromDiscord<Gumber> editors I mean
19:22:14FromDiscord<Gumber> not operating systems
19:22:19FromDiscord<fae> i feel like MS turned it around with vsc
19:22:37FromDiscord<Gumber> In reply to @Gustavo6046 "it'd be fun": that's pretty subjective, but sure
19:22:54FromDiscord<Gumber> In reply to @fae "i feel like MS": I don't think it was VSC I think it was .NET core
19:22:59FromDiscord<Gumber> and all the work on mono etc
19:23:24FromDiscord<Gumber> once they had the ability to target linux and mac with their runtime
19:23:29FromDiscord<fae> oh sure, .net was huge, i was only talking about IDEs
19:23:39FromDiscord<Gumber> all their software got way better and then we got VS for mac and linux and vscode followed
19:23:47FromDiscord<Gumber> but vscode was all possible because of electron
19:23:55FromDiscord<Gumber> well I mean .NET has been around for a long time
19:24:03FromDiscord<Gumber> like the CLR has been around since I started programming
19:24:12FromDiscord<Gumber> but it was a windows only thing for a long time
19:24:29FromDiscord<Gumber> now they have .NET core and can run .NET applications on the three major operating systems
19:24:44FromDiscord<Gumber> but it doesn't solve the cross platform UI issue
19:24:52FromDiscord<Gumber> so that's where electron comes in
19:25:11FromDiscord<Gumber> so it was like a confluence of things that happened
19:25:12FromDiscord<fae> two projects that initially drew me into nim were nimx and fidget
19:25:19FromDiscord<fae> i think nim is well positioned to take on the cross platform UI story
19:25:37FromDiscord<Gumber> I disagree and have voiced my vocal opposition to fidget's design
19:25:37FromDiscord<fae> i think treeform has a nice vision for fidget
19:25:38FromDiscord<Gumber> and why I think it's bad
19:25:47FromDiscord<Gumber> but others disagree which is fine
19:25:53FromDiscord<Gumber> I just don't think it's going anywhere
19:25:59FromDiscord<Gumber> it doesn't really solve the problem anyway
19:26:22FromDiscord<Gustavo6046> yes, subjective
19:26:40FromDiscord<Gustavo6046> it wouldn't be objectively good and there are definitely more important efforts to pursue
19:26:42FromDiscord<Gustavo6046> nonetheless it'd be interesting
19:26:48FromDiscord<Gumber> again subjective πŸ™‚
19:27:19FromDiscord<fae> how do you feel about the nimx project
19:28:49FromDiscord<Gumber> again I don't think it really is going to go anywhere and it doesn't solve the problem
19:29:04FromDiscord<Gumber> look the problem with both of those libraries is they are tightly coupled with certain technologies
19:29:11FromDiscord<Gumber> they're not agnostic which is a huge design flaw
19:29:23FromDiscord<Gumber> a UI library should handle managing the UI
19:29:31FromDiscord<Gumber> it shouldn't be responsible for drawing it
19:29:38FromDiscord<Gumber> that's a separate task and responsibliity
19:29:43FromDiscord<Gumber> and should be treated as such
19:29:57FromDiscord<Gumber> what if I want to use Direct3d to draw my API or Vulkan or Cairo?
19:30:13FromDiscord<Gumber> a GUI library shouldn't handle eventing for me
19:30:22FromDiscord<Gumber> I shouldn't be tied to GLFW's event handling because I use your GUI library
19:30:26FromDiscord<Gumber> that's a bad side effect
19:30:34FromDiscord<Gumber> or SDL's or whatever
19:30:44FromDiscord<Gumber> I shoudl be able to use your GUI library with whatever windowing / event management library I want
19:30:58FromDiscord<Gumber> the only decent Nim GUI library I've seen that aims to be cross paltform is....
19:31:03FromDiscord<fae> i think most people want a ui library that does both, ie that is has batteries included to do drawing (with various backend plugins). But the design of the library and how you split up and export your modules etc is a different topic
19:31:17FromDiscord<Gumber> https://github.com/trustable-code/NiGui
19:31:19nrds<R2D299> itHub: 7"Cross-platform desktop GUI toolkit written in Nim"
19:31:20FromDiscord<Gumber> and it's still a long way off
19:31:36FromDiscord<fae> There is not reason you can't split up the lib to separate the responsibilities of UI and gfx
19:31:41FromDiscord<Gumber> most people is a pretty broad category
19:31:43FromDiscord<fae> WIth pluggable backends
19:31:53FromDiscord<Gumber> yes there is
19:31:58FromDiscord<Gumber> if you base your entire GUI library around GLFW
19:32:08FromDiscord<Gumber> then no one is goign to be able to use it without using GLFW
19:32:13FromDiscord<Gumber> (edit) "goign" => "going"
19:32:16FromDiscord<Gumber> what if I don't want to use GLFW?
19:32:27FromDiscord<Gumber> a UI library should handle managing the UI that's it
19:32:35FromDiscord<Gumber> it should manage the state of my ui
19:32:46FromDiscord<Gumber> and it should tell me when something happened in my UI so I can do something about it
19:32:57FromDiscord<Gumber> other than that I don't want my UI library to do anything but tell me what needs to be drawn and when
19:33:10FromDiscord<Gumber> it's also nice if it has built in widggets etc
19:33:11FromDiscord<fae> fidget has multiple backends already
19:33:14FromDiscord<Gumber> and a layout engine
19:33:19FromDiscord<Gumber> yeah but they're not reallyb ackends
19:33:24FromDiscord<Gumber> it can use opengl and glfw
19:33:27FromDiscord<Gumber> that's not a backend
19:33:39FromDiscord<Gumber> that's a requirement
19:33:51FromDiscord<fae> btw i dont completely disagree with you, which is why i was working on things like <https://github.com/farism/flex>
19:33:53FromDiscord<Gumber> I don't think you're understanding the nuance here
19:33:56FromDiscord<Gumber> okay
19:34:00FromDiscord<Gumber> like IMGUI is a good UI library
19:34:01FromDiscord<fae> i like the idea of smaller composable UI pieces
19:34:03FromDiscord<Gumber> Nuklear is a good ui library
19:34:11FromDiscord<Gumber> yes they're not retained, they are immediate mode
19:34:13FromDiscord<Gumber> but that's not the point
19:34:22FromDiscord<Gumber> you could do very similar things with a retained mode UI library
19:34:43FromDiscord<Gumber> what treeform has built is closer to something like Qt
19:34:50FromDiscord<Gumber> same thing with NimX
19:35:01FromDiscord<Gumber> neither of which I really want or need
19:35:02FromDiscord<fae> imgui has drawing capabilities built in though, they just happen to have implemented a ton of backends
19:35:08FromDiscord<Gumber> no it doesn't
19:35:12FromDiscord<Gumber> have you used IMGUI?
19:35:21FromDiscord<Gumber> it doesn't draw anything
19:35:34FromDiscord<Gumber> it gives you a bunch of information so you can submit your own draw commands to the API of your choosing
19:35:39FromDiscord<Gumber> but it doesn't do any drawing
19:35:52FromDiscord<Gumber> trust me - I've wrapped and used both libraries extensively
19:35:55FromDiscord<Gumber> imgui and nuklear
19:37:29FromDiscord<fae> i guess im confused because imgui ships with a ton of backends for drawing
19:37:38FromDiscord<Gumber> that doesn't mean it's a part of the library
19:37:44FromDiscord<Gumber> yes you are confused
19:37:58FromDiscord<Gumber> IMGUI and nuklear ar every simple libraries
19:38:03FromDiscord<Gumber> they don't do anyhint about events
19:38:08FromDiscord<Gumber> they don't do anything about drawing
19:38:14FromDiscord<Gumber> they basically track what's happening with the UI
19:38:20FromDiscord<Gumber> and give you enough data
19:38:31FromDiscord<Gumber> so that every frame you know what to draw and where and how to render your UI
19:38:40FromDiscord<Gumber> ANYONE can implement a backend for nuklear / imgui
19:38:44FromDiscord<Gumber> just because it ships with some out of the box
19:38:47FromDiscord<Gumber> doesn't mean they're a part of the library
19:38:55FromDiscord<Gumber> I've written backends for IMGUI and Nuklear for BGFX for instance
19:39:00FromDiscord<Gumber> that doesn't mean BGFX is a hard requirement
19:39:02FromDiscord<fae> sent a code paste, see https://play.nim-lang.org/#ix=3zu6
19:39:06FromDiscord<Gumber> okay stop and listen to what I"m saying please
19:39:07FromDiscord<fae> i don't see any drawing calls here in userland
19:39:13NimEventerNew thread by Stefan_Salewski: FieldPairs iterator, see https://forum.nim-lang.org/t/8442
19:39:15FromDiscord<Gumber> yeah because nothing was drawn there
19:39:34FromDiscord<Gumber> there's an entire separate unit of code doing the drawing
19:39:38FromDiscord<Gumber> which is NOT a part of the library
19:39:42FromDiscord<Gumber> it is implemented IN userland
19:39:59FromDiscord<Gumber> libraries have tests and examples
19:40:02FromDiscord<Gumber> are they part of the library?
19:40:08FromDiscord<Gumber> same deal here
19:40:23FromDiscord<Gumber> if you want to use treeform's widget on a desktop application with hardeware accelerated rendering
19:40:33FromDiscord<Gumber> you don't have a choice EXCEPT to use GLFW and OpenGL
19:40:40FromDiscord<Gumber> and even if OpenGL becomes optional - GLFW won't
19:40:48FromDiscord<Gumber> and you don't have a choice on how to handle or respond to UI events
19:40:53FromDiscord<Gumber> fidget does all that for you
19:41:04FromDiscord<Gumber> again - it is way more opinionated / does more than just UI
19:41:41FromDiscord<Gumber> and I don't want to debate or argue about facts lol
19:41:48FromDiscord<fae> i guess i just dont really know what you meant by your original statement of "it doesnt solve the cross platform ui problem". If it's batteries included and it works on a bunch of different platforms that kind of solves the problem
19:41:50FromDiscord<Gumber> like this is the truth and you're not going to convince me otherwise
19:41:56FromDiscord<fae> it may just not be implemented in the way you want
19:42:04FromDiscord<Gumber> no it has nothing to do with the implementation
19:42:12FromDiscord<Gumber> but you're refusing to hear or listen to what I"m saying
19:42:21FromDiscord<Gumber> maybe I have different requirements than yuou
19:42:24FromDiscord<Gumber> (edit) "yuou" => "you"
19:42:30FromDiscord<fae> i feel like i hear pretty clearly what you are saying, you want something less coupled. its pretty clear haha
19:42:33FromDiscord<Gumber> for a cross platform UI library but I've been pretty clear and explicit in my explanation
19:42:46FromDiscord<Gumber> yeah so - that's why I don't think it's a good UI library
19:42:52FromDiscord<Gumber> because not everyone wants these decisions made for them
19:42:55FromDiscord<Gumber> for good reasons
19:42:58FromDiscord<Gumber> it's not just being pick or pedantic
19:43:05FromDiscord<Gumber> (edit) "pick" => "picky"
19:44:28FromDiscord<Goel> In reply to @fae "like https://nim-lang.org/docs/sequtils.html#count%": @fae Yes i was looking for that, thanks πŸ™‚
19:44:32FromDiscord<fae> well my original point is that _Nim_ is well positioned to solve the cross platform UI issue, not necessarily fidget or nimx, i was just mentioning those as projects of interest
19:44:45FromDiscord<Gumber> I don't think it's any more well suited than any other language
19:44:52FromDiscord<Gumber> cross platform GUI is a difficult problem to solve
19:45:04FromDiscord<Gumber> unless operating system developers start embracing Nim
19:45:07FromDiscord<Gumber> I don't think the situation is going to change much
19:45:19FromDiscord<Gumber> there's a reason it's the way it is
19:45:32FromDiscord<fae> i would like to eventually get to a world where people do rewrite c/c++ libraries in higher level languages rather than just wrapping them
19:45:33FromDiscord<Gumber> and it's not because there's no well suited technology
19:45:41FromDiscord<Gumber> why?
19:45:58FromDiscord<fae> idk, just utopian thinking
19:46:06FromDiscord<Gumber> I mean it's completely transparent to you
19:46:09FromDiscord<Gumber> as a consumer of the library
19:46:19FromDiscord<Gumber> it's not even really utopian thinking
19:46:26FromDiscord<Gumber> it's a bit impractical
19:46:35FromDiscord<Gumber> it's nice to have pure implementations of certain libraries sure
19:46:45FromDiscord<Gumber> but some things you can't implement in Nim
19:46:51FromDiscord<Gumber> you need assembly
19:47:01FromDiscord<Gumber> and other things are better not to be implemented in a higher level language
19:47:08FromDiscord<Gumber> because reasons
19:47:52FromDiscord<fae> well i didnt mention assembly, i only talked about c/c++. and i know you have your opinions on rust, but apparently many people do think that its worth it to rewrite some of these long standing c++ libs in a safer more egonomic (lol) language
19:48:08FromDiscord<Gumber> anyone who things Rust is more ergonomic than C++ is silly af
19:48:12FromDiscord<Gumber> and / or on drugs
19:48:14FromDiscord<fae> hence the lol πŸ™‚
19:48:25FromDiscord<Gumber> okay but like rust isn't really higher level than C++
19:48:27FromDiscord<fae> but ask the rustaceans πŸ™‚
19:48:30FromDiscord<Gumber> so what you said is a bit of a misstatement
19:48:37FromDiscord<Gumber> it's pretty much at the same abstraction level of C++
19:49:04FromDiscord<Gumber> and higher level doesn't automatically mean safer
19:49:10FromDiscord<Gumber> soooo it was hard to parse what you were truly getting at
19:49:16FromDiscord<fae> true, i guess they have just codified some of the lower level aspects like memory management, giving a "higher level" feel to it
19:49:27FromDiscord<Gumber> but yes - there is, in some arenas, value in memory safety when it comes to computing
19:49:39FromDiscord<Gumber> in others it's pretty much a pointless pursuit (like game development)
19:49:57FromDiscord<Gumber> I mean C++ has memory management
19:50:04FromDiscord<Gumber> it has RAII
19:50:23FromDiscord<Gumber> `new` `delete`
19:50:27FromDiscord<Gumber> it's just not automatic memory management
19:50:39FromDiscord<Gumber> RAII is closer to it but not the same as garbage collection
19:51:02FromDiscord<Gumber> and in the grand scheme of things memory management is simple
19:51:11FromDiscord<Gumber> like - I could crank out a memory management subsystem for a game engine in two weeks
19:51:26FromDiscord<fae> it is one of the really impressive things about Nim though, that it does feel so high level
19:51:26FromDiscord<Gumber> and it would be perfect, production ready, and usable for the rest of my project's lifespan as well as future projects
19:51:36FromDiscord<fae> but you can really get down to the nitty gritty if you need to
19:51:49FromDiscord<Gumber> yeah well I find that those who praise its high level features
19:51:52FromDiscord<Gumber> rarely get into the nitty gritty
19:52:03FromDiscord<Gumber> I mean of course there are efforts to do so
19:52:18FromDiscord<Gumber> but currently, the only realistic way to do low level systems programming with Nim is to resort to unsafe means
19:52:26FromDiscord<Gumber> or slow abstractions like channels etc
19:52:39FromDiscord<Gumber> and most pepole who are all about safety and the gc and stuff don't like to do that stuff
19:52:41FromDiscord<fae> like using `pointer` everywhere?
19:52:49FromDiscord<Gumber> so their applications tend to be higher level
19:52:53FromDiscord<fae> and turning gc off lol
19:52:59FromDiscord<Gumber> right now if you want to use threads with Nim you're going to either have to use channels or `pointer`
19:53:02FromDiscord<Gumber> or `ptr`
19:53:05FromDiscord<Gumber> turning the GC off is extreme
19:53:20FromDiscord<Gumber> but if you're writing for SBCs or something or doing a lot of IoT work you might be doing that
19:53:26FromDiscord<Gumber> it's just you give up most of the stdlib in doing so
19:53:39FromDiscord<Gumber> and Nim basically becomes C with some better (subjective) syntax and types
19:53:53FromDiscord<fae> that is good enough for some people im sure
19:53:58FromDiscord<fae> especially with the metaprogramming capabilities
19:54:08FromDiscord<Gumber> yeah I mean don't get me wrong Nim is great I love Nim
19:54:20FromDiscord<Gumber> but it's rare I see folks who use it for like embedded / 3d gaming stuff etc
19:54:31FromDiscord<Gumber> using like ref objects etc
19:54:38FromDiscord<Gumber> like I use pointers A LOT
19:55:04FromDiscord<Gumber> only if I"m writing some code that I know doesn't need to be performant or I know will never execute on anything but a single thread will I start using GCd mem
19:55:04*Gustavo6046 quit (Ping timeout: 252 seconds)
19:55:17FromDiscord<Gumber> I mean of course like stack allocations and stuff I dont' care about
19:55:41FromDiscord<Gumber> but if I"m allocating anything on the heap and I know there's the potential for it to be accessed by another thread it's automatically going to be a manual allocation / free
19:56:11FromDiscord<Gumber> and one nice thing about Nim is I can always write my own allocator that uses `malloc` and `free` to implement my own allocator
19:56:13FromDiscord<fae> im looking forward to learning about threading
19:56:21FromDiscord<Gumber> and then I can track allocations and memory usage by subsystem
19:56:46*Gustavo6046 joined #nim
19:56:55FromDiscord<Gumber> Yeah well you might want to temper your excitement
19:57:12FromDiscord<Gumber> Concurrency in parallelism are some of the more complicated topics in computer science
19:57:20FromDiscord<fae> oh shit forgot i ordered food like 30 min ago lol afk
19:57:23FromDiscord<Gumber> And you don't get good at them overnight or in a year or even in two years
19:57:59FromDiscord<Gumber> You have to really have a solid understanding of your programming language it's memory model your operating system how system threads work and are implemented you need to understand concurrency primitive like what a mutex is what a semaphore is what a condition is what a lock is
19:58:16FromDiscord<Gumber> You need to understand the difference between I/o bound and CPU bound and be able to identify when a certain type of concurrency should be applied
19:58:58FromDiscord<Gumber> There is a ton to learn about when it comes to that topic and when you go to actually start practicing and implementing some multi-threaded code it requires a different mode of thinking versus how you might normally go about authoring a program that executes on a single system thread
19:59:39FromDiscord<Gumber> Like if you don't fully understand how you're operating system scheduler works you don't know enough to write good multithreaded code
19:59:59FromDiscord<Gumber> Because the operating system scheduler is what is going to be switching between thread contexts and just switching between two threads has side effects and implications
20:00:28FromDiscord<Gumber> So when someone starts talking about writing multithreaded code to someone who's been there and done that it's kind of a I wish you good luck scenario
20:01:30FromDiscord<Gumber> A lot of this would probably go over your head but either way it would give you a good introduction to some concepts in concurrency and multi-threading I shared it the other day but if you want to link all grab it
20:01:44FromDiscord<Gumber> But I highly recommend listening to the podcast by the guys that are building the machinery on their fiber-based job system
20:11:03*Vladar quit (Remote host closed the connection)
20:32:22*PMunch quit (Quit: leaving)
20:37:33*Gustavo6046_ joined #nim
20:38:31*Gustavo6046 quit (Ping timeout: 252 seconds)
20:40:02*Gustavo6046_ is now known as Gustavo6046
21:27:40*arfy8820 joined #nim
21:30:26*arfy quit (Ping timeout: 260 seconds)
21:30:36*arfy8820 is now known as arfy
21:41:27FromDiscord<Smarc> sent a code paste, see https://play.nim-lang.org/#ix=3zuE
21:41:59*sagax quit (Ping timeout: 268 seconds)
21:44:49FromDiscord<enthus1ast> nice library
21:44:50*max22- quit (Quit: Leaving)
21:46:25FromDiscord<enthus1ast> https://github.com/kwhat/libuiohook/blob/1.2/demo/demo_hook.c
21:46:37FromDiscord<enthus1ast> hook\_run
21:46:50FromDiscord<enthus1ast> but you must supply the logger and dispatcher proc
21:47:52FromDiscord<Smarc> what do you mean by supply? Never worked with FFI's in Nim
21:48:46FromDiscord<enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=3zuG
21:49:19FromDiscord<Smarc> Actually I have no clue how to work with those extern functions yet . . Are you keen to help me a little with my small project?
21:49:42FromDiscord<enthus1ast> this could be a pointer to a nim proc which has the {.cdecl.} pragma
21:49:54FromDiscord<enthus1ast> and implements the matching proc header
21:50:07FromDiscord<enthus1ast> and return oc.
21:51:39FromDiscord<enthus1ast> i would start by wrapping the uihook.h with c2nim
21:52:10FromDiscord<enthus1ast> then i guess you can use the compile pragma on the c code
21:52:45FromDiscord<enthus1ast> or link the compiled c code to your nim executable
21:53:57FromDiscord<enthus1ast> or maybe, depending on what you wanna do, there is another way, instead of global hooking
21:54:37FromDiscord<Smarc> well I want to simulate a mech keyboard, so I want a program running in the bg that reacts with a sound on every key pressed, regardless of the focused window
21:54:59FromDiscord<enthus1ast> for windows?
21:55:06FromDiscord<Smarc> I already made a program that is capable of that if it has focus, using BASS
21:55:09FromDiscord<Smarc> for linux
21:55:56FromDiscord<Smarc> sent a code paste, see https://play.nim-lang.org/#ix=3zuH
21:57:33FromDiscord<Smarc> just in a good programming language :P
21:57:40FromDiscord<Smarc> and ofc without electron-garbage
21:59:37FromDiscord<enthus1ast> yeah try to wrap uihook.h first (either manually, with c2nim or nimterop) then compile the c sources either with your program or build libuihook to a lib and link it to your nim program
22:00:55FromDiscord<Smarc> I actually don't know how to get nim to know those custom libraries. I followed the install guide on the uihook-github but nim gives me a "no such file or directory" if i want to import hook_run()
22:01:37FromDiscord<enthus1ast> you must first create a nim wrapper of the header
22:02:00FromDiscord<enthus1ast> so that your nim program knows how the functions must be called
22:02:24FromDiscord<Smarc> I don't exactly know what you mean by that
22:02:36FromDiscord<enthus1ast> have a look at this example\: https://github.com/OpenSystemsLab/xxhash.nim/blob/master/src/xxhash.nim
22:02:39FromDiscord<Smarc> sent a code paste, see https://play.nim-lang.org/#ix=3zuK
22:03:00FromDiscord<Smarc> (tried uiohook.h too)
22:04:05FromDiscord<enthus1ast> {.compile\: "private/xxHash/xxhash.c".} # \<--- here the c is compiled alongside with the nim app
22:04:29FromDiscord<enthus1ast> then the function is declared\:↡`proc XXH32(input: ptr UncheckedArray[byte], length: csize_t, seed: uint32): uint32 {.cdecl, importc: "XXH32".} `
22:05:32FromDiscord<enthus1ast> you basically recreate a "nim header" file for the c library
22:08:05FromDiscord<enthus1ast> but i can imagine that the c library is easier to wrap when build with cmake as a lib, then just linked
22:14:54nrds<Prestige99> Can I not modify values passed into a proc generated inside a macro?
22:15:50nrds<Prestige99> e.g. https://play.nim-lang.org/#ix=3zuL line 14, I can't reassign `time`
22:25:20nrds<Prestige99> ah nvm, it has to be a var...
22:32:18*arfy8820 joined #nim
22:34:41*arfy quit (Ping timeout: 246 seconds)
22:34:44*arfy8820 is now known as arfy
22:41:42FromDiscord<@bracketmaster-5a708063d73408ce4> This seemingly trivial nim snippet fails rather ungracefully...
22:41:42FromDiscord<@bracketmaster-5a708063d73408ce4> https://play.nim-lang.org/#ix=3zuM
22:42:39FromDiscord<dom96> do we have anything in stdlib (or as nimble package) that format floats to a certain number of significant figures?
22:42:58FromDiscord<Elegantbeef> https://nim-lang.org/docs/strutils.html#formatFloat%2Cfloat%2CFloatFormatMode%2Crange%5B%5D%2Cchar
22:43:05FromDiscord<Elegantbeef> There is also one that does sci notation
22:43:35FromDiscord<Elegantbeef> Actually that does it you just provide `ffScientific`
22:43:46FromDiscord<enthus1ast> ..... this i rolled myself two days ago
22:43:51FromDiscord<enthus1ast> nice to know
22:44:08FromDiscord<Elegantbeef> Bracket this is you failing to allocate a ref object
22:44:14FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=3zuN
22:44:47FromDiscord<Elegantbeef> Ref objects are by default initialized to a nil pointer, you must allocate either using the object constructor or by using `new` to use the fields
22:44:50FromDiscord<Elegantbeef> Otherwise you're derferencing nil
22:44:54FromDiscord<dom96> afaik scientific notation isn't the same as significant figures
22:45:43FromDiscord<Elegantbeef> I said also
22:46:07FromDiscord<dom96> well... formatFloat doesn't do it either lol
22:46:23FromDiscord<Elegantbeef> Scientific notation uses significant figures though
22:47:05FromDiscord<Elegantbeef> 5243 with 2 significant figures is `5.2 10^3` or `5.2e3`
22:47:24nrds<Prestige99> Elegantbeef I finally got that animation system working just now.. lol
22:47:33FromDiscord<Elegantbeef> Congrats
22:48:40nrds<Prestige99> Thanks, was a bear
22:49:42FromDiscord<dom96> I need it to give e0
22:50:07FromDiscord<Elegantbeef> You want to count the significant digits in a float?
22:52:44FromDiscord<Elegantbeef> There is also `formatEng`
22:54:30FromDiscord<dom96> hm, that might be good enough
22:54:54FromDiscord<dom96> but really I want: formSig(4000.42, precision=2) -> 4000.4
22:54:58FromDiscord<dom96> (edit) "formSig(4000.42," => "formatSig(4000.42,"
22:55:34FromDiscord<Elegantbeef> Ok so you dont want sig digits you want decimals
22:56:17FromDiscord<dom96> No, I want significant figures: https://en.wikipedia.org/wiki/Significant_figures
22:56:18FromDiscord<Elegantbeef> Wait... why would you get `4000.4` with 2 percision
22:56:58FromDiscord<dom96> 4000.4 has 2 significant figures/digits
23:00:52FromDiscord<dom96> oh well, formatEng will do
23:01:24FromDiscord<Elegantbeef> Well even that link agrees that `4000.42` may or may not be represented as `4.0e3`
23:01:36FromDiscord<Elegantbeef> There is ambiguity with sigdigs in that case
23:03:54FromDiscord<Elegantbeef> But then again i just dont want to admit i was never taught the case that 0's following integer values can be sig digs
23:04:32FromDiscord<Elegantbeef> So prestige what did you end with OOP or variants?\>
23:04:57nrds<Prestige99> a converter
23:05:00nrds<Prestige99> lol
23:05:09FromDiscord<Elegantbeef> That doesnt answer the question
23:05:16FromDiscord<Elegantbeef> Are you only using floats?
23:05:38nrds<Prestige99> Yeah, converting int to floats, then back to ints later
23:05:40nrds<Prestige99> https://git.einheit.tech/EinheitTechnologies/shade/src/commit/ed060db609ef4ec3cc890af79195f9f23295a57c/src/shadepkg/game/animation.nim
23:07:01nrds<Prestige99> I didn't use either oop or variants so, yeah
23:09:42*federico3 is now known as federico3_
23:09:57*federico3[m] is now known as federico
23:09:59FromDiscord<Elegantbeef> Also damn you and varriount i've been thinking about concepts + vtable like stuff
23:10:07*federico is now known as federico3
23:10:19nrds<Prestige99> I imagine there's a cleaner way to do what I'm doing here but I couldn't figure it out, e.g. the template I use at the very bottom
23:10:38nrds<Prestige99> bascially is just for `field is int`
23:11:29FromDiscord<Elegantbeef> i mean the macro has `T` so use `T is int` instead
23:12:06*federico3 quit (Changing host)
23:12:06*federico3 joined #nim
23:12:07nrds<Prestige99> It wouldn't compile iirc
23:12:09FromDiscord<Elegantbeef> or `field is int`
23:12:21FromDiscord<Elegantbeef> dont lie to me
23:12:36FromDiscord<Elegantbeef> `typeof(field) is int`?
23:12:43FromDiscord<Elegantbeef> Dont make me go get my macro beating stick
23:13:19*federico3_ left #nim (https://quassel-irc.org - Chat comfortably. Anywhere.)
23:13:27nrds<Prestige99> when `field` is int did work :) I just tried T before
23:13:29nrds<Prestige99> Thanks
23:13:45FromDiscord<Elegantbeef> Well T should've also worked afaik
23:14:02nrds<Prestige99> 🀷
23:14:33nrds<Prestige99> it always expected a float when I tried that
23:15:11nrds<Prestige99> https://git.einheit.tech/EinheitTechnologies/shade/src/commit/ed060db609ef4ec3cc890af79195f9f23295a57c/src/shadepkg/game/faketestentity.nim Here's an example of it in use, pretty neat
23:15:54FromDiscord<Elegantbeef> Now i have to wonder what this does better than my impl
23:16:06nrds<Prestige99> The macro one?
23:16:31FromDiscord<Elegantbeef> Yea my macro impl vs this
23:16:35nrds<Prestige99> Probably nothing better but I couldn't figure out how to work with yours
23:16:52FromDiscord<Elegantbeef> Ah you just defined a lerp for the type you wanted πŸ˜›
23:33:21FromDiscord<@bracketmaster-5a708063d73408ce4> can you pass a typedesc to a function as an argument?
23:35:57FromDiscord<auxym> yes, see as example: https://github.com/nim-lang/Nim/blob/version-1-4/lib/system/memalloc.nim#L121
23:50:45FromDiscord<@bracketmaster-5a708063d73408ce4> OK
23:50:56FromDiscord<@bracketmaster-5a708063d73408ce4> I ended up going with a template\: https://play.nim-lang.org/#ix=3zuZ
23:51:17FromDiscord<@bracketmaster-5a708063d73408ce4> Seems unhappy with me passing in a string though ^^
23:51:39FromDiscord<Elegantbeef> Nope
23:52:05FromDiscord<Elegantbeef> templates replace all instances that match parameters with that parameter
23:52:06FromDiscord<@bracketmaster-5a708063d73408ce4> nope?
23:52:10FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=3zv1
23:52:31FromDiscord<@bracketmaster-5a708063d73408ce4> oh yeah - not hygenic
23:52:37FromDiscord<Elegantbeef> It's hygenic
23:53:00FromDiscord<Elegantbeef> When looking for symbols it's preferential to passed in parameters
23:56:24FromDiscord<@bracketmaster-5a708063d73408ce4> hmm