Live data from Hacker News

Raspberry Pi Bare Metal Programming with Rust

blog.thiago.me

11–20 of 96 posts

Re: Raspberry Pi Bare Metal Programming with Rust

#11
post #9

Is Rust the future? As a C++ (hobby), Java (full time) developer, should I invest my time in Rust?

Rust, Go, Java, Scala, Clojure, Javascript... (leaving out quite a few other choices for brevity). They say choice is a good thing but too much choice is actually really annoying and fragments the community across a very large number of ecosystems.

Re: Raspberry Pi Bare Metal Programming with Rust

#12
post #9

Is Rust the future? As a C++ (hobby), Java (full time) developer, should I invest my time in Rust?

Out of all the new languages of the last 5 years or so (D, Rust, Crystal, Go?, etc.) I think Rust shows the most promise. It is attracting both c/c++ people and people coming from dynamic languages (Python, ruby, js). So I'd recommend trying Rust out for sure, not much to lose, maybe spending a day...

Re: Raspberry Pi Bare Metal Programming with Rust

#13
post #9

Is Rust the future? As a C++ (hobby), Java (full time) developer, should I invest my time in Rust?

Rust, Go, Java, Scala, Clojure, Javascript... (leaving out quite a few other choices for brevity). They say choice is a good thing but too much choice is actually really annoying and fragments the community across a very large number of ecosystems.

I can't stand JS and Go syntax, I tried a few times... This is the worst thing that happened to humanity after in XXI century. I feel more comfortable with Prolog than with JS.

Re: Raspberry Pi Bare Metal Programming with Rust

#14
post #9

Is Rust the future? As a C++ (hobby), Java (full time) developer, should I invest my time in Rust?

If you're just concerned about employment then you'll probably be fine with java (maybe go in the future). If you're looking for self-improvement then its always a good idea to learn a new language, especially if it does something different like Rust's borrow checker. Outside of that, I also used to do all my hobby code in C++ and after learning Rust I'm never going back to C++.

Re: Raspberry Pi Bare Metal Programming with Rust

#15
post #13

Earlier quoted context omitted.

Rust, Go, Java, Scala, Clojure, Javascript... (leaving out quite a few other choices for brevity). They say choice is a good thing but too much choice is actually really annoying and fragments the community across a very large number of ecosystems.

I can't stand JS and Go syntax, I tried a few times... This is the worst thing that happened to humanity after in XXI century. I feel more comfortable with Prolog than with JS.

In a way Go is a step backwards from C towards Pascal. Since a number of people that had extensive C experience and were in fact present at the birth of the C language made that decision I figure they are doing it for a good reason.

I can read Go easily enough, I haven't done any major writing in it (yet), other than some minor work on Hugo trying to help to nail down/replicate a bug. It was easy enough that I think I'd pick it up quite fast, the syntax feels 'weird' to me but that's most likely just unfamiliarity.

Re: Raspberry Pi Bare Metal Programming with Rust

#16
post #9

Is Rust the future? As a C++ (hobby), Java (full time) developer, should I invest my time in Rust?

I started playing around with Rust a few weeks ago and fell in love; it has some quirks for sure (the whole borrowing system is a bit tough to grok at first) but it didn't take long for me to start seeing things the "Rust way." My only hang-up with it right now is that so many of the most useful packages in Cargo depend on the nightly build of Rust.

Re: Raspberry Pi Bare Metal Programming with Rust

#17
post #8

I have the perfect project for this! Generate a signal using the GPIO ports to drive a mirror and camera in a synchronized fashion. Does anyone know if the RPi GPIOs can be driven at around 80KHz? I've seen reports that this is possible, but that the USB or video driver tends to lock the CPU for long times, messing with timings - but hopefully running on bare metal would take care of that.

This might be of interest: http://codeandlife.com/2012/07/03/benchmarking-raspberry-pi-...

Excellent, thanks!

So GPIO performance won't be a problem, but they note that OS multitasking can cause issues:

"What is not evident from the snapshots, however, is that due to multitasking nature of Linux, the GPIO manipulation is constantly interrupted for short periods when the CPU is doing something else, such as receiving or sending data over network, writing log files, etc"

Running on bare metal should take care of that, so the only remaining problem is how to synchronize the signal generation on the RPi with the recording of data on the host computer. (Sigh, if only RPi had a USB3 port...)

Re: Raspberry Pi Bare Metal Programming with Rust

#18
post #17

Earlier quoted context omitted.

This might be of interest: http://codeandlife.com/2012/07/03/benchmarking-raspberry-pi-...

Excellent, thanks! So GPIO performance won't be a problem, but they note that OS multitasking can cause issues: "What is not evident from the snapshots, however, is that due to multitasking nature of Linux, the GPIO manipulation is constantly interrupted for short periods when the CPU is doing something else, such as receiving or sending data over network, writing log files, etc" Running on bare metal should take car…

The new raspberry pi zero can be run as a device, so you could use that.

Re: Raspberry Pi Bare Metal Programming with Rust

#19
post #17

Earlier quoted context omitted.

Excellent, thanks! So GPIO performance won't be a problem, but they note that OS multitasking can cause issues: "What is not evident from the snapshots, however, is that due to multitasking nature of Linux, the GPIO manipulation is constantly interrupted for short periods when the CPU is doing something else, such as receiving or sending data over network, writing log files, etc" Running on bare metal should take car…

The new raspberry pi zero can be run as a device, so you could use that.

O.o this $5 puppy could essentially replace the 1.5K National Instruments DAQ I'm using right now. Even better, I won't have to deal with their horrendous API documentation anymore.

Of course that would require a Linux kernel, so not bare metal anymore, but there might be a way to make this work!

Now I just need to get my hands on one, it's out of stock everywhere within a radius of 300km...

Post reply on HN