1. extern

--
   Why is there no extern directive in the translator/compiler
   How can Euphoria be linked to any other "C" object.

   Sure you can use shared or DLL librarys but what if you want
   to link with other static object files.

   This means that you have to ship a shared or DLL librarys
   instead of a single executable.

   Is speed the only advantage of using the translator ?

   Bernie

new topic     » topic index » view message » categorize

2. Re: extern

I will definately have to agree with you there Bernie. "extern" support for the
translator would make it *alot* more useful. It would allow a programmer to
distribute just one executable instead of ".dll" or ".so" files just as you
mentioned. what a great convienece that would be!

i dont do much C/C++ work that uses "extern"'s but i do see how this would be
very useful to many people. Please takes bernies suggestions into account
Robert.

--
evil, corruption and bad taste
  ^cense

new topic     » goto parent     » topic index » view message » categorize

3. Re: extern

It's a new product and like all new products im sure it will go through
phases that make it more and more useful.

--Al

new topic     » goto parent     » topic index » view message » categorize

4. Re: extern

On Sun, 17 Sep 2000 01:11:53 -0400, Al Getz <xaxo at AOL.COM> wrote:

>It's a new product and like all new products im sure it will go through
>phases that make it more and more useful.
>
>--Al

  Al:

  My point is that just like the interpeter the core langauge
  contains no easy way to interface to other langauge except
  through a DLL in Windows, shared library in Linux, and no
  way in DOS.
  The interpeter has been around for 4 years and this has not
  changed.

  Now that the translator is available it has no way to define
  and call a "C" function that is NOT contain in a DLL or SO.
  Are you prepared to wait for another 4 years to see if it
  might be added.

  Bernie

new topic     » goto parent     » topic index » view message » categorize

5. Re: extern

Bernie Ryan writes:

> Why is there no extern directive in the translator/compiler
> How can Euphoria be linked to any other "C" object...
> ...Now that the translator is available it has no way to define
>  and call a "C" function that is NOT contain in a DLL or SO.
>  Are you prepared to wait for another 4 years to see if it
>  might be added.

The current translator converts your Euphoria code into
C code. You can do *anything* you like with that C code,
including adding extern declarations and calling C functions
in dynamic *or static* libraries.

With the current (alpha-release) translator I would recommend
the following:
       1. make a .e file, bernie.e, that contains dummy (empty)
            Euphoria procedures and functions.
       2. translate your program to C
       3. make your own copy of bernie.c that has extern declarations
           and inserts calls to C functions from the
           dummy Euphoria routines (now dummy C routines)
       4. Run emake.bat to build your .exe. You can add
           additional static or dynamic libraries to the link.

After each translation you will have to overwrite bernie.c
with your modified version. Maybe you can make a .bat
for this, or make your own modified emake.bat that ignores
bernie.c, and uses your modified bernie2.c.

Mechanisms for a smoother interface to C code
will be added to the translator as it matures, and we learn
more about what people want to do with the translator.

Regards,
   Rob Craig
   Rapid Deployment Software
   http://www.RapidEuphoria.com

new topic     » goto parent     » topic index » view message » categorize

6. Re: extern

--
  Thanks Rob:

  I will try your suggestion.

  Bernie

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu