DutchScript is a fun programming language dedicated to an assignment from my study at Hogeschool Utrecht.
Explore the docs »
View Demo
·
Report Bug
·
Request Feature
- About The Project
- Getting Started
- Usage
- Roadmap
- Requirements
- Contributing
- License
- Contact
- Acknowledgments
This project is a practical part of the class Advanced Technical Programming at my study: Technical Informatics at the Hogeschool Utrecht. The main goal of the project is: to create an interpreter and compiler that is made with the functional programming paradigm. Both the interpreter and the compiler are made with Python.
- Clone the repo
git clone https://github.com/howtoprogrambirds/Dutchscript.git
To run the code, you would have to run the cli.py file. Here by running the cli.py file, you can pass the source file and the values of the arguments of your "Begin" function.
As an example, I have created double recursion functions (in the examples folder with other examples, if you want to make your own just add a new file to the example folder. For more information about the DutchScript language itself, explore the docs). See below:
Bekijk de evenheidstest 'een n':
als een n kleiner 0 :
als een n hetzelfde 0 :
Geef waarheid .
!
anders :
Geef leugen .
!
!
anders :
Geef de evenheidstest 'een n - 2 '.
!
!
Bekijk de onevenheidstest met 'een m':
als een m kleiner 1 :
als een m hetzelfde 1 :
Geef waarheid .
!
anders :
Geef leugen .
!
!
anders :
Geef de onevenheidstest 'een m - 2 '.
!
!
Bekijk het Begin'een n, een m':
de resultaatEen is Roep een evenheidstest 'een n'.
Zeg "resultaat 1 terug: ", de resultaatEen.
de resultaatTwee is Roep een onevenheidstest 'een m'.
Zeg "resultaat 2 terug: ", de resultaatTwee.
Geef de resultaatTwee.
!
To run this code, you would run this command in the terminal. For this example, argument values 2 and 3 are given (if there are more or less, you have to add the "--arguments" flag to it). You can, of course, change these values.
[your desktop path]/src/CommandLineInterface$ python3 cli.py --filename="double_recursive" --arguments=2 --arguments=3
Which will give this output:
resultaat 1 terug: waarheid
resultaat 2 terug: waarheid
waarheid
- Lexer
- Parser (can't parse classes)
- Interpreter (can't interpret classes)
See the open issues for a full list of proposed features (and known issues).
- Turing Complete
- It can do everything what a Turing Machine can do (Changing multiple variables (chaining multiple functions), being able to move from one place to another and running patterns using a while loop).
- Goto-statements [testfile][tests]
- Loops [testfile][tests]
- Classes with inheritance [abstract syntax tree], [lexer enums]
- Object printing
- Decorator [printFunctionExectution]
- Type annotation
- Use a higher order function 3 times:
- map: [runCLI]
- map: [interpretIdentifier]
- map: [interpretFunction]
- zip: [interpretFunction]
- One or more functies per file
- Function arguments pass through function call
- Recursive Function
- Function can call other functions
- Return value can be printed out
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Distributed under the MIT License. See LICENSE.txt for more information.
I used the rules of functional programming with this exercise, and I'm still learning!
So if you have any comments on my code. Please let me know!
Dylan van Eck - dylananne_v_eck@gmail.com
Project Link: https://github.com/howtoprogrambirds/Dutchscript
Machine-learning icons (logo) created by Smashicons - Flaticon
