NatLang is a conversational programming language inspired by natural English. Programs begin with "Hi" and end with "Bye", making coding feel like a dialogue. It's designed for clarity, readability, and ease of learning, especially for beginners.
The goal of NatLang is to bridge the gap between human language and programming syntax, allowing users to write code in a way that feels natural and intuitive.
NatLang makes programming more accessible to:
- Non-programmers
- Students
- Anyone intimidated by traditional syntax
With its friendly structure and human-like keywords, NatLang encourages logical thinking while removing unnecessary complexity. This makes it an excellent tool for:
- Educational purposes
- Workshops
- Early exposure to computational thinking
- Navigate to the project source folder:
cd SER502-NatLang-Team8/src - Make the runner script executable (only needed once):
chmod +x runner.sh
- Run the script with your .txt program file (from data/):
./runner.sh ../data/ProgramFileName.txt
- Navigate to the project source folder:
cd SER502-NatLang-Team8/src - Run the script with your .txt program file (from data/):
./runner.sh ../data/ProgramFileName.txt
We use Python to tokenize the NatLang code, identifying:
- Keywords
- Identifiers
- Values
- Punctuation
This step converts the raw code into a stream of meaningful tokens that can be processed by the parser.
Using Definite Clause Grammar (DCG) in Prolog, we define the structure of valid NatLang syntax and generate the parse tree.
This helps enforce language rules and ensures the code follows the expected structure.
A Python interpreter processes the parse tree:
- Handles assignments
- Executes print statements
- Manages memory and variables
- Simulates execution of the program
Once the parse tree is built, a Prolog-based evaluator walks the tree, maintaining an environment (an associative map) that binds each identifier to its current value.
- Thrupthi Hosahalli Manjunatha
- Mrunal Kapure
- Ayush Desai
- Piyush Sharma