129 Followers
224 Following
437 Posts

C++, computer science, electronics, oxford commas, and running (he/him)

#cplusplus
#programming

Websitehttp://jsonlink.ca
Githubhttps://github.com/beached/
Twitterhttps://twitter.com/beached_whale
Websitehttps://o1fast.com/

JSON Link has C++26 reflection mostly baked in now. #cplusplus #cpp

https://github.com/beached/daw_json_link

GitHub - beached/daw_json_link: Fast, convenient JSON serialization and parsing in C++

Fast, convenient JSON serialization and parsing in C++ - beached/daw_json_link

GitHub
Does anyone know the use cases for d-lang adding access to all members in Feb 2008 change to tupleof? #dlang I can see reflection/debugging but anything else interesting?

Read Barry Revzin's blog [https://brevzin.github.io/c++/2024/09/30/annotations/] and it motivated me to update the C++26 Reflection support but with annotions to JSON Link. Code like

struct [[=daw::json::reflectable]] X {
[[=daw::json::rename_json{"member1"}]]
int m1;

[[=daw::json::rename_json{"member2"}]]
int m2;
};

Will (de)serialize to and from

{
"member1": 42,
"member2": 24
}

#cpp #cpp26 #reflection

Code Generation in Rust vs C++26

One of the things I like to do is compare how different languages solve the same problem — especially when they end up having very different approaches. It’s always educational. In this case, a bunch of us have been working hard on trying to get reflection — a really transformative language feature — into C++26. Fundamentally, reflection itself can be divided into two pieces:

Barry’s C++ Blog
Was able to add #cpp 26 reflection support to DAW JSON Link. Still experimenting but tests pass and it is opt-in via header include
I really dislike that MS doesn't allow Azure authentication for remote WMI.

Getting good bug reports and usage difficulty is so helpful in OSS libraries. New release of JSON Link today because of the help of others.
https://github.com/beached/daw_json_link/releases/tag/v3.25.0

#json #cpp #cplusplus

Release v3.25.0 · beached/daw_json_link

What's Changed Update parsing_individual_members.md by @jk-jeon in #431 Pulling release changes into v3 by @beached in #434 Fix for #433 by @beached in #435 Thanks to @jk-jeon and @pkerichang for...

GitHub
The thing I worry about with all these ML or even basic auto completion/fixes is that it takes away ones voice. Everyone will express themselves the same and the differences will be nudged away.

The more I think about it, the more I think that #cplusplus OutputIterators are a mistake. At best they work ok with pointers, but that throws away size info. Outside of pointers, there is pretty much a forced size check on each call to operator* that may or may not be elided. It often isn't and types like back_inserter which calls push_back will almost never(not sure if it can) elide the check.

I think we would be much better off with a Writeable interface where the destination can do 1 size check for the full write instead of N of them.

TIL that I can open links to toots in my instance via https://<servername>/authorize_interaction?uri=<link to toot>

This is useful, without a dedicated plugin or with things like Alfred

C++ needs class/variable template specialization of things outside the current namespace e.g.

namespace ns {
struct Foo {};
template<>
inline constexpr bool ::other_ns::trait_v<Foo> = true;
}

It would make customizing things so much more ergonomic #cpp #cplusplus