I was looking to zig as a new language to experiment and see what benefits it brings. So before that I had experience in Python, Golang, Elixir and Zig was something different and more low level… probably no…
Work with allocators and all that process of managing memory is different from what I saw before, it is true. And of course it is pretty small and fast. I have some hobbies relate to play with microcontrollers and self-hosting multiple different things so memory usage and speed are supper important there.
I was thinking about something to experiment and make language easier to use. And I started with something I used in Python to make things that were unexpected for other languages. I like when I can access some props or functions by simply asking it by name like string.
So, I added small lib zattr with two public functions hasattr and getattr. I do not know if language expects such in main lib but I think it would be useful.
I tried to add setattr but it was a bit complicated, because it is not dynamic language and I was able to set only existing properties. Not sure if it is possible to implement function setting too… Okay a lot of text. Here is the implementation I did kaimanhub/zattr - Codeberg.org.