home *** CD-ROM | disk | FTP | other *** search
/ Media Share 9 / MEDIASHARE_09.ISO / progmisc / euphor10.zip / GOALS.DOC < prev    next >
Text File  |  1993-06-24  |  9KB  |  164 lines

  1.         The Euphoria Programming Language
  2.         ---------------------------------
  3.  Introduction
  4.  ------------
  5.  Euphoria is a new, general purpose, programming language. Euphoria is
  6.  currently available for IBM PC compatibles running MS-DOS. It will run
  7.  comfortably with 2Mb of memory on any 386/486/Pentium processor.
  8.  It is very portable and will soon be available on many platforms.
  9.  
  10.  Why A New Language?
  11.  -------------------
  12.  The project to develop Euphoria was started because it was felt that there
  13.  was no really good language for the average non-professional to use on
  14.  their PC. BASIC was outdated years ago. C has grown into ANSI C and into
  15.  C++. C is a good language for professional programmers to use in
  16.  developing large programs, where performance is critical. There is however
  17.  a long learning curve in mastering C or C++. A part-time programmer will have
  18.  difficulty in developing proficiency in these languages. Debugging can be
  19.  very frustrating and time-consuming. A programmer working for a
  20.  large company might be willing to spend all day on a bug. The cost of his
  21.  efforts can be recovered by selling many copies of the resulting program.
  22.  Programs developed by end users must be developed at minimal
  23.  cost or not at all. The time spent developing the program greatly overshadows
  24.  the time spent executing the program. Professional compiler packages come with
  25.  thousands of pages of documentation, and unfortunately a large number of these
  26.  pages must actually be read before you can accomplish anything. End users do 
  27.  not have time for this. Programming is not something that they wish to devote
  28.  their lives to.
  29.  
  30.  Goals
  31.  -----
  32.  The goal then was to develop a language for end users that was:
  33.     - simple
  34.     - easy to write
  35.     - easy to debug
  36.     - practical
  37.  
  38.  It seemed likely that an interpreter would be called for, since
  39.  interpreted languages tend to be simpler, more flexible, friendlier,
  40.  and provide better debugging facilities. However, interpreters have
  41.  acquired a reputation for being very slow, compared to compiled languages.
  42.  We wanted to change that. A good deal of research went into developing an
  43.  interpreter that would provide all the good things associated with
  44.  interpreters while executing programs at blinding speed.
  45.  
  46.  The result of this research was Euphoria.
  47.  
  48.  How did we Achieve these Goals?
  49.  -------------------------------
  50.  
  51.  Simplicity
  52.  ----------
  53.  The first goal of Euphoria was "keep it simple". This was achieved by
  54.  minimizing the number of different statements, and using only familiar
  55.  control-flow statements, such as "if", "while" etc. Most people can understand
  56.  the control-flow statements of Euphoria right away without reading the manual.
  57.  Euphoria eliminates the need for braces or begin..end brackets around series
  58.  of statements. We defined a consistent syntax using:
  59.     if ... end if,
  60.     while ... end while,
  61.     for ... end for
  62.     procedure ... end procedure
  63.     function ... end function
  64.     etc.
  65.  This lets you see more clearly which construct is being "ended". When only
  66.  braces are used, as in C, it is more difficult to match things up. The 
  67.  Euphoria editor highlights keywords in blue, making it even easier to see the
  68.  structure.
  69.  
  70.  We also eliminated those annoying, and unnecessary semicolons that are
  71.  pervasive in many other languages, and cause a large percentage of the
  72.  syntax errors. For comments we chose the clearly superior style of having
  73.  a marker ,"--", start each comment, and the end of line end it.
  74.  
  75.  For data structures, we adopted the "sequence" as a simple recursive
  76.  structure that takes the place of *all* of the complicated structures in other
  77.  languages. You can use sequences as arrays, 2-d arrays, n-d arrays, arrays of
  78.  structures, arrays of strings etc.
  79.  
  80.  Easy to Write
  81.  -------------
  82.  One of the tedious aspects of programming in conventional languages is
  83.  that you are constantly forced to specify how big things are allowed
  84.  to be. This happens at the level of choosing char vs short vs int vs long
  85.  for your integers, or double vs float for your floating-point data (or
  86.  even choosing between floating point and integer). It also happens at the
  87.  level of declaring maximum sizes for all of your arrays. When you pass arrays
  88.  to a subroutine you must also pass the size of the array. In Euphoria 
  89.  everything is dynamic. Sequences can easily grow or shrink from either end or
  90.  anywhere in between. You do not have to declare the size of scalar values 
  91.  (atoms). Say goodbye to malloc() and free() and all the bugs associated with 
  92.  using them. Programs requiring dynamic allocation/deallocation of storage 
  93.  become particularly easy to write and to understand.
  94.  
  95.  C programmers must always keep a picture in their minds of the exact layout of
  96.  bits and bytes in memory. Euphoria programmers think only of the values they 
  97.  are manipulating, and not the storage layout or bit-level representation of 
  98.  those values. In Euphoria, the value 17 is the value 17, period. In C it might
  99.  be (char)17 or (short)17 or (int)17 or (unsigned)17 or (float)17 or (double)17 
  100.  or even (char *)17 etc. What happens when you add (char)-17 to (int)17? All of
  101.  this complexity is unnecessary in an applications development language and
  102.  Euphoria completely eliminates it. Euphoria frees you to think at the higher 
  103.  level of pure *values*, rather than having to mess around at the level of bits, 
  104.  bytes and pointers. 
  105.  
  106.  MS-DOS programmers are well aware of the 640K memory limit. Euphoria
  107.  destroys this limit by using a 32-bit DOS-extender. Euphoria programs can
  108.  effortlessly and seamlessly use the full multi-megabyte memory of your machine.
  109.  
  110.  Euphoria programs are naturally generic. See include\sort.e for
  111.  an example of a single subroutine that sorts any type of data -- and does
  112.  it several times faster than the MS-DOS sort command.
  113.  
  114.  Easy to Debug
  115.  -------------
  116.  At all times, Euphoria checks that subscripts or slices of sequences are
  117.  in bounds, that variables have been initialized before being used, that
  118.  integers overflow nicely into floating point numbers, that more space is
  119.  provided for the call stack when necessary, that arguments to built-in
  120.  functions are legal values, that you don't return from a function without
  121.  specifying a return value, etc. etc.
  122.  
  123.  On top of this, you can precisely restrict the legal values for any variable,
  124.  and have this enforced at runtime.
  125.  
  126.  An integrated full-screen source level debugger and a profiler are included.
  127.  The debugger/tracer is much easier to use than debuggers for other languages,
  128.  as much of what it does is automatic. Variable names and values are updated
  129.  automatically on your screen. Even professional programmers will shy away 
  130.  from using a source debugger, because they haven't used it for a while and 
  131.  they have forgotten how to get started. Not so in Euphoria.
  132.  
  133.  
  134.  Practical
  135.  ---------
  136.  Using conventional technology, Euphoria could have been developed
  137.  to run at the speed of BASIC. In fact you'd expect it to run *slower* than
  138.  BASIC, since data types are not predetermined and fixed, it checks
  139.  for uninitialized variables, it has dynamic storage allocation, etc.
  140.  In fact, Euphoria programs run 10 to 15 times *faster* than equivalent
  141.  programs in Microsoft QBASIC (see demo\bench\readme.doc). This lets you 
  142.  write programs, such as the Euphoria full-screen color editor, the Mset 
  143.  plotter, the 3-D wire frame rotator etc. that would be totally impractical
  144.  in QBASIC. (see demo directory)
  145.  
  146.  Of course there's more to practicality than speed. Euphoria supplies you with
  147.  a set of built-in routines that let you do just about anything on your system
  148.  that you can do with languages costing 10 times as much. Don't be fooled by 
  149.  the 57 different library functions provided by WATCOM C for memory 
  150.  allocation/deallocation - *none* of those routines are at all necessary in 
  151.  Euphoria! You can also throw away the 67 different memory and string 
  152.  manipulation functions - in Euphoria strings are just sequences like 
  153.  anything else - you don't need special functions to manipulate them!
  154.  
  155.  Conclusion
  156.  ----------
  157.  Euphoria is a simple, elegant, complete, practical, easy to use, and 
  158.  surprisingly fast language for your PC that we know you will enjoy using.
  159.  
  160.  --> For more details on the language see miniman.doc.
  161.  --> C programmers who need more convincing see c.doc.
  162.  --> BASIC programmers who need more convincing see basic.doc.
  163.  
  164.