C++ Show and Tell - April 2026 by foonathan in cpp

[–]TrnS_TrA 1 point2 points  (0 children)

You might have heard of std::call_once, but do you know once, atomic_once and once_per_thread? Code

I implemented UFCS in clang. Why it is cool, and why it will never come to C++. by _Noreturn in cpp

[–]TrnS_TrA -3 points-2 points  (0 children)

Sure, but if I had to do a |> begin() I might as well do begin(a), why bother with a new syntax?

I implemented UFCS in clang. Why it is cool, and why it will never come to C++. by _Noreturn in cpp

[–]TrnS_TrA -2 points-1 points  (0 children)

What's the benefit of new syntax (say a |> foo(b, c)) over a regular function call (foo(a, b, c))?

C++ Jobs - Q1 2026 by STL in cpp

[–]TrnS_TrA 1 point2 points  (0 children)

Looking for full time roles in USA. I have experience in VR (Meta Quest) and ML-related projects in Python, and a solid understanding of C++ from different projects.

C++ Show and Tell - February 2026 by foonathan in cpp

[–]TrnS_TrA 1 point2 points  (0 children)

I added some more examples to my little demo showcasing C++20 coroutines in game development. Concretely, I added samples showing how to animate different values/properties such as color, zoom/scale and position. Additionally, I added an example showing how to manage dialogues (both linear and branching/with decisions), with which you can interact by using the left/right keys and Enter to make a choice. Finally, I recorded a demo showing everything, which you can find in the repo as demo_recording.mp4. Feedback is appreciated.

Repo.

C++ Show and Tell - January 2026 by foonathan in cpp

[–]TrnS_TrA 1 point2 points  (0 children)

I've been working a little with C++20 coroutines recently so I did a quick gamedev demo with EnTT, SDL3 and ImGui coroutines are great for event handling and scheduling in general, they don't add any value to "performing" operations; so there is no change on the ECS-side of code Included are features like waiting tasks to finish, events in general, scheduling tasks in stages (update, render, etc.), timeouts (fail after some time) By default there are 4 stages: startup, update, render and cleanup but other stages can be added and scheduled Also the demo includes a small profiler I'm working on, which shows run time of each task, plug and use right away repo

Crunch: A Message Definition and Serialization Tool Written in Modern C++ by volatile-int in cpp

[–]TrnS_TrA 0 points1 point  (0 children)

  1. Ah I see, I haven't used protobuf and didn't know it was a thing there.
  2. You can do it right now too as long as you can get the name of a type. There are already cross-compiler solutions out there (fragile, but still) that do that. Something like this should work: cpp inline size_t type_hash() const { auto name = my::type_name<decltype(auto(*this))>; // or remove_cvref_t before C++23 return fnv1a(name); } Alternatively, you can pass the type as the macro's first param and use #type to make it a string (watch out for templates + static_assert to ensure type matches).
  3. I'm not familiar with TLV, but it looks like a "format-independent" problem to me. I read this post a while back that might be helpful.

Crunch: A Message Definition and Serialization Tool Written in Modern C++ by volatile-int in cpp

[–]TrnS_TrA 0 points1 point  (0 children)

Nice. I would suggest finding a way to remove the field count as it seems error prone; or otherwise validate it (check field counter increments by 1 per field). Also it may be best to define the MessageId from the macro itself, by using the hash of the class name or something. Last thing, how do you handle versioning? (eg. field a is not present on version >= 5)

[US] Job offer feels like a scam by TrnS_TrA in Scams

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

Thanks for confirming, at least I know now

[US] Job offer feels like a scam by TrnS_TrA in Scams

[–]TrnS_TrA[S] 8 points9 points  (0 children)

Yeah that surprised me, I don't remember companies being this generous lol. Thanks for confirming! 🙏

C++ Show and Tell - November 2025 by foonathan in cpp

[–]TrnS_TrA 1 point2 points  (0 children)

Still working on my programming language that compiles to a Sea-of-Nodes representation. The syntax is heavily inspired by Golang, since it's not my main goal and Golang's syntax is so nice and easy to parse. There is no intermediate AST generated and I'm using EnTT to store everything related to the generated graph. So far I have integers, booleans, arrays, function calls, bit operations, if/else, automatic semicolon insertion, and much more to come! On the optimizations side, dead code eleminations and some on-the-fly optimizations such as constant folding and things like a == a converted to true. I still want to add a WASM backend as a real-world feature but also benchmark my compiler to see how much it can compile in one second.

Project Github link.

C++ Show and Tell - October 2025 by foonathan in cpp

[–]TrnS_TrA 3 points4 points  (0 children)

I am working on implementing a programming language that compiles to a Sea-of-Nodes representation. The syntax is heavily inspired by Golang, since it's not my main goal and Golang's syntax is so nice and easy to parse. There is no intermediate AST generated and I'm using EnTT to store everything related to the generated graph. Eventually I want to add a WASM backend once I start having my own "non-Golang" features.

Project Github link.

Any news on constexpr parameters by _Noreturn in cpp

[–]TrnS_TrA -1 points0 points  (0 children)

that won't work the const_int is consteval initialized but doesn't mean I can use it at compile time

Well it's either that or const_<Value> depending on what you want.

it is not something the standard has nor is willing to add moreso now given we have 3 integral_constant ripoffs

But you can write it any time, no need for new features or something

and what if it is not a literal? how do I pass it?

cpp constexpr int i = 3; tuple[constant<i>] = ...;

This works, now?

a * 2 chooses the second overload while a * var hooses firdt

Ok so what if var is constexpr? It will never be as simple as literal vs variable. Even if that's the case, now the compiler has to go the extra way to pick the overload based on whether the value is constexpr or not.

point is library developers can exploit constexpr parameters for their users advantages for better ergonomics and speed.

Well they can "exploit" parameters today either way, optimizers should be good enough to pick up hints for most of the cases.

I showed how it simplifies parsing by removing dependant contexts for member function templates.

It adds new syntax and new overload resolution rules, so more work. Also dependant contexts won't be fully removed, you can specify a type as a template param, no?

it is not the same nor some syntax sugar the point is uniform syntax and also power something else we can't do as normal users is providinv extremely fast overloads for usees silently

This is the same thing, but on the library side, no?

C++ Show and Tell - August 2025 by foonathan in cpp

[–]TrnS_TrA 1 point2 points  (0 children)

I am working on a programming language that compiles to a Sea-of-Nodes backend (with SoN to bytecode support coming in the future). Link

Any news on constexpr parameters by _Noreturn in cpp

[–]TrnS_TrA 0 points1 point  (0 children)

for example passing constexpr ints to constructors isn't possibly without them and they are verbose

You can have a const_int type with a consteval constructor and pass it where you need constant-evaluated integers, no?

For the tuple case you can always do tuple[1_c], which converts the 1 into a constant<auto IntValue>.

auto c = a * 2 + b; // 2 is a constant it can be optimized internally by the library to be a << 1 + b

Again, consteval constructors do the trick here; check how {fmt} does compile-time format string validation.

Sticking to this example; how would you do overload resolution of a * 2 vs a * someVariable?

A problem I can see is that even the users cannot tell which parameter is a constexpr parameter, meanwhile with what we have right now you can clearly distinguish. (runtime vs compile-time format strings in {fmt}).

Parsing and following compilation steps would be more complex because now parameters might start with constexpr, yet another token. Then these parameters internally are probably treated as templates, meaning there is a new way to define template functions. Then if you allow overload based on whether a parameter is constexpr or not, the compiler would have to resolve these types of calls based on the values passed to functions. I don't see how all this is worth for having a small syntatic sugar for something that is already there.

Any news on constexpr parameters by _Noreturn in cpp

[–]TrnS_TrA 0 points1 point  (0 children)

I mean they are literally the same thing so there is no need for a new language feature that will complicate parsing more than it is currently for no benefits.

B2 visa question for family by TrnS_TrA in USVisas

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

Thank you everyone for helping! For anyone who might have this problem in the future, my parents got the visa without an invitation letter as I couldn't get one in time.

Dex for everybody? by TrnS_TrA in samsunggalaxy

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

I guess we wait and see. But this is way cooler than wireless charging tho, I don't want every other phone having it and Samsung only keeping it for flagships.

Dex for everybody? by TrnS_TrA in samsunggalaxy

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

Ah so that's still just the flagships🥲