[Info-vax] C et al (was: Re: Rust as a HS language, was: Re: Quiet?)

Stephen Hoffman seaohveh at hoffmanlabs.invalid
Sat Apr 9 22:29:53 EDT 2022


On 2022-04-09 22:10:00 +0000, John Dallman said:

> In article <6251fe92$0$696$14726298 at news.sunsite.dk>, arne at vajhoej.dk
> (Arne Vajhøj) wrote:
> 
>> But are you saying that an ANSI C compiler also supports the
>> old style function?
> 
> At least some of them do. The compiler I had handy was on Windows, 
> Visual Studio 2019. I just compiled this:
> 
> #include <stdio.h>
> int main( argc, argv)
> int argc;
> char *argv[];
> {
...

Enjoy that K&R C syntax while it lasts (C17 and earlier), as C2X 
(probably C23) expects to deprecate K&R function declarations.

Here's the (accepted) proposal (for deprecation):

http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2432.pdf

More on C2X (though not the most current list):

https://habr.com/en/company/badoo/blog/512802/

Some opinions on the C ABI, and the "fun" that is parsing C more generally:

https://gankra.github.io/blah/c-isnt-a-language/

The IDE I routinely use live-parses C source code in the editor input 
using callable Clang, which makes finding errors faster, and makes 
source code completion near prescient. At some point, maybe that 
arrives in VSI VSC or LSEDIT or some other IDE...

A proposal discussing part of the mess that is C signed and unsigned handling:

http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2837.pdf

Some light reading on hardware and language memory models:

https://research.swtch.com/mm

Memory de-initialization (and C is bad at this, as are many other languages):

https://gankra.github.io/blah/deinitialize-me-maybe/

Undefined behaviour sanitizer (UBSan):

https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html

And since there's been a discussion of assembly languages else-thread, 
here is an intro to that of RISC-V:

https://mcyoung.xyz/2021/11/29/assembly-1/

My usual pointer to just what volatile provides, and doesn't provide:

http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1152r0.html

Previous discussion of the C volatile keyword here in c.o.v.:

https://groups.google.com/g/comp.os.vms/c/Zf9tM2UkKAE/m/awJ6Tp-yAQAJ

If you have lots of C around and are thinking about alternatives, maybe 
look at zig:

https://ziglang.org

https://ziglang.org/documentation/master/#Introduction

...or Crystal:

https://crystal-lang.org

And included here mostly for grins, a C interpreter:

https://github.com/asvitkine/ccons#readme

I'm interested in alternatives to C, as well as at least some of what 
C2x will seemingly bring to existing and new C code.

If C, Swift, Go, Rust, Crystal, or Zig works for y'all, great. Or 
BASIC, COBOL, Macro32, C++, or Fortran/FORTRAN, for that matter. Even 
Java or some other JVM, or Ada. Whatever. Use what works for your task 
and your staff and your needs, whether the languages are familiar to 
you, or new.


ps:

Understanding other (and completely different) sorts of strings and 
string encodings:

https://www.sapiens.org/language/khipu-andean-writing/

And understanding and maintaining skills:

https://codewithoutrules.com/2017/10/23/obsolete-skills/



-- 
Pure Personal Opinion | HoffmanLabs LLC 




More information about the Info-vax mailing list