MaybeView

Note: this is based on the version of Ox in following revision in the Nostalgia repo : 1b629da8fc658a85f07b5209f2791a5ebdf79fa1 Problem In C++, hash maps are often used with strings as keys. This would typically look something like this. std::unordered_map<std::string, int> ages; ages["Jerry Smith"] = 54; And here is an example of a lookup: int age = ages["Jerry Smith"]; There is a hidden inefficiency here. The lookup operator does not take a std::string_view or a C string. The lookup operator takes a std::string. That means, even though we are passing in a C string that has all the necessary data, we are implicitly calling the std::string constructor, which will allocate space on the heap for the string data, then copy the existing C string into the buffer it allocated. Then, as soon as the lookup call is finished, the temporary std::string is destroyed. ...

April 24, 2024 · 2 min · Gary Talent

Ox Preloader

Note: While this was originally published on 2023-02-27, it was updated to reflect later changes to the codebase on 2025-05-18. Note: this is based on the following revision in the Nostalgia repo : d6e4ab7a24 This might be the most insane piece of software I have ever written. That’s probably mostly because I have never heard such a system as this, which should usually be a deterrent when you think you have come up with a brilliant new idea. But questions of whether or not I should proceed with this idea never stood a chance against my firm conviction that it could be done. Those questions were in fact mercilessly slaughtered by my unrelenting will to make this beautiful abomination a reality. ...

February 27, 2023 · 10 min · Gary Talent

Ox Model System

Note: While this was originally published on 2023-01-30, it was updated to reflect later changes to the codebase on 2025-05-18. Note: this is based on the version of Ox in this commit in the Nostalgia repo : d6e4ab7a24 Synopsis In languages like Go and Python, there is a feature called reflection. This essentially allows functions to iterate over arbitrary struct types to get or set its data, or simply get information about the type. Reflection is most commonly used for object serialization, and that is the main use for it in Nostalgia. ...

January 30, 2023 · 10 min · Gary Talent

Nostalgia Developer Handbook

Note: this document is a copy of a document in the Nostalgia repo and will periodically be updated. Last updated: 2024-05-29 Nostalgia Developer Handbook About The purpose of the Developer Handbook is similar to that of the README. The README should be viewed as a prerequisite to the Developer Handbook. The README should provide information needed to build the project, which might be used by an advanced user or a person trying to build and package the project. The Developer Handbook should focus on information needed by a developer working on the project. ...

February 23, 2022 · 13 min · Gary Talent