Jump to content

Euphoria (disambiguation): Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
Atlas_2091 (talk)
No edit summary
 
Atlas_2091 (talk)
mNo edit summary
Line 1: Line 1:


Euphoria is a PC [[programming language]] created with the following design goals:
Euphoria is a PC [[programming language]] created with the following design goals:


#<b>Simplicity</b> - To be easier to learn and use than [[BASIC]], with higher-level constructs. Uses flat-form 32-bit memory to avoid complicated memory management and arbitrary limits.
#<b>Simplicity</b> - To be easier to learn and use than [[BASIC]], with more-consistent high-level constructs. Uses flat-form 32-bit memory to avoid complicated memory management and size/addressing limits.


#<b>Power</b> - A full-power language with low-level capabilities for professional development, but much more structured and less terse than, for example, [[C]]
#<b>Power</b> - To provide low-level capabilities needed to access the OS and BIOS for professional development, but be more structured and less terse than a low-level language, making low-level programming less dangerous.


#<b>Safety</b> - Extensive debugging support and run-time error-handling; automatic subscript checking, type-checking, and memory handling.
#<b>Safety</b> - Extensive debugging support and run-time error-handling; automatic subscript checking, type-checking, and memory handling.


#<b>Flexibility</b> - Free-form user-defined type support, so that variables can be as loosely or strictly typed as desired. Object-oriented programming is easily accomplished by defining objects as types (subsets of the sequence, which is a general-purpose collection).
#<b>Flexibility</b> - User-defined type support, with variables as loosely or strictly typed as desired. Object-oriented programming can be accomplished by defining objects as types (subsets of the sequence, which is a general-purpose collection).


#<b>Ease of Development</b> - Interpreted, with automatic memory management and garbage collection.
#<b>Ease of Development</b> - Interpreted, with automatic memory management and garbage collection.


#<b>Speed</b> - Fastest [[interpreted language]]
#<b>Speed</b> - To be fast enough to rival [[compiled language]]s for usefulness, despite being an [[interpreted language]]



The name Euphoria is an acronym for 'End-User Programming with Hierarchical Objects for Robust Interpreted Applications'. It was originally released in July 1993 by Robert Craig ([http://www.rapideuphoria.com Rapid Deployment Software]) for the [[DOS]] operating system. Current versions support 32-bit DOS, [[Windows]], and [[Linux]]. There is also a translator to convert Euphoria code into [[C]] for compilation to native [[machine code]].



Euphoria is primarily used by hobbyists for utility and [[computer game]] programming, but has proven useful for fairly diverse purposes. The primary strength seems to be the ease of handling dynamic collections of data of various types, most useful when dealing with string processing and image processing, which can be quite difficult in many languages. It has been used in [[artificial intelligence]] experiments, the study of [[mathematics]], for teaching programming, and to implement fonts involving thousands of characters.



As a brief example, the following code

<pre>

global function replace( object old, object new, sequence group )

old = find( old, group )

if old then

group = group[1..old - 1] & new & group[old + 1..length( group )]

end if

return( group )

end function

</pre>

looks for an old item in a group of items. If found, it replaces it with a new item. The group is then returned.



Simplicity is apparent in that the code clearly delineates it's constructs with words. Instead of braces, semicolons, and question marks, you see phrases like 'if..then', 'end if', and 'end function'.




Flexibility is present; the items 'old' and 'new' could be strings, numbers, images, or whole collections of data themselves. A different function for each data type isn't needed, nor does the programmer have to check the data types. This function will work with any sequence of data of any type, and requires no external libraries.




The name Euphoria is an acronym for 'End User Programming with Hierarchical Objects for Robust Interpreted Applications'


Safety is present due to the fact that there are no pointers involved and subscripts are automatically checked. Thus the function cannot access memory out-of-bounds, and cannot go beyond the end of the sequence or before the beginning of it to corrupt the memory. There is no need to explicitly allocate or deallocate memory, and no chance of a leak.




Originally released in July 1993 by Robert Craig ([http://www.rapideuphoria.com Rapid Deployment Software]). Current versions support 32-bit DOS, Windows, and Linux. There is also a translator to convert Euphoria code into C for compilation to native [[machine code]].


The line <code>group = group[1..old - 1] & new & group[old + 1..length( group )]</code> shows some of the collection handling facilities. Collections of any type can be sliced ('slice' means to take a subset of the data in a collection) and concatenated in expressions, with no need for special functions.


----


External link: [http://www.rapideuphoria.com Euphoria website]
Euphoria is primarily used by hobbyists for utility and [[computer game]] programming, but has proven useful for fairly diverse purposes. The primary strength seems to be the ease of handling dynamic collections of data of various types, most useful when dealing with string processing and image processing. It has been used to implement other interpreted languages along with translators and compilers, in[[artificial intelligence]] experiments, in the study of mathematics, to teach programming, and implementing fonts involving thousands of [[characters]].


----
----

Revision as of 05:36, 23 April 2001

Euphoria is a PC programming language created with the following design goals:

  1. Simplicity - To be easier to learn and use than BASIC, with more-consistent high-level constructs. Uses flat-form 32-bit memory to avoid complicated memory management and size/addressing limits.
  1. Power - To provide low-level capabilities needed to access the OS and BIOS for professional development, but be more structured and less terse than a low-level language, making low-level programming less dangerous.
  1. Safety - Extensive debugging support and run-time error-handling; automatic subscript checking, type-checking, and memory handling.
  1. Flexibility - User-defined type support, with variables as loosely or strictly typed as desired. Object-oriented programming can be accomplished by defining objects as types (subsets of the sequence, which is a general-purpose collection).
  1. Ease of Development - Interpreted, with automatic memory management and garbage collection.
  1. Speed - To be fast enough to rival compiled languages for usefulness, despite being an interpreted language


The name Euphoria is an acronym for 'End-User Programming with Hierarchical Objects for Robust Interpreted Applications'. It was originally released in July 1993 by Robert Craig (Rapid Deployment Software) for the DOS operating system. Current versions support 32-bit DOS, Windows, and Linux. There is also a translator to convert Euphoria code into C for compilation to native machine code.


Euphoria is primarily used by hobbyists for utility and computer game programming, but has proven useful for fairly diverse purposes. The primary strength seems to be the ease of handling dynamic collections of data of various types, most useful when dealing with string processing and image processing, which can be quite difficult in many languages. It has been used in artificial intelligence experiments, the study of mathematics, for teaching programming, and to implement fonts involving thousands of characters.


As a brief example, the following code


global function replace( object old, object new, sequence group )

   old = find( old, group )

   if old then

      group = group[1..old - 1] & new & group[old + 1..length( group )]

   end if

   return( group )

end function

looks for an old item in a group of items. If found, it replaces it with a new item. The group is then returned.


Simplicity is apparent in that the code clearly delineates it's constructs with words. Instead of braces, semicolons, and question marks, you see phrases like 'if..then', 'end if', and 'end function'.


Flexibility is present; the items 'old' and 'new' could be strings, numbers, images, or whole collections of data themselves. A different function for each data type isn't needed, nor does the programmer have to check the data types. This function will work with any sequence of data of any type, and requires no external libraries.


Safety is present due to the fact that there are no pointers involved and subscripts are automatically checked. Thus the function cannot access memory out-of-bounds, and cannot go beyond the end of the sequence or before the beginning of it to corrupt the memory. There is no need to explicitly allocate or deallocate memory, and no chance of a leak.


The line group = group[1..old - 1] & new & group[old + 1..length( group )] shows some of the collection handling facilities. Collections of any type can be sliced ('slice' means to take a subset of the data in a collection) and concatenated in expressions, with no need for special functions.


External link: Euphoria website


/Talk