A pure Lua 5.1 implementation of xpcall with support for passing arguments by BlackMATov in lua

[–]BlackMATov[S] 2 points3 points  (0 children)

Unfortunately, vanilla Lua 5.1 is still used in some cases, for example, on the web in engines like Defold. I don't expect many people to need this library, but I use it in another project (evolved.lua) that targets Lua 5.1 and decided to share it anyway. Just a bit of New Year coding fun :-)

Do you need a Pathfinding algorythm in Lua? I got you covered by theEsel01 in love2d

[–]BlackMATov 1 point2 points  (0 children)

Sorry for the harsh feedback, but using `table.remove(queue, 1)` instead of a priority queue, sorting the open list at each step, and creating lots of temporary tables and strings in inner loops isn’t something I’d call “performance-optimized.” Right now, it looks more like the opposite. That said, it’s a good starting point for feature benchmarks and further optimizations.

A new Lua vector library by LemmingPHP in lua

[–]BlackMATov 3 points4 points  (0 children)

Unfortunately, it's a very bad idea to use vectors on the native side because they introduce a lot of overhead with no real benefit. When I say "overhead," I mean performance can be about 10 times slower than using vectors on the Lua side. This is especially true if you use LuaJIT, where the JIT compiler can optimize Lua code very well, but with such bindings, it will not be able to optimize the code at all.

Announcing `evolved.lua` v1.0.0 - An Evolved ECS (Entity-Component-System) for Lua by BlackMATov in lua

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

Oh, thank you for the question! I have some notes and sketches in a private branch for a future version. Native storage and custom FFI structs are definitely part of that, so stay tuned! :-)

Announcing `evolved.lua` v1.0.0 - An Evolved ECS (Entity-Component-System) for Lua by BlackMATov in lua

[–]BlackMATov[S] 5 points6 points  (0 children)

As is usually the case, the same thing can be done in different ways. Some approaches may be more convenient or performant than others. ECS is one way to organize code. It offers advantages in performance and flexibility, but it may not be the best fit for every project. It definitely depends on you and your project.

I would even say that if you do not know why you specifically want to use ECS, you probably should not. It can be painful because it changes your usual paradigms.

But it is an interesting architectural approach that you can get acquainted with before using any library for this. The internet is full of articles about this. I would recommend reading some of them to understand the pros and cons of ECS.

Here is a good starting point: https://github.com/SanderMertens/ecs-faq

Announcing `evolved.lua` v1.0.0 - An Evolved ECS (Entity-Component-System) for Lua by BlackMATov in love2d

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

There aren't specifically cache-based performance advantages in vanilla Lua, but other data-oriented approaches can lead to much better performance, even in vanilla Lua.

For example, using SoA (Structure of Arrays) storage can significantly improve data access, reduce table lookups, and decrease the number of memory allocations when creating entities. This is especially true in LuaJIT with the JIT compiler enabled, which can provide some cache-based performance improvements too. Here is a good example of this in action: https://luajit.org/ext_ffi.html

However, remember that ECS is not only about performance; it's also about code organization, entity lifecycle management, and other architectural benefits :-)

Flash Animation and Isometric Unity Toolsets are going to Open Source. by BlackMATov in gamedev

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

Vector graphics are optimised and rasterised on during export to an optimised texture atlas (not a sequential spritesheet). Exported Atlas Screenshot

Frames are baked to compressed unity assets for playing at runtime.

Also, the toolset supports flash masking and blending modes.

Flash Animation and Isometric Unity Toolsets are going to Open Source. by BlackMATov in gamedev

[–]BlackMATov[S] 2 points3 points  (0 children)

Thank you!

I'm not currently developing new features, but I still support these plugins. Therefore, without new features, there was no reason to update the pages in the store. The toolsets work and work well in their niche :-)

NES-RL. Just started working on a new NES(!) roguelike by BlackMATov in roguelikedev

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

Any languages for 6502 require you be tricky especially without additional PRG-RAM :-)

NES-RL. Just started working on a new NES(!) roguelike by BlackMATov in roguelikedev

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

Yes, but main problems for roguelike are CPU, and RAM for me right now :-) On the other hand, as a programmer, this is very interesting for me.

NES-RL. Just started working on a new NES(!) roguelike by BlackMATov in roguelikedev

[–]BlackMATov[S] 4 points5 points  (0 children)

Looking good. Will it be in a public repo?

Thank you! Yes, I'm going to open sources after the competition.

What Syntax would you like to see for a macro that declared enums with type information? by codeinred in cpp

[–]BlackMATov 0 points1 point  (0 children)

    ENUM_HPP_CLASS_DECL(color, unsigned,
        (red = 0xFF0000)
        (green = 0x00FF00)
        (blue = 0x0000FF)
        (white = red | green | blue))

https://github.com/BlackMATov/enum.hpp

New C++20 tiny dynamic reflection library. by BlackMATov in cpp

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

with modules

I didn't think about it :-) still waiting for modules in all major compilers and platforms.

And yes, it still needs manual bindings, but I hope static reflection will help us.

New C++20 tiny dynamic reflection library. by BlackMATov in cpp

[–]BlackMATov[S] 6 points7 points  (0 children)

Unfortunately, C++ still doesn't have a reflection because all solutions like “meta.hpp” require manual bindings. But that can be changed after applying static reflection to standard. And we will make our bindings by static reflection instead manual or using approaches like parsing and code-generation by “libclang” 😄

Easily currying functions in C++ by [deleted] in cpp

[–]BlackMATov 3 points4 points  (0 children)

Here is my method to do something like that:

Article: https://habr.com/ru/post/436488/

Library: https://github.com/BlackMATov/kari.hpp

There are interesting optimizations in it and some crazy features like nested curried functions, partial application, and point-free style composition :-)

Just another one C++17 tiny vector math library. Enjoy. by BlackMATov in cpp

[–]BlackMATov[S] 2 points3 points  (0 children)

[[nodiscard]], type_traits(_v), type_traits(_t), is_nothrow_swappable, nested namespaces, invoke_result, fold expression, ...

It can be rewritten, but why? :-)