4 ms·
Interestingly, one can substitute Ada/SPARK for C in a lot of this article on "C's benefits" with huge boost on safety & maintenance side. For cutting-edge, one
by nickpsecurity 10y ago
Interestingly, one can substitute Ada/SPARK for C in a lot of this article on "C's benefits" with huge boost on safety & maintenance side. For cutting-edge, one project on 8-bit micro's used ATS language for its combo of safety & performance. OcaPIC let's tinkerers use Ocaml subset for algorithms if performance doesn't preclude it. People are also getting a combo of high-level and C benefits by using DSL's embedded in eg Haskell that output C. The Atom, Ivory, and Tower languages are examples of this.
The only thing that's uniquely an advantage of C in the article is understanding legacy code in popular projects. It's mostly in C for historical & social reasons. Mastering C is a great help there. Although, one could still use Ada (Ada-to-C compiler) or DSL approaches above with better results when writing code. Maintainers won't accept that in popular projects, though. So, back to knowing & writing good C for this sort of thing.
- ci5er 10y agoSo... Ada is better, and anyone could use it where they use C - and in fact could use it to generate C. But nobody does. Is that your point?
- nickpsecurity 10y agoThe point is that many benefits ascribed to C to justify use of C arent unique to C and therefore dont immediately justify it. Then I corroborate that with several examples including Ada. You got that much right. The nobody does part seems off given amount of customers companies like AdaCore have and how much is recurring business. Safety-critical industries like tools that help software work correctly from the start. A significant chunk, esp in aerospace, use Ada.
- Keyframe 10y agoThere was recently a discussion about Ada here and it seemed real nice with an obvious question - if it's so nice, why no one is using it outside of scope of people already using it. So, I gave it a try. Ada is a wonderful, WONDERFUL, language. Albeit a bit verbose. Here comes the catch though. Everything related to Ada seems to be tied to Adacore and proprietary toolings. There's a path for you to do it without (still tied to Adacore though), but not as obvious and not as widespread. Kind of like Common Lisp in ye olde Franz days. C is great too. C99 especially so. C11 threads are good too. C20 seems to be on a good path as well, here's its charter: http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2086.htm http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2086.htm Only thing I would add to C as a language or in standard libraries is some kind of (better) string and UTF handling. ICU4C is coolio, but too much. Antirez's SDS looks cool, but I haven't used it, so I don't know from practice how/if it works with UTF and if it's great in production.
- ci5er 10y agoI like Ada. It's nice. It's actually beyond nice. I don't like working at/for the places that use it. Just in terms of "I'm used to it, and it (mostly) works everywhere I want it to be", C89 + your UTF-handling would be super. I can (and have) construct support for CJK if/when needed, but, gosh, at this point, I wouldn't mind relegating it to some standard run-time.
- nickpsecurity 10y ago"Everything related to Ada seems to be tied to Adacore and proprietary toolings. There's a path for you to do it without (still tied to Adacore though), but not as obvious and not as widespread. Kind of like Common Lisp in ye olde Franz days." That's a fair criticism. The comparison to Franz CL seems good, too. The good news about this risk is that AdaCore at least FOSS'd most of the key stuff. The compiler also has rigorous validation suite that can be used in an alternate one. I've always thought it would be better to redo the compiler in Scheme, Ocaml, or Haskell anyway to use all the wonderful tooling they have for abstraction, assurance of correctness, and maintenance. Maybe a front-end that then gets run through LLVM as is getting more common.
- Keyframe 10y agoYou hit the point I've missed to punctuate. At least Adacore's stuff is FOSS'd. Well, a version or two away at least. In contrast with Allegro, that's a huge point forward. Also, at least someone is actively working on FOSS, even though it's only one company (mostly). That's kind of the only major downside I saw with Ada when I've tried to answer to myself that question of why isn't anyone using it outside of people already using it. The other part-answer would probably be that it's not in fashion, but I'm not concerning myself with that.
- nickpsecurity 10y agoI remember that I loved reading most of what was on Allegro's feature page. Especially AllegroCache where you put OOP data in an OOP database instead of the round peg, square hole concept involving a RDBMS & ORM that are popular. They throw in a Prolog for queries and their own little SourceForge of libraries. Kept it proprietary at a cost. It about seemed worth the money albeit I'd keep a FOSS variant of my code on CLISP or something in parallel just in case. ;) Then I saw the real anti-FOSS: royalties. They charge royalties!? In (year here) in software!? Their dependence is reminiscent of Adacore but their financial benefit on development and distribution can only be topped by Microsoft, IBM, and Apple. ;)
- mfukar 10y agoGHC deprecated the C backend since 7.0 (just FYI, the choices of LLVM and Cmm backends are more nuanced).
- nickpsecurity 10y agoThe DSL's generate it themselves I believe. Here's Ivory for instance: http://ivorylang.org/ivory-introduction.html http://ivorylang.org/ivory-introduction.html
- qwertyuiop924 10y ago>The only thing that's uniquely an advantage of C in the article is understanding legacy code in popular projects. As much as I love C (despite its flaws), I have to agree here: Like drinking, C is only fun if you do it socially. If you do it nonsocially at all hours, your friends might begin to distance themselves from you. Or hold an intervention.