Live data from Hacker News

Writing Linux Modules in Ada (2016)

nihamkin.com

21–30 of 87 posts

Re: Writing Linux Modules in Ada (2016)

#21
post #7

Hah, my perfect niche! I think that an ada-like language could make a real resurgence in embedded programming. Ada gets all the things about bare-metal right that C got wrong. However, it's held up by legacy tooling, clunky syntax, and obtuse compiler errors. Adacore has gone a long way towards alleviating those issues over the last few years, with alire and the ada_language_server. Time will see where this language…

I completely agree. 'Design-by-committee' gets a bad rap, but Ada's designers got a lot of things right when it came to bare-metal programming. The ability to specify the in-memory representation of a type is one of my personal favourites. I don't think Ada's syntax has aged well. I wish it would get a 21st-century overhaul. I don't think that's likely though, but we can all dream. AdaCore do great work, and contribu…

For what it is worth, Ada was not "designed by committee" more than most languages. It was designed by a design team, and in each revision, there was a strong technical leader of the design team, with the whole design team sharing a strong design aesthetic. I doubt you could say even that about many mainstream languages these days.

Re: Writing Linux Modules in Ada (2016)

#22
post #17

Earlier quoted context omitted.

Ada’s take on memory safety is pretty limited. Heap allocation is explicit; there’s a procedure literally named Unchecked_Deallocation to free a pointer. It does have thread-scoped locals and arenas, but nothing like declared lifetimes or borrowing. The spec allows for GC but I believe it’s rarely offered. It’s safer than C, but I’m not quite sure where recent specs line up against C++.

Only true for those stuck in Ada83. People keep repeating this nonsense without updating themselves beforehand. EDIT: To simply education on Ada, Yes there was an optional GC, no one ever implemented it, so in Ada2012 got removed from the standard. Almost everything can be allocated on the stack, so a strategy is to catch exceptions of not enough stack space and retry the same function with a smaller size for the dat…

What’s your sense of the size of the Ada job market? High hundreds? Close to 10,000? Is it static or growing or shrinking? Is there a preferred online community for Ada devs?

Re: Writing Linux Modules in Ada (2016)

#23
post #8

I've never used Ada, and I also don't really do systems stuff, but it does seem like it's a pretty neat language, at least compared to C. From what I have seen, it looks like it has better memory guarantees while still being fast and low-level. With be the popularity of Rust, it makes me kind of wonder why Ada isn't more popular. I should give the language a go.

There wasn't an open source compiler from the beginning, and thus a lot of the compilers where expensive. You could only use the language in an awful legacy setting behind a wall of NDAs and security clearances. Not my experience, just a bunch comments on HN of actual retired Ada devs on why the language didn't take when I was researching the language.

Adacore in the last few years have been investing heavily in modernizing the tool chain, but now it seems they are also investing in Rust.

Re: Writing Linux Modules in Ada (2016)

#24
post #11
post #7

Earlier quoted context omitted.

I completely agree. 'Design-by-committee' gets a bad rap, but Ada's designers got a lot of things right when it came to bare-metal programming. The ability to specify the in-memory representation of a type is one of my personal favourites. I don't think Ada's syntax has aged well. I wish it would get a 21st-century overhaul. I don't think that's likely though, but we can all dream. AdaCore do great work, and contribu…

It's unclear exactly what you mean by your remark that Ada's syntax hasn't aged well, let alone what a 21st-century overhaul would look like. Is there any chance you'd expand on that? I'm curious to know your thoughts.

They probably mean that they can’t get past the fact that it looks more like Algol or Pascal than C. Which is, frankly, a pretty silly argument.

I’ve heard this exact argument about VHDL versus Verilog, with the former being explicitly based on Ada’s syntax and the latter being explicitly based on C’s. (Turns out though that VHDL is also strictly better than at least traditional Verilog, as it requires separate interface specifications which lead to improved modularity.)

If anyone were to actually try to create “Ada: The Next Generation” I’d encourage you to just go all the way to S-expressions. Focus on the completeness and correctness of _the system_ and stop worrying about superficial complaints—or brush them off with a suggestion that they can use any syntax they want and just translate it to the standard one via tree-walking.

Re: Writing Linux Modules in Ada (2016)

#25
post #19

Earlier quoted context omitted.

Is this meant as a joke, too English-heavy?

They likely mean the pascal-like syntax

Standard Pascal has 35 reserved words compared to ANSI C 89 which has 32. Not a big difference in terms of English-heaviness.

https://wiki.freepascal.org/Standard_Pascal

https://en.cppreference.com/w/c/keyword

Re: Writing Linux Modules in Ada (2016)

#26

Hah, my perfect niche! I think that an ada-like language could make a real resurgence in embedded programming. Ada gets all the things about bare-metal right that C got wrong. However, it's held up by legacy tooling, clunky syntax, and obtuse compiler errors. Adacore has gone a long way towards alleviating those issues over the last few years, with alire and the ada_language_server. Time will see where this language…

> Ada gets all the things about bare-metal right that C got wrong

I'm curious, never had a look at Ada, can you elaborate?

Re: Writing Linux Modules in Ada (2016)

#27
post #7

Hah, my perfect niche! I think that an ada-like language could make a real resurgence in embedded programming. Ada gets all the things about bare-metal right that C got wrong. However, it's held up by legacy tooling, clunky syntax, and obtuse compiler errors. Adacore has gone a long way towards alleviating those issues over the last few years, with alire and the ada_language_server. Time will see where this language…

I completely agree. 'Design-by-committee' gets a bad rap, but Ada's designers got a lot of things right when it came to bare-metal programming. The ability to specify the in-memory representation of a type is one of my personal favourites. I don't think Ada's syntax has aged well. I wish it would get a 21st-century overhaul. I don't think that's likely though, but we can all dream. AdaCore do great work, and contribu…

It was designed by committee, but as long as the original author was involved he had a veto right and he used it very often, which alleviated the "committee" effect.

Re: Writing Linux Modules in Ada (2016)

#28
post #16
post #7

Earlier quoted context omitted.

I completely agree. 'Design-by-committee' gets a bad rap, but Ada's designers got a lot of things right when it came to bare-metal programming. The ability to specify the in-memory representation of a type is one of my personal favourites. I don't think Ada's syntax has aged well. I wish it would get a 21st-century overhaul. I don't think that's likely though, but we can all dream. AdaCore do great work, and contribu…

Usually many forget that their beloved C, JavaScript, Webassembly, OpenGL, Vulkan, Web, POSIX,... are equally design by committee.

The benevolent dictator cachet comes mostly from Python microcosm.

Re: Writing Linux Modules in Ada (2016)

#29
post #14

A very long time ago The University of York (UK) secured the contract from the UK Science and Engineering Council (SERC) to write a unix Ada compiler. It was a multi pass, 5-10 stage process (or more. I want to say 13 but time plays tricks) Very costly language to compile, in those days. (Vax 11/780 running Unix 32V, a precursor to BSD and Ultrix by some years) The story was it emitted an error/warning code along the…

10 or so years ago they had a collection of marble runs with mixed steel/glass marbles with a Hall effect sensor, a proximity sensor and some track switches. Students would use Ada to run the marble tracks and have them sort the marbles.

It’s interesting to hear that they had a longer history of teaching Ada with real-time sensors and controls.

Re: Writing Linux Modules in Ada (2016)

#30
post #26

Hah, my perfect niche! I think that an ada-like language could make a real resurgence in embedded programming. Ada gets all the things about bare-metal right that C got wrong. However, it's held up by legacy tooling, clunky syntax, and obtuse compiler errors. Adacore has gone a long way towards alleviating those issues over the last few years, with alire and the ada_language_server. Time will see where this language…

> Ada gets all the things about bare-metal right that C got wrong I'm curious, never had a look at Ada, can you elaborate?

I think it mostly refers to the build in functions in Ada for Bit fiddeling. You can represent registers and bitmaps in Ada data structures and use relatively simple to understand functions on them instead. https://learn.adacore.com/courses/intro-to-embedded-sys-prog...
Post reply on HN