Eon Computer Programming Language.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
xerox 527a4143b6
v0.9.5 release!
5 years ago
deon-unix v0.9.5 release! 5 years ago
deon-win v0.9.5 release! 5 years ago
examples added to example program 5 years ago
functions - debugged/fixed some issues. 5 years ago
hashmap V0.9.2 5 years ago
includes - debugged/fixed some issues. 5 years ago
linked_list - debugged/fixed some issues. 5 years ago
logic cleaned dirty code. 5 years ago
parser - debugged/fixed some issues. 5 years ago
print - debugged/fixed some issues. 5 years ago
vars - debugged/fixed some issues. 5 years ago
README.md v0.9.5 release! 5 years ago
deon.l Finished cleaning, found/documented issues. 5 years ago
deon.y - debugged/fixed some issues. 5 years ago
lex.yy.c - debugged/fixed some issues. 5 years ago
make.sh V0.9.2 5 years ago
y.tab.c - debugged/fixed some issues. 5 years ago
y.tab.h - debugged/fixed some issues. 5 years ago

README.md

Deon programming language V0.9.5

My computer programming language made with LEX/YACC written in C. (interpreted)

Downloads


Win-32: download Win-64: download Linux-32: download Linux-64: download

Hello World.


Hello world in Deon. ``` def main: { print["hello world"]; }; call main; ```

Variables


- Variables support "type juggling" where types are assumed at runtime. - Variables can be assigned to each other even if they are different types. ``` /* main function */ def main: { my_var = 121231; /* int */ print[my_var]; my_var = -123.122; /* double */ print[my_var]; my_var = "cool string"; /* null terminating string */ print[my_var]; my_var = 'c'; /* char */ print[my_var]; my_var = { print[ "hello world" ]; }; /* lambda function */ call my_var; }; call main; ``` # Expressions - As ov v0.9.5 expressions are only supported for int types, I need to recode the entire expression parsing system to support up to doubles. ``` def main: { var = 10 + (5 * 2 / (11 % 2)); /* should print 20 */ print[var]; }; call main; ```

Scope

  • As of v0.9.5 there is not scope inside of this programming language.
/* changes var from 10 to 100 */
def another_function:
{
	var = 100;
};

def main:
{
	var = 10;
	/* should print 10 */
	print[var];
	call another_function;
	/* should print 100 */
	print[var];
};
call main;

Logic


- while loops are if statements - As of version 0.9.5, logic conditions must only be variables.

If statements

As stated above, if statement conditions must be a variable.

def main:
{
	var = 1;
	if[var]: /* condition must be a variable */
	{
		print["var was 1"];
		var = 0;
	};
	if[var]:
	{
		print["this wont print! (or shouldnt)"];
	};
};
call main;

While loop

def main:
{
	var = 1;
	/* loop that runs forever */
	while[var]:
	{
		print["this will run forever"];
		print["it also wont stack overflow, so dont worry"];
	};
};
call main;

Functions

  • Functions can be defined as variables (lambda) or defined normally.
def my_function: 
{
    some_function = {
      print["hello world"];
    };
	call some_function;
};
call my_function;

Redefinitions

  • As of v0.9.5 everything in this programming language can be redefined. That means everything, including the function that is currently being executed.
def main:
{
	main = {
		print["i just redefined main"];
	};
};
call main;
call main;