Live data from Hacker News

C (Cbang) - A system oriented programming language

blog.lse.epita.fr

71–80 of 86 posts

Re: C (Cbang) - A system oriented programming language

#71
post #52

Earlier quoted context omitted.

Note 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.

Yes, but reference counting (ARC) is also automatic memory management.

Reference 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.

Re: C (Cbang) - A system oriented programming language

#72
post #42

Earlier quoted context omitted.

:D It has pointers too, will make a man outta you. Then you'll be able to easily move on to C++ as the OOP structure is almost the same.

You're making it sound like C++ with Basic syntax, which does not increase its appeal.

No, it's BASIC with the potential for C++ syntax when using objects.

Re: C (Cbang) - A system oriented programming language

#73
post #51
post #47

Earlier quoted context omitted.

Objective-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).

System 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.

You "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.

Re: C (Cbang) - A system oriented programming language

#74
post #73
post #51

Earlier quoted context omitted.

System 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.

You "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.

This 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.

Re: C (Cbang) - A system oriented programming language

#75

Regarding the use of integers as bit arrays, it would be nice if the syntax supported referring to a subset of the bits, similarly to bitfields in struct s. Example based on the syntax from the article: x: int ; x[0:6] = 42; // Set six bits starting with lsb 0 to 42

Yes, this is in the TODO list ;)

In fact, it doesn't reach top priority since we can do without for now (we have bitfields.) The issue with slicing is more a question of design: does slicing need to be constant expression or should we authorize more expression power (and then how could we implement that and how could we check it … )

Anyway, I'm looking for a clever way to define values accessed in a none uniform ways.

Integer as bit array was the simplest idea to test (and seems useful to me.) Now the compiler has almost everything I need to implement easily that kind of syntactic sugars.

Re: C (Cbang) - A system oriented programming language

#76
post #52

Earlier quoted context omitted.

Yes, but reference counting (ARC) is also automatic memory management.

Reference 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.

Funny, because Windows uses reference counting on the Kernel.

http://technet.microsoft.com/en-us/sysinternals/bb963901

Re: C (Cbang) - A system oriented programming language

#77
post #74
post #73

Earlier quoted context omitted.

You "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.

This 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…

C hardly requires it's runtime. Objective-C without the runtime is just C, if you write the runtime, GC, and other low-level system components in the C subset of Objective-C you are just writing the kernel in C.

Re: C (Cbang) - A system oriented programming language

#78
post #49
post #36

Earlier quoted context omitted.

Interesting 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.

> Interesting that none of those systems are in active usage... That's a ridiculous dismissal to make; we live in a world where hand-written assembly is considered a badge of honor, where people prefer to patch up a 40-year-old dinosaur rather than make something new, where people to go ridiculous lengths to avoid using a mouse simply because Unix didn't have mouse support in 1973. Is it any wonder that we're not usi…

> we live in a world where hand-written assembly is considered a badge of honor

Even in video games where this held true for longer, this is generally no longer the case.

> where people prefer to patch up a 40-year-old dinosaur rather than make something new

Also not true, Generally engineers prefer to make new things, The problem is that, creating new products from scratch to replace old ones ends up almost always being more effort than expected. Failure, is what causes patching the dinosaur the better approach, rather then engineering desires, Netscape is a classic example.

> where people to go ridiculous lengths to avoid using a mouse simply because Unix didn't have mouse support in 1973

I don't know what world you live in, because in the world I live in, computers with mice are much more popular than the alternative.

The fact that none of these systems are in usage is true, you can make excuses for them, but the fact of the matter is that there is a lot of smart people trying, and very little success. There is little evidence to support that this is a superior approach.

Re: C (Cbang) - A system oriented programming language

#79
post #77
post #74

Earlier quoted context omitted.

This 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…

C hardly requires it's runtime. Objective-C without the runtime is just C, if you write the runtime, GC, and other low-level system components in the C subset of Objective-C you are just writing the kernel in C.

Technically you will be using the Objective-C compiler, so it is still Objective-C even if the syntax looks like C.

The same applies if you would be using the C subset of a C++ compiler.

Re: C (Cbang) - A system oriented programming language

#80
post #79
post #77

Earlier quoted context omitted.

C hardly requires it's runtime. Objective-C without the runtime is just C, if you write the runtime, GC, and other low-level system components in the C subset of Objective-C you are just writing the kernel in C.

Technically you will be using the Objective-C compiler, so it is still Objective-C even if the syntax looks like C. The same applies if you would be using the C subset of a C++ compiler.

This is in the original context of how all systems will be written in "GC enabled system programming languages". If the language is not GC enabled due to missing a runtime or w/e then the technicality isn't relevant.
Post reply on HN