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