[Info-vax] Rust as a HS language, was: Re: Quiet?
plugh
jchimene at gmail.com
Wed Apr 6 13:08:54 EDT 2022
On Wednesday, April 6, 2022 at 9:36:05 AM UTC-7, Arne Vajhøj wrote:
> On 4/6/2022 12:08 PM, Bill Gunshannon wrote:
> > On 4/5/22 20:20, Arne Vajhøj wrote:
> >> On 4/5/2022 8:08 PM, Bill Gunshannon wrote:
> >>> On 4/5/22 19:46, Arne Vajhøj wrote:
> >>>> C and C++ are currently dominating the low level code area, but
> >>>> there are some well known problem.
> >>>>
> >>>> Two of those problems are:
> >>>> * buffer overruns
> >>>> * memory leaks
> >>>
> >>> Both those problems were fixed 40 years ago. The fixes were
> >>> ignored and the company offering Safe C went out of business.
> >>
> >> They were not fixed as the current C compilers allow
> >> the problems.
> >>
> >> Maybe they could have been fixed, but that does not really
> >> help those with C code today.
> >
> > Let me re-word that. 40 years ago the problems were well known
> > and documented. A company created a C compiler and support package
> > to fix it. The industry rejected it because the cost (and I don't
> > mean the purchase price!) was too high.
> >
> > It is interesting that very little of this made it into the C
> > Standard which is when they could have fixed all of it. And
> > they can't use the backwards compatibility argument because
> > there was no compatibility maintained between K&R and ANSI C.
> How much is known about why that product failed?
>
> I could have been the overhead. But I doubt it. Many languages
> from that era did either check or had the option of enabling checks.
>
> And today it would almost certainly not have been an issue. Most
> languages check.
>
> Arne
Bill, are you referring to
https://pages.cs.wisc.edu/~austin/scc.html
If so, that's certainly a valuable contribution to the C compiler ecosystem. It's necessary, but not sufficient to address the kinds of UB we've been talking about. And, frankly, there are kinds of invalid pointer access that simply can't be caught without the other static guarantees that Rust makes, and /all/ current C compilers do not. For example, C simply isn't capable of inhibiting type punning. It's a core feature of the language, and at the same time a footgun.
Speaking of compilers vs. interpreters, I'd like to add "transpilers" like Google Web Toolkit to the mix. Write in modern Java and transpile to optimized JavaScript. Lots of fun! And, of course one has to admit the intense brain-fukery of Threaded Interpretive Languages. Is they compiled? Do they interpret? Only the debbil knows, and she ain't tellin'
More information about the Info-vax
mailing list