This page is meant to be a collaborative page for altering the way that Euphoria is installed and is configured under Linux and FreeBSD to behave more like a normal application. This would also allow euphoria to be packaged (i.e., deb, rpm, etc) and possibly included in distros, or at least easily installed.

The environment variables (EUDIR and EUINC) would become obsolete (for now at least, they are still supported), Euphoria would read all settings from one or more configuration files instead. This would allow easier installation of libraries, since a script could more easily update a config file than update .bashrc or something similar. And, it wouldn't require the user to log out before changes would take effect. It would also enable Euphoria to run smoothly from USB drives or other portable devices, or as cgi. Additionally, it would make CGI programming easier, since, apparently, some hosts don't allow to mess with environment variables.

The euinc.conf would probably be a plain text file, with one path per line that specifies where to search for include files. Relative path and file names must be allowed in 'euinc.conf' (important when Euphoria runs from a portable device or as cgi). A relative path in a conf file is assumed to be relative to the location of the conf file.

If a line in a conf file starts with a double dash "--" (i.e., like a normal euphoria comment) then it will be treated as a comment.

The interpreters/translators would search for the configuration file firstly in their own directory (important if they are on a portable device and in some cgi configurations). If no configuration file is found there, then they'll look for it in some standard places. If the files (also assuming environment variables exist) cannot be found, processing will skip that particular step. The config files (by OS) could be (see below for more detail):

  • on *nix : /etc/euphoria/euinc.conf : /.euinc.conf
  • on Windows: %ALLUSERSPROFILE%\euphoria\euinc.conf : %APPDATA%\euphoria\euinc.conf
  • on DOS : ??? Probably just a local conf file, since there are no users

But there should be a way to get a different conf file, which leads into another idea regarding allowing interpreter specific command line switches before the file name:

  • $ exu -c ./myinc.conf myapp.exu
  • > exw -i c:\wxeu wxeuapp.exw

A nominal search order might be (and this would also define the order in which directories are searched):

  • command line switches (based on the order encountered on the command line)
    • -c command line switch
    • -i command line switch (a specific directory)
  • euinc.conf local to the interpreter (mainly for a portable/cgi config)
  • /.euinc.conf or %APPDATA%\euphoria\euinc.conf
  • /etc/euphoria/euinc.conf %ALLUSERSPROFILE%\euphoria\euinc.conf (the system-wide config)

The new include system implementation works like this (if the file is found, stop, otherwise go to the next step):

  1. The scanner encounters an include directive
  2. If absolute path, the file is opened, or an error occurs
  3. Attempt to open the file relative to the path of the file that included it
  4. Attempt to open the file relative to the main source file
  5. open based upon the command line switches and conf files (priority as above)
  6. open based upon EUINC environment
  7. open based upon EUDIR/include directory

The command_line() function would still work the same (so the interpreter would fiddle with the actual command line passed in). We should add an additional routine like interpreter_options() to access those switches. This can be important for debugging: Sometimes programmers might be confused, because their program does not do what they expected. The reason might be, that Euphoria does use a different configuration file (and so includes different source code) than they expected. So there should be a way to check, which configuration file is actually used by a given instance of Euphoria.

On *nix, the Euphoria files could be stored in the following places:

  • /usr/bin
    • exu
    • ecu
    • bindu
    • backendu (should we make this a more eu-like name: exub? bexu?)
    • Other .ex files? (ed.ex)
  • /usr/lib
    • ecu.lib
  • /usr/share/euphoria/
    • include files
    • libraries could be installed in directories here
    • demo/
    • maybe other .ex files currently in euphoria/bin in another directory here?
  • /usr/share/doc/euphoria
    • html documents
    • plain text documents
  • /usr/share/man/man1
    • man page for eu!
  • /usr/src/euphoria
    • the current euphoria/source directory
  • /etc/euphoria
    • euinc (replacement for environment variables)

Places in the Documentation that will need to be updated:

  • Refman 1.2 Installation
  • Refman 1.3 Running a Program
  • Refman 2.6.1 include
  • Need to add docs for option_switches() to library


Quick Links

User menu

Not signed in.

Misc Menu