CSH (Pronounced as Cash) is an Open-source stack-based programming language, written in C. This was a practice project. Its features include:
- A stack based memory, consisting of 1024 elements.
- Supports Integers (Strings, floats, and booleans will be added later.)
- Has 11 commands.
To get started, you can either:
- Compile the code.
- Download already compiled code.
Clone the github repository.
git clone https://github.com/Subedara/CSH.gitthen
cd CSH
cd codegcc csh.c -o csh.exe
csh.exegcc csh.c -o csh
cshClone the github repository.
git clone https://github.com/Subedara/CSH.gitthen
cd CSH
cd programcsh.execshAfter running the csh program, either on linux or windows, you will be greeted with this:
csh >
PUSH is used to push numbers into the stack.
Usage:
csh > push 10
PUSHING VALUE IN STACK.
POP is used to pop the last number from the stack.
Usage:
csh > pop
POPPING VALUE FROM STACK.
NOTE: Nothing will happen if the stack is empty.
ADD is used to add the last 2 numbers from the stack.
Usage:
csh > push 10
PUSHING VALUE IN STACK.
csh > push 9
PUSHING VALUE IN STACK.
csh > add
ADDING NUMBERS.
SUBTRACT is used to subtract the last 2 numbers from the stack.
Usage:
csh > push 10
PUSHING VALUE IN STACK.
csh > push 9
PUSHING VALUE IN STACK.
csh > subtract
SUBTRACTING NUMBER.
MULTIPLY is used to multiply the last 2 numbers from the stack.
Usage:
csh > push 10
PUSHING VALUE IN STACK.
csh > push 9
PUSHING VALUE IN STACK.
csh > multiply
MULTIPLYING NUMBER.
DIVIDE is used to divide the last 2 numbers from the stack.
Usage:
csh > push 10
PUSHING VALUE IN STACK.
csh > push 5
PUSHING VALUE IN STACK.
csh > divide
DIVIDING NUMBER.
MOD is used to take the mod of the last 2 numbers from the stack.
Usage:
csh > push 10
PUSHING VALUE IN STACK.
csh > push 4
PUSHING VALUE IN STACK.
csh > mod
MODDING NUMBER.
XOR is used to take the XOR of the last 2 numbers from the stack.
Usage:
csh > push 10
PUSHING VALUE IN STACK.
csh > push 9
PUSHING VALUE IN STACK.
csh > xor
XORING NUMBER.
AND is used to take the AND of the last 2 numbers from the stack.
Usage:
csh > push 10
PUSHING VALUE IN STACK.
csh > push 9
PUSHING VALUE IN STACK.
csh > and
ANDING NUMBER.
OR is used to take the OR of the last 2 numbers from the stack.
Usage:
csh > push 10
PUSHING VALUE IN STACK.
csh > push 9
PUSHING VALUE IN STACK.
csh > or
ORING NUMBER.
NOT is used to take the NOT of the last number from the stack.
Usage:
csh > push 10
PUSHING VALUE IN STACK.
csh > not
NOTING NUMBER.
SHOW is used to show the integer that is on the top of the stack.
Usage:
csh > push 10
PUSHING VALUE IN STACK.
csh > show
TOP OF STACK = 10
- The Language is still in its early phase, so expect bugs.
- The Language does not support floats, strings, and other types. They will be added soon.
- Input is case-sensitive in this language. Meaning you will have to write
push,add,show, notPUSH,ADD,SHOW.
Contributions are welcome! If you want to help improve this project, you can:
- Report Bugs: Open an issue, describing what bug you are facing, steps to reproduce it, and expected output.
- Feature Suggestions: Open an issue if you have and want to give an idea about any new command, memory, and other language features.
- Submit Code:
- Fork the repository.
- Create a new branch for your feature or fix:
git checkout -b feature-name
- Make your changes and commit with clear messages.
- Push to your fork and open a pull request.
This project is MIT Licensed. This is the LICENSE.
- Support for floats, chars, and bools.
- Implementation for loops and conditions.
- Add custom file format.
- Improve error handling.
This project was, initially, not supposed to be a stack-based programming language. It was supposed to be a bash type scripting language. It was also made when I was learning C programming language as a practice for making Terminal RPG.
If you want to get in contact, you can email me on abd2maqsood@gmail.com or you can use my github Subedara.