7 ms·
I didn't checked the details, but I would love to see ten attempts every year, trying to solve the same problem. D and Go are not trying to provide us with a b
by antirez 15y ago
I didn't checked the details, but I would love to see ten attempts every year, trying to solve the same problem.
D and Go are not trying to provide us with a better C, because they don't share the concept of, a language that translates straightforward to assembler, but still is designed so that you can mount good abstractions with it.
This is what you need for kernel programming, embedded systems, and a good deal of system programming as well.
At the same point C is one of the top-used languages in the world, with a vast code base, and yet almost all the attempts in the languages area are about much higher level or exoteric stuff. Not that I don't want that kind of research, but it's bizzarre that no one is focusing where a lot of meat is.
I bet this better C will arise in a few years at max, and it is not going to come from academia. Times are mature apparently, there is even a C conf this year ;)
- Dn_Ab 15y agohi antirez, do you have a top contender from the current crop or a suspicion of which/what C Next would be like? I would guess that you would also eliminate languages like ATS, Felix, Rust and Vala. What about languages like Cyclone, decac, Clay?
- pjmlp 15y agoNative Oberon, Spin, Singularity, Home, Inferno are all operating systems written in GC enabled system programming languages. D and Go are just following that thread. Eventually all mainstream OS will have such type of languages and C will be legacy. Microsoft is already slowly doing that by dropping support for C later than C90, and adding COM based API as the default Windows API. Now mainly for Metro, perhaps for the complete OS in later versions. Apple as well, by adding reference counting and GC on their systems language, Objective-C. C only got spread thanks to UNIX, and brought upon us the wrath of buffer overruns and dangling pointers security exploits. We need better languages for doing systems programming.
- Arelius 15y agoInteresting that none of those systems are in active usage... > Eventually all mainstream OS will have such type of languages and C will be legacy. That's just speculation. Personally I have high hopes for languages with optional-only GC, and much stricter memory management principals. Ala, Rust.
- pjmlp 15y agoWindows and Mac OS X are, and they are slowly incorporating such changes, as I mentioned. Don't forget that UNIX was once upon a time a research operating system, and took a few decades to have industry impact. New ideas take time to mature.
- calloc 15y agoObjective-C isn't used in XNU the kernel that Mac OS X uses, Mach is a mixture of C and C++ (A subset of it actually, known as IOKit).
- pjmlp 15y agoSystem programming is more than just the kernel. I imagine that the kernel can easily compiled with the Objective-C or Objective-C++ compiler, if Apple so wishes.
- kelnos 15y agoYou "imagine" incorrectly. A functioning Obj-C requirement requires a runtime. Currently that runtime (libobjc) is written in C, and it requires a C library to function. Yes, you can rewrite those portions to use only functions available in kernel-land, but it is by no means "easy" as you suggest.
- pjmlp 15y agoThis just goes to show you don't understand compilers. All languages require runtimes, even C. The thing is that C as high level assembler it is, uses the operating system as its runtime. The C language is also part of Objective-C, in a similar vein as C++ also supports most of the C89 features with small exceptions. So it is possible to have the Objective-C runtime compiled using the C subset of Objective-C. This is known as compiler bootstrapping.
- Arelius 15y ago
- pcwalton 15y agoNote that Apple is abandoning garbage collection for Objective-C. Additionally, GC is not strictly necessary to solve buffer overruns and dangling pointers. Region-based memory management is an alternative for many use cases.
- pjmlp 15y agoYes, but reference counting (ARC) is also automatic memory management.
- slashvar 15y agoReference counting is the low-end of automatic memory management and garbage collection. And about GC in kernel, of course you can. The issue is that most efficient GC needs giant locking and giant locking in kernel is something that you don't want. In fact you can really live without GC. The burden of integrating it in kernel space out-range the benefit of using it.
- pjmlp 15y agoFunny, because Windows uses reference counting on the Kernel. http://technet.microsoft.com/en-us/sysinternals/bb963901 http://technet.microsoft.com/en-us/sysinternals/bb963901
- jff 15y agoI love Inferno, but the actual kernel is written in C, not Limbo.
- ams6110 15y agoObjective-C was not created by Apple.
- pjmlp 15y agoIt has created by NeXT, which was bough by Apple, thus Apple holds the language copyright.
- podperson 15y agoNot exactly: http://en.wikipedia.org/wiki/Objective-C http://en.wikipedia.org/wiki/Objective-C
- dchest 15y agoIt was not created by NeXT: https://en.wikipedia.org/wiki/Objective-C#History https://en.wikipedia.org/wiki/Objective-C#History There's no such thing as language copyright.
- pjmlp 15y agoA programming language is under copyright of the creator. , which can decide to put it in public domain, standardize it, give an open source license to it, whatever. While NeXT did not exactly created Objective-C, it acquired a license to be able to create their own implementation, which became the official Objective-C compiler. Plus, lets see what is the outcome of the Oracle vs Google trial regarding copyright.
- dchest 15y agoA programming language is under copyright of the creator. , which can decide to put it in public domain, standardize it, give an open source license to it, whatever. Implementation -- yes, the language itself -- no.
- cube13 15y agoWhat requirements would you have for a better C? The only major requirement that I can think of is that it's compiled directly to assembly without requiring an intermediate runtime or VM. This helps avoid the fundamental "chicken and egg" problem that a lot of higher level languages have. This means that GC needs to be an optional component. It does not specifically exclude it, however.
- chwahoo 15y ago> I bet this better C will arise in a few years at max, and it is not going to come from academia. I take this statement to mean: Academia is failing us by not providing us with the next generation C. If that was the intent, I think it's not a fair jab. Academia IS actively investigating low-level languages: ATS, Cyclone, and typed assembly are all examples. But, it's not academia's job to create widely-used languages and tools. Sometimes they do create something that achieves wide use, but that's mostly a side benefit. Their job is to generate and evaluate useful "idea nuggets" that can inform future system builders and to train students to do novel systematic research. There seems to be a common meme that academic CS is "out of touch" with what real developers need. I think it's mostly unfair: while the world always needs a slightly better web framework, compiler, language, etc., that's not the goal of academic CS; they aim to fertilize the ground with ideas that facilitate the growth of more big and small ideas.
- antirez 15y ago> I take this statement to mean: Academia is failing us by not providing us with the next generation C. If that was the intent, I think it's not a fair jab. I don't want to say that academia is failing or should responsible of giving us this "better C", just where I guess we should look to see "new C" coming is not there. However I think that academia may have a role in this matter, that is, to study the interaction between the programmer and the programming language about getting things done. This is probably done (but I can't remember famous recent studies about this) and could provide useful hints about how we can incrementally build / modify C to get a more reliable and less bug prone language. However ultimately "new C" will be designed by one or two guys at max, as it always happened with this kind of practical programming languages.
- eli_gottlieb 15y agoI mostly agree, but I would make a small correction: that's not what academic CS is paid for. Jonathan Shapiro didn't stop work on BitC because he ran out of enthusiasm but because he ran out of funding. Habit will only remain a live project while its PIs can keep the ~~grant money~~ spice flowing.