4 ms·
For systems programming, C89 is definitely a "sweet spot". It's relatively easy to write a compiler for and was dominant when system variety was at its highest,
by coldpie 4y ago
For systems programming, C89 is definitely a "sweet spot". It's relatively easy to write a compiler for and was dominant when system variety was at its highest, so it is best supported across the widest variety of platforms. Later C standards are harder to write compilers for and have questionable features like VLAs and more complicated macro syntax. C++ is a hideous mess. Rust is promising, and would probably be my choice personally, but it's also still fairly new and will limit your deployment platform options.
C89 is still a reasonable choice today. I don't think it's depressing. It's a good language, and hitting the sweet spot of both language design and implementation is really hard, so you'd expect to have very few options.
- kibwen 4y agoRe: Rust, Curl is modular enough that you don't need to rewrite it in Rust in order to enjoy some of its benefits, you can just tell Curl to use Hyper (Rust's de-facto HTTP lib) as a backend. For the past few years they've been working on getting the Hyper backend to pass the Curl test suite and they're down to five remaining tests, so perfect support looks to be imminent: https://github.com/orgs/hyperium/projects/2/views/1 https://github.com/orgs/hyperium/projects/2/views/1 (seanmonstar occasionally streams on Twitch if you'd like to watch him work on these).
- bitexploder 4y agoAlso, and this sort of blows my mind, but Rust is almost 10 years old. It is a pretty darn stable language, especially for greenfield projects like a new HTTP library. The better Rust gets at interop the more it will begin to eat the systems programming world IMO, and we all benefit, even if it is quietly doing it without much fanfare.
- laumars 4y agoI was with you right up until “quietly doing it without much fanfare”. Personal opinions of Rust aside, it has gained so much fanfare that “rewrite it Rust” is now practically a meme.
- bitexploder 4y agoThe other side of that is the back end of what Rust folks are doing. There is a vocal segment that are doing a lot of surface level things. But there are also people quietly building the language and toolchain up to be something that you can do true low level embedded work with while maintaining (most of) the guarantees of Rust. That is what I was alluding to. I don't think "rewrite it in Rust" is always smart or even productive. edit: It is also worth exploring why and how a systems programming language has generated this much excitement in folks that are "rewriting it in Rust". These people are also in their way making it that much easier for everyone else to transition to Rust, proving these projects work just fine in Rust. I do agree it is a meme, but it is a good one for us all. As an infosec practitioner nothing could make me happier than seeing people excited about a language that eradicates one of the worst and most pernicious classes of C/C++ bugs.
- pjmlp 4y agoThe sad part is that this was inflicted by the industry themselves, https://www.schneier.com/blog/archives/2007/09/the_multics_ope.html https://www.schneier.com/blog/archives/2007/09/the_multics_o... > The combination of BASED and REFER leaves the compiler to do the error prone pointer arithmetic while having the same innate efficiency as the clumsy equivalent in C. Add to this that PL/1 (like most contemporary languages) included bounds checking and the result is significantly superior to C.
- still_grokking 4y agoThanks for the link! One data point more backing my theory that we're in the middle(?) of "computing dark ages", where the biggest crap and nonsense dominates everything (and people not even know how crappy everything is). Do you think we will ever leave the dark age? I mean before our AI overlords get in charge and kill and replace all the nonsense we've built, of course.
- pjmlp 4y agoNot before our lifetimes. This is a matter of quality, and like everything in computing, quality only matters when money or law is involved, so in a way returning digital goods with refund is one way to make companies take quality more seriously, other are stricter liability laws for when exploits ocurr in the wild.
- b3morales 4y agoRust is over 12 years old at this point as a publicly-available project (its development started internally sometime in the late 00s; it was publicized in summer of 2010).
- steveklabnik 4y agoPeriodization is hard, especially with Rust, but if we're talking about reliability, counting time before 1.0 in 2015 doesn't feel right to me. Seven and a half years is still a long time :)
- b3morales 4y agoAgree, time since v1.0 is a very reasonable measure.
- conaclos 4y ago10 years and still an okish IDE experience… This is going to stay with Rust. The problem is not the tooling, but the language.
- selfmodruntime 4y agoI am unsure what you mean. Care to elaborate?
- conaclos 4y agoSee my other answer [1] to get more context :) [1] https://news.ycombinator.com/item?id=33729406 https://news.ycombinator.com/item?id=33729406
- TheCycoONE 4y agoI think I followed. One aspect of a programming language is how easy it is to build a useful IDE for with code prediction, navigation, refactoring, etc. Java is relatively easy, Lua is very hard. Rust is somewhere in the middle, with macros being a complicating factor. https://rust-analyzer.github.io/blog/2021/11/21/ides-and-macros.html https://rust-analyzer.github.io/blog/2021/11/21/ides-and-mac... discusses the problems specific to rust much better than I could.
- bitexploder 4y agoGo has one of the best compiled language IDE experiences out there. GoLand makes it feel easier than Python code :)
- zaphirplane 4y agoCan it find all Implementations of an interface or what interfaces this implements ?
- bitexploder 4y agoYes to both. It is great :)
- flykespice 4y agoSo you're arguing C89 is better because it's easier to write compilers with it? How is that a relevant point for the context? We're talking about whether c99 it's better migrating for the end user and not a compiler writer
- nightfly 4y agoThey are arguing that C89 is better because it's supported on more platforms (curl is used on all sorts of oddball embedded systems), and that it's easier to get a new platform going with C89