ThyLang is a interpreted and case sensitive programming language inspired by Shakespearean/old English. This language allows you to code in a way that feels poetic, ancient, and deep.
ThyLang is currently in beta and has not been thoroughly tested! You may encounter bugs, unexpected behavior, or incomplete features while using this language. This project was built primarily for fun and creativity rather than functionality. This documentation assumes you already have an understanding or programming concepts likle loops, data types, variables, etc. This is a documentation, not a programming tutorial. Please keep this in mind when experimenting with ThyLang!
- Getting Started
- Data Types
- Variables
- Operators
- Control Flow
- Functions
- Built-in Functions
- Lists
- Comments
- Error Messages
- Examples
- Contributing
To run ThyLang, execute Main.py and you'll see the following interactive prompt in your terminal:
Type your ThyLang code and press Enter to execute the code. You can type cease to exit the interpreter.
ThyLang supports several fundamental data types such as:
- Integers: 42, -17, 0
- Floats: 3.14, -2.5, 0.0
- Enclosed in double quotes: "Hello, fair maiden!"
- Supported escape characters:
- \n - newline
- \t - tab
- \\ - backslash
- Ordered collections: [1, 2, 3]
- Lists can contain mixed types: [42, "hello", 3.14]
- ThyLang also supports nested lists like: [[1, 2], [3, 4]]
- sooth - true (1)
- falsehood - false (0)
Use the hath keyword to assign values to variables:
Simply use the variable name:
- + - Addition
- - - Subtraction
- * - Multiplication
- / - Division
- // - Floor division
- ^ - Exponentiation
- == - Equal to
- != - Not equal to
- > - Greater than
- < - Less than
- >= - Greater than or equal to
- <= - Less than or equal to
- and - Logical AND
- or - Logical OR
- not - Logical NOT
- + - Positive (unary plus)
- - - Negative (unary minus)
The syntax for a if-else statement in ThyLang is as follows:
For else-if and else:
Keep in mind that as of now, ThyLang does not support multi line statements and is case sensitive (shouldst ≠ Shouldst).
The syntax for a while loop in ThyLang is as follows:
Your expressions can be separated by using commas ","
Example:
Example:
Note: For loops automatically handle ascending and descending ranges, for loops also support mutiple expression each separated by commas.
WARNING - As of now, functions can not accept more than one expression, but can accept more than one parameters separated by commas!
Example:
You can even assign functions to a variable, and that new variable will work the same way as your original function did:
Example:
Example:
ThyLang provides several built-in functions which are listed as follows:
- printeth(value) - Print a value to the terminal
- recieve_sentence() - Get string input from user
- recieve_number() - Get numeric input from user
These functions like any other in ThyLang return 1 if true and 0 if false
- beith_whole(value) - Check if value is a number
- beith_tongue(value) - Check if value is a string
- beith_listeth(value) - Check if value is a list
- includeth(list, value) - Append value to list
- banish(list, index) - Remove and return element at index
- length(value) - Get length of string or list
NOTE - As of now, ThyLang does not support list index accessing, so you can not do something like multiplying the 0th element (or any other element) of a list by any number. You can use the banish function to pop an index from a list which is 0 indexed.
Lists in ThyLang support arithmetic operations that apply to all elements of the list:
Use # to create comments. Everything after # on a line is ignored:
ThyLang provides error messages in classical English style, while these messages might be cryptic to understand for some users, please remember that this language is built more from a fun perspective rather than a functionality one. Some error messages are listed below:
- Undefined Variable: "Verily, no variable of 'name' is inscribed in these sacred scripts."
- Division by Zero: "Thou dared divide by naught."
- Invalid Operation: "Hark! Thou hast attempted an operation most grievous and forbidden!"
- Illegal Character: "Expected '=', but thy script delivereth none."
I appreciate anyone who takes the time to contribute to ThyLang! Whether you're fixing bugs, adding new features, improving documentation, or just experimenting with the language, your involvement means a lot.
If you encounter any bugs or have ideas for improvements, please feel free to:
Submit bug reports Create pull requests with fixes or enhancements Suggest new features or language constructs Improve the documentation Share your ThyLang projects!
Remember, ThyLang is a project built for fun and creative expression, so don't hesitate to get creative with your contributions. I hope you love the documentation as well as ThyLang!
.png)

