r/programming • • May 01 '18

C Is Not a Low-level Language - ACM Queue

https://queue.acm.org/detail.cfm?id=3212479
152 Upvotes

303 comments sorted by

View all comments

Show parent comments

-1

u/claytonkb May 01 '18

Is "re-write the C code-base in Erlang" what you mean by "how it's done"? Because that's more-or-less what the article boils down to.

5

u/ArkyBeagle May 01 '18

Erlang

The actor model is hardly specific to Erlang. You can write C that conforms to the actor model.

6

u/claytonkb May 01 '18

You can write C that conforms to the actor model.

There you have it.

I find - as with most things - that criticism of C is often founded on ignorance. "C does not support structured programming." Only if you redefine structured programming to mean something other than modular, interface-based design. Is it vintage? Well, yes, of course it is. I find that the people who complain about C's lack of this-or-that frequently lack the knowledge of what is possible with C. C is useful as an intermediate language for structured program generation (Lua, Chicken Scheme, et. al.) I don't know what the exact percentage is, but a huge portion of modern programming languages themselves depend upon C in one way or another. A quick Web search shows that an early Erlang VM (no longer in use) was written in C.

1

u/ArkyBeagle May 01 '18

I do write C that conforms to the actor model. Got in the habit in the late '80s when the pressure was on and with late-90s CASE tools that did that.

Know what? It works. The abstraction is better than whatever tool you use for it.

But it's a well-justified ignorance. It takes... what, 18 months of intensive practice to become a journeyman level C coder? 5 years to master it? That was a pittance in the 1980s but who's got time for that now?

It's not done in a built-in, forced-by-the-toolchain way but you can write pretty much any OO pattern in C.

But don't kid yourself - C is a "Dad language".

That's how I see it - the time horizons are much, much shorter now.

2

u/claytonkb May 01 '18

late-90s CASE tools

Out of curiosity, what tools do/did you use?

2

u/ArkyBeagle May 01 '18

ObjecTime and Rose RT.

3

u/eliot_and_charles May 02 '18

The article describes several techniques already in use by mainstream microarchitecture and compilers. You really should read it.

1

u/[deleted] May 02 '18

Lol what?!?