smurthys, (edited ) to programming
@smurthys@hachyderm.io avatar

A serious question for C and C++ programmers:

What are the benefits of using C over C++ for greenfield projects, setting aside build times and such.

In other words, is there anything that can be done in C that cannot be done at least equally well in C++? Is there something that can be done in C that just can't be done in C++? What are the dealbreakers?

(No language wars please.)

Boosts appreciated: my sphere of influence is quite small. 🙏

#c #cpp #cplusplus

markuswerle, to rust German
@markuswerle@nrw.social avatar

Because #Rust is a secure language you can set RUSTFLAGS to "-zsanitizer =address". I begin to understand.

#cpp #cplusplus

janriemer, to rust

C++ will be taken over by #Rust.

What will be the Rust-equivalent for #JavaScript?

I mean #TypeScript is a very good first step, but it's basically the C++ for C.

So in short:
C => C++
JavaScript ≈> TypeScript
C++ => #RustLang
JavaScript => ???

I think it will be a looong way to go, but maybe, maybe we'll see more and more #WebAssembly in the #frontend, but not quite sure yet.

#WASM #ProgrammingLanguage #CPlusPlus #C

gracicot, to cpp
@gracicot@mastodon.social avatar

Yay!! Again, some compiler decided to change template conversion operator rules.

And again, compilers won't agree with what the standard says or with each other since changing the rules may break users, even though they keep doing it (even in minor versions!) 🤦

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

I was experimenting with colour distances at work today. I need to find out how similar two colours are, so I wrote a little test program and it was surprisingly pretty.

The algorithm is simple:

  1. Fill the canvas with random colours.
  2. Set the first pixel (top left) to red.
  3. For all pixels, find the most similar pixel and move it next to the current pixel.

To determine the similarity, I calculated the 3D distance in the RGB, HSV and YUV color spaces, which brought very different results. Now, it's quite possible that my HSV and YUV conversion functions were just broken, but that's okay.

(I recommend zooming in!)

#programming #development #cplusplus #cpp #cpp20 #immediate2d #rgb #hsv #yuv #art #pixelart #rainbow #noise #gamedev #opengl #math #mathematics

maxim, to programming
@maxim@mastodon.gamedev.place avatar

Programmers, developers, coders!

Let's get to know each other in Mastodon

📻 Make a repost, write what you do and where you are from
🤝 Subscribe each other
🛰️ Let this signal pass through all obstacles

Let the wave flow! Halt and Catch Fire!

gracicot, to cpp
@gracicot@mastodon.social avatar

As far as I can test, I'm able to do precise reflection on overload set to get the reference kind of each parameters on all overload.

This is true, at least on GCC.

The only way it's possible is to try to call the function many time with a carefully crafted type with a specific set of conversion operators. I can then detect what expressions are ambiguous and which are not and deduce the reference kind of a particular parameter.

I'll have to see if it's possible with Clang.

#cpp #cplusplus

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++.

smurthys, to programming
@smurthys@hachyderm.io avatar

Wish I'd the confidence of people who self-assess their C++ knowledge to be 10/10.

<insert link to Stroustrup saying his C++ knowledge is 7 or 8 or such. Someone give me a link please>

#cpp #cplusplus

oblomov, to programming
@oblomov@sociale.network avatar

I have a question for people with better theoretical background on #ObjectOriented #programming and especially for #CPlusPlus developers.

#askFedi #fediHelp Is the following pattern known and does it have a name?

I have a number of classes (call them C1, C2, etc) that all derive from the same class B. I have a superclass (template, actually) D that derives from C1, C2 etc. To have a single B, the standard solution is to go with virtual inheritance to close the diamond (so far, so good).

1/n

mightyspaceman, to HollowKnight
@mightyspaceman@aus.social avatar

Making a metroidvania-style thing in #cplusplus and #SDL2 inspired by #hollowknight. Don't know how far it'll go, but as linus torvalds once said, "This'll just be a small project, not anything big like the other contenders (or something like that)"

Currently finishing off a HK-style character controller system. It looks jaggedy, but I know that's just because of the lack of any animations, so the next step will be to integrate spritesheets and such. Then level elements and a loading system.

lobocode, to rust

Do you think it's worth spending time studying the C programming language today, considering that #Rust addresses and improves upon many of the fundamental issues found in #C and #cplusplus?? Why?

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

One #programming feature I'm always missing is some way to define variables with automatic dirty flags.

Imagine doing object.pos.x += 5.0f; automatically, implicitly sets object.is_dirty = true.

On the instruction level, this would only require one more mov instruction to be inserted, which is super efficient!

I know this is generally what getters/setters are for, but you can't nicely do += with them, or only write the X position.

#cpp #cplusplus #gamedev

ramin_hal9001, to cpp
@ramin_hal9001@emacs.ch avatar

C++ is everywhere, that makes ECL very valuable.

The software industry, especially in the realm of free software, has mostly settled on a pattern of using C++ for creating performance critical libraries, and creating Python binding to the C++ libraries for scripting. I was hoping Rust might come along and change all this, but it will take decades.

In the mean time, if you want to use C++ but not actually write C++, you can make use of the ECL Common Lisp compiler, which can compile Lisp to C++ code. This gives you all the best features of Common Lisp for programming with the universe of C++ code libraries available to you. You can use a C++ library and still have Common Lisp macros, garbage collection, high-level scripting, S-expressions as serialization, domain specific languages, a proper meta-object protocol that wraps C++ classes nicely, and wealth of choices for functional programming systems from the untyped lambda calculus all the way up the lambda cube to System-F and the Calculus of Constructs. This not only makes ECL a viable alternative to Python for scripting and app development, but objectively better than Python since you can actually turn your Common Lisp scripts into code that gets compiled into a larger C++ application.

With ECL I would have all sorts of C++ libraries available to me:

  • game engines like Unreal and Godot
  • 3D modeling: FreeCAD, OpenSCAD, Blender
  • Machine learning, big data, and HPC with PyTorch, TensorFlow, OpenCV, OpenCL

I will continue to contribute to the Scheme and Haskell communities as much as I can. I will continue to pursue my dream of an Xfce-like desktop environment written in Scheme. But no matter how I look at it, I am going to more productive in the long run using ECL and C++.

I was hoping that the software industry would gradually shift over to better, more functional languages like Rust and Haskell. And I would love it if Scheme languages could ever begin to seriously replace Python as a scripting language. But realistically, I think I am going to change tack and meet the industry half way. I think I should probably start using ECL as my language of choice, as much as I would prefer Scheme or an ML-family language like Haskell.

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

Post your latest commit message. I'll start:

> Fixed a possible crash during the trophy cutscene that could happen if the stadium did not have a scheduled match and was not associated with an owning club.

#programming #gamedev #software #dev #development #git #cpp #cplusplus #javascript #python #rust #rustlang #go #golang #coding #c #clang #opensource #foss

alok99, to programming

When you read someone else's code and they have a weird style

#programming #developers #cplusplus

markuswerle, to mastodon German
@markuswerle@nrw.social avatar

In eine Diskussion von der Seite einsteigen, unsachlich argumentieren, C und C++ im selben Wort zusammenfassen, einen Informatikprofessor mit mehreren Ehrentiteln beleidigen und direkt nach der Antwort die Gesprächsteilnehmer blocken.

#Mastodon wird immer mehr zu #X

#cplusplus #rust

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

Here goes! Put a little template thingie to somewhat emulate checked exceptions in C++ on GitHub.

It's mostly a proof of concept and probably problematic in a dozen ways, but I think there might be something useful in there.

#cpp #cplusplus #programming #softwareengineering

https://github.com/SonnyBonds/cpp-checked-exceptions

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

I just found a piece of old code where I encoded some information into an 8-bit bitfield just to decode it again 3 lines later.

I am certainly wiser now.

#programming #cpp #cplusplus #gamedev #gamedevelopment

darkcisum, to cpp
@darkcisum@swiss.social avatar

Does anyone know a tool to compare APIs of two different versions of a C++ library?
Meaning, it would list added, changed, and removed public APIs.

#cpp #cplusplus #api #OpenSource #FOSS #library

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 🤔

vitaut, to programming
@vitaut@mastodon.social avatar

Optimizing the unoptimizable: a journey to faster C++ compile times https://vitaut.net/posts/2024/faster-cpp-compile-times/ #programming #cplusplus

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

C++ compiler be like:

error LNK2001: unresolved external symbol "public: static class std::unordered_map&lt;class std::basic_string&lt;char,struct std::char_traits&lt;char&gt;,class std::allocator&lt;char&gt; &gt;,unsigned int,struct std::hash&lt;class std::basic_string&lt;char,struct std::char_traits&lt;cha r&gt;,class std::allocator&lt;char&gt; &gt; &gt;,struct std::equal_to&lt;class std::basic_string&lt;char,struct std::char_traits&lt;char&gt;,class std::allocator&lt;char&gt; &gt; &gt;,class std::allocator&lt;struct std::pair&lt;class std::basic_string&lt;char,struct std::char_traits&lt;char&gt;,class std::allocator&lt;char&gt; &gt; const ,unsigned int&gt; &gt; &gt; TextureStore::texture_cache" (?texture_cache@TextureStore@@2V?$unordered_map@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@IU?$hash@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@U?$equal_to@V?$basic_string@DU?$char_traits @D@std@@V?$allocator@D@2@@std@@@2@V?$allocator@U?$pair@$$CBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@I@std@@@2@@std@@A)

And expect me to casually read that and go "Ah, I see".

jaycruz, to rust
@jaycruz@fosstodon.org avatar

This is a 48 minute long article that's critical of the Rust hype train vs C/C++. The TLDR is that while security is a problem, the Rust vs C choice as the only choice for low-level systems programming is a “non choice”. The author states that Go is a perfectly fine choice. https://medium.com/

#rustlang #c #cplusplus #GoLang

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

I just heard the bad news that I am probably going to need a new job starting in July.

So, before beginning the regular search, I wanted to ask my Fedi friends if anyone could use a capable C++ programmer with lots of graphics and networking experience. I wouldn't mind a change, so I'm open to anything. Even other programming languages! It would be awesome if I could use Linux to do the work. 🐧

Locations I would consider are: Central Europe, Melbourne, Sydney or Remote

🔁 Boost appreciated! 🙏

#Job #Jobs #Work #Hiring #FediHire #FediHired #GetFediHired #LookingForWork #Germany #Düsseldorf #Sydney #Melbourne #Programming #CPP #CPlusPlus #OpenGL #GameDev
#OpenToWork

  • All
  • Subscribed
  • Moderated
  • Favorites
  • JUstTest
  • mdbf
  • ngwrru68w68
  • tester
  • magazineikmin
  • thenastyranch
  • rosin
  • khanakhh
  • InstantRegret
  • Youngstown
  • slotface
  • Durango
  • kavyap
  • DreamBathrooms
  • megavids
  • tacticalgear
  • osvaldo12
  • normalnudes
  • cubers
  • cisconetworking
  • everett
  • GTA5RPClips
  • ethstaker
  • Leos
  • provamag3
  • anitta
  • modclub
  • lostlight
  • All magazines