* Posts by MikeTheHill

13 publicly visible posts • joined 17 Aug 2021

The US government wants developers to stop using C and C++

MikeTheHill

Re: Why?

> Can someone give me a summary of just what about Rust is causing the translation problems?

Data structures and ABIs. Rust has its own way of representing data structures and its own way of calling functions - it needs this as part of its borrow/checker stuff and possibly other reasons.

That means the cross-over between Rust and C/C++ is a pain as there has to be an unsafe conversion in both directions. And in some cases there are no easy conversions so the C function has to adapt and thus all the callers of that C function also have to adapt.

So if you are completely replacing a standalone C/C++ executable *and* all its dependencies at the same time, then no big deal. But, if you are replacing a single source module in a morass of C/C++ then it's much harder as you have to write unsafe Rust wrappers for every C/C++ function called and for every C function you replace. And you may have to adapt some C functions to suit Rust.

This is why Rust in Linux is so hard as essentially every source module in Linux calls many other C functions so replacing even a single source module with a Rust version requires writing a fleet of unsafe Rust wrappers and potentially modifying the C functions to be more amenable to Rust callers.

Even if someone goes to the trouble of writing a bunch of wrappers to, say, the networking stack in Linux, that's not the end of the job by a long-shot. Quite the opposite in fact.

The question arises as to who changes these Rust wrappers when the networking folk want to change their C interfaces? The networking folk argue they don't know Rust, so they can't do it, but if they push their change to the repo, suddenly the kernel build fails due to the now-incompatible Rust wrappers.

So do the networking folk just sit around and hope there is a Rust developer on hand to respond to their every whim? That's a pretty uncomfortable and risky dependency if you're trying to get your code out the door. Or are the networking folk expected to learn Rust so that they can spend time changing the wrappers? And it's not just the wrappers they'll have to change, they have to change the Rust code which calls the wrappers and the associated test programs. And if one of the Rust tests now fails, who debugs and fixes that?

Whichever way you look at it, the C developers end up with brittle dependencies, stalls in their work-flow, more work and possibly a whole other language to learn that they may not want to learn.

In an Open Source project that unwelcome burden is highly likely to disengage many C programmers, not a great strategy where engagement is already a problem. In an Enterprise environment, you can probably coerce your C/C++ programmers to learn enough rudimentary Rust to support the gun Rust programmers writing the cool stuff, but that is a pretty risky manoeuvre unless you are absolutely certain of the cost/benefits.

Which brings up the resource issue. Once you start down the Rust path, the end result is that ultimately you expect to be able to completely replace your C/C++ workforce with a Rust workforce and that 10 years down the road, when your code-base is predominantly converted, that Rust is still popular with the cool kids. If I were a CTO, I'd want to think long and hard about the implications, costs and risks of that little jaunt into the unknown.

The empire of C++ strikes back with Safe C++ blueprint

MikeTheHill

"..just recompile a few million projects".

Excepting that's not how it will work. The rewritten C++ compiler will be much stricter and as a consequence it will barf up an extraordinary number of warnings and errors when compiling exisiting projects because most of those projects will contain code which is verboten in this stricter world. For example any program which uses pointers or indexes into arrays may well fail to compile.

More likely is that if a safe C++ profile can be created a more likely target will be new code, such as that one might put into a kernel wishing to move on from C to something safer.

Google says replacing C/C++ in firmware with Rust is easy

MikeTheHill

Even if Rust is good, it's still only addressing a niche problem

The thing to remember here is that the class of problems that are currently being solved in C/C++ and perhaps should be solved in Rust are quite narrow. Firmware, Operating Systems, Real Time systems, Embedded Systems and games. All very important of course, but what percentage of programmers work on these problems? Maybe 1-2% of all programmers?

The vast majority of programming problems are probably better solved in languages other than Rust, C or C++. Languages which intrinsically don't have the sort of memory problems that Rust claims to solve. Languages which are far easier to learn. Languages which are far more mature and stable. Languages which are routinely taught in schools and Universities.

I would think that for most applications, programming in easier languages like php, Java, go, python, COBOL and the like are better choices than C, C++ & Rust.

E.g., if a commercial entity such as a bank or insurance company contemplated writing their applications in C/C++/Rust I would think them crazy. The cost/benefit just isn't there.

So perhaps keep the discussion in the context of dealing with a very narrow class of programming problems for a very narrow subset of programmers.

GhostBSD makes FreeBSD a little less frightening for the Linux loyal

MikeTheHill

Re: I've Used GhostBSD

I see this as a feature, not a bug.

Building and testing your application on any *BSD instead of just a Linux is often a great way to discover how many unwanted and non-standard assumptions have crept into your code base.

If your project is well structured with a good amount of automated testing, which they all should of course, it shouldn't take much more than an "rsync; make test" to test on a *BSD platform. This could easily be part of your CI flow.

Reminds me of the old days of SMTP programming. Everyone tested their new code against sendmail and if it worked with sendmail it was deemed to meet the standard. But sendmail accepted all manner of non-standard cruft and was very forgiving. The story goes that when Wietse first connected VMailer (now Postfix) to the net it could hardly exchange mail with any SMTP server or client. Why? Because Wietse wrote to, and tested against, the standards, not to what sendmail accepted.

Same same for just developing on Linux. Bad habits, narrow dependencies and assumptions creep in over time. *BSD can help keep that in check for you.

MikeTheHill

Re: BSD, Linux or ... Linux

I don't know about Ghost directly, but regular 64bit FreeBSD 13.2 runs just fine on PI4s.

$ dmesg | some-grepping

FreeBSD 13.2-RELEASE-p4 GENERIC arm64

FreeBSD/SMP: Multiprocessor System Detected: 4 CPUs

This system runs a ZFS file system for TimeMachine, Proxmox backups and an rsnapshot target. It's also used as a cross-compile system when I need to check multi-platform compatibility.

If Ghost doesn't yet run on arm64, it can't be too far off from being able to do so.

95% of NFTs now totally worthless, say researchers

MikeTheHill

Revolutionary new model?

"the NFT space has introduced a revolutionary new model for ownership and the monetization of digital assets"

With quotes like that, dappGambl's are clearly part of the cult of bitcoin, so for them to say their favourite parrot is dead, must mean it is indeed very very dead.

Meta tells staff to return to office three days a week

MikeTheHill

Why can't each group decide?

Three days a week is pretty arbitrary. If you trust a group to define, create and release a product or feature, surely you can trust them to self-manage how much time they spend physically together?

A group might decide that in the early product development stage they all need to be in the same room, but during the mid-phases when the project is well defined and delivery targets are being met, maybe no physical meetings are required. Then as it gets closer to release date and maybe during release the group decides they really want to be together so they can instantly react and problem solve if something goes wrong. In short, the need to be physically together, is very fluid.

And I'm sure many of these groups have highly experienced developers, project managers and product managers who hardly benefit from micromanagement from on high.

Yet strangely, Zuck has this epiphany, that only a genius could get, that three days a week in the office is the perfect number for everyone.

Is there anyone more out of touch with reality and clouded by their own narcissism?

Twitter tweaks third-party app rules to ban third-party apps

MikeTheHill

Re: Why should they feel obligated to refund anyone?

> You bought a product off them, that product no longer works, you can claim a refund

You could argue the product still works, just that you no longer have access to the inputs it needs to run.

If you buy an electric blanket and your electricity gets cut off, do you have a right to a refund on the blanket?

If you buy an Internet connected device and you lose access to the Internet, do you have a right to a refund on the device?

If you buy a twitter app and you lose access to Twitter APIs, do you have a right to a refund on the app?

Electricity, Internet and Twitter APIs are all services delivered by 3rd parties independent of the vendor who sold you product. So where do you draw the line?

MikeTheHill

Re: Why should they feel obligated to refund anyone?

Probably depends on the terms of the contract. Was the app fee sold as a maintenance fee, a one-off purchase fee, a promise to access free upgrades fee, access to a better twitter experience fee or something else?

Some of the above terms suggest a refund while others do not. Largely it depends on whether they sold a finished product or future delivery of a product/service. It also might depend on the accounting treatment that the app vendors took with their sales.

Compare the difference between selling a book and selling a magazine subscription. When selling a book, the revenue is realised immediately and the vendor moves on. When selling a magazine subscription the subscription fee is actually a liability in that the vendor has to deliver future product.

Importantly, a vendor should *not* spend a liability before delivering the promised product/service otherwise they risk creating an unfunded liability which can send a company broke.

Bizarrely, Icon Factory, seem to have one foot in each camp. By pleading with customer's not to seek a refund it is admitting that they treat the sale as, at least in part, a delivery of a future service/product. But in their next breath they suggest refunds will send them broke which implies that from an accounting perspective they did not treat their sales as a liability.

In short, Icon Factory appear to have created an unfunded liability that has now come back to bite them.

If this surprises them they must not have received any financial advice of any kind over the life of the company. If this doesn't surprise them then they always knew they were running a risky "hand to mouth" business.

There is a path to replace TCP in the datacenter

MikeTheHill

Only for ipv4 networks inside a data-centre

While the title makes it obvious, some people might have missed that the goal is only to replace data-centre traffic as Homa is current ipv4-only and relies on things like DSCP markings to survive transit between end-points.

There is *no* suggestion that Homa will replace wide-area TCP.

Out of beta and ready for data: 64-bit Raspberry Pi OS is here

MikeTheHill

FreeBSD13/aarch64 runs on them too!

Yeah, I have stable results running a couple of FreeBSD13/aarch64 pi4b servers. I just use the Raspberry PI Imager app to burn the iso, and Bob's your Uncle.

Mainly running network monitoring and DNS, so pretty light-weight stuff, but perfect for a bit of systemic diversity on low wattage h/w.

I also use them as a cross-platform check that code compiles and runs in different environments. If my applications compile and run on an Intel Debian and a 64bit Arm FreeBSD, I feel pretty confident that I've covered most system dependencies. Important for me as I mainly work in the cli/server space.

Earth to Voyager 2: Standby for connection – after we tip this water out of the dish

MikeTheHill

Re: Rusty scuppers?

"Not even NASA is stupid enough"

Wait what? I thought we were fixing NASA's design flaws.

Are you telling me that, bear with me here, NASA may have thought about rain when they designed these dishes?

Say it's not so.

Here I was ready to expose my genius level skills by denigrating those stupid engineers and scientists who have deployed the largest dishes all over the planet, and now you tell me they actual might know what they are doing?

This keyboard warrior is so disappointed about a missed opportunity. Anyone got any suggestions for other areas I can excel in? I hear vaccines are big right now. Maybe I'll mosey on over to the immunology department and use my genius to point out their obvious errors.

Pi calculated to '62.8 trillion digits' with a pair of 32-core AMD Epyc chips, 1TB RAM, 510TB disk space

MikeTheHill

How does anyone prove this number is correct?

After all, only the first part of it can be compared to the previously longest value of pi. But what about the last part?

Is there some mathematical trickery that one can use to verify this value? (Probably, I'm no mathematician).