[Info-vax] Viable versus ideal programming languages

Bill Gunshannon bill.gunshannon at gmail.com
Tue Mar 22 15:28:32 EDT 2022


On 3/22/22 14:38, Simon Clubley wrote:
> On 2022-03-21, Bill Gunshannon <bill.gunshannon at gmail.com> wrote:
>> On 3/21/22 14:46, Simon Clubley wrote:
>>>
>>> I would say that C is a _viable_ programming language in that case,
>>> but I would not say that it is an _ideal_ programming language.
>>>
>>> You may end up using something that is viable but is not your preferred
>>> language. This could be due to language availability across multiple
>>> environments, the ability of the language to be easily called from
>>> other languages, etc.
>>>
>>> This is especially important when you are writing library code for
>>> example. Consider that I can write a portable library in C, and I can
>>> then compile it unchanged on VMS, Linux/FreeBSD/Unix, Windows, embedded
>>> operating systems, bare metal ARM/MIPS/etc, and even 8/16-bit MCUs if
>>> the library is small enough.
>>>
>>> I can then easily call that C library from a wide range of languages
>>> running on those multiple operating systems and environments. The language
>>> also allows me to create code that runs both in kernel mode and user mode.
>>>
>>> Name one other programming language that allows me to do all that.
>>
>> What does any of that have to do with the language?  The specific
>> compiler maybe, but not necessarily the language.  I could see
>> not doing it in COBOL and probably LISP but otherwise, most languages
>> can do what you want.
>>
> 
> Fine. Where do I find the compilers in today's world that allow me
> to do all of the above in a language other than C ? :-)

Well, you missed the point of that entirely.
I specifically said it was the fault of the compiler and not the
fault of any language.  Just because no one makes a compiler to
do what you want to do isn't the fault of the languages. Make
your own compiler.

I do have to admit that I am baffled why no one made/makes an
Ada compiler to do this.  I thought that was one of the intents
of Ada.  But it looks like language snobbery is strong in Ada.
Probably why even the agency responsible for it refused to use
it when it finally came out.

> 
> BTW, you are not going to be writing kernel mode device drivers or
> kernel modules in Fortran (for example).

No, cause that's not the intended purpose of that language.  But
that really has nothing to do with writing libraries.

> 
> BTW #2, you can only easily call C++ code from a non-C++ program by
> providing a C interface in the C++ library so you are back to using
> C as an interface language even with C++...

Once again, languages don't define calling sequences, compilers do.

> 
> Would be nice if that was not the only viable option, but the problem
> is that C is a very viable language in all of these cases, even when
> it is not an ideal language, so no-one has developed a viable alternative
> over the decades.

But they could.  Just like they could develop a Safe C language and
make compilers for it.  That was done.  And was met with a resounding
silence and the company just went away.  All of these things could be
addressed but all we seem to get is the latest ego language du jour.

bill





More information about the Info-vax mailing list