help-marst
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Marst Algol 60 compiler


From: Andrew Makhorin
Subject: Re: Marst Algol 60 compiler
Date: Wed, 20 Jan 2016 20:37:49 +0300

Hi Steve,

> First thing: Thank you for providing this compiler.

Thanks for your interest in GNU Marst.

> 
> I have downloaded and successfully installed marst on my Fedora 17
> Linux, 32 bit i686 computer.
> 
> I have written programs and sucessfully created and used a library of
> Algol 60 procedures using the 'code' keyword to call them.
> 
> However I am having a problem in trying to use my own library of
> procedures written in C. I have given my C procedures the same names
> as those of  the Algol 60 calling program and, from the description in
> the Marst manual, assumed that they would join at the compile stage -
> again using 'code'. I get an error message telling me that the names
> are different with a _0 appended to the desired procedure name.

The Marst translator provides no feature to directly call subprograms
written in a programming language other than Algol 60. This is mainly
because Algol 60 uses so called "call-by-name" parameter passing
mechanism, which is missing in all modern programming languages.

However, you can call external C functions via wrapper procedures
written in Algol 60 in the same way as Marst implements some standard
procedures. See, for example, implementations of sqrt, sin, cos, etc.,
as well as inchar and outchar, in marst-2.7/alglib1.alg; these
procedures call some external functions from the standard C library.

If you need more details, please contact me.


Best regards,

Andrew Makhorin

> 
> That is:
> 
> I create myprog.alg 
> 
> passed it to marst then tried compiling the resultant .c program with
> my library as
> 
> gcc myprog.c mylib.c ......
> 
> I also tried (having just compiled mylib)
> 
>  gcc myprog.c mylib.o  ......
> 
> In both case I get the same error message.
> 
> My question to you is this: Can such a link to my own C library be
> done? And if so how please.
> 
> Regards,
> 
> Steve
> 
> 





reply via email to

[Prev in Thread] Current Thread [Next in Thread]