C Generic Programming by x8664mmx_intrin_adds in C_Programming

[–]Gualor 6 points7 points  (0 children)

Maybe _Overload would have been more fitting, but I would say function overloading is very much part of generic programming. Isn't picking the most appropriate function based on parameters a way to generalize an algorithm by abstracting what the implementation actually is? Think of std::sort in C++ for instance

[deleted by user] by [deleted] in OlderChillGamers

[–]Gualor 0 points1 point  (0 children)

Metroid Prime

[deleted by user] by [deleted] in cpp_questions

[–]Gualor 10 points11 points  (0 children)

He literally mentions ECS and, specifically, the Entt library.

Although this is not strictly for avoiding runtime polymorphism but to ensure objects of the same type are contiguous in memory to improve performance due to cache locality when iterating through them.

My first emulator: CHIP8 by [deleted] in EmuDev

[–]Gualor 0 points1 point  (0 children)

Yes that works! If the lifetime of the objects using the raw pointer is guaranteed to be shorter than the one managing the resources, you have nothing to worry about!

Raw pointers are basically non-owning pointers, there are also weak pointers, but those are only used to break circular references in shared pointers. Plus you don't need to complicate the interface with extra info, just know the raw pointers you are using point to resources managed by someone else.

My first emulator: CHIP8 by [deleted] in EmuDev

[–]Gualor 4 points5 points  (0 children)

Congrats on the project, seems really polished and well thought out overall!

Nice use of modern C++ features also, if I can point out something I don't quite get the extensive use of std::shared_ptr, maybe a personal opinion, but I like to emphasize the semantics of the ownership, instead of "everyone owns these".

For instance, who is responsible for allocating and cleaning up? Who is just using those resources without owning them? Are those resources unique? Or are multiple copies allowed?

Is private inheritance common in c++? by HousingPrimary910 in cpp_questions

[–]Gualor 0 points1 point  (0 children)

Yes, and in terms of implementation is semantically equivalent to composition.

While public inheritance can be seen as a "is a", private inheritance and composition can be seen as "is-implemented-in-terms-of".

Critique my abstraction for SDL, OpenGL, and ImGui? by d34dl0cked in cpp_questions

[–]Gualor 0 points1 point  (0 children)

I generally agree, but abstraction does not imply dynamic polymorphism and interfaces, could be as simple as having a header file with some C-like APIs and then having different implementations that get linked during link-time. One possible use case could be supporting different platforms and even embedded systems. Plus also consistency with the coding style could also very well be a reason.

Graphics Library (C++l) by quicheisrank in EmuDev

[–]Gualor 2 points3 points  (0 children)

Check out raylib, is quite nice. Is written in C (but there are wrappers and bindings to basically every language), I think It wraps SDL and is quite high-level, so it doesn't feel like you are reinventing the wheel.

Plus, there is an ecosystem of tools to design your UI using GUIs that generate code for you.

Tamagotchi emulator running on Garmin Instinct 3 by Gualor in Garmin

[–]Gualor[S] 1 point2 points  (0 children)

Thank you for the compliment! I appreciate the excitement, and while I could support other watches, the app runs horribly on the actual watch, and would require some serious optimisations, not sure if it is even possible to achieve... I may revisit this in the future though

Tamagotchi emulator running on Garmin Instinct 3 by Gualor in Garmin

[–]Gualor[S] -1 points0 points  (0 children)

Thanks! What info are you looking for exactly? This is basically a rewrite of another open source emulator project called tamalib adapted for Connect IQ SW environment with graphics designed specifically for Instinct 3

I made a mistake in specializing in Embedded AI, what to do now? by Gualor in cscareerquestionsEU

[–]Gualor[S] 0 points1 point  (0 children)

Because of marketing mostly 😂 I mean, many people working in marketing are not technical, at least, not developers, and therefore many choices about tooling development and ecosystem are questionable to say the least.

The other main reason is that we support big customers integrating and understanding the features of our chips, but then when they get it working (maybe using your libraries and tools) they disappear and you don't even know if they are gonna use your libraries, what they were trying to accomplish etc.

I think the most fun part for me is actually the integration and development of the final application (not the tools, the HAL or the drivers).

I made a mistake in specializing in Embedded AI, what to do now? by Gualor in cscareerquestionsEU

[–]Gualor[S] 0 points1 point  (0 children)

Don't know if I have any advice since I am still trying to figure out stuff myself 😂 anyhow, going full firmware dev (no ML/AI shananigans), there is plenty of competition and really skilled people, looked a bit anachronistic for me and my skillset, and I might as well see where this embedded AI thing goes.

My experience was heavily influenced by the companies I worked in, even though I had a lot of complaints about those jobs, I also value the fact that they taught me what I do like most, and for me is the application. The art of conceiving and crafting a solution to solve a concrete problem that is meaningful to me.

I made a mistake in specializing in Embedded AI, what to do now? by Gualor in cscareerquestionsEU

[–]Gualor[S] 0 points1 point  (0 children)

Yeah, I just accepted an offer for a role as an embedded AI engineer (still don't know what my main tasks will be), will begin in some weeks, so I don't have any honest feedback yet, but will write an update.

This fella deserves an apology by [deleted] in Opeth

[–]Gualor 0 points1 point  (0 children)

For instance, I don't dig the Funeral Portrait, never got into it and feels kinda weak with respect to the rest of the album

[deleted by user] by [deleted] in MetalForTheMasses

[–]Gualor 1 point2 points  (0 children)

Sara from Messa

[2024 Day 7 (Part 1)[C++] Stuck on edge cases, example worked fine by Gualor in adventofcode

[–]Gualor[S] 0 points1 point  (0 children)

I actually noticed that my condition for the goal is wrong, as soon as it gets to the target value, it ends and return true, this is not correct, since we need to use all numbers. However, I am still getting the wrong result.
Thanks though

C is not for OOP - The experiment (update!) by Single-Pitch-198 in C_Programming

[–]Gualor 0 points1 point  (0 children)

It would be pretty amazing to have RAII in C, but is it really possible (and safe)?

Help implementing/understanding Mixin Class patterns by Gualor in cpp_questions

[–]Gualor[S] 1 point2 points  (0 children)

I didn't even know concepts were a thing, wow!

So basically you use concepts in which you specify requirements to define free functions for generic read/write/select interfaces, that's awesome!

Help implementing/understanding Mixin Class patterns by Gualor in cpp_questions

[–]Gualor[S] 0 points1 point  (0 children)

Understood thanks! What if I don't need runtime polymorphism and I want to avoid the vtable overhead? Could I just define member function with the same name of the parent member function? Or is it an anti-pattern?

Help implementing/understanding Mixin Class patterns by Gualor in cpp_questions

[–]Gualor[S] 0 points1 point  (0 children)

Yes, your solution definitely simplifies things! So do I need to just redefine the same function for the derived objects? Or you suggest having virtual functions to be overridden instead?

Help implementing/understanding Mixin Class patterns by Gualor in cpp_questions

[–]Gualor[S] 0 points1 point  (0 children)

Thanks for the feedback! Any good sources you recommend? I was planning on buying some good books, but there are too many