Trusted answers to developer questions
Trusted Answers to Developer Questions

Related Tags

euphoria
communitycreator

Getting started in the Euphoria programing language

NDUKWE CHIDERA K.

Introduction

There is a whole lot of programming languages out there today that programmers use for different purposes. Each of these languages has their strengths and weaknesses that makes them stand out.

The EUPHORIAEnd-User Programming with Hierarchical Objects for Robust Interpreted Applications programing language is an interpreted language that is similar to Perl and C. It makes extensive use of the command line and terminal. It was initially developed by Robert Craig in 1993 and maintained by Rapid Deployment Software. Euphoria was initially a proprietary language until 2003, when it was made open source. Platforms like Windows, Linux, OSX, FreeBSD, and more supports Euphoria language programs.

Some features of Euphoria

  • The syntax, data types, and subroutines that can be written in Euphoria are all simplified to enable the deployment of one application in the shortest time possible.

  • Programs written with Euphoria language run under Linux, FreeBSD, 64/32-bit Windows, and any DOS environment.

  • The Euphoria interpreter is faster than Python and Perl interpreters.

  • The complexities of the underlying hardware are hidden from the programs. Things like word length, bit level representation, and byte order are not the concern of a Euphoria program.

  • Euphoria programs can be translated to a C program that can be compiled using C compilers to get an executable that is a .exe file.

  • Euphoria supports automatic memory garbage removal and dynamic storage allocation.

  • Euphoria develops various applications such as Windows GUI programs, and Linux and Windows programs, CGI programs etc.

  • Euphoria has an integrated database system.

Limitations

  • The community and support around this language is very poor.
  • Due to its simplicity, provisions for core programming functionalities are not included, like network programming.

Supported platforms

You need Windows 95 or later, up to date Linux, FreeBSD, or Mac OS X versions to successfully install and run the Euphoria interpreter.

Installing Euphoria

To get started, you first have to install the interpreter. To do this head straight to this site, and download the installer for your platform.

Then, run the installer. If you are a Windows user, you should see the image below upon successful installation.

Click finish and you will be up and running!

With this installation comes:

  • For a windows platform, a Path for the interpreter is added to the systems environment variables.
  • You will discover n editor, database system, and other features while you write.

VS Code also has support for coding in Euphoria. Just check out the VS code extensions market place and search for Euphoria Extension, install it, and you can enjoy features like autocomplete, syntax highlighting, and more that it comes with.

Writing your first Euphoria program

Now, you are all set up to write your first code. Let’s write the tradition Hello World! code for starters of a language.

  • Create a new file in CS code and save it with an .e extension, e.g., our file can be hello.e, saved in the desktop directory.

  • Edit the file and write down the code below.

puts(1, "Hello, World!\n")

This code will print “Hello! World” to the screen. The puts() function is used to print to a screen, the first parameter (1) indicates what type of screen, and the next argument is the text to be displayed to the output. You’re now ready to save this and get ready to execute.

Executing the program

Open the command prompt for a windows system or terminal for other platforms.

Next, change the directory to where the Euphoria program file is saved. For our example, it will look like this:

/users/desktop/

Now type in the below command and hit enter:

/users/desktop/ eui main.ex

You should see Hello! World printed to the output.

The eui will call the Euphoria interpreter to execute the main.ex file.

There you have it! So far, we have been able to:

  • Setup our Euphoria environment.
  • Write our first program.
  • And run our program from the command prompt successfully.
puts(1, "Hello, World!\n")

RELATED TAGS

euphoria
communitycreator
RELATED COURSES

View all Courses

Keep Exploring