Skip to content

Eros is an expiremental programming language built using simple Python code. Featuring an easy syntax and unique features like type slicing, the language remains an expirement that grows in down time.

xozxro/Eros

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EROS EXPIREMENTAL PROGRAMMING LANGUAGE


UPDATE: The readme is a little rough on this one - updating it within the next 24 hrs. Stay tuned.

Eros is a simple syntax programming language built with relatively basic Python code,
allowing for more ease in modification and further expirementation by anyone.

The language currently uses a static file for ease in testing, but this will obviously be
changed to open any file executed through it. To run, simply put your code in test.es and run main.py.

main.py creates an intepreter space using interpreter.py, which goes through the code and uses
functions.py to carry out the users commands. The design is currently simple but will evolve soon
as much more user expandability is added.

Built by zxro (c) 2021
twitter.com/xozxro

BASIC SYNTAX

VARIABLES


#########################################
### STRINGS

# DYNAMIC - dynamic strings are string variables that can be modified and type sliced after being set

dynamic stringVar = this is a string 123 these are ints 456
print stringVar

# outputs 'this is a string 123 these are ints 456'

# STATIC - static strings are string variables that hold retained data from another variable
# they can be used just like dynamic variables in all other aspects

# they can be used to 'type slice' - extracting only a certain data type out of dynamic strings
# in the future this will be modifyable, making it easy for developers to define their own types in order
# to quickly handle and filter large amounts of data through a one line type slice.

static intVar = stringVar : int
print intVar

# outputs 123 456

#########################################
### ARRAYS

# arrays can be created via segmenting data by any specified token.
# place this token in between brackets when creating the array.
# leave blank to segregate by space or place your data in brackets.
# eg. new [] arr = [x,y,z]

int elem1 = 1
int elem2 = 2
dynamic elem3 = string
new [] arrVar = elem1 elem2 elem3
print arrVar

# outputs [1,2,'string']

# and these will have the same result...

new [,] arrVar = elem1,elem2,elem3
new [-] arrVar = elem1- elem2-elem3
new [] arrVar = [elem1, elem2,elem3]

# TYPE CONVERSION

static intVar = stringVar : int
new [] intVar;

#########################################
### NUMBERS

# INT

new int newInt = 3
print newInt

# outputs 3

# FLOAT

new float newFloat = 3.2
print newFloat

# outputs 3.2

# TYPE CONVERSION
# this will convert typeSliceVar into an integer variable within the programs data array.
# if typeSliceVar includes multiple numbers spaced apart, this will sum them up and return that value.

static typeSliceVar = example : int
int typeSliceVar;

#########################################
### BOOLEANS

new bool isBool = True

###

PRINT


### basic string and variable output

print this is a string

# outputs 'this is a string'

dynamic string = 'xyz'
print string

# outputs 'xyz'

### string connetation and type slicing

dynamic string = this is a string with some 8324 numbers and some 3.23 floats
dynamic stringB = and this is another!
print string ++ string : int ++ stringB

# outputs 'this is a string with some 8324 numbers and some 3.23 floats 8324 and this is another!'

About

Eros is an expiremental programming language built using simple Python code. Featuring an easy syntax and unique features like type slicing, the language remains an expirement that grows in down time.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published