Hacker News new | comments | show | ask | jobs | submit login
There's a mini RTOS in my language (adacore.com)
159 points by inamberclad 10 months ago | hide | past | web | favorite | 24 comments

For people wanting to learn, this article trying to use it for audio applications will give you a nice taste of the language:


This Barnes book shows how it’s systematically designed for safety at every level:


Note: The AdaCore website has a section called Gems that gives tips on a lot of useful ways to apply Ada.

Finally, if you do Ada, you get the option of using Design-by-Contract (built-in to 2012) and/or SPARK language. One gives you clear specifications of program behavior that take you right to source of errors when fuzzing or something. The other is a smaller variant of Ada that integrates into automated, theorem provers to try to prove your code free of common errors in all cases versus just ones you think of like with testing. Those errors include things like integer overflow or divide by zero. Here’s some resources on those:




The book and even language was designed for people without a background in formal methods. I’ve gotten positive feedback from a few people on it. Also, I encouraged some people to try SPARK for safer, native methods in languages such as Go. It’s kludgier than things like Rust designed for that in mind but still works.

GPL download for AdaCore GNAT:


I'd also reference Rosetta Code (http://rosettacode.org/wiki/Rosetta_Code) to get a taste of Ada. I use it sometimes when I forget some simple stuff.

For C++ and Java practitioners : https://www.adacore.com/books/ada-for-the-c-or-java-develope... .

There's also http://university.adacore.com .

For Spark2014 you might want to start with AdaCore University also, or if you're in Paris in December there is a public training session : https://www.adacore.com/public-spark-training .

Then you might want to look up an implementation guidance : https://www.adacore.com/books/implementation-guidance-spark

And no I don't work for AdaCore :-D.

SPARK might be kludgier than Rust, but the guarantees it can make are stronger. And from what I've seen, it's less kludgy than the dependent type systems I've seen.

I meant integrating it into FFI's expecting C code. It's true that it makes stronger guarantees. I have a concept also that's called Brute Force Assurance where one source gets converted into Rust, Frama-C, and SPARK. Idea is static analysis tools for each knock out errors others can't catch. Final result is portable C.

I wonder if the lack of mechanisms like Ada's rendez-vous or QNX' mailboxes in other ecosystems are due to patent encumbrance.

Those are quite old concepts - I would imagine any patent to have expired by now.

They are also available in almost all embedded/rtos ecosystems.

I wonder if rust's "fearless concurrency"[1] allows you to create threads which can migrate between CPUs.

[1] - https://blog.rust-lang.org/2017/11/14/Fearless-Concurrency-I...

Threads which can move between CPUs? That's up to the OS, no?

According to the article, an ADA partitioning scheme (ravenscar) enforces this option.

Rust not, because rust is not thread safe. You manually have to prevent it from dead-locking. Fearless concurrency is just a clever marketing trick. But with pony you can. And there are several other "fearless concurrent" systems with native threading.


Real time scheduling on multicore is theoretically hard. The problem is not subtle concurrency bugs which can be squashed with a clever type system.

Rusts approach won't help you with scheduling---but in theory you don't have to do all your scheduling dynamically: if you know your program well enough you can schedule a lot of things statically and give guarantees.

(I wonder if anyone has come up with the right type system for this problem, yet?)

Pony and parrot did.

Saw this on reddit. Comments were full of "What's an RTOS?" ... which made me sad.

Real Time Operating System people.. cmon..

What makes me sad is the arrogance of your comment. There are 1000 of things that each of us know that you don't.

Not knowing is normal.

Not learning is bad.

If I don't know what RTOS is, my first reflex is to try and learn it on my own. Only if I fail this I will try to make others to give me an answer. I don't like wasting their time and making them provide the same reply for the thousandth time looks pretty wasteful to me.

In this case, looking up RTOS in Google is as simple as it gets. People who ask what it is do so because they didn't try to learn this by themselves.

I'm not exactly a fan of such people. I accept that they have different beliefs than me, and I try my best to be tolerant, but a sense of discomfort when dealing with people like that never leaves me. Is it arrogance too, I wonder?

If you are in a thread about a specific topic, likely filled with people knowing what they are talking about, asking there is only natural. It's quick, prevent you from learning the wrong information by looking it up wrong, filter the essential... And last but not least, the answer will be added to the thread, allowing the next readers to find it in the right context, including search engine bots.

This is as close as it gets to a win-win.

> If you are in a thread about a specific topic, likely filled with people knowing what they are talking about, asking there is only natural.

Sure. But, is it also natural and a win-win situation if your exact question is answered multiple times upthread? Shouldn't you use your browser's search function to see if it's not answered already before posting the question?

Yeah that's fair.

Somewhere a 12 or 13 year old is reading this for the first time and wondering what the heck a RTOS is. You were young and uninformed once too(or at least I was), and some nice people didn't tell me to RTFM, because at that point I didn't know what it would have even meant.

Yup. That was all of us once. (Well, those of us obsessed with computing at that age!)

One of the most important skills in life, is to be able to step into the shoes of someone else, and look through their eyes. It helps you in all kinds of ways: negotiation, getting a job, hiring employees, keeping others happy, having fulfilling relationships, knowing what users or customers want, etc.

You need this skill in your personal life, in your job, when you start a company, etc.

I suggest you try it.

One of my all-time favorite xkcd’s.

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact