Earlier quoted context omitted.
The first release of D was in 2001. That's 15, not 5, years ago.
Though, what I find odd is that for me (and yes that is an extremely small sample) I barely heard of D until people started wondering why rust was being picked over D.
Raspberry Pi Bare Metal Programming with Rust
81–90 of 96 posts
Re: Raspberry Pi Bare Metal Programming with Rust
#82Earlier quoted context omitted.
> Not every engineering decision is a tradeoff. Scratch the "not". For example, if I have a small-enough code-base, a module-system, is not worth it, unless it has zero cost. Or if the module system doesn't fit my needs, it will often be easier to create what I need if I don't have to work around what is there. Same with error handlers. Every engineering decision is a tradeoff, though you may be in a space where the…
A module system is always worth it because every program needs to use library functions. Even if you think you don't, LLVM will generate calls to library functions for ordinary code; for example, if you move structures around on the stack, LLVM might just decide to call memcpy(), even if you didn't ever import string.h. (Checking your code after the fact to verify there are no library calls doesn't get around this be…
Re: Raspberry Pi Bare Metal Programming with Rust
#83Earlier quoted context omitted.
And C++, surely? (Although, I would probably choose C (or even assembler) over C++ for something this simple (loop, blink a light). And between all those, I think Rust is really interesting. It could probably be argued that Rust doesn't add much on top of D (as a "better" C++) -- but between the mind-share and the focus on "safe" (and boxing in unsafe) memory access, I think Rust is really interesting. Not sure how r…
I left C++, Objective-C and Objective-C++ out, because of the C compatibility. The price of commercial compilers wasn't the only issue with Ads. It never had any friends in the UNIX culture. UNIX culture always ignored safer system programming languages from the 60 and 70's. If the hacker culture bashes Java for being verbose, what would they say about Algol languages like Ada? Another problem was Ads was mainly a Do…
[ed1: eg: http://rosettacode.org/wiki/N-queens_problem#Ada compares pretty favourably/neutrally in my mind to the C++ version in terms of verbosity (or lack thereof). Unless one gets upset about "end loop" vs "}" ]
[ed3: Hm, I guess looking at: http://rosettacode.org/wiki/Balanced_brackets#Ada I could see Ada as being derided as verbose... maybe :-) ]
[ed2: And looking a bit more at rosettacode, I now found:
http://forge.ada-ru.org/matreshka (Quite unrelated to the rest of the discussion here, but anyone else interested in poking at Ada might find it interesting) ]
Re: Raspberry Pi Bare Metal Programming with Rust
#84As a C programmer who fiddles with low level stuff I wonder why people get exciting about such trivial thing. Don't get me wrong. Rust is an interesting language. The thing described in this post is well within its capability, i.e. IMO there isn't really anything that worths bragging about. Such trivial thing neither demonstrates the real potential of Rust, nor answers important questions from real world engineering…
Has hello world ever been exciting, it is only really a building point. You can't do anything intersting until you know the basics, of building and flashing the board. The question is what does Rust have to offer as your embedded program grows.
The HN upvote says otherwise. :-)
But I guess had there been an HN-equivalent in assembly age people would get excited about C, too.
> The question is what does Rust have to offer as your embedded program grows.
Exactly.
We are aware of the good, bad and ugly bits of C. The industry has built extensive tooling around it. Rust has a long way to go. I certainly wish to see more pioneering projects from Rust.
Re: Raspberry Pi Bare Metal Programming with Rust
#85As a C programmer who fiddles with low level stuff I wonder why people get exciting about such trivial thing. Don't get me wrong. Rust is an interesting language. The thing described in this post is well within its capability, i.e. IMO there isn't really anything that worths bragging about. Such trivial thing neither demonstrates the real potential of Rust, nor answers important questions from real world engineering…
I don't think the post is bragging about this. It's well known amongst the Rust community that this stuff is pretty easy to do) I read it as a primer for writing simple Rust programs that can run baremetal on the Pi (I've cross compiled for a Pi-with-OS before but never tried this) and access GPIO. If you're talking about the HN upvotes, HN just tends to upvote posts mentioning Rust a lot :) Have you looked at https:…
Re: Raspberry Pi Bare Metal Programming with Rust
#86Earlier quoted context omitted.
I left C++, Objective-C and Objective-C++ out, because of the C compatibility. The price of commercial compilers wasn't the only issue with Ads. It never had any friends in the UNIX culture. UNIX culture always ignored safer system programming languages from the 60 and 70's. If the hacker culture bashes Java for being verbose, what would they say about Algol languages like Ada? Another problem was Ads was mainly a Do…
I've only toyed with Ada, but it doesn't strike me as particularly verbose? [ed1: eg: http://rosettacode.org/wiki/N-queens_problem#Ada compares pretty favourably/neutrally in my mind to the C++ version in terms of verbosity (or lack thereof). Unless one gets upset about "end loop" vs "}" ] [ed3: Hm, I guess looking at: http://rosettacode.org/wiki/Balanced_brackets#Ada I could see Ada as being derided as verbose... ma…
My real work experience with Algol like languages are Turbo Pascal, Delphi and Oberon. Although thanks to my interest into compiler development during my CS degree, I also do have some knowledge of almost all major Wirth influenced languages.
Personally, I do prefer some verbosity to lines full of symbols.
Ada 2012 is quite good.
It is also remarkable that in the 80's Ada 83 as seen as almost impossible to implement and nowadays C++ is way complexer to implement than Ada 2012.
Another anecdote, Rational started out in mid-80's as a startup doing Ada workstations[1] (think Ada machines), with IDE capabilities that probably only Lucid C++ had in the 90's [2].
[1] https://en.wikipedia.org/wiki/Rational_R1000
Re: Raspberry Pi Bare Metal Programming with Rust
#87I 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.
You could do this with much less than an RPi. I would recommend using an AVR or better yet a 555 timer if all you need is an 80KHz signal. Let me know if you want help with this I'm looking for projects like this or something much more complicated.
Re: Raspberry Pi Bare Metal Programming with Rust
#88Earlier quoted context omitted.
I tried digging around but couldn't find the package names -- I could've sworn ansi-term ( https://crates.io/crates/ansi_term/ ) and hyper ( https://crates.io/crates/hyper/ ) were two of them, but it looks like they both use stable. Thanks though!
Depends on when you last tried I guess. So what happened was that many of these packages existed pre-1.0 when there was no stability system. Nobody knew which features would be stabilized (if you go further back, the fact that things would be stabilized in such a way wasn't clear either). So we all just used whatever feature we liked. Many of these unstable APIs or features had stable counterparts, but the choice to…
Re: Raspberry Pi Bare Metal Programming with Rust
#89Earlier quoted context omitted.
A module system is always worth it because every program needs to use library functions. Even if you think you don't, LLVM will generate calls to library functions for ordinary code; for example, if you move structures around on the stack, LLVM might just decide to call memcpy(), even if you didn't ever import string.h. (Checking your code after the fact to verify there are no library calls doesn't get around this be…
Does bare metal Rust also use memcpy() or other library functions? If so, how are those linked into the final binary?
Re: Raspberry Pi Bare Metal Programming with Rust
#90Earlier quoted context omitted.
I think he was asking which languages could actually be used to do this today, without writing a new cross-compiler first.
You always need a cross-compiler, or a VM. There is no way around it.