Live data from Hacker News

C (Cbang) - A system oriented programming language

blog.lse.epita.fr

1–10 of 86 posts

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

#2
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!

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

#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 are part of the name, and mandatory)).

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

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

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

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

I can see what you mean, but stdint.h is just a bunch of typedefs stardardising the naming scheme. It doesn't take much work to sort it out.

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

#8

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!

Indeed, however this first blog post doesn't tell us much about the language itself. The couple examples seem a bit... anecdotal.

I'd also like to point out that setting individual bits in an integer is not usually atomic. So the "syntactic sugar" here could be pretty error-prone (and I can't say it was very high on my list of "features I wish C had").

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

#9
post #5

Earlier quoted context omitted.

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.

I can see what you mean, but stdint.h is just a bunch of typedefs stardardising the naming scheme. It doesn't take much work to sort it out.

Indeed, linux uses u32 and friends for instance. It's really not much of a problem in practice (kernels are by definition very hardware dependent anyway...)

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

#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] http://minnie.tuhs.org/cgi-bin/utree.pl?file=V7/usr/src/cmd/...

Post reply on HN