4 ms·
In how many "safe" languages can you write a complete shipping application without calling into libraries and/or kernels written in C?
by durandal1 10y ago
In how many "safe" languages can you write a complete shipping application without calling into libraries and/or kernels written in C?
- geofft 10y agoToday? Zero, probably. Five years from now? Probably a number of them. You've been able to write in Go with no standard library for years. There's a project to avoid it in Rust. There are lots of active kernel development projects. Do you want your software to continue to be written in C with a kernel and standard library in safe languages? And why does it matter to you to avoid improving your code until it's possible to run on an all-safe stack? It is as if it is 1990, and you are asking, why should I license my code as free software? How much can I run on a free C library and a free kernel?
- steveklabnik 10y agoYou don't need a project to do it with Rust, you just need a !#[no_std] marker.
- nickpsecurity 10y agoIs C being in at some point even relevant? There's plenty of safer languages thst can fo that. There's also containers, OS's, and embedded runtimes for some. The first, business mainframe was even programmed in an early one. It's even still on market although less desirable today. And C itself has automated toolimg available like SAFEcode that can make it safer with one team doing that for FreeBSD. So you can make the C safe or get rid of it. However much work you want to put in.
- steveklabnik 10y agoYou can do so with Rust, and there's a number of them, from toy POCs to much more serious projects.
- thesuperbigfrog 10y agoIt depends on what platform you are targeting, but as far as safe languages go, it is hard to beat Ada: https://en.wikipedia.org/wiki/Ada_(programming_language) https://en.wikipedia.org/wiki/Ada_(programming_language) Although Rust shows a lot of promise, Ada has a proven track record of use in safety critical applications such as avionics and railways.
- pcwalton 10y agoYou can make the same argument for assembler.
- pjmlp 10y agoLots of them, like any Modula descendent. C only became relevant outside UNIX around the late 90's.
- khedoros1 10y agoThat doesn't sound right. A ton of DOS software in the late 80s and early 90s was written in C.
- otterley 10y agoAre you thinking of Pascal, maybe? I thought that was the language of choice for DOS application development (and 8086 assembly, of course).
- AstralStorm 10y agoThat and advanced variants of BASIC such as GWBasic and QBasic. There is a good reason why Visual Basic is still alive.
- khedoros1 10y agoI'm thinking of games, really. The ones I'm most familiar with had certain performance-critical parts written in assembly, with the bulk of the connective code written in C. I suppose it depends on the definition of "written in C".
- pjmlp 10y agoSo not C at all, that was a common practice in Basic and Pascal as well. Those languages were the "Unity" of the 80 and 90's. Real games were 100% Assembly. This only started to change with the adoption of Watcom C, as it could generate relatively good code and use a DOS 32 bit Extender.
- pjmlp 10y agoNot at all. MS-DOS was written in Assembly, just like any application where performance mattered. CRUD applications were mostly written in an xBase dialect, with Clipper being the prominent one. Turbo Pascal, Turbo C, Turbo C++, Turbo Basic, Quick Basic, Quick C, Quick Pascal.... All of them had plenty of users. I own MS-DOS system programming books, with examples in Assembly, Pascal, Basic and C for both Microsoft and Borland variants.