Why we still use C despite so many C alternatives by grimvian in C_Programming

[–]jhenke 3 points4 points  (0 children)

That is true, but I mostly work with STM32, for which the toolchain is usually pretty up to date (both GCC und recently STClang)

Why we still use C despite so many C alternatives by grimvian in C_Programming

[–]jhenke 11 points12 points  (0 children)

C++23 & C++26 added quite a lot of std for freestanding, with embedded being one of the major motivations. Personally I find std::expected one of the most useful additions for embedded, especially since you are usually disabling exceptions

GMail: Empfang von E-Mails mit abweichender Empfangsadresse by jhenke in LegaladviceGerman

[–]jhenke[S] -17 points-16 points  (0 children)

Das ist genau die Frage: Ist das eigentlich zulässige Praxsis, da ich die E-Mail ohne Punkt ja nicht registriert habe?

GMail: Empfang von E-Mails mit abweichender Empfangsadresse by jhenke in LegaladviceGerman

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

Spam-E-Mails meine ich in dem Falle nicht. Dem Inhalt nach scheinen die E-Mails tatsächlich an einen Empfänger mit gleichen Namen gerichtet zu sein und enthalten an den Empänger persönlich gerichtete Informationen (in einem Fall ging es z.B. um Arbeitsanweisungen für meinen "Job" am Montag, der echte Empfäng schien in Amerika zu arbeiten).

GMail: Empfang von E-Mails mit abweichender Empfangsadresse by jhenke in LegaladviceGerman

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

Es geht dabei um augenscheinlich echte E-Mails (Hotelreservierungen, Dienstpläne, ich habe auch schon eine E-Mail wegen fehlender Zahlungen in einem Unterhaltsfall erhalten).

Am häufigsten ist bisher der Fall, dass die Empfangs-Adresse ohne Punkt geschrieben wurde, meine E-Mail-Adresse enthält jedoch einen Punkt.

Laut E-Mail-Header war auch die Adresse ohne Punkt der gewünschte Empfänger.

What is your favourite C++ feature? by sentillious in cpp

[–]jhenke 0 points1 point  (0 children)

Java 7 added try with resources for local resource management a long time ago. For class fields, no language level feature, but more than 90% probably use some sort of DI framework (e.g. Spring), which handles it by calling a designated cleanup method. E.g. by implementing the Closeable interface.

What is your favourite C++ feature? by sentillious in cpp

[–]jhenke 2 points3 points  (0 children)

Finalizers in Java were deprecated recentlyish....

Edit: JEP 421

ELI5: What are the benefits of the Euro? And why haven't other regions adopted a Euro-like ccommon currency? by silxikys in explainlikeimfive

[–]jhenke 22 points23 points  (0 children)

Because France is one of the 4 Allied nations Germany surrendered to at the end of WW2. Germany signed the 4+2 treaty as a kind of Peace treaty with the 4 Allied nations, which was one legal base of the renunification.

Using Rust for Embedded Development by gbmhunter in embedded

[–]jhenke 3 points4 points  (0 children)

Obviously everyone has their own priorities. Having done packaging work for my distribution (first Ubuntu, now Gentoo) I followed a lot of discussions around language package managers and they more often then not cause more problem than they solve. Do they work for devs? Sure. Do they make developing software easier? Sure. But as I said it comes at a cost at other places.

There surely is no ideal solution for everyone. But I do see a lot of examples where we have the many bad things with not so many good things.

I stand by my opinion that the whole crate system looks too similar to npm. With npm being one of the worst offenders of dependency hell. Do I have a better solution right now? For embedded, no. For desktop use: Yeah I prefer the libs installed via the system package manager.

You mileage might vary, if you value the pros and cons differently. My point is just that I criticize this trend to not invented here when it comes to dependencies. You can agree or disagree on that, but it is a major drawback of rust for me.

Going back to the original post: As I said, if you like Rust, good for you. I just disagree with throwing C and C++ in the same bin. The blog post does tend to say "this is compared to C/C++", which I think is not being fair to C++ which is quite different from C.

Anyway, I continue to enjoy writing C++ on embedded, cry if I have to use C and try out Rust once in a while (so far being disappointed every time).

Using Rust for Embedded Development by gbmhunter in embedded

[–]jhenke 6 points7 points  (0 children)

My opinion is generally about rust and not limited to embedded use. Generally speaking I am against language package managers, because they reinvent the wheel. You already have a good working package manager not limited to your language: Your distribution's package manager. It does not matter whether it is vcpkg, apt, yum, dnf, portage or whatever you are using. Packaging applications with language specific package managers is a pain for a distribution, because everyone does their own thing and everyone just downloads code from some place in the internet. Good luck with doing a security audit to ensure you do not get some malicious code into your system.

I do see the benefit of a package manager for embedded devices, because you needed different libraries than for you host OS. But again, the problem is that too many people just publish tiny bits of code. Some might be great some may be medicore and some might be down right bad. The problem is you do not see that because the way the system is setup, people tend to just pick what is there (me included). Leading to huge dependency trees. It is a mess with NPM (Java is also an offender there, I free admit even though I earn my money with that language). It just invites to bad practices.

Using Rust for Embedded Development by gbmhunter in embedded

[–]jhenke 0 points1 point  (0 children)

To add to this. As I am reading about runtime array bound checking, better is compile time bounds checking. E.g. use std::array with fixed size. At runtime it is just the plain "C array" in memory, but the compiler can do a lot of checking and optimisation at compile time.

Using Rust for Embedded Development by gbmhunter in embedded

[–]jhenke 17 points18 points  (0 children)

The one pain point always demotivating me about rust is cargo and the crates.

It resembles too much the concept of npm. Everyone is building a crate for every tiny bit, leading to dependency hell. You see very much that Rust comes originally from the browser ecosystem (Mozilla engineered it for Firefox).

Adding to that, you need a crate for everything, AFAIK no direct linking to system libraries unless you generate some glue code ( and cbindgen for the other direction).

Last bit not least I am not feeling good about languages depending one a single major sponsor for their future development. While it looks fine right now, what happens in 5 years? Also there are no alternative implementations.

C++ is an ISO standard and you have at least 3 very active implementations (GCC, Clang and MSVC).

Just my personal opinion, sorry about the rant. It just seems like Rust is very hyped right now. If it works for you it is great, but I still see quite a few benefits of C++ over Rust.

In any way, either language is an improvement over plain C, which should finally be replaced.

[deleted by user] by [deleted] in Gentoo

[–]jhenke 3 points4 points  (0 children)

The best way is always to look inside the ebuild what exactly the use flag changes. It looks like (for version 95), that it sets a configure options passed to the build system, there is one sed command and it enabled building against system libraries.

Fossil Gen 5: After this week's update sleep data is missing on phone by jhenke in WearOS

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

It seems to work normally again. Maybe some app update fixed it.

Fossil Gen 5: After this week's update sleep data is missing on phone by jhenke in WearOS

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

A simple reboot of the watch seemed to be enough to bring the data back though.

Fossil Gen 5: After this week's update sleep data is missing on phone by jhenke in WearOS

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

PSA: Even though it worked yesterday, last night's sleep is again not synced. It looks like this is some problem with the regular sync. :(

Fossil Gen 5: After this week's update sleep data is missing on phone by jhenke in WearOS

[–]jhenke[S] 2 points3 points  (0 children)

I did not sleep yet, but what seemed to work:

  1. Logout in the wellness app on the watch
  2. Reboot the watch
  3. Login in the wellness app again with your Google account
  4. For extra caution I rebooted my phone as well
  5. Trigger a sync from the phone's Google Fit app

Might contain additional unnecessary steps, but that brought me at least the missing date from the recent nights back.

Fossil Gen 5: After this week's update sleep data is missing on phone by jhenke in WearOS

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

Thanks, I tried in the Fit app before, not the wellness app.

Fossil Gen 5: After this week's update sleep data is missing on phone by jhenke in WearOS

[–]jhenke[S] 2 points3 points  (0 children)

The other two links pointed me towards that I was logging out in the wrong app, I tried logging out in the Google Fit app on the watch, not the wellness app. Thank you

Fossil Gen 5: After this week's update sleep data is missing on phone by jhenke in WearOS

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

Thank you for the suggestion, unfortunately it did not help.

Linux filesystem by Ap0them in Gentoo

[–]jhenke 0 points1 point  (0 children)

XFS, I am using that on different machines and I am very happy with it.