Kex is a dynamically typed, interpreted programming language designed for simplicity and ease of use. It supports basic arithmetic operations, variable assignments, and data structures like lists and dictionaries.
Kex supports the following data types:
- Text Type
- String (str)
- Numeric Type
- Integer (int)
- Float (float)
- Boolean Type (bool)
- Sequence Type
- List (list)
- Tuple (tuple)
- Mapping Type
- Dictionary (dict)
Variables in Kex are dynamically typed and can be assigned using the =
operator:
x = 5
name = "Alice"
Kex supports basic arithmetic operations:
- Addition:
+
- Subtraction:
-
- Multiplication:
*
- Division:
/
Example:
result = 10 + 5 * 2
Lists are created using square brackets:
numbers = [1, 2, 3, 4, 5]
Dictionaries are created using curly braces:
person = {"name": "Bob", "age": 30}
Kex supports both single-line and multi-line comments:
// This is a single-line comment
/*
This is a
multi-line comment
*/
- Expression Evaluation: Kex evaluates expressions and can handle nested arithmetic operations.
- Variable Scope: The language uses a simple symbol table for variable management, suggesting it has a global scope for variables.
- Error Handling: Basic error handling is implemented, including syntax errors and undefined variable errors.
- Interactive Mode: The language can be used in an interactive REPL (Read-Eval-Print Loop) mode.
Based on the current implementation, Kex has several limitations:
- No control structures (if/else, loops) are implemented.
- Functions are not supported.
- There's no module or import system.
To use Kex, run the interpreter and input expressions or statements at the prompt:
kex> x = 10
kex> y = 20
kex> x + y
30
-
Immediate (I):
- Feature Addition: Conditional Operators
-
Short Period (S):
- Feature Addition: Control Flow Statements
- Feature Addition: Add Documentation Capability (docstring)
-
Long Run (L):
- Feature Addition: File Handling
- Feature Addition: Exception Handling