News for hackers. Stuff that matters.
Re:Checked C by Keyframe on Tuesday June 14, 2016 @11:24AM (#11902567)
You know, some people seem to scoff at replacement Cs. I'm kind of one of them. I know my reason(s) though. It's not about other languages as much as C itself. I've been with it for awful long time now and I used to think I kind of know my way around it. I've changed that line of thinking, because I know it's not true. I make a lot of mistakes, especially considering memory. At least (almost all of) my code isn't public-facing.

Since I thought I knew C very well, I came to realisation (due to many memory bugs/leaks) that maybe that's not the case after all. What is it then? I can get performance out of it, lots of it (that's one thing I know to do, somewhat at least). That's when I questioned myself and started thinking that it's not that I know C (I don't, after 20 years or so), but that I am very comfortable with it and I don't want to change that comfort. C++ and 90's traumas and post 90's (STL) traumas had a lot to do with it. Now, I'm fishing out for newer languages that would replace C for me, Rust namely, but I'm still falling back to C all the time. Now, I'm thinking that that's just the way it is. I'm a C programmer and that's how it will stay. At least for a long while. I do and have used a lot (A LOT) of languages in my past, but my core is always C (also first language I've learned). I don't program anymore for a living (I do "creative stuff" in film and tv now), so that is now more prominent than any other time in the past. I do stuff for me only and I can pick and choose whatever I want to - yet, it's always C.

Sorry for the "rant".

Re:Checked C by PeCaN on Tuesday June 14, 2016 @12:48PM (#11903288)
This mirrors my experience. C is a drug man. It's bad but you can't stop. You know how to get shit done in C and it's easy to think in. C is, IMO, something of a local optima for programming. Problem is, it's actually a relatively awful language, and I don't subscribe to the worse-is-better philosophy (though C may well be the best example of it).

Thankfully Rust gets my ML instincts going. I'm trying to use it more. It'll be nice not to be anxiously running my test suite under ASAN after every build.

Re:Checked C by ArkyBeagle on Thursday June 16, 2016 @05:32PM (#11919045)
I am surprised you never found managing those risks as stimulating. I do. 'C' is pretty good at providing the furniture needed to enforce formal constraints.
Re:Checked C by shrugger on Tuesday June 14, 2016 @12:54PM (#11903344)
Yeah but after sixty years of C, why should we trust an origanization like Mozilla? They've been thoroughly unwilling to come up with any sort of ANSI standard or anything, despite Rust being a reasonably mature language.

Google sought ECMA standardization when they took on Dart. Go language has an official specification, so someone could hypothetically re-implement it if they wanted to, and remain compatible Go projects.

Mozilla only wants Mozilla to be involved with Rust. They want everybody to use it in their systems, and have no input on where the language should go.

Re:Checked C by kibwen on Tuesday June 14, 2016 @02:23PM (#11904114)
This comment is beyond uninformed. Rust is currently working towards standardization, starting with the memory model. See http://smallcultfollowing.com/babysteps/blog/2016/05/23/unsa... . This work is being undertaken by Niko Matsakis (a Mozilla employee, so yes, Mozilla cares about standardization) and Nicole Mazzuca (an independent volunteer, so yes, Rust takes broad input from the community).

As for "they want everybody to use it in their systems, and have no input on where the language should go", you appear to be utterly clueless about how Rust is developed. Enormous swaths of the language have been designed by contributors who just showed up out of the blue and started putting in elbow grease. Iterators. Every data structure in the stdlib. Crucial, fundamental details of how the borrow checker operates. There's an entire repository for allowing anyone to propose changes to the language (a process which Mozilla employees are also forced to follow), which is a model that several other open source projects have since adopted (e.g. Swift).

Re:Checked C by PeCaN on Tuesday June 14, 2016 @01:23PM (#11903595)
Huh? Anyone can submit an RFC: https://github.com/rust-lang/rfcs

While Mozilla may not be the best organization, the Rust team seems much more willing to listen to their users than the Firefox team.

Re:Checked C by vvanders on Tuesday June 14, 2016 @01:16PM (#11903528)
Really? The Rust community has been one of the most open and encouraging ones I've seen. They've also taken great pains to make sure that community feedback is solicited and incorporated.
Re:Checked C by Guvante on Tuesday June 14, 2016 @01:26PM (#11903627)
From the little research I have done into Rust it seems unsurprising that there isn't a formal definition as any Rust standard would be similar in value to Haskell 2010. Useful but not sufficient due to the language still evolving.
Re:Checked C by kazinator on Tuesday June 14, 2016 @11:57AM (#11902863)
All of the things which the C-like replacements for C are competely missing the point. All their goals can be achieved by using a decent high level language (not "C like"), together with using C for just those parts that have to run fast, or interact with the hardware.

"Let's make an improved C, and then write millions of codes in nothing but that" is a myopic non-starter.

Re:Checked C by kbenson on Tuesday June 14, 2016 @12:10PM (#11902976)
How does this apply towards library creation, where the code is meant to be consumed by other programs languages?

While the total lines of code in libraries is less than that in applications, I would say the relative importance is more. That zlib has a fast and correct implementation matters to a lot of people.

Re:Checked C by kazinator on Tuesday June 14, 2016 @02:57PM (#11904402)
That's right; one fast and correct zlib matters more than giving everyone an improved C so that they can all try to roll their own zlib that is fast and correct.
Re:Checked C by kbenson on Tuesday June 14, 2016 @04:12PM (#11904968)
My comment was mean to point out that even if we magically achieved your dream tomorrow, and almost all applications were written in some HLL (which is probably a good thing), the amount of machine code being run in those applications that was generated from C is still substantial due to library use. If we accept that C is "bad", or at least that some major gains in usability, reasoning and security can be made by changing or replacing it, then there's still a major benefit to doing so.

When a bug comes out in zlib (or more likely, OpenSSL again), and we can attribute it to poor engineering in C, it doesn't really matter that all the applications are written in a HLL if they still loaded the library and used it because the performance was needed.