News for hackers. Stuff that matters.
Re:C meeting is over. C23 added: by WithinReason on Saturday February 19, 2022 @05:11AM (#30395892)
Languages exist that compile to C which gives them many of the above advantages and more, so why choose C over them?
Re:C meeting is over. C23 added: by 10x-dev on Saturday February 19, 2022 @06:12AM (#30396213)
Control over the code that actually runs.

We already lose quite a bit of control with C (e.g. it reorders your code as it pleases) to gain portability across CPUs, otherwise we'd have to rewrite the code in several assembly languages.

If you consciously choose to give up even more control over the code that runs (because a compiler that targets C necessarily adds another layer of autogenerated code that you don't control) then it better be a wise tradeoff.

Re:C meeting is over. C23 added: by WithinReason on Saturday February 19, 2022 @06:43AM (#30396369)
The downside of reordering being performance? Or something else?
Re:C meeting is over. C23 added: by 10x-dev on Saturday February 19, 2022 @07:05AM (#30396491)
Performance is usually the upside. The downside is subtle bugs that can happen due to side effects of the statements being reordered between sequence points.
Re:C meeting is over. C23 added: by WithinReason on Saturday February 19, 2022 @07:14AM (#30396554)
AFAIK compilers don't reorder if it would change the result.
Re:C meeting is over. C23 added: by Thiez on Saturday February 19, 2022 @10:05AM (#30397631)
Compilers not allowed to violate the language spec when optimizing. But the spec may be fairly generous in its allowed interpretations, which may not match what a programmer may naively expect. C, with its many undefined behaviors and implementation defined behaviors, is especially dangerous.
Re:C meeting is over. C23 added: by raptorfactor on Saturday February 19, 2022 @05:38AM (#30396035)
Having never used such a language, I'm curious, what's the debugging experience like? Can I source level step the application in the original language or do I have to debug the generated C?
Re:C meeting is over. C23 added: by rightbyte on Saturday February 19, 2022 @07:40AM (#30396699)
You can put in line pragmas for e.g. gcc that will point you from "foo.gen.c" to "foo.fancylang". However it is not very useful unless the fancy language matches C's structs and native types and also does not mangle names.
Re:C meeting is over. C23 added: by TingPing on Saturday February 19, 2022 @11:21AM (#30398217)
It is always a pain to debug transpiled C IME.
Re:C meeting is over. C23 added: by rwmj on Saturday February 19, 2022 @05:39AM (#30396040)
One of the criteria is "excellent debugging support" which you don't get with transpiled languages, since you'll be buried in generated code when you open the debugger.
Re:C meeting is over. C23 added: by pjmlp on Saturday February 19, 2022 @09:45AM (#30397471)
Languages like Eiffel prove this isn't the case, it is a matter of proper debug tooling.
Re:C meeting is over. C23 added: by zabzonk on Saturday February 19, 2022 @11:15AM (#30398170)
Of course, Eiffel is such a popular and widely used language, with a great toolset. /s
Re:C meeting is over. C23 added: by pjmlp on Saturday February 19, 2022 @12:44PM (#30398885)
The amount of users doesn't change the fact of the tooling quality, but no wonder, UNIX folks tend to only take free beer, so what do they know about fine wine.
Re:C meeting is over. C23 added: by zabzonk on Saturday February 19, 2022 @01:02PM (#30399041)
I've read the Eiffel books, and tried to use the Eifell tools, on Windows - a horrid experience. I am not a "UNIX folk" and I can't imagine what comparing UNIX and Eifell has to do with anything. It is basically an unuseable programming language and toolset, promoted by an egomaniac with a grudge against C++.

If you disagree, please provide a link to something medium sized and useful written in Eifel.

Re:C meeting is over. C23 added: by pjmlp on Saturday February 19, 2022 @01:38PM (#30399332)
Useful to whom?

To you or the companies that keep Eiffel Software in business for 30 years?

Re:C meeting is over. C23 added: by zabzonk on Saturday February 19, 2022 @02:07PM (#30399589)
> the companies that keep Eiffel Software in business for 30 years?

Such as? If you can't provide links to people using Eiffel succefuly, then maybe there are none.

Re:C meeting is over. C23 added: by pjmlp on Sunday February 20, 2022 @04:20AM (#30404385)
I can provide them, but you apparently will ignore them anyway, because it is clear a company can exist for 30 years without money.

Here is one, just to keep you happy.

https://washingtontechnology.com/2003/06/tech-success-xontec...

Yes, the article is from 2003, then again you haven't asked for dates, but to make it easier on you, you can ask them how they feel about Eiffel in 2022.

https://www.xontech.md/en/

Re:C meeting is over. C23 added: by dig1 on Saturday February 19, 2022 @07:13AM (#30396546)
Depending on transpiler (compilers that will compile to C), you can get near representation in C (rarely) or something completely different (frequently). In Scheme/LISP world (where transpilers were popular for a while), even a simple expression like "(+ 1 1)" will rarely give you something like: "int a = 1 + 1;". I've seen these things would produce dozen of lines of various boxing/unboxing calls, type checks and GC protection marks. If the compiler is really aggressive, it will just put "2" as a constant.

I think that the only benefit of "compiling to C" was reusing existing compilers, not tooling around it. Also, debugging that code is a nightmare unless you are intimate with transpiler internals.

Re:C meeting is over. C23 added: by sys_64738 on Saturday February 19, 2022 @08:00AM (#30396836)
A compiler that translates to another language used to be called a translator.
Re:C meeting is over. C23 added: by zabzonk on Saturday February 19, 2022 @11:13AM (#30398155)
All compilers covert programs in one language (say C) into another, (say assembler or machine code), and they are called compilers. The whole transpiler thing is a bit bogus, but a C compiler has never IME been called a translator.