Eve features
Eve is a front-end data processiong imperative programming language. Eve is multi-paradigm, statically typed, with type inference and gradual typing. Our intention is to create a verbose robust language for enterprise applications.
Names: {eve, Eve, EVE) are related. Eve is the language name, EVE is the virtual machine, *.eve is the source code extesion for script files. Initially Eve use to be called Level 123 but we have simplified the name. Level project was archived in 2007.
Targt Features:
# | Feature | Description |
1 |
readable |
use familiar keywords |
2 |
effective |
focus on domain specific jobs |
3 |
safe |
use static data type system |
4 |
modular |
has reusable scripts and modules |
5 |
versatile |
can connect to multiple databases |
Design: Eve has a classic design inspired from Ada, Ruby & Fortran. Therefore learning Eve is more easy if you know one of these languages. Eve is not a curly bracket language, and is much more different than C, C++, Java, Rust, Go, Swift, JavaScript.
Readable
Eve is designed to be learned by reading code examples. It has an explicit consistent and verbose syntax. We believe future users will learn a language much more easly, when the syntax looks right.
Eve has ...
- familiar English keywords, with no abbreviation;
- declarative statements based on noun keywords;
- sugestive keywords to finish a block statement;
- only ASCII operators and delimiters not Unicode symbols;
- more flat code by making indentation optional at 2 spaces;
- comprehensive data literals for constants and collections;
- uppercase and lowercase to separate data types from variables;
- sigil/prefix for some identifiers to reduce name collisions;
The result of these choices is demonstrate below with an example. You can observe different comment notations enable different colors. Syntax colorizer is able to identify the keywords and highlight every statement. This can not be achieved in a curly bracket language.
# Fibonacci series demonstrate
driver fibonacci:
** declare Fibonacci routine
function fib(n:Integer) => (y:Integer):
if (n == 1) or (n == 0) then
let y := 1; -- first value
else
let y := fib(n-1) + fib(n-2);
done;
return;
process
** local variable for result
new r: Integer;
** call fib rule using argument 5
let r := fib(5);
** print the result to console
print r;
return;
Effective
Eve is aiming to be effective and feasible. This means Eve is design to improve developer productivity and get the job done. Effective does not necessarily imply extreme efficiency or higher performance. Eve is design to be productive and easy to learn.
Eve ...
- is using gradual typing;
- is using type inference;
- is using separation of concerns;
- enables string templates and interpolation
- enables exclusive database connectivity;
- enables model first application design;
- enables generative (macro) programming;
Safe
Eve is designed to be a safe. For this we avoid using Null pointers. Eve is using boxed values that are actually references but we initialize all the basic types with zero values. Null is equivalent to zero value. We believe the next principles will help us design a better language:
- We favor safety over performance,
- It is better to be productive than efficient,
- Implicit values are better than wrong values,
- A good error message worth more than gold,
- If the system is not ready it should tell you,
- If a process fail it should report the errors,
- Sometimes if you try a second time it works!
Modular
Eve applications are usually small, based on single source file that do one job. However we enable usage of multiple files for separation of concerns in large project. There are 3 kind of modules defined for Eve, as follows:
Eve modular design
- One master script called "driver"
- Multiple secondary scripts called "aspects"
- Multiple reusable modules organized in lybraries.
Drivers and aspects are executable while modules are reusable but not executable. Aspects are launched from the driver and are individual process. Once an aspect is resolved it is removed from memory, unlike modules that are persistent until the driver ends.
Versatile
Eve is a domain specific language but it looks and feel like a general purpose language. We do not do graphics but we manipulate data in any form. This can be text data but also row bit data. So we can read and write images and video streams. Next design choices will make Eve a versatile language:
- Eve variables and parameters can be declared using: type hint, type inference and gradual typing. This improve readability and reduce clutter;
- Eve use implicit data types that are static but enable also variant type. The variant type can support a number of alternative data types that can be specified.
- Eve has processes that can support input/output parameters. A process can run in a separate thread. However a process can not be used in expressions.
- Eve has functions. Functions are usually defined in modules. A function can return one or more results. You can define the result name and type explicit.
- Eve has lambda expressions. These are similar to functions but restricted. A lambda expression can't have side effects and can return a single value.
- Variables and parameters are automatically initialized with zero value when there is no explicit initialization. Also, if a parameter has explicit initial value it becomes optional.
- In a subroutine, native type parameters are transferred by value. You can sent parameters by reference using "@" prefix.
- Eve has two assignment operators: "::" (colne) and ":=" (assign). Developers can control the asignment explicit.
Classic
Eve is using a familiar syntax. We try to avoid being disruptive. If you know Java or C++ you will be able to learn Eve in less then one week. Also if you know Ada or Pascal, or Ruby you will be confortable learning Eve.
- Eve is using classic control flow statements: {decision, selection, repetition, error handlers} that you already know from other languages.
- Eve is using ASCII operators, and keyword based operators but not Unicode. This enable fast code input required to write large business oriented scripts.
- Eve has user defined data types (classes). Eve is a hybrid language it has suport for object oriented programming OOP.
- Eve is familiar with SQL, HTML and JSON. To deal with many SQL dialects, Eve have specific drivers that enable direct interaction with major databases.
Read next:
Eve Syntax