Nice, that looks like the way to do it!
“Funny” how it even offers a libc
for compatibility … but I guess this helps getting it some more serious testing 😉
Dipl.inform., FreeBSD ports committer, musician, C64 fan/coder, hetero cis white male, not proud, no wing, no ally, leaning liberal/ecologist, pro facts/science
Nice, that looks like the way to do it!
“Funny” how it even offers a libc
for compatibility … but I guess this helps getting it some more serious testing 😉
When the answer to major draw backs with a language is use it better that’s a dead end for me.
Try browsing the list of somewhat recent #CVE rated critical, as I just did to verify. A majority of them is not related to any memory errors. Will you tell all them “just use a different programming language”?
And again with OOP. Why hack it into a language rather than use a language that supports it.
Have you seen existing C code? For anything non-trivial, most code uses some OOP, and it comes quite natural in C, certainly no “hacking”. You don’t need a class
keyword to do that.
If it came out today you’d have an incredibly hard time convincing anyone to use it over other languages.
It doesn’t come out today, it’s been there for a long time, and it’s standardized, proven and stable. Sounds like you seriously misunderstood my points, which were, in a nutshell: For applications and similar, just use whatever suits you; for operating systems do experiments in lab/research projects (as was done with Unix), because existing and established ones are relied upon by lots of software. Just to make that perfectly clear, that doesn’t mean they should use C forever, it means they should wait for a potential replacement to reach a similar state of stability with independent standards and competing implementations.
I’d say if you’re happy with #C, there’s no need to choose any second language. 🤷
Before even looking at any alternatives, the question should be “why not C”. Some of the typical complaints are:
sizeof
everywhere possible, preferably on expressions instead of type names, defining clear ownership of allocated objects (and, where not possible, add manual reference counting), making ownership explicit by using const
where appropriate and naming your functions well, and so on. Given also there’s no guarantee alternative languages will safeguard you from all the possible issues and there are also a lot of other ways to create security vulnerabilities, my take on this would be: partially valid.Then, the next question would be: For what purpose are you looking for a second language?
For applications and services, there’s already a wide range of languages used, and I’d say do what everyone does and pick what you’re most comfortable with and/or think best suits the job. IOW, it makes little sense to ask what would be “the future”, there have always been many different languages used, just pick one that’s unlikely to quickly disappear again, so you’d have to restart from scratch.
For systems programming “the future” has been C for many decades 😏 … some people want to change that, actually for good reasons. IMHO, the current push for #Rust (I don’t see anything similar regarding #Zig yet?) into established operating systems is dangerous. An operating system is very different from individual apps and services. It’s required by these as a reliable and stable (in terms of no breaking changes) platform. It’s complex and evolves over an extremely long period of time. It needs to interface with all sorts of hardware using all sorts of machine mechanisms (PIO, DMA, MMIO, etc pp). I conclude it needs a very stable, proven and durable programming language. You’ll find C code from the 30 years ago that just still builds and works. IMHO a key factor is that there’s an international standard for the C language, governed by a standards body that isn’t controlled by any individual group. And correlated to that, there are many different implementations of the language. Before considering any different language in core areas of an established operating system, I’d like to see similar for that new language.
Now, C was developed more or less together with #Unix, so back then, nobody knew it would be such a success, of course there was no standard yet. But then, I think this is the sane way to introduce a new systems programming language: Use it in a new (research?) OS.
Sure, that’s yet another aspect. #Javascript (#ECMAscript to be precise) evolved a lot. Where we came from was a very limited standard and browsers doing their own incompatible thing, also adding “random” bugs, which btw triggered development of #jQuery, back then an extremely helpful thing, nowadays more or less obsolete. I’m sure writing a well-working #SPA with nothing but vanilla JS is perfectly possible these days, it just requires some planning and design, you’d probably end up with a (minimal and tailored to your needs) “framework” as part of your project. But from my experience, most “frontend devs” are indoctrinated into a strong belief you absolutely need super-fat frameworks for everything.
What I was talking about is that these you mentioned (React, Angular) are designed with nothing but SPA in mind. So, everything will end up being an SPA, which just makes no sense for 95% of “web apps”. There’s a nice set of architecture guidelines for web apps called #ROCA, which is in line with the initial design of #http and the web in general: https://roca-style.org/ – and then, you decided in your organization to follow that, you have the need for some enhanced UI components in JS, and these frontend guys basically keep telling you “we need our awesome framework here”. Oh boy. 🤦
In the end, I see the resident set of my local browser and have no questions left…
Side note, it’s not so much React, Angular, Vue or whatever that sucks, it’s the concept behind: #SPA. Or, more precisely, that concept used not in a niche where it belongs, but for every damn web site, or classic form-based web app. I remember getting into some very weird arguments with “frontend devs” over a simple demo class I wrote in vanilla JS to “enhance” a standard browser control (so, it still worked without a script). This class was pretty short and clean. Still they insisted it would be “hard” to program like that. It seems they can’t do the simplest things any more without the help of their massive shitloads of “frameworks”. And then, everything is a stupid SPA in the end, completely breaking the logical design of the web.
Ok, back to admiring the pure elegance of #C, sorry 😂
I always had the idea in mind to one day code something in #C for the #C64. There’s #cc65 offering a decent compiler. I always ended up with using #assembler again. That’s because on that platform, it is the only way to have “full control”: The OS only offers a machine code ABI (jump to routines, pass stuff in registers) and misses lots of things, so you need to program the hardware directly. Of course, I still use an assembler instead of hacking the bytes of the machine code directly.
Any Unix and similar OS comes with a C compiler, and even other systems offer a C API, so for a “modern” environment, that’s the natural language to use for that “full control”. And remember, C is your “portable assembler”. 😏
In a nutshell, if you take “from scratch” literally, it would mean to somehow hack bytes into the machine’s memory. That doesn’t make much sense. I understand it as “use a simple programming language and avoid these huge frameworks and similar doing deep magical stuff for you”.
CC: @[email protected]