steven, to random
@steven@gts.passthejoe.net avatar

I complied a C++ program with clang.

That's my toot.

#openbsd #clang #cplusplus

fell, to gamedev
@fell@ma.fellr.net avatar

Engine programmers literally only want one thing and it's fucking disgusting:

> The game has PASSED the Hardware/Software Compatibility and Performance Check with a great majority of systems obtaining excellent performance results.

(Actual results of my work, I am SO proud!!! 🥳)

ChristosArgyrop, to programming
@ChristosArgyrop@mstdn.science avatar

Reminder that the languages useful for may not be the same as those used for that the applications use, and this is just fine, e.g. performance often requires that one does not rediscover the wheel by recoding libraries in and because they are, for whatever reason , resistant to use a proper (or an ) .

gracicot, to cpp
@gracicot@mastodon.social avatar

In modern C++, when I'm writing constexpr static data member of an integral type, I find myself using the pre-C++11 hack of enum { value = ... };. Why? Well, I could write static constexpr auto value = ... but the hack is shorter and less noise than the real syntax for it 😕

SonnyBonds, to cpp
@SonnyBonds@mastodon.gamedev.place avatar

Apparently popen won't take 65k long command lines on Windows.

Don't ask me how I know.

SonnyBonds, to cpp
@SonnyBonds@mastodon.gamedev.place avatar

What's your favorite way of doing type safe flags in C++? I typically just use some enum/int combo, but it's not really type safe and you can combine flags from different sets.

fell,
@fell@ma.fellr.net avatar

@SonnyBonds We use C++ bitfields:

struct Object {  
 bool is_active:1 = 0;  
 bool is_dirty:1 = 0;  
}  

So, each member is just one bit. The default value only works in C++20 but the bitfields are C++11 I think.

poppastring, to VisualStudio
@poppastring@dotnet.social avatar
DM_Ronin, to embedded
@DM_Ronin@mstdn.social avatar
meetingcpp, to cpp German
@meetingcpp@mastodon.online avatar

A Proposal Fix for C/C++ Relaxed Atomics in Practice
https://lukegeeson.com/blog/2023-10-17-A-Proposal-For-Relaxed-Atomics/

fell, to godot
@fell@ma.fellr.net avatar

Guys, it happened. :drgn_flat_sob:

Despite me being an absolute performance addict beyond reason, I have decided not to write my dice roller entirely in C++, for now. At least not until Godot 4.2 comes out, which brings hot-reloading to GDExtension.

GDScript is slow, and I really hate wasting people's CPU cycles, but prototyping the game logic is just so much quicker because it's right in the editor and changes are applied immediately.

I am also certain that I will be able to convert GDScript to GDExtension C++ fairly easily, because all I do is call engine functions, basically. It's just a matter of translating the syntax.

Last but not least, It would make a nice case study to directly compare the same implementations in GDScript and GDExtension C++.

rcs, to delhi
@rcs@hachyderm.io avatar

C++ engineers, join our Tokyo meetup!

Join C++ experts Robert Seacord and Jessica Paquette to learn about improving optimization.

✅ Date & Time: November 21, 2023, 6:30-8:30 pm (JST)
✅ Format: Joint presentation followed by networking
✅ Location: Woven by Toyota Tokyo Office
✅ RSVP by November 14th at 12pm

👋 RSVP now!
https://lnkd.in/gYH82f4U

fell, (edited ) to fediverse
@fell@ma.fellr.net avatar

Okay, I need the swarm intelligence regarding :

Let's say I write a function like this, in C++17 or later:

inline int Calculate(int a, int b) {  
 return a+b;  
}  

I put it in a file called calculate.h and include (and use) it at multiple other places in the code.

Let's assume the function is not inlined at call sites. Due to the inline keyword, the compiler will ensure that Calculate() exists only once. (See https://en.cppreference.com/w/cpp/language/inline)

Question: Will the compiler generate the instructions multiple times, or does it avoid compiling a function body that's already going to be compiled in a different translation unit?

In other words: Do lots of inline functions in header files slow down compilation?

vitaut, to programming
@vitaut@mastodon.social avatar

They charged almost $4k to fix our auto. Modern C++ is expensive!

meetingcpp, to cpp German
@meetingcpp@mastodon.online avatar

Meeting C++ 2023 featured talk of the day: Daniela Engert - So, you want to use C++ Modules ... cross-platform?
https://meetingcpp.com/mcpp/schedule/talkview.php?th=764543a2a87ba615122a8f1d1e20f27c26ba70ce


ciura_victor, to cpp
@ciura_victor@hachyderm.io avatar

A nice narrative in 4 chapters about C++ casts:
https://www.youtube.com/watch?v=SmlLdd1Q2V8
Some evil detours with pun_cast and public_cast 😈

arzi, to gamedev
@arzi@mastodon.gamedev.place avatar

What they don't tell you about C++ is that while the language itself isn't too bad, getting anything above a very vanilla console app to compile needs HOURS of work googling and twiddling with frameworks and packages and include paths and obscure nuget errors no one else seems to have encountered before.

"OpenGL context with just a couple of lines of code!"

"Sure, but WHAT ABOUT THE DEPENDENCIES"

ilmai,
@ilmai@hachyderm.io avatar

@arzi programmers are rolling their eyes at the amount of dependencies / etc. projects use. But the only reason C++ projects don’t have more dependencies is because it’s literally impossible to use them.

Context: I’ve been using C++ for 20+ years and I still hate having to integrate dependencies

ramin_hal9001, to scheme
@ramin_hal9001@emacs.ch avatar

Why Program in C+Python when you can program in Zig+Scheme?

Another bit of gold from by Pjotr Prins of the University of Tennessee. The actual title of the talk is "Why code in Python+C if you can code in Lisp+Zig?" but the "Lisp" in this case is actually Guile Scheme. I didn't know this, but Zig uses the C ABI so it binds to any language that can do FFI bindings to C, including most Scheme and Common Lisp implementations. But why don't I just post the abstract here:

> "Most bioinformatics software today is written in Python and for performance C is used. Lisp has been around for over half a century and here I don’t have to tell how or why programming Lisp is great. I will talk about Zig as a minimalistic new language that is unapologetically focused on performance, tellingly with a blazingly fast compiler. It is advertised as a replacement for Thompson, Ritchie, and Kernighan’s C, but it may even replace C++ in places. Zig uses the C-ABI and does not do garbage collection, so it is ideal for binding against other languages. In this talk I will present combining GNU Guile Lisp with Zig. I’ll argue that everyone needs two languages: one for quick coding and one for performance. With Guile and Zig you get both at the same time and you won’t have to fight the Rust borrow checker either."

foonathan, to cpp
@foonathan@fosstodon.org avatar

If you're in or near Amsterdam: I'll be speaking at the Dutch C++ group on November 23rd about think-cell's core library and ways we work around flaws in C++. It's free to attend, but spots are limited.

https://www.meetup.com/the-dutch-cpp-group/events/296721359/

shafik, to random
@shafik@hachyderm.io avatar

Spooky Halloween C++

👻🎃👻🎃👻🎃👻🎃👻🎃

What was the zombies favorite type trait?

🧟
🧟‍♂️

std::decay

👻🎃👻🎃👻🎃👻🎃👻🎃

simontoth, to cpp
@simontoth@hachyderm.io avatar

C++20 introduced the <bit> header with a group of functions for manipulating and querying bits in unsigned integers.

These functions were previously only available as compiler extensions.

Compiler Explorer link: https://compiler-explorer.com/z/qEWzzcfv9

meetingcpp, to cpp German
@meetingcpp@mastodon.online avatar
shafik, to random
@shafik@hachyderm.io avatar

#6 Spooky Halloween C++.

👻🎃👻🎃👻🎃👻🎃👻🎃

What is a vampires favorite type?

👻
👻

std::byte

👻🎃👻🎃👻🎃👻🎃👻🎃

fell, to gamedev
@fell@ma.fellr.net avatar

So, like many folks, I'm doing a bit of saturday work from home to support the project as it is getting closer to release.

Since my home desktop is primarily a system, I decided to try and see if I could compile a game without Windows.

Short answer: No. I could not.

There is actually an package that gives you a working compiler in , but there is no way to get to work to build .sln and .vcxproj files.

I wonder how much worse the build time would be in a VM 🤔

drmorr, to rust
@drmorr@hachyderm.io avatar

One of the things I am constantly running into in my code is needless passing-by-reference. I am too used to and , where if you don't sprinkle & everywhere, you (potentially) end up making a bajillion needless copies*.

I'm constantly finding by-reference variables and being like "Oh, this function can just take ownership of this object, I don't need the ref"

  • Yes I'm aware that compiler optimizations and recent move semantic stuff in C++ make this less of a problem.
  • All
  • Subscribed
  • Moderated
  • Favorites
  • megavids
  • thenastyranch
  • magazineikmin
  • everett
  • InstantRegret
  • rosin
  • Youngstown
  • slotface
  • love
  • khanakhh
  • kavyap
  • tacticalgear
  • GTA5RPClips
  • DreamBathrooms
  • provamag3
  • modclub
  • mdbf
  • normalnudes
  • Durango
  • ethstaker
  • osvaldo12
  • cubers
  • ngwrru68w68
  • tester
  • anitta
  • cisconetworking
  • Leos
  • JUstTest
  • All magazines