C language 50th anniversary - Page 1
Forum section: electronics / general

author: Picuino
author_rank: Super Contributor
timestamp: July 22, 2022, 07:22:48 am
content: The first version of the C language (the C compiler and some utilities made with it) appeared in 1972. I have not been able to find out in which month exactly. In any case I am very happy for the 50th anniversary.At the time it took me a little bit of a big effort to learn C. In those years the fashionable language was Pascal and its implementation by Borland, TurboPascal. TurboPascal had many libraries and was much more productive than C in the MS-DOS based PC environment.But in the long run, C has served me much better for programming embedded systems and today it has nothing to envy to Pascal.Happy C anniversary!!!Edit: Better saidCode: (c)#include <stdio.h>int main(void) {printf("Happy 50th anniversary C!!!");return 0;}

author: Karel
author_rank: Super Contributor
timestamp: July 22, 2022, 08:25:42 am
content: Happy anniversaryOn to another 50 years of (quasi) dominationMy all time favorite programming language, simple, reliable and best supported everywhereAnd no, this is not an invite to C haters and Rust zealots to start to explain why they believe C should be replaced

author: Picuino
author_rank: Super Contributor
timestamp: July 22, 2022, 09:35:25 am
content: C haters?It certainly seems that there must be people for everything. XD

author: niconiconi
author_rank: Frequent Contributor
timestamp: July 22, 2022, 10:19:20 am
content: Quote from: Picuino on July 22, 2022, 07:22:48 amTo be more historically accurate.Code: (c)main(){printf("Happy 50th anniversary C!!!");}In pre-ANSI C (K&R C, as found in the 1st ed. K&R), all functions without a specified return type are implied to be int, the main() function without a return type is implied to be 0 in practice, and printf's definition was provided by the compiler by default.Here's a PDP-11 simulation run on the original UNIX v6 system.PDP-11 simulator V3.11-0Disabling XQListening on port 1106 (socket 7)SR:@unixlogin: root## lsbincoredevetclibmntrkunixtmpunixusr# edamain(){printf("Happy 50th anniversary C!\n");}w 50th.c51q# cc 50th.c# ./a.outHappy 50th anniversary C!Not to say it's a good style in 2022. By modern standard it's sloppy - but it was what the original C was - a quick-and-dirty experimental design to test ideas, just like UNIX was also a quick-and-dirty experimental operating system for the same purpose. Both are probably the most productive experiment in computing history.

author: Marco
author_rank: Super Contributor
timestamp: July 22, 2022, 10:41:08 am
content: Quote from: niconiconi on July 22, 2022, 10:19:20 amOnly in a broken window sense.Lack of runtime bounds checking, null in general and null delimited strings in particular (and escape codes in general). So many fundamentally wrong approaches cemented during the Unix days, with most of the disastrous and unnecessary stupidity still mostly unrecognized (people will still defend SQL!).

author: niconiconi
author_rank: Frequent Contributor
timestamp: July 22, 2022, 10:54:35 am
content: Quote from: Marco on July 22, 2022, 10:41:08 amOkay, the flamewar just arrived as expected, time to leave the thread.I think we can all agree that the original experiment itself was productive within its original scope. Minicomputers were 70s equivalent of microcomputers, they made computing available to individual researchers for the first time. Unix started out as a hack and experiment on what you could do with the new power.However, by a series of historical coincidences, it was later adopted and used on almost all computers in existence, and eventually used as even an industrial-grade production system, this is well beyond its intentions. I think saying it's counterproductive or harmful at this point is a reasonable opinion (Disclaimer: I'm just saying it's reasonable, but I'm not necessarily advocating this position, I have no motivation to start yet another flamewar - I've already seen all kinds of arguments since a long time ago...)

author: Marco
author_rank: Super Contributor
timestamp: July 22, 2022, 12:56:29 pm
content: Quote from: niconiconi on July 22, 2022, 10:54:35 amThe scope died almost immediately, by the 90s the writing was on the wall for the horrific results of buffer overflows, null and SQL. Yet somehow it took 3 decades more for the hyperscalers to finally start bringing some sanity to IT.UNIX somehow managed to be the perfect storm of extremely seductive concepts fundamentally wrong for modernity. They couldn't have known it at the time, but Unix and C likely railroaded IT into trillion dollar level of lost productivity, which could have been saved had other contemporary concepts won out.Just because the mistakes could not realistically be recognized at the time is no reason to celebrate instead of mourn the mistakes of the past.

author: Picuino
author_rank: Super Contributor
timestamp: July 22, 2022, 01:35:29 pm
content: The C language was a replacement for assembly language, used at the time to write operating systems such as Unix. In that sense, it has been a complete success. In microcontrollers there are still people (including university professors) who prefer to program in assembler instead of C. And I don't mean a few lines to speed up the program, use special instructions for multitasking or something like that, I mean that the convenience of programming the whole program in assembler is still defended. There is not much to comment on this... each one with their decisions.Lately there is news about the use of Rust in the Linux kernel. Welcome a new language if it improves security. But the fact is that the millions of lines of GNU/Linux code are written in C and no serious contender for C has appeared in 50 years.

author: Marco
author_rank: Super Contributor
timestamp: July 22, 2022, 01:45:51 pm
content: As I said, they stumbled on the perfectly wrong set of seductive yet disastrous.The lack of necessity and danger of allowing buffer overflows and use after free 99% of the time, have been only very recently barely recognised. Till two years or so ago C defenders would shout you off every forum. The lack of necessity for null and its danger is rarely recognized. The lack of necessity for escape codes outside wire protocols and their danger virtually unrecognised as of yet.The perfection of C/Unix to blind people to its flaws is impressive all in and of itself, they pioneered so many ways to do things exactly wrong while blinding people to how.

author: magic
author_rank: Super Contributor
timestamp: July 22, 2022, 02:57:42 pm
content: What do you mean by SQL and what does it have to do with C?

author: tom66
author_rank: Super Contributor
timestamp: July 22, 2022, 03:24:17 pm
content: It's not as if non-C approaches investigated at the same time are flawless.Pascal-style strings prefixed with length are also problematic because the length has to be tracked by all operations to that string, so you can still cause buffer overflows by triggering a bug in that logic, and you need to pre-estimate the string size range to know whether a byte or word is appropriate for length, or use some variable integer type. And don't get me started about the hodge-podge that C++ strings are with SSO and reallocated/pooled buffers.Use after free() can is a consequence of a lack of garbage collection and memory management built into the language. This was probably not a conscious decision, there was just no need for it when Unix systems typically had under a megabyte of memory. Besides, even if it was considered at the time, you couldn't just rely on your interpreter or language to handle memory for you, you had to do it properly, else you'll just run out.The biggest issue I have with modern languages is the level of bloat they add to remove errors that could be avoided by conscious security design and audits. The reality is that security is only seemingly a concern when things go wrong, so these checks only get done on the most essential software. I mean, come on,things like the printf() BMW bugare just showing embarrassingly poor practices that signal overall bad practice in the organisation, rather than a failure of the language itself.

author: Marco
author_rank: Super Contributor
timestamp: July 22, 2022, 03:28:00 pm
content: The whole concept of in line escape sequences is a C/Unix'ism and the cause of SQL's disastrous economic damage. The Null in a way is the grand daddy of escape sequences and on top for damage caused.Escape sequences are only acceptable for truly harmless markup and interactive use, for non interactive use all parameters should have length with color coding in IDE translating the parameter/length pair into something user friendly (that includes shell programming, which takes adverserial input almost as often as SQL with the same predictable results).

author: free_electron
author_rank: Super Contributor
timestamp: July 22, 2022, 05:01:50 pm
content: Quote from: niconiconi on July 22, 2022, 10:19:20 amall that ? pfff .. no thanksclick power button on commodore 64 (or any home computer or even an original ibm pc with no bootable disk in it so it falls to rom basic )print "piss off c!"piss off c!10 ? "piss off c!" : goto 10runpiss off c!piss off c!piss off c!piss off c!piss off c!piss off c!piss off c!at infintem ...

author: bsfeechannel
author_rank: Super Contributor
timestamp: July 22, 2022, 05:17:17 pm
content: Bashing C is like bashing the soldering iron just because today we have pick-and-place machines.

author: Picuino
author_rank: Super Contributor
timestamp: July 22, 2022, 05:27:33 pm
content: There are people who amuse themselves by contradicting others with theories that can be very absurd.The brain is like a fertile ground where all kinds of ideas can grow.I think that's good for humanity. That there are all kinds ofmemes(as Richard Dawkins means it) keeping in our heads makes us a less homogeneous and more varied society and, therefore, more resistant to environmental changes.The problem lies with those who end up believing that they "should not look up". Or any other conspiracy theory such as that the earth is flat.I repeat, I think that is good for society as a whole, but bad for the poor person who believes it.

author: bsfeechannel
author_rank: Super Contributor
timestamp: July 22, 2022, 05:57:32 pm
content: Quote from: niconiconi on July 22, 2022, 10:19:20 amI tried to replicate that in Linux, but the ed version I have demands the insertion of a single period (".") on a line to terminate the input mode. Did the ed of old dispense with the period?

author: PaulAm
author_rank: Frequent Contributor
timestamp: July 22, 2022, 06:13:17 pm
content: No, ed always used a single period to terminate input mode (how else are you going to tell the program to start taking commands again?). The poster missed it.

author: niconiconi
author_rank: Frequent Contributor
timestamp: July 22, 2022, 07:02:14 pm
content: Quote from: PaulAm on July 22, 2022, 06:13:17 pmI actually used an EOF (Control-D) to terminate the input, which unfortunately is invisible and didn't appear in the text log. It was a real simulation run.

author: Marco
author_rank: Super Contributor
timestamp: July 22, 2022, 07:16:07 pm
content: Quote from: bsfeechannel on July 22, 2022, 05:17:17 pmIT is like a world persistently manufacturing electronics by soldering irons when there's pick and place machines and reflow.

author: coppice
author_rank: Super Contributor
timestamp: July 22, 2022, 08:49:43 pm
content: Quote from: Picuino on July 22, 2022, 07:22:48 amYour timing is a bit off. Pascal was loved by academics in the early 70s, but had little presence elsewhere until the 1980s and TurboPascal. Several C compilers, notably Lattice C, appeared about the same time as TurboPascal, but were more expensive. TurboPascal's low price gained it a strong following. Cheap C compilers were a bit late.I've been writing C for 45 years.

author: Picuino
author_rank: Super Contributor
timestamp: July 22, 2022, 09:07:13 pm
content: I started programming with a serious language (not BASIC) with TurboPascal 6.0, which already included object-oriented programming in 1990. It also had a built-in assembler, debugger and helper, as well as an extensive library system that made programming text-mode user interfaces much easier.On the other hand, Microsoft Quick-C 2.5 had much less capabilities (from my point of view) and was not as well regarded then as TurboPascal.Quote from: coppice on July 22, 2022, 08:49:43 pmCongratulations, I have been programming in C for much less time.Edit: In my case, 25 years of C coding.

author: rsjsouza
author_rank: Super Contributor
timestamp: July 22, 2022, 09:11:44 pm
content: Man, reply #4 to start the BS finger wagging context...At any rate, happy 50th! I hope many more to come (C coder for 25+ years).Quote from: coppice on July 22, 2022, 08:49:43 pmIndeed. I remember how Borland's "Turbo" IDEs were exceptional development platforms - I started with Turbo Basic, having a quick stint on Turbo Pascal and landing on Turbo C. In my life all that came after I was actually building my PC programs in Tasm (Turbo Assembler).Quote from: coppice on July 22, 2022, 08:49:43 pm

author: SiliconWizard
author_rank: Super Contributor
timestamp: July 22, 2022, 09:16:17 pm
content: And then there was Delphi. And it's still being used. Definitely never died.

author: mclute0
author_rank: Regular Contributor
timestamp: July 22, 2022, 09:34:22 pm
content: I will have to dig out my original book, The C Programming language by Brian W. Kernighan & Dennis M. Ritchie and read it all again. True heroes the modern world. Salute!

author: BrianHG
author_rank: Super Contributor
timestamp: July 22, 2022, 09:46:26 pm
content: I tried C on my firs Amiga with a 68000 processor, 2.5mb ram and a super slow HD.No way, too long to compile. (1989ish)I tried again when I got my 25MHz 68030 Amiga 3000 with 10mb ram and a top performance 7200 RPM SCSI HD. (1993ish)Ok, now I was hooked as compiling time was actually good.Though a lot of code was copy & paste modified examples from existing source code with my algorithms in-between.I didn't delve deeper into a modern C compiler until I had access to a C compiler for Microchip MCUs and had to do a DSPIC project for my exercise bike controller. Then it was more fun as compile times were only around 2 seconds.

author: Tomorokoshi
author_rank: Super Contributor
timestamp: July 22, 2022, 09:59:44 pm
content: Quote from: BrianHG on July 22, 2022, 09:46:26 pmYes, Ihadhave Lattice C on the Amiga 3000.

author: SiliconWizard
author_rank: Super Contributor
timestamp: July 22, 2022, 10:12:11 pm
content: That's funny. I had a Mac Plus at some point with 2.5MB RAM and Think C, and it was perfectly usable.

author: DiTBho
author_rank: Super Contributor
timestamp: July 22, 2022, 10:54:22 pm
content: From my university experiences, I remember that gcc-v2.95 was decently usable on an HP 712 @ 100Mhz with 192 MBytes of ram and HPUX v10.20

author: DiTBho
author_rank: Super Contributor
timestamp: July 22, 2022, 11:07:30 pm
content: what good memories ... when C was "the other language", one step over from Basic, times when X11 didn't even start, rebuilding the kernel (2.0..2.2) took two days, and getting X11decently workingtook up to two months on a i486 with a bloody ET4000 ...And people felt lucky when they managed to successfully install gcc-v2.95, learn enough about C to hack and compileneditto run it on Xmotif

author: Sal Ammoniac
author_rank: Super Contributor
timestamp: July 22, 2022, 11:14:02 pm
content: My copy of the first edition ofThe C Programming Languageis signed by DMR.

author: SiliconWizard
author_rank: Super Contributor
timestamp: July 22, 2022, 11:14:19 pm
content: Quote from: DiTBho on July 22, 2022, 10:54:22 pmOh yeah, GCC was a dog.Think C was pretty fast considering the kind of platforms it ran on.

author: langwadt
author_rank: Super Contributor
timestamp: July 22, 2022, 11:25:46 pm
content: Quote from: mclute0 on July 22, 2022, 09:34:22 pmI have two, the one I bought at uni and the one my dad used at some point. I wonder if there is a way to tell when it was printed

author: Ed.Kloonk
author_rank: Super Contributor
timestamp: July 23, 2022, 03:32:14 am
content: Quote from: langwadt on July 22, 2022, 11:25:46 pmThe wiki saysQuotehttps://en.wikipedia.org/wiki/The_C_Programming_Language

author: Karel
author_rank: Super Contributor
timestamp: July 23, 2022, 06:22:10 am
content: Many times people are astonished when they see how fast my programs are.It seems that today a lot of people use more "modern" languages which seem to be very slow,specially in performance critical situations. Or they simply have no clue about how to write efficient software.Somebody once wrote:Unfortunately, after 30 years professional in software, I find the main problem is that "a bad programmer can writebad code in any language", to paraphrase the famous saying. And most programmers are pretty bad.Good programmers avoid unsafe practices anyway, so new and better languages don't provide the advantage that is hoped.

author: Ian.M
author_rank: Super Contributor
timestamp: July 23, 2022, 06:50:32 am
content: Back in 1984, I got my first copy of K&R as the manual forHisoft C for the ZX Spectrummostly consisted of its divergencies from K&R, so was useless without the book!In 1986 I got the Metacomco QL C development kit, which had a Lattice C based compiler (and a ROM 'dongle') and since then I don't think I've ever had a system I haven't been able to compile C code for, apart from some tinkerings with low end 8 bit MCUs in the days before Hi-Tech C. Heck, I've even got the Tiny C compiler installed on my Kindle!

author: VK3DRB
author_rank: Super Contributor
timestamp: July 23, 2022, 07:14:25 am
content: I like C. I am programming a micro-controller in C right now in fact. Been programming in C for just over 30 years.Before that, Pascal. Before that, BASIC, and a few odd-ball languages at various times... C++, C#, Assembly Language, APL, Fortran, Clipper (dBaseIII. Remember Clipper from Nantucket?). And even direct machine code which isn't really a language.Hmm BASIC... Beginners All-purpose Symbolic Instruction Code. It has nothing to do with beginners. It is useless for embedded or any serious programming. But I have a soft spot for it. The old line-numbered BASIC was my first language. I programmed in BASIC on the Cyber-72 mainframe at RMIT as an engineering student from 1977 and loved it. That machine was way ahead of its time. BASIC and FORTRAN were part of KRONOS, the O/S for the Cyber-72. First year, we used punched cards on the IBM 029 card punches (don't drop the deck!). Then we used upgraded to VDUs... a revolutionary improvement. If you don't know what a VDU is, you are clearly a newbie.I found the manual here, in case others are as nostalgic or have an interest...http://www.bitsavers.org/pdf/cdc/cyber/cyber_70/kronos/60407600B_KRONOS2.1ug_May74.pdf

author: BrianHG
author_rank: Super Contributor
timestamp: July 23, 2022, 07:47:47 am
content: Quote from: Tomorokoshi on July 22, 2022, 09:59:44 pmI currently have SAS/C version 6.3, still alive and kicking...I think I had Lattice on my A1000, however, I no longer have that computer.Hmmm, I just tried a compile and it took 15 seconds on my A3000.Hmmm, I just tried the same compile on a JIT WinUAE emulated A3000.Half a second to compile the same project.

author: Kjelt
author_rank: Super Contributor
timestamp: July 23, 2022, 07:59:50 am
content: Congratulations C you deserved it.End 90s when I was graduating I was only taught C++. Teachers stated C was "the past" and OO was the future.Then the next 24 years working for 6 companies as embedded SWdev, from devices with 16kB OTPROM and 2kB RAM upto now machines with over 500MB program data and a GB of RAM except for two couple of months projects, I never ever did anything but C.C all the way! And nowadays companies have problems finding good C developers, hiring persons from other continents where they still are taught C. Funny world.

author: nfmax
author_rank: Super Contributor
timestamp: July 23, 2022, 08:56:47 am
content: C is L!I started using EcoC on CP/M, before moving to Whitesmiths C cross compiler, running on Unix but targeting the Z80. I guess this would be about 1984 or soPeople should remember that C/Unix was the very first time a whole operating system had been developed in anything other than assembler. Don’t knock K&R for not getting everything absolutely perfect!

author: DiTBho
author_rank: Super Contributor
timestamp: July 23, 2022, 09:28:35 am
content: Quote from: SiliconWizard on July 22, 2022, 11:14:19 pmNextStep/Objective-C - vs - HPUX/GNU Gcc v2.95: the crazy thing is thatObjective-Cran twice as fast on the same hardware(1) with NextSTEP v3.3/HPPA1(1) HP712 workstation, cpu PA-7100LC@100 MHz with 1 KB on-chip L1 and 256 KB off-chip L1 cache, 192Mbyte of ram, 9GB narrow SCSI 10K rpm

author: DiTBho
author_rank: Super Contributor
timestamp: July 23, 2022, 09:35:39 am
content: I mean, the *compiler* used on NextSTEP computers was obtained from GNU CC, modified and extended as a compiler for the Objective C language by NeXT Computer, Inc. for use on NextSTEP computers.And they made it 2x-faster than Gcc on HPUX, that's impressing

author: jfiresto
author_rank: Frequent Contributor
timestamp: July 23, 2022, 09:43:17 am
content: I started in 1983 with DECUS C, which was written in and generated PDP-11 assembler. It was my introduction in how to trick a compiler to do your bidding, and not excite compiler bugs.Although C compilers have improved a lot over the years, I can think of many less pleasant things to do than study PDP-11 assembler.

author: Tomorokoshi
author_rank: Super Contributor
timestamp: July 23, 2022, 11:51:32 am
content: Quote from: BrianHG on July 23, 2022, 07:47:47 amThat's right! It was updated from Lattice to SAS!The machine is currently disassembled. The battery leaked, and I need to repair the damage.

author: langwadt
author_rank: Super Contributor
timestamp: July 23, 2022, 02:11:27 pm
content: Quote from: Ed.Kloonk on July 23, 2022, 03:32:14 amthat's the publishing date, they didn't print all of them at once

author: BrianHG
author_rank: Super Contributor
timestamp: July 23, 2022, 08:12:47 pm
content: Quote from: SiliconWizard on July 22, 2022, 10:12:11 pmWhat was the build time of a complete project with a full GUI libraries in the source code?

author: BrianHG
author_rank: Super Contributor
timestamp: July 23, 2022, 08:15:48 pm
content: Quote from: nfmax on July 23, 2022, 08:56:47 amI'm curious, do you have a date for this first release?

author: PaulAm
author_rank: Frequent Contributor
timestamp: July 23, 2022, 11:11:12 pm
content: QuoteWell, no. That would be Multics written in PL/1 out of MIT's Project MAC. Ritchie was part of that project and when Bell Labs pulled out, Ritchie and Thompson redid the work (on a much smaller scale). Unix, which ran on one processor was a pun on Multics which was a big multiprocessor system. Unix was originally spelled Unics and C was preceded by B.Multics became a commercial product and was sold by Honeywell on a 36bit architecture. Some very dedicated peopled ended up writing an emulator for that architecture and were able to recover boot images. You can now run Multics on a Rasberry PI; a $40 credit card has more MIPS than a multimillion dollar room full of Honeywell hardware. Runs faster too.

author: PlainName
author_rank: Super Contributor
timestamp: July 24, 2022, 01:16:09 am
content: I've never really minded a relatively long compile time (except when you get to something like the Linux kernel) - you expect something noticeable to happen when you hit the button. In fact, an apparently instant compile is really off-putting to me because I can't tell the difference between it working and nothing happening.I suppose I should say something like needing to compile every minute just shows a lack of confidence in one's code-writing ability, but I'd better not.

author: ebclr
author_rank: Super Contributor
timestamp: July 24, 2022, 06:30:12 am
content: I Program in C and many other languages, including several assemblers, but I really love pascal, in my point of view is much more readable than C, But unfortunately, C won the programming language war, and pascal is used by very few people most from Europe.

author: snarkysparky
author_rank: Frequent Contributor
timestamp: July 25, 2022, 06:56:24 pm
content: if C had never been invented to this date someone would invent it now. Look a dangerous but highly efficient language to do low level coding. It will out perform anything we have now.Just learn how to use it !!!

author: SiliconWizard
author_rank: Super Contributor
timestamp: July 25, 2022, 08:07:26 pm
content: Quote from: BrianHG on July 23, 2022, 08:12:47 pm- I don't remember fully and our expectations back then were certainly different from those we have now. But as I remember, it took like a few seconds per source file and a few additional seconds for linking.- I'm not sure what you mean by 'full GUI libraries' - back then we were not using bloated libraries all over, GUIs on the Mac were implemented using the Mac OS API most often (at least that's what we were doing) and wouldn't take all that much source code.- Full build times were mostly irrelevant during development (as they should be these days, although it's not uncommon to see people not setting up projects properly or making a mess of dependencies that will trigger a full build every time you change a single source file). Certainly separate compilation was of utmost importance back then, so we were making the most of it. A few changes in a couple source files would then only require a few seconds for rebuilding the full project.Again, I don't remember the details, so by "a few seconds", I can't tell for sure whether it was closer to 2 s or 30 s, but what I remember is that it was largely usable.I did use Turbo Pascal on Mac OS at the time before switching to C. (The first and only version of TP for Mac OS was actually pretty nice. It supported units and features that TP for DOS or CPM didn't support yet at the time.) TP was fast. When I switched to C (with again Think C), I didn't notice a huge slowdown in compile times. It was slower, but certainly not unbearably so. Just to get an idea.Think C was also supporting a subset of C++, and the C++ compiler was much slower though. But very few people used C++ with Think C that I know of - it was mostly used for learning purposes. I did some C++ with Think C to learn C++ basically, but anything serious was only done with pure C at the time.

author: Zero999
author_rank: Super Contributor
timestamp: July 25, 2022, 08:50:43 pm
content: Quote from: snarkysparky on July 25, 2022, 06:56:24 pmSomething else comparable would have been invented instead. It would have been superior in some respects and inferior in others.

author: Karel
author_rank: Super Contributor
timestamp: July 26, 2022, 07:38:16 am
content: I believe it's the companies that prefer more "modern" and "safer" languages, not the programmers.For most companies, it's cheaper to invest in more powerful hardware (to deal with the overhead) instead of investing in more powerful programmers.Hardware can easily be added and/or replaced, good employees not so much...

author: Marco
author_rank: Super Contributor
timestamp: July 26, 2022, 08:35:13 am
content: Quote from: Karel on July 26, 2022, 07:38:16 amIt's like LOTO, you need beancounters and annoying people with sticks up their ass to get it done right.Laziness, misplaced sense of urgency and illusion of control are very hard to overcome. To the point small companies can very rarely manage it with any level of consistency.

author: DiTBho
author_rank: Super Contributor
timestamp: July 26, 2022, 10:37:16 am
content: You can talk as long as you like about how beautifully fast and coherent the C is, there are a number of fakecelebrity Cameosthese day, especially on RADs and thosehipster rapiddevelopment toys.Too beautiful (or ugly?) actors likeMassimo Banziwant us to believe that we are the last heroes ever through infamous promotional sentences like "Arduino, the C power under your finger tips"They can talk as long as they like,Cowboys on the consolecan dare to challenge a piece of wild hardware like aMIPS4 R18200 prototype. Try to dare to challenge C to see how much power you can control under your finger tips when you try to ride a kicking bull in a rodeo.Sure, you cannot be wrong, real C is a wild bull which, sooner or later, will throw you on the ground, pouring some misery on you, bleeding and battered, but proud to be a real cowboy on the consoleWhy? well ...MIPS4is vaguely supported, butMIPS4 R18200is supported neither by Gcc nor by Clang/LLvm, there is no support from any C-compiler except experimental onesyou have two cores, each core has two thread, each thread has its pipeline and registersit doesn't issueOoOthings, but in theLoad/Store stagewrites go into aFIFO, while reads can bypass the circuittheCop0, Cop1, and some memory mapped peripheralsare sensitive to the order of operationssemaphoresandmutexare also sensitive, and you need them when the cores have to talk on the internalshared ramoh, and don't forget TLB and cache, which both bite hardhence, in order to assure the correct order, since the C compiler is experimental and lacks all the support, you manually have to put asm("sync,isync,eieio") (yes, pretty like PowerPC assembly) here and there as "defensive code", plus tons of other tricks... do you think the R18200 is too rare? Do you want an alternative kicking bull? Try with the PPC64/Cell (Playstation3)Still after 50 years, C forwild hardwaremanages ashaky laugh, it can't wait to throw you on the ground

author: Picuino
author_rank: Super Contributor
timestamp: July 26, 2022, 02:41:38 pm
content: One of the advantages of the existence of C is that many microprocessor designers have taken into account that C was the de facto standard language, for designing their cores.Perhaps the most notable exception is the 8-bit PIC cores, which seem to be designed so that no one, except Microchip, wants to make a decent C compiler for them.

author: tom66
author_rank: Super Contributor
timestamp: July 26, 2022, 02:44:33 pm
content: Quote from: Picuino on July 26, 2022, 02:41:38 pmYes, the PIC18 with its bizarre file-pointer registers that increment themselves when you read from them. It's a fun, and *horrid*, architecture.

author: Kjelt
author_rank: Super Contributor
timestamp: July 26, 2022, 03:24:30 pm
content: Quote from: Picuino on July 26, 2022, 02:41:38 pmInteresting statement, so you are saying that the opcodes of the microcontroller were designed for C ?I don't get that. Can you give an example of what you mean with this?Because simple example C does not have a carry (bit) with multiplications, however no microcontroller manufacturer would be so stupid to drop the carry bit in the registers

author: emece67
author_rank: Frequent Contributor
timestamp: July 26, 2022, 05:33:05 pm
content: .

author: Kjelt
author_rank: Super Contributor
timestamp: July 26, 2022, 05:39:16 pm
content: Quote from: emece67 on July 26, 2022, 05:33:05 pmThat is indeed a very Reduced Instruction SetBut I think they did not drop it because of the c-compiler?

author: Picuino
author_rank: Super Contributor
timestamp: July 26, 2022, 11:32:34 pm
content: Is very frequent read "C optimized" in microcontroller descriptions.

author: Kjelt
author_rank: Super Contributor
timestamp: July 27, 2022, 06:23:52 am
content: You mean like cache and branch prediction ?No just simple processor evolution IMO.Control flow eg conditional constructs/loops etc., are the logical basis of any software design even used in the earliest 1940s computers.