The Silk Programming Language
Welcome to the Silk programming language!
SilkLang is a programming language created for simple usage but packed with advanced features. This programming language is intended for educational use, as mastering this language would make the learners easier to enter the arena of computer programming. Also, the programming language is made in such a way that it can be Platform Independent. Silk is still in its early stages, so the language is still changing rapidly. Nonetheless, we’re trying our best to keep the guide and the documentation as up to date as possible.
Installation
If you haven't installed Silk, head over to the project's README for more information.
Quick tour of the language
The Silk interpreter has two modes:
The REPL mode: The famous Read Eval Print Loop mode. This Opens up an interactive session in which you can execute simple commands.
The Execution mode: You'll pass an
.slk
file to the interpreter, and it will be interpreted.
For simple programs, the REPL mode is enough. But if you want to use the language for complex tasks, you need to use the interpreter.
The REPL mode
To start the REPL, run
You'll be greeted with the following message
You can execute various commands within this mode:
By default, the result of expressions are not shown in the interpreter. Just exclude the semicolon to view the result
The Execution mode
For simple programs, the REPL is good enough. But if you want to write large programs, the execution mode is best. Most of the time, this mode is used
Let's assume that you need to get input from the user and greet him/her with a message. To implement it, you need to follow these steps:
Create a
greet.slk
file and add the following content:
Having saved the file, run the following command:
You'll see the following result
🥳 Yay! You just ran your first Silk program.
Last updated