Skip to content

WildSource/DimiCore

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 

Repository files navigation

DimiCore

Toy programming language for me to implement to learn how to write an interpreter. Syntax and features generated by chatgpt.

Features:

- Variables and data types (integers and strings)
- Arithmetic operations (addition, subtraction, multiplication, division)
- Control flow (if/else statements, loops)
- Input/output (printing to the console, reading user input)

Basic Syntax

Variables and Data Types


# Data types
int age = 30
string name = "John"
string address = "14_carroll_street"

Arithmetic Operations

# Addition
x = 5 + 3

# Subtraction
y = 10 - 2

# Multiplication
z = 2 * 4

# Division
w = 20 / 4

Control Flow

# If statement
if x > 3 {
  print("x is greater than 3")
} else {
  print("x is less than or equal to 3")
}

# While loop
i = 0
while i < 10 {
  print(i)
  i = i + 1
}

Input/Output

# Printing to the console
print("Hello, world!")

# Reading user input
name = read()
print("Hello, " + name + "!")

About

Toy programming language for me to implement to learn how to write an interpreter. Syntax and features generated by chatgpt.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages