Maxim's Avatar

Maxim

@mzaks.bsky.social

Tells computers how to waste electricity, hopefully in an efficient and useful way. Here to write about my hobby projects. At this point in time, it is mostly πŸ”₯ Mojo experiments.

755 Followers  |  2,217 Following  |  107 Posts  |  Joined: 08.12.2023  |  1.9252

Latest posts by mzaks.bsky.social on Bluesky

Video thumbnail

Did some weightlifting in my Mojo socks today.
Achieved 20% of SOTA performance.
Was I wearing my socks in debug mode?

23.09.2025 09:19 β€” πŸ‘ 2    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

One interesting side effect of introducing defaults is:

Now users can deprecate required fields if they provide a default. As the default will be set in the binary so old code will be ok, users just need to identify what kind of default value will make sense for an older client.

19.08.2025 10:27 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

For union type you define the union case and then the prefab name of the type or directly a value if the type is a primitive one.

19.08.2025 10:27 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

This implies that users should be able to describe a default for a complex node if the field points to a node, or even better if it points to a union type.

Hence I decided to introduce a concept of a prefab. Users can add named prefabs to a node, defining an instance of the node.

19.08.2025 10:27 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

This saves a little bit of payload, but stiffens the schema for later evolutions. I decided to always store the values in the binary so the defaults become only API convenience.
Another difference, I allow you to provide defaults to all types of fields.

19.08.2025 10:27 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

Working on default values for fields in Dagr. Turned out to be a much deeper rabbit hole than I expected.

Formats like ProtoBuff and FlatBuffer allow users to define default values in schema and then do not store the values in the binary if they are equal to default values.

19.08.2025 10:27 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

Then it provides a function to generate the source code from the graph.

What Dagr does not provide, is an executable.

You build the code generator yourself.

This reduces tons of β€œlast mile” complexity.

14.08.2025 06:28 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

What do I mean by that?

Dagr provides all building blocks for code generation. It has an internal DSL for expressing the data grab of your dreams. It validates the grab for correctness, it even checks if you already generated code with other graph and if those graphs follow the evolution strategy.

14.08.2025 06:28 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

Dagr is the IKEA of code generation. πŸ˜†

13.08.2025 18:17 β€” πŸ‘ 2    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0
Preview
GitHub - mzaks/dagr: A high-performance, type-safe binary serialization framework for Swift. A high-performance, type-safe binary serialization framework for Swift. - mzaks/dagr

Published something new today:

github.com/mzaks/dagr

12.08.2025 21:05 β€” πŸ‘ 2    πŸ” 0    πŸ’¬ 0    πŸ“Œ 1

I am also experimenting with bubbling up of the values on find for larger dictionaries. Something like self balancing the dictionary on usage. Often used keys should come first.

28.07.2025 14:51 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

Hence the striding of the hash values. This way, the linear search compares 16, 32 or 64 elements at a time (dependent on your CPU supported SIMD instructions) and is quite efficient for small dictionaries. The overhead of Smap is quite minimal.

28.07.2025 14:51 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

Another experiment I am doing right now is called Smap. S stand for simple/small/strides …

The idea is to have just list with key values and and additional buffer with hash values computed from key values and strided over SIMD width. The lookup is a vectorized linear search.

28.07.2025 14:51 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

I’m in the associated array rabbit hole again. Implemented a StringDict where the key is a String. This restriction allows for compact key storage but that makes compression upon deletion expensive. But who deletes an entry in a dictionary? Am I right? πŸ˜„

28.07.2025 14:51 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0
Preview
What do AI Agents and Retained GUI Frameworks Have in Common? No, this is not the start of a bad joke. Though it could be:

AI agents = retained GUIs with ambition πŸ˜…
Same old state sync chaos, just more tools.
New post πŸ‘‰ mzaks.medium.com/what-do-ai-a...

24.05.2025 14:31 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

Thanks πŸ™

13.03.2025 16:40 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Preview
Zencoder - Integrated, customizable, and intuitive coding agent | Product Hunt Zencoder – AI coding assistant helping developers ship products faster. With deep contextual awareness, AI agents, and 20+ integrations, we help developers effortlessly build production ready solution...

If you wondered, what kept me busy this year. Here is a glimpse:

www.producthunt.com/posts/zencod...

Give it a try!

13.03.2025 14:48 β€” πŸ‘ 3    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

I would assume that as the field is optional, the server should return null for the fields it doesn’t know, but it seems like the server returns a validation error. πŸ€¦β€β™‚οΈ

31.01.2025 09:18 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

I am genuinely surprised to see that GraphQL does not support forward compatibility.
Meaning an old server will error out when a new client sends it a query which it can’t validate due to schema evolution, like for example an addition of an optional field on a type.

31.01.2025 09:18 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0
38C3 - Wir wissen wo dein Auto steht - Volksdaten von Volkswagen
YouTube video by media.ccc.de 38C3 - Wir wissen wo dein Auto steht - Volksdaten von Volkswagen

πŸ€¦β€β™‚οΈ

youtu.be/iHsz6jzjbRc?...

03.01.2025 17:28 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

I agree that it is always best to understand the domain and the business you are in, but will the prima donnas be affected by AI? I am very skeptical about that πŸ˜€.

03.01.2025 14:20 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

There are tons of use cases where this will not be a problem, but there are probably even more use cases where it’s not a good idea.

03.01.2025 14:03 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

So you build something, which now you need to maintain and it is also just built for you, there is no guarantees others will find it useful. So instead of a system used by many and maintained/evolved by many, you lock yourself in into a DIY solution.

03.01.2025 14:03 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

You need to test the software and although you build it for yourself and you should know what you need, it’s often that what we believe is best for us is only based of luck of imagination or experience. β€œFaster horse” and such…

03.01.2025 14:03 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

This however didn’t make professional cooks obsolete. Moreover most people prefer not to cook for themselves, be it out of convenience, or expectation of higher quality.

Building a software for yourself is work, even if it is done by an AI assistant, you still need to explain everything.

03.01.2025 14:03 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

A few days ago, I was thinking along the same lines. I came to an analogy with cooking. Nowadays everybody can cook a meal for them selves, there are different β€œtools”, different recipes and ingredients e.g. instant noodles, where you just need bowling water.

03.01.2025 14:03 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

Oh, sorry! Missed that precondition. Very interesting approach. Thank you for sharing.

15.12.2024 08:05 β€” πŸ‘ 2    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

When entries are arbitrary integers, the entries might contain duplicates in this case i != j is possible for sorted array.

15.12.2024 07:49 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

Yeah, this is what makes it all fun when you play with people who already did some of the life choices. You can make fun of it all.

12.12.2024 14:07 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

πŸ˜‚ I first played it in my late 20s with friends. We’d already experienced things like university, jobs, and taxes, so a mock speed run of life was funβ€”but not educational! πŸ˜…

As a kid deciding on staying single or get married, which gives you different probabilities for wealth can be overwhelming.

12.12.2024 13:55 β€” πŸ‘ 2    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

@mzaks is following 20 prominent accounts