AstraKernel, to rust
simontoth, to cpp
@simontoth@hachyderm.io avatar

C++20 introduced a set of safe integral comparison functions that can compare different integral types without introducing accidental conversions.

Compiler Explorer: https://compiler-explorer.com/z/3Phjhrcqv

phiofx, to rust

For several years it seemed like deficiencies of older ecosystems will usher new takes: #rust fixing #cpp, #kotlin fixing #java, #julia fixing #python, #wasm fixing #javascript etc.

But it no longer feels so. Maybe it was a case of "you have to move fast to fix things" and as incumbents raise their game the window of opportunity closes. The vast investment in established stacks incentivises patching the most egregious weaknesses.

One exception seems #golang, which found a network niche

mstrohm, to random
@mstrohm@kanoa.de avatar

By removing direct dvdread support, mpv broke DVD ripping for me since it now jumps to the dvd menu after the title I want to rip, producing a garbage output file. I tried alternatives like dvdbackup and handbrake, but both are not usable. The latter crashed at some point.

Seems I do have to write my own code again just to be able to batch rip DVDs on the command line. If that happens, it will be released here:

https://codeberg.org/ncc1988/moeripper

mstrohm,
@mstrohm@kanoa.de avatar

Work on my own DVD ripping functionality that doesn't need mpv anymore started here:

https://codeberg.org/ncc1988/moeripper/src/branch/move-to-cpp

This will be a great opportunity to gradually move the whole functionality of moeripper.rb into a C++ application.

mstrohm,
@mstrohm@kanoa.de avatar

The small C++ program for ripping individual DVD titles is working now and available in the main branch of moeripper:

https://codeberg.org/ncc1988/moeripper

Thank you to all of those that contributed to libdvdread. It does all the magic during ripping and without it, my small C++ program could not be written in just a few hours.

kloetzl, to python

New years resolution: stop using loops. In particular no more for(int i; i<size; i++){} that is just bad style. Use more algorithms, list-comprehensions or yield from. Much more expressive.

Septem9er, to programming German
@Septem9er@chaos.social avatar

Edit: Solved

m_parts ist a vector. When lengthOfShip = 4, the code does add four objects to the vector but all with (row,col) not (row,col+i).

Why? I really don't see what's wrong.

Septem9er,
@Septem9er@chaos.social avatar

Next question: Why does this cause an segmentation fault? m_status is definitely 0 at this point (verified with debugger).

image/png

Ozzy, to cpp

in case you also wonder and compare vs I ran some code in my old laptop and numbers are fun to share.

cpp is from https://github.com/lehuyduc/1brc-simd and java from https://github.com/gunnarmorling/1brc/blob/main/src/main/java/dev/morling/onebrc/CalculateAverage_royvanrijn.java

for java I used to generate a native binary image and results:

./run_cpp.sh
Using 8 threads

real 0m23.854s

and for java
./calculate_average_royvanrijn.sh

real 0m13.402s

looks like java winning here or am I reading wrong ?

slint, to rust
@slint@fosstodon.org avatar

Throwback Thursday - Last month we had great discussions at the in Sindelfingen. Our partner Cloudflight gave a great presentation on at the conference - "Slint in practice".

Picture of customers discussing with Slint team at ESE Kongress.

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

Chaos_99, to programming
@Chaos_99@fosstodon.org avatar

I'm always looking for new ways to explore large legacy code bases. I'm still wondering why there are no/few dedicated tools for this.

I've now tried the way of pre-processing C/C++ Source files with unifdef to remove the confusing mess that is build-options via preprocessor defines and then use doxygen to generate a browsable version of the code with call-graphs.

It's still far from perfect, but it helps.

artagnon, to cpp

In news, a 2018 thread on has recently had some activity, notably from H. Peter Anvin. It’s about using in the kernel. While it might arguably go nowhere, HPA’s lengthy commentary is worth reading.

https://lore.kernel.org/lkml/3465e0c6-f5b2-4c42-95eb-29361481f805@zytor.com/

uliwitness, to swift German
@uliwitness@chaos.social avatar

Wow! I hadn't realized calling Swift from C++ had landed in mainline Xcode already! And it's really easy to use:

  1. In Xcode, set ‘SWIFT_OBJC_INTEROP_MODE = objcxx’
  2. Make sure all Swift you want to call is public
  3. Include the "MYSWIFTMODULENAME-Swift.h" header from your C++ code. (Where MYSWIFTMODULENAME is your Swift module’s name)
  4. Create the Swift object by calling the MYSWIFTMODULENAME::MYSWIFTCLASSNAME::init() method. (with your initializer's arguments)

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

It's one thing to start using CMake in a project, it's another to actually create a distributable package for major operating systems. Something I learned on my journey mastering CPack with CMake.

I'll try to cover much: from application bundle structure, how installation works with CMake, adding a shared library, static assets like fonts and images, application icons, the installer itself, and more.

https://martin-fieber.de/blog/cmake-cpack-cross-platform-distributables/

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

It is interesting that both C++ coroutines and async Rust are stackless coroutines, but unlike Rust, C++ coroutine states must be dynamically allocated.

In addition, C++ coroutines is a more general-purpose feature that can model things such as generators, which I definitely wish it could reside on stack.

I am not knowledgable enough about what kind of tradeoff lead to those design decisions though.

herzenschein, to cpp
@herzenschein@furry.engineer avatar

:blobfoxdrakedislike:​

using namespace std::ranges;<br></br>using namespace std::ranges::views;<br></br><br></br>auto squaresOfEvenNumbers = someVectorOfInts<br></br>  | filter([](const int n){return n % 2 == 0;};)<br></br>  | transform([](const int n){return n * n;};)<br></br>  | to<std::vector>();<br></br>

:blobfoxdrakelike:​

using namespace std::ranges;<br></br>using namespace std::ranges::views;<br></br><br></br>auto isEven = [](const int n){return n % 2 == 0;};<br></br><br></br>auto square = [](const int n){return n * n;};<br></br><br></br>auto squaresOfEvenNumbers = someVectorOfInts<br></br>  | filter(isEven)<br></br>  | transform(square)<br></br>  | to<std::vector>();<br></br>

diehlpk, to cpp

We are happy to announce that we submitted our book to the publisher:

Parallel C++: Efficient and Scalable High-Performance Parrallel Programming

Using HPX

Stay tuned for the official release ad paperback and ebook.

looopTools, to cpp
@looopTools@mastodon.social avatar

Okay I need to understand something here.
If I in C++ have the program in the picture below.
What would the type of T1 be in print?

I assumed it would char* but that is incorrect and so is std::string.
Can someone help?

aeva, to random
@aeva@mastodon.gamedev.place avatar

hands you a long double :3

TehPenguin,
@TehPenguin@hachyderm.io avatar

@aeva
MSVC: You mean a double?
Me: No, a long double.
C++ spec: Yeah, same thing except when it's not.
"long double — extended precision floating-point type. Matches IEEE-754 binary128 format if supported, otherwise matches IEEE-754 binary64-extended format if supported, otherwise matches some non-IEEE-754 extended floating-point format as long as its precision is better than binary64 and range is at least as good as binary64, otherwise matches IEEE-754 binary64 format."

AstraKernel, to rust

🦀 Rust Audio Programming with Ian Hobson | WolfTalk

👉 Interview with Ian Hobson: ex-Ableton freelancer in audio programming using Rust!

https://thewolfsound.com/talk016/

tylerburton, to programming
@tylerburton@mstdn.ca avatar

The First Law of Software Architecture states that everything in software is a trade-off

-Mark Richards & Neal Ford

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!) 🤦

Kimimaru, to CSharp

I've considered rewriting in another language, given how is still non-free after 10 years (https://github.com/open-dotnet). I don't have high hopes for its future so long as it remains controlled by .

I've been looking at for its high performance without the memory management of . One feature I need is the ability to execute custom code (https://codeberg.org/kimimaru/TRBot/src/branch/master/Wiki/Custom-Commands.md).

Would bindings with rust be a way to do this? Open to suggestions!

Snowshadow, to Canada
@Snowshadow@mastodon.social avatar

🍁 🍁 🍁 🍁

New year, new tax measures — what to expect in 2024

GST/HST exemptions, end of short-term rental deductions and CPP hikes are among new 2024 measures

https://www.cbc.ca/news/politics/2024-federal-tax-changes-1.7067843

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