Speed - To become convenient sufficiency to competitor compiled languages for usefulness, despite existence an interpreted language
A title "Euphoria" itself is an acronym for "End-User Programming with Hierarchical Objects for Robust Interpreted Applications", although there exists the few suspicion that this is in point of fact a backronym.
A number 1 globe-obvious incarnation of the language was for the 32-bit DOS platform and was freed within July of 1993. A original Atari version, up to now, has non been freed.
Todays versions trend lines 32-bit DOS, Windows, Linux, and FreeBSD. There exists likewise the translator to convert Euphory code into C for compilation to native machine code and what is known as a Binder, which binds a Euphory source code to the interpreter to produce an executable instead of machine compiling.
By having a release of version Deuce.Quint a Euphory interpreter was split into ii sections: a front-prevent parser & a back-prevent interpreter. A front-prevent is nowadays written within Euphory instead of C & wwhen freed as open source. A front-prevent is too utilized by owning a Euphoria-to-C translator & a Binder.
What is it used for
Euphory was primarily utilized by hobbyists for utility & computer game programming, but has proven utile for fairly diverse purposes. A primary nature & severity seems to exist as a ease of treating dynamic collections of information of various types, virtually all utile whilst treating by owning string processing and image processing, which may be quite hard inside several languages. It has been utilized within artificial intelligence experiments, the survey of mathematics, for teaching programming, and to implement fonts involving hundreds to thousands of characters. As well, Euphory has been proven to become utile as a language to wash CGI programing in.
Euphory source code may be "bound" to the Euphory rerun-instance code
to create the could have-alone program for distribution. A code can also
exist as "shrouded" to block others from either viewing, copying, or even ever-changing the
source.
We can too have a Euphory-to-One hundred translator to convert your computers Euphoria source code into C source code and then compile it into machine language. Applying this system, that you potty produce have-alone software online too when Windows DLL files.
Data types
Euphory has upright deuce basic information types:
;atom : Which are actually counts, implemented when either 31-bit integer or 64-bit IEEE floating-point, depending on the todays value. Euphory dynamically changes a implementation to the virtually all effective 1 for the information item's todays value.
;sequence : Vectors which can stand zero or even supplementary elements; for each one element is either an atom or even the sequence. a total of elements within a sequence is non fixed; the programmer might add or even dislodge elements equally called upon in the period of start-period. Euphory automatically handles a allocation & deallocation of RAM, and a automatic garbage collection for you. Single elements come referenced utilizing an stock value enclosed within square brackets. the number 1 element within a sequence has an stock of of these [1]. Elements in embedded sequences come referenced by extra bracked stock values, so X[3][2] refers to the 2nd element contained in the sequence that is the third element of X.
In addition, Euphory has deuce specialised information types:
;whole number : The favorite form of atom, restricted to 31-bit integer values in the range -1073741824 to 1073741823. Whole number information types come extra effective than a atom information types, however just can't contain a equivalent range of values. Characters come stored when whole number, eg disregard ASCII-'A' is exactly a equivalent when cryptography 65.
;object : The generic datatype that could contain any of the above, & may be changed when you took redo-period. This means that if you keep around an object known as X that is assigned a value Triad.172, so later wise shoppers might assign it a value "ABC". Note that in point of fact, apiece element of the sequence is actually an object.
No character string datthe type, when which are actually represented by a sequence of whole number values. But, because literal strings come thus usually utilized inside programming, Euphory interprets double-quote enclosed characters as a sequence of whole number. Thus
"ABC"
is seen when in case a computer programmer got written:
which is the equivalent when:
Hello World
puts(Single,"Hello World!\n")
Examples
Note: Code comments run by owning the double dash "--" & last through the prevent of line. No multi-line comments.
When brief examples, a resulting code
spherical work delete_item( object old, sequence class action )
whole number pos
-- Code begins --
pos = buy( old, class action )
in case pos > Cipher then
class action = class action[1..pos - 1] & group[pos + 1..length( group )]
prevent if
go to group
prevent function
looks for an old item within the class action of things. In case discovered, it removes it by concatenating all the elements before it by owning all the elements when it. A effect is so returned. Note that elements inside sequences come One-depending indexed. This means that a number one element has an stock of Unity.
Simplicity is apparent in this a code clearly delineates its constructs by owning words. Instead of braces, semicolons, & wonder marks, that you watch phrases prefer 'in case..so', 'prevent in case', & 'prevent work'.
Flexibility is present; a item 'old' can be strings, counts, images, or even wholly collections of information themselves. The different work for both information nature and severity international relations and security network't required, nor does a coder own to prevent a information types. This act may work by having any sequence of information of any nature & severity, and takes there are no external libraries.
spherical work replace_item( object old, object fresh, sequence class action )
whole number pos
-- Code begins --
pos = buy( old, class action )
whenever pos > Cypher then
class action[pos] = new
prevent if
go to group
prevent function
Safety is present due to the fact that no pointers required & inferior come automatically checked. So a work just can't access memory out-of-bounds, & just can't last beyond a prevent of a sequence or even prior to a beginning of it to corrupt the memory. there are no require to explicitly allocate or even deallocate memory, & no risk of the leak.
A line
class action = class action[1..pos - 1] & group[pos + 1..length( group )]
shows a bit of of the sequence treating facilities. The sequence potty containside the collection of any types, & this may be sliced (to take the subset of the information in a sequence) & concatenated inside expressions, by having there are no want for favorite functions.
Version Two.Quintuplet introduces a freshly '$' symbol, which is utilized for "length(sequence)." And then, a above lesson can be written around Ii.Little phoebe when follows:
class action = class action[1..pos - 1] & group[pos + 1..$]
Parameter passing
A second feature is that 100% arguments to routines come universally surpass value. No pass-by-information facility. This is implemented inside the super effective manner when sequences automatically stand copy-on-write semantics. Around more words, when you pass the sequence to a routine, at foremost exclusively a information to that passed however at the point that the routine first modifies a sequence parameter, the sequence is copied & the routine updates a copy of the original.
Comparisons
D programming language
Lua Programming Language
Python programming language