[Info-vax] Viable versus ideal programming languages

Simon Clubley clubley at remove_me.eisner.decus.org-Earth.UFP
Wed Mar 23 14:35:55 EDT 2022


On 2022-03-22, Dan Cross <cross at spitfire.i.gajendra.net> wrote:
> In article <t1d53c$ges$1 at dont-email.me>,
> Simon Clubley  <clubley at remove_me.eisner.decus.org-Earth.UFP> wrote:
>
>>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++...
>
> That's not precisely true; you're using an ABI that the C
> compiler targets, but that's qualitatively different than using
> the C language.  For example, in Rust, I can define structures
> that use the layout of the system's native ABI, or functions
> that use the ABI's calling convention, etc.  In my work, that
> usually implies calling between Rust and primitives written in
> assembly, but not C.  In some sense, the connection with C is
> incidental, though admittedly many such ABIs were designed as a
> target for C primarily.
>

Does Rust have a C++ type name mangling problem when trying to call
a Rust library function from C ?

It seems that everyone falls back to C interface mode when trying
to export functions for use by another language. A quick look around
seems to show that Rust does the same.

It would be nice to have a richer interface standard that handles calling
between both OO and procedural languages natively but we are back once
again to C being viable if not ideal.

(And before anyone mentions the VMS common language environment, it
doesn't have support for OO languages.)

Simon.

-- 
Simon Clubley, clubley at remove_me.eisner.decus.org-Earth.UFP
Walking destinations on a map are further away than they appear.



More information about the Info-vax mailing list