News for hackers. Stuff that matters.

fbkr

Re:RISC-V Guns for Raspberry Pi, Legacy Chips on Thursday July 14, 2022 @02:37PM (#32099872)
Raspberry Pi Pico is ARM though.
Re:Elon Musk on Remote Work on Wednesday June 01, 2022 @11:58AM (#31583832)
> Madrigal Elektromotoren GmbH

Wait, isn't this a fictitious company from breaking bad?

Re:The Tower of Weakenings: Memory Models for Everyone on Wednesday April 06, 2022 @02:22PM (#30935666)
> Stray away from this model (e.g., relaxed atomics)

Relaxed atomics are still data-race free, did you mean non-atomic accesses?

Re:Generics can make your Go code slower on Thursday March 31, 2022 @03:10AM (#30864637)
I, along with everyone in the embedded space, have been using separate function sections forever for --gc-sections and I would be very surprised if they really cause any bloat and duplication at runtime. Do you mean bloat for intermediate files?
Re:Generics can make your Go code slower on Wednesday March 30, 2022 @02:14PM (#30858778)
> There are linker flags that allow some deduplication but those have their own drawbacks

As long as you use --icf=safe I don't see any drawback, and most of the time it results in almost identical reductions to --icf=all since not many real programs compare addresses of functions.

You cannot overload operators of integral types in C++, if you mean you can overload `int operator+(int, int)` to be saturating. You can create `saturating_int` kind of types easily though.
Re:Apple announces 27-inch 5K Studio Display on Tuesday March 08, 2022 @04:54PM (#30607662)
Can you actually connect HDMI input to a thunderbolt only display? I have the LG 5K thunderbolt-only display and cannot use it with a desktop PC due to this issue.
Re:Bringing the Framework Laptop to more of the world on Tuesday February 22, 2022 @03:14PM (#30433067)
Isn't this supposed to be a strength of framework? Their machines are pretty modular. Users should get to pick and choose AMD vs Intel, keyboard layouts, wifi chipsets without framework having to design different machines for each configuration.
I've been using `expected`, i.e. value-or-error type, for a while in C++ and it works just fine, but the article shows it has some noticeable overhead for the `fib` workload for instance. Not sure if the Rust implementation has a different design to make it perform better though.
Re:System V Application Binary Interface [pdf] on Saturday February 19, 2022 @02:12PM (#30399626)
Have you checked section 9.1 of the System V ABI doc?
Re:Allocgate: Restructuring how allocators work in Zig on Wednesday December 15, 2021 @05:49PM (#29572578)
There is no double indirection and allocation here, it stores the FILE* directly, not as a pointer to a FILE*.
Re:Fibers under the magnifying glass [pdf] on Wednesday December 08, 2021 @08:11PM (#29492648)
Section 2.1.1 talks about fixed stack sizes though, so you only get to do 1 allocation, and in general it is not possible to precisely compute the necessary transitive stack size given a function due to recursion/indirect calls.

Stackless coroutines do not have this requirement, it is enough to be able to know the required frame size locally, without considering recursion/indirection. And fallback heap allocations are not surprising since we do not statically know the required frame size at the call site. Segmented stacks have their own tradeoffs too, checking if you have enough stack space at every function entry is not cheap.

Re:Std: Print is headed for C++23. std:cout is now a code smell on Tuesday November 30, 2021 @01:48AM (#29389629)
I doubt that's possible with the C++98 preprocessor.
Disclaimer: I dislike iostreams and in our environment <iostream> is completely banned.

However, in C++98, how else would you handle when you have an arbitrary number of things to print in a type-safe way? e.g.

    cout << myInt << ": " << something << " - " << otherthing << " - " << etc << '\n';
printf is not type-safe, nor supports user defined types. I'd rather not write 8 lines of functions calls for the same thing either.

I think it made some sense C++98, though it is an awful API in 2021.

Re:Microsoft is bringing Android apps to Windows 11 on Thursday June 24, 2021 @06:13PM (#27624529)
I thought Zircon is the kernel and Fuchsia is the operating system. Though that wouldn't prevent Google from building Android on top of Fuchsia.
Re:Ray Tracing in pure CMake on Saturday January 09, 2021 @03:48PM (#25704584)
Could you explain how cmake stuff isn't portable or broken between different flavors of Unix? I comfortably maintain CMake builds that work on linux (with centos, ubuntu and arch), macos and windows without much trouble.

If you mean cmake versions, I'm not sure what you expect, should cmake just freeze in time and stop adding features so someone gets to use cmake from 5 years ago?

Also, the bit about autotools on windows is silly. If it can't build native windows stuff, it's not at all viable for windows.

I also dislike cmake (particularly dependency management) and wish for something better, but I think our criticisms should be well-founded.

Re:Does C++ still deserve a bad rap? on Saturday October 17, 2020 @04:28PM (#24813023)
This fails when you want `4 + c` or `c + 4.f` etc. So you either have a gross number of overloads doing the same thing, or you just put an implicit constructor to `complex`.

Also, I agree that implicit conversions in general should be avoided, but this complex number example feels like the perfect use case.

Re:Does C++ still deserve a bad rap? on Saturday October 17, 2020 @03:14AM (#24808062)
> C language has some very limited implicit type conversions

What? C will happily compile this:

    void g() {
        float f = 3.14;
        int* ip = &f;
    }
C++ has no such _craziness_. Your strawman actually has pretty good uses:

    complex c = 3i;
    ... = c + 4;
Would you rather have the last line not compile because 4 is not a complex number? Because one _could_ argue that 4 is a complex number, and C++ can represent this with an implicit constructor.

The issue with C++ is that implicit is the default, not that it exists.

Re:How expensive is integer-overflow trapping in C++? on Thursday September 24, 2020 @12:56PM (#24580732)
This is not correct, what you are thinking is implementation defined or maybe unspecified behavior.

Please do explain the behavior of calling an uninitialized function pointer on x86 if you insist.

Re:We made an open source ESP8266 dev board for makers on Thursday September 17, 2020 @07:48PM (#24511337)
Maybe I'm missing it but I wish there was an ESP8266 board with a proper JTAG connector.

I have hacked something on a protoboard for nodemcus before, but it ended up being pretty messy.

Re:Pigweed: A Collection of Embedded Libraries on Friday March 20, 2020 @07:17PM (#22642728)
It's for bare metal microcontroller development. It _can_ work for those, but you probably already have relatively better alternatives for those environments.