Live data from Hacker News

Android's new Bluetooth stack rewrite (Gabeldorsh) is written with Rust

android.googlesource.com

311–320 of 393 posts

Re: Android's new Bluetooth stack rewrite (Gabeldorsh) is written with Rust

#311

Earlier quoted context omitted.

I have worked with decades old codebases. I use up-to-date compiler where you get to use smart pointers and all the Modern C++ features. It's your fault if you not teach them how to upgrade the compiler. There is zero risk when compiling C++98 with C++11. It's also student fault if he selects a company with C++98 codebase. The student shall do due diligence. It's my advice for you to teach the Modern C++ before drivi…

Ok. I'll take your advice and give it the consideration which it's due. Thanks for taking the time out of your day to create a throwaway account just to tell me how to do my job. Cheers.

Unfortunately, the C ++ Committee knows that universities do a terrible job teaching C ++, except the one Bjarne teaches. If you ask Bjarne, he will tell you the same things I said.

A lot of universities stuck in C++98. It will takes them 1000 years to adopt C++20 tho.

One of mistakes many universities do is teaching either C or Java before C++.

I find C++ as a minimal OOP language to get head start.

C++ -> Java -> C

But if student is a complete noob to programming, I'd suggest to learn Javascript before going to C++

Again, this is to keep the intuition otherwise they will forget what they learnt.

I wish if many universities listened to Kate Gregory talk.

When you teach Java before C++,

Students try to write C++ in Java Style (Eg with new and delete). I answer plenty questions of students on Reddit's cpp sub who are trying to write C++ in Java style. I might make a talk on this in CPPCon.

When you teach C before C++,

Students try to write C with Classes.

But, as once Steve Jobs said,

"I used to think that technology could help education. I’ve probably spearheaded giving away more computer equipment to schools than anybody else on the planet. But I’ve had to come to the inevitable conclusion that the problem is not one that technology can hope to solve. What’s wrong with education cannot be fixed with technology. No amount of technology will make a dent."

You can laugh at me, that's okay. But truth is truth!

By the way, This is my 50th throwaway account. I use them because I'm getting down voted to death when speaking in defense of C++.

Re: Android's new Bluetooth stack rewrite (Gabeldorsh) is written with Rust

#312

I know the guy that heads up the team that did this work -- he and I spent 2+ years fighting Broadcom's old, god-awful bluetooth code. Our whole team used to play what-if games about replacing the thing while massive code dumps came in from vendors, making the task ever larger. Zach, if you're reading this, HUGE kudos to holding the line in replacing that, and double kudos for doing it in a verifiable, sane language!

> fighting Broadcom's old, god-awful bluetooth code Correction: god-awful host side bluetooth code. There is still the bluetooth firmware residing on the BCMxxx chip (or Qualcomm chip) - >1MB of god-awfulerer closed-source code, half of it is in ROM (with limited number of available patch slots), full of bugs. You can see it crash from time to time in the kernel debug logs (and auto-restart itself)

Broadcom's firmware seems to be just absolutely terrible across the stack, NIC included. They seem to have solid product design / engineering chops, but firmware just defies them.

Re: Android's new Bluetooth stack rewrite (Gabeldorsh) is written with Rust

#313

Earlier quoted context omitted.

Serious question, why doesn't Google build its own bluetooth & BLE chips? Please put some competition on Broadcoam and the like and either push them entirely out of the market (good riddance), or force them to step up their game.

I can't speak to this directly because of numerous reasons, chiefly among them being that I don't get to make those decisions. Standard disclaimer follows: I rejoined in the last two years, what follows are my opinions, these opinions are my own, blah blah. Android has never been about driving the hardware narrative -- it's always been about building a phone with mostly open contributions and driving the start of a w…

What a hopelessly naive perspective. Android has always been about ensuring the Google surveillance operation doesn't get shut out of mobile. The whole OS is designed to enable snooping on the user not just while in the browser, but at all times.

The fact that they've had to build actual hardware that functions at times, and includes things like driver stacks is purely incidental to the main mission. Try seeing how willing they are to add support for chipsets on phones that don't include Google Services.

Re: Android's new Bluetooth stack rewrite (Gabeldorsh) is written with Rust

#314
post #297

Earlier quoted context omitted.

I have worked with decades old codebases. I use up-to-date compiler where you get to use smart pointers and all the Modern C++ features. It's your fault if you not teach them how to upgrade the compiler. There is zero risk when compiling C++98 with C++11. It's also student fault if he selects a company with C++98 codebase. The student shall do due diligence. It's my advice for you to teach the Modern C++ before drivi…

>It's also student fault if he selects a company with C++98 codebase. The student shall do due diligence. So you are saying they should (as totally newbies) ask to go through a company's code before accepting a job?

No. A lot of job posts out there that highlights the language version. For example, I saw a lot of job posts for C++11, C++17 so on. Heck even, some jobs directly mentions Modern C++.

https://jobs.smartrecruiters.com/FireEyeInc1/743999738511776...

They can also look at the creation date of company and make a educated guess.

Re: Android's new Bluetooth stack rewrite (Gabeldorsh) is written with Rust

#315
post #257

Earlier quoted context omitted.

I have worked with decades old codebases. I use up-to-date compiler where you get to use smart pointers and all the Modern C++ features. It's your fault if you not teach them how to upgrade the compiler. There is zero risk when compiling C++98 with C++11. It's also student fault if he selects a company with C++98 codebase. The student shall do due diligence. It's my advice for you to teach the Modern C++ before drivi…

Have you coded on larger code bases not written by you? Usually most of the time you read code instead of writing it. Sure you can add new code that adds smart pointers, but you still have to understand the exant code, at least to some degree.

I've done plenty contractual work on larger code bases that has C++98 to some extent. I will tell you what you will never truly understand the whole code base.

Sourcetrail does amazing job at explaining larger code bases. Check it out.

Re: Android's new Bluetooth stack rewrite (Gabeldorsh) is written with Rust

#316
I've always been annoyed at the cross-platform story for Bluetooth. GATT is one of my favorite protocols because it is so simple, but writing simple code against this simple protocol is _not_ portable:

iOS and macOS have CoreBluetooth, Linux has BlueZ, Windows has Windows.Devices.Bluetooth and Android has android.bluetooth.

I've seen a few projects trying to fix this, like https://github.com/deviceplug/btleplug, and I hope one of them becomes production ready.

Re: Android's new Bluetooth stack rewrite (Gabeldorsh) is written with Rust

#317

Earlier quoted context omitted.

> "new" and "delete" considered as bad practices. Depending on what kind of work you do, you may not have a choice as to whether you get to you smart pointers or not. Our students go into work with decades-old codebases littered with new and delete. They need to know what they do. > You claimed that you don't have to teach Manual Memory management in Rust so why not do the same for C++? Because there are no old rust…

I have worked with decades old codebases. I use up-to-date compiler where you get to use smart pointers and all the Modern C++ features. It's your fault if you not teach them how to upgrade the compiler. There is zero risk when compiling C++98 with C++11. It's also student fault if he selects a company with C++98 codebase. The student shall do due diligence. It's my advice for you to teach the Modern C++ before drivi…

My experience with C++ is that every time I look at it every few years, C++ developers tell me that I'm stupid for wanting to do memory management the way it was done a few years ago and nobody has ever done that.

Re: Android's new Bluetooth stack rewrite (Gabeldorsh) is written with Rust

#318
post #31

Earlier quoted context omitted.

I suspect that Zig will still end up eclipsing Rust - not because it's a "more powerful" language, but because it's much easier to learn. Lower barriers of entry seem to matter more than mere "power" - see Common Lisp's multi-decade feature lead being ignored, and Python leapfrogging other more capable languages (Common Lisp) or equally capable ones that came first (Ruby) due to ease-of-use.

Rust isn't that hard to learn. I teach it to college sophomores who only know Java, and within 2-3 months I have them writing parsers and interpreters in Rust. In fact these students are requesting our courses to be taught in Rust, and have never heard of Zig. I think that while the language is a little complicated, this is tempered by how nice the tooling is. I consider the borrow checker to be my TA, as it actually…

Heh, figures that the only person with actual experience systematically teaching the language, is downvoted here.

Re: Android's new Bluetooth stack rewrite (Gabeldorsh) is written with Rust

#319

Earlier quoted context omitted.

Serious question, why doesn't Google build its own bluetooth & BLE chips? Please put some competition on Broadcoam and the like and either push them entirely out of the market (good riddance), or force them to step up their game.

Building radio ASICs is a world rife with patents. Pretty much nobody new can enter the market.

Aren't they considered "essential patents" that must be made available at a reasonable price?

Re: Android's new Bluetooth stack rewrite (Gabeldorsh) is written with Rust

#320

This is great news. Hopefully it fixes a lot of the jank that I've always experienced with Android Bluetooth. I don't think I've ever had a smooth experience - even with a supposedly flagship device (Pixel 4a!) I've encountered all of the following problems: * Devices getting stuck at max volume (thankfully not headphones) * Devices getting stuck at really low volumes * Devices randomly switching between absolute vol…

Hopefully they fix the Bluetooth issue with YouTube and Chromecast. It is such a odd issue for me. Chromecast will pause the video because YouTube demands to have the Bluetooth audio back to the app instead of the TV (I have specialized Bluetooth audio transceiver hook up to my TV because of my disability). YT keep forcing the bluetooth audio back to my phone instead of the TV after few second of casting on my TV. This cause the cast to pause the video because my phone detected that audio switched to different source (YouTube). The only way to stop that from happening is to swipe away the YouTube casting notification after casting the video in my phone, then YouTube will stop doing that.

Honestly, I think the issue is the bluetooth itself, it an amazing but extremely fragile technology. My Win 10 laptop crap the bed with the internal bluetooth. And it crap the bed with the USB bluetooth transceiver as well. Microsoft been having issue with bluetooth. The same for OSX, Apple have their issues with it. They recently released a update to fix the bluetooth issue in Big Sur M1 and that didn't fix the issue.

Post reply on HN