Live data from Hacker News

C (Cbang) - A system oriented programming language

blog.lse.epita.fr

11–20 of 86 posts

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

#11
post #10
post #3

I think that languages that are a just thin shell on top of C (as opposed to languages that merely target C, e.g. Chicken Scheme) might have some potential. I'll call this coffeescriptification --still eagerly awaiting the first transpiled language that does nothing but remove C's braces and semicolons. If someone doesn't do it by next April Fools, I certainly will (I already have the name in mind: Glee (the italics…

Sounds like what you're looking for is the original Bash source code, circa 1977, for example [1]: LOCAL STRING copyto(endch) REG CHAR endch; { REG CHAR c; WHILE (c=getch(endch))!=endch ANDF c DO pushstak(c|quote) OD zerostak(); IF c!=endch THEN error(badsub) FI } Applicable macros if you want to give your code that classic ALGOL 68 smell in [2]. [1] http://minnie.tuhs.org/cgi-bin/utree.pl?file=V7/usr/src/cmd/... [2]…

"An original idea. That can't be too hard. The library must be full of them."

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

#12
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 ;)

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

#13
post #6

How about a few more default data structures, like resizable arrays or hashes? I find the biggest bump in my productivity in most other languages is that those two things are there already.

The problem is dynamic memory allocation. It's actually one of the gripes I have with the "rust" language [1]. As a C coder I find it hard to take seriously a language that don't let me customize memory allocation easily.

It's not impossible to do right though, C++ has "allocators" parameter templates to do exactly that (there's a default implementation that you can "override" with a custom class).

[1] https://news.ycombinator.com/item?id=3027777

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

#14
post #13
post #6

How about a few more default data structures, like resizable arrays or hashes? I find the biggest bump in my productivity in most other languages is that those two things are there already.

The problem is dynamic memory allocation. It's actually one of the gripes I have with the "rust" language [1]. As a C coder I find it hard to take seriously a language that don't let me customize memory allocation easily. It's not impossible to do right though, C++ has "allocators" parameter templates to do exactly that (there's a default implementation that you can "override" with a custom class). [1] https://news.y…

Rust isn't finished yet. It's about to get 'regions', which come with custom allocators.

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

#15
post #5

I have a couple of problems with their analysis of C. There's no typed macros There are inlined functions... While the type system of C is basically size based, a lot of types have an ambiguous size (int for example) Use stdint.h definitions. Having said that, I would like namespaces in C!

But they've identified this as for systems based programming where you don't have any guarantee of stdint.h holding true (POSIX compliance). Their implementation is much more flexible. Albeit slightly reinventing the wheel.

If you're doing systems level programming, you shouldn't be counting on anything being portable anyway. Reimplementing it is worthless for projects are on a single OS. If you're implementing the OS, then these decisions need to be made anyway, independent of the language.

You should be coding to(or with) the OS you're working on. If you're doing multiplatform stuff, then #defines with a naming scheme work, and are already the standard practice.

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

#16
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 structs.

Example based on the syntax from the article:

  x: int;
  x[0:6] = 42; // Set six bits starting with lsb 0 to 42

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

#17
post #12

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…

hi 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?

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

#20
post #13
post #6

How about a few more default data structures, like resizable arrays or hashes? I find the biggest bump in my productivity in most other languages is that those two things are there already.

The problem is dynamic memory allocation. It's actually one of the gripes I have with the "rust" language [1]. As a C coder I find it hard to take seriously a language that don't let me customize memory allocation easily. It's not impossible to do right though, C++ has "allocators" parameter templates to do exactly that (there's a default implementation that you can "override" with a custom class). [1] https://news.y…

To complement Marijn's response, here's a blog post from one of the Rust developers that gives a bit of an introduction into regions:

http://smallcultfollowing.com/babysteps/blog/2012/04/25/refe...

Post reply on HN