diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml index 4f928f0..9cb54c7 100755 --- a/.github/ISSUE_TEMPLATE/bug-report.yml +++ b/.github/ISSUE_TEMPLATE/bug-report.yml @@ -66,9 +66,9 @@ body: - type: input id: version attributes: - label: Nuru version + label: vint version description: | - Please make sure to use the latest version of Nuru before reporting any issues as it may have already been fixed. + Please make sure to use the latest version of vint before reporting any issues as it may have already been fixed. validations: required: true diff --git a/.gitignore b/.gitignore index a813444..b69b550 100755 --- a/.gitignore +++ b/.gitignore @@ -54,8 +54,8 @@ tutorials/en/* config.json *local* -# For Nuru executables +# For vint executables +/vint /vint -/Nuru dist/ diff --git a/ascii.txt b/ascii.txt new file mode 100644 index 0000000..23b4481 --- /dev/null +++ b/ascii.txt @@ -0,0 +1,16 @@ +██╗ ██╗██╗███╗ ██╗████████╗██████╗ ██╗ ██╗██╗ ███████╗ +██║ ██║██║████╗ ██║╚══██╔══╝██╔══██╗██║ ██║██║ ██╔════╝ +██║ ██║██║██╔██╗ ██║ ██║ ██████╔╝██║ ██║██║ █████╗ +╚██╗ ██╔╝██║██║╚██╗██║ ██║ ██╔══██╗██║ ██║██║ ██╔══╝ + ╚████╔╝ ██║██║ ╚████║ ██║ ██████╔╝██████╗ ██║██████╗ ███████╗ + ╚═══╝ ╚═╝╚═╝ ╚═══╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝╚═════╝ ╚══════╝ + + + + +██╗ █████╗ ███╗ ██╗ +██║ ██╔══██╗████╗ ██║ +██║ ███████║██╔██╗ ██║ +██║ ██╔══██║██║╚██╗██║ +██████╗ ██║ ██║██║ ╚████║ +╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═══╝ diff --git a/evaluator/package.go b/evaluator/package.go index 63551cf..7e48301 100755 --- a/evaluator/package.go +++ b/evaluator/package.go @@ -6,13 +6,13 @@ import ( ) func evalPackage(node *ast.Package, env *object.Environment) object.Object { - pakeji := &object.Package{ + Package := &object.Package{ Name: node.Name, Env: env, Scope: object.NewEnclosedEnvironment(env), } - Eval(node.Block, pakeji.Scope) - env.Set(node.Name.Value, pakeji) - return pakeji + Eval(node.Block, Package.Scope) + env.Set(node.Name.Value, Package) + return Package } diff --git a/examples/example.nr b/examples/example.nr index 68c6e09..b2441f8 100755 --- a/examples/example.nr +++ b/examples/example.nr @@ -1,7 +1,7 @@ // basics -jina = "Nuru" -andika(jina) // Nuru +jina = "vint" +andika(jina) // vint // lists @@ -101,7 +101,7 @@ salamu = unda() { salamu() aina(2) // Output: "NAMBA" -aina("Nuru") // Output: "NENO" +aina("vint") // Output: "NENO" orodha = {"jina": "Juma", "umri": 25} @@ -323,7 +323,7 @@ andika(a == "mambo") // sikweli a = "mambo" a.idadi() // 5 -a = "NURU" +a = "vint" a.herufindogo() // vint a = "vint mambo habari" diff --git a/examples/sudoku_solver.nr b/examples/sudoku_solver.nr index de5d3a6..7072c32 100755 --- a/examples/sudoku_solver.nr +++ b/examples/sudoku_solver.nr @@ -4,7 +4,7 @@ https://github.com/VictorKariuki -NURU program to solve Sudoku using Backtracking Algorithm +vint program to solve Sudoku using Backtracking Algorithm The sudoku puzzle is represented as a 2D array. The empty cells are represented by 0. The algorithm works by trying diff --git a/extensions/README.md b/extensions/README.md index 5e68382..b08d17d 100755 --- a/extensions/README.md +++ b/extensions/README.md @@ -1,8 +1,8 @@ -# Nuru Extensions For Various Editors +# vint Extensions For Various Editors ## [VSCODE](./vscode/) -Nuru syntax highlighting on VSCode +vint syntax highlighting on VSCode ## [VIM](./vim) diff --git a/extensions/vim/syntax/nuru.vim b/extensions/vim/syntax/nuru.vim index b363322..70963bb 100755 --- a/extensions/vim/syntax/nuru.vim +++ b/extensions/vim/syntax/nuru.vim @@ -1,5 +1,5 @@ " Sintaksia ya vint kwenye programu ya "vim" -" Lugha: Nuru +" Lugha: vint " Maneno tengwa syntax keyword vintKeyword unda pakeji rudisha vunja endelea tupu diff --git a/extensions/vscode/README.md b/extensions/vscode/README.md index 2c44aa2..960b6d4 100755 --- a/extensions/vscode/README.md +++ b/extensions/vscode/README.md @@ -1,13 +1,13 @@ -# Nuru VSCode Extension +# vint VSCode Extension -This is a syntax highliting extension for Nuru on vscode. It detects `.nr` and `.sw` files. +This is a syntax highliting extension for vint on vscode. It detects `.nr` and `.sw` files. ## How To Install ### Download From Market Place -- Simply download the Nuru Extension from VSCode Market Place +- Simply download the vint Extension from VSCode Market Place ### Windows diff --git a/main.go b/main.go index 1056067..a39aec0 100755 --- a/main.go +++ b/main.go @@ -1,5 +1,6 @@ package main + import ( "fmt" "os" @@ -11,63 +12,68 @@ import ( ) var ( - Title = styles.TitleStyle. - Render(` -█░░ █░█ █▀▀ █░█ ▄▀█ █▄█ ▄▀█ █▄░█ █░█ █▀█ █░█ -█▄▄ █▄█ █▄█ █▀█ █▀█ ░█░ █▀█ █░▀█ █▄█ █▀▄ █▄█`) - Version = styles.VersionStyle.Render("v0.1.0") - Author = styles.AuthorStyle.Render("by ekilie") - NewLogo = lipgloss.JoinVertical(lipgloss.Center, Title, lipgloss.JoinHorizontal(lipgloss.Center, Author, " | ", Version)) - Help = styles.HelpStyle.Italic(false).Render(fmt.Sprintf(`💡 Namna ya kutumia vint: - %s: Kuanza programu ya vint - %s: Kuendesha faili la vint - %s: Kusoma nyaraka za vint - %s: Kufahamu toleo la vint + Title = styles.TitleStyle. + Render(` +██╗ ██╗██╗███╗ ██╗████████╗ +██║ ██║██║████╗ ██║╚══██╔══╝ +██║ ██║██║██╔██╗ ██║ ██║ +╚██╗ ██╔╝██║██║╚██╗██║ ██║ + ╚████╔╝ ██║██║ ╚████║ ██║ + ╚═══╝ ╚═╝╚═╝ ╚═══╝ ╚═╝ +`) + Version = styles.VersionStyle.Render("v0.1.0") + Author = styles.AuthorStyle.Render("by ekilie") + NewLogo = lipgloss.JoinVertical(lipgloss.Center, Title, lipgloss.JoinHorizontal(lipgloss.Center, Author, " | ", Version)) + Help = styles.HelpStyle.Italic(false).Render(fmt.Sprintf(`💡 How to use vint: + %s: Start the vint program + %s: Run a vint file + %s: Read vint documentation + %s: Know vint version `, - styles.HelpStyle.Bold(true).Render("vint"), - styles.HelpStyle.Bold(true).Render("vint jinaLaFile.vint"), - styles.HelpStyle.Bold(true).Render("vint --nyaraka"), - styles.HelpStyle.Bold(true).Render("vint --toleo"))) + styles.HelpStyle.Bold(true).Render("vint"), + styles.HelpStyle.Bold(true).Render("vint filename.vint"), + styles.HelpStyle.Bold(true).Render("vint --docs"), + styles.HelpStyle.Bold(true).Render("vint --version"))) ) func main() { - args := os.Args - if len(args) < 2 { + args := os.Args + if len(args) < 2 { - help := styles.HelpStyle.Render("💡 Tumia exit() au toka() kuondoka") - fmt.Println(lipgloss.JoinVertical(lipgloss.Left, NewLogo, "\n", help)) - repl.Start() - return - } + help := styles.HelpStyle.Render("💡 Use exit() or quit() to exit") + fmt.Println(lipgloss.JoinVertical(lipgloss.Left, NewLogo, "\n", help)) + repl.Start() + return + } - if len(args) == 2 { - switch args[1] { - case "msaada", "-msaada", "--msaada", "help", "-help", "--help", "-h": - fmt.Println(Help) - case "version", "-version", "--version", "-v", "v", "--toleo", "-toleo": - fmt.Println(NewLogo) - case "-docs", "--docs", "-nyaraka", "--nyaraka": - repl.Docs() - default: - file := args[1] + if len(args) == 2 { + switch args[1] { + case "help", "-help", "--help", "-h": + fmt.Println(Help) + case "version", "-version", "--version", "-v", "v": + fmt.Println(NewLogo) + case "--docs", "-docs": + repl.Docs() + default: + file := args[1] - if strings.HasSuffix(file, ".vint") { - contents, err := os.ReadFile(file) - if err != nil { - fmt.Println(styles.ErrorStyle.Render("Error: vint Failed to read the file: ", args[1])) - os.Exit(1) - } + if strings.HasSuffix(file, ".vint") { + contents, err := os.ReadFile(file) + if err != nil { + fmt.Println(styles.ErrorStyle.Render("Error: vint Failed to read the file: ", args[1])) + os.Exit(1) + } - repl.Read(string(contents)) - } else { - fmt.Println(styles.ErrorStyle.Render("'"+file+"'", "is not a correct file type use '.vint' ")) - os.Exit(1) - } - } - } else { - fmt.Println(styles.ErrorStyle.Render("Error: Operation failed.")) - fmt.Println(Help) - os.Exit(1) - } + repl.Read(string(contents)) + } else { + fmt.Println(styles.ErrorStyle.Render("'"+file+"'", "is not a correct file type. Use '.vint'")) + os.Exit(1) + } + } + } else { + fmt.Println(styles.ErrorStyle.Render("Error: Operation failed.")) + fmt.Println(Help) + os.Exit(1) + } } diff --git a/repl/docs.go b/repl/docs.go index 9885644..a4a5d44 100755 --- a/repl/docs.go +++ b/repl/docs.go @@ -213,7 +213,7 @@ func (pg playground) Update(msg tea.Msg) (tea.Model, tea.Cmd) { // editor code pg.editor = textarea.New() if pg.language == "en" { - pg.editor.Placeholder = "Write Nuru code here..." + pg.editor.Placeholder = "Write vint code here..." } else { pg.editor.Placeholder = "Andika code yako hapa..." } diff --git a/repl/docs/en/README.md b/repl/docs/en/README.md index c3a430c..23ec195 100755 --- a/repl/docs/en/README.md +++ b/repl/docs/en/README.md @@ -1,10 +1,10 @@ -# NURU PROGRAMMING LANGUAGE DOCUMENTATION +# vint PROGRAMMING LANGUAGE DOCUMENTATION This documentation is intended for people with some experience in programming. It describes the syntax, types and how to perform various operations using the language. ## Table Of Contents -- [Arrays in Nuru](arrays.md#arrays-in-vint) +- [Arrays in vint](arrays.md#arrays-in-vint) - [Creating Arrays](arrays.md#creating-arrays) - [Accessing and Modifying Array Elements](arrays.md#accessing-and-modifying-array-elements) - [Concatenating Arrays](arrays.md#concatenating-arrays) @@ -14,18 +14,18 @@ This documentation is intended for people with some experience in programming. I - [idadi()](arrays.md#idadi()) - [sukuma()](arrays.md#sukuma()) - [yamwisho()](arrays.md#yamwisho()) -- [Built-in Functions in Nuru](builtins.md#built-in-functions-in-vint) +- [Built-in Functions in vint](builtins.md#built-in-functions-in-vint) - [The andika() Function](builtins.md#the-andika()-function) - [The jaza() Function](builtins.md#the-jaza()-function) - [The aina() Function](builtins.md#the-aina()-function) - [The fungua() Function](builtins.md#the-fungua()-function) -- [Comments in Nuru](comments.md#comments-in-vint) +- [Comments in vint](comments.md#comments-in-vint) - [Single-Line Comments](comments.md#single-line-comments) - [Multi-Line Comments](comments.md#multi-line-comments) -- [Conditional Statements in Nuru](ifStatements.md#conditional-statements-in-vint) +- [Conditional Statements in vint](ifStatements.md#conditional-statements-in-vint) - [If Statement (Kama)](ifStatements.md#if-statement-(kama)) - [Else If and Else Blocks (Au Kama and Sivyo)](ifStatements.md#else-if-and-else-blocks-(au-kama-and-sivyo)) -- [Dictionaries in Nuru](dictionaries.md#dictionaries-in-vint) +- [Dictionaries in vint](dictionaries.md#dictionaries-in-vint) - [Creating Dictionaries](dictionaries.md#creating-dictionaries) - [Accessing Elements](dictionaries.md#accessing-elements) - [Updating Elements](dictionaries.md#updating-elements) @@ -33,10 +33,10 @@ This documentation is intended for people with some experience in programming. I - [Concatenating Dictionaries](dictionaries.md#concatenating-dictionaries) - [Checking If a Key Exists in a Dictionary](dictionaries.md#checking-if-a-key-exists-in-a-dictionary) - [Looping Over a Dictionary](dictionaries.md#looping-over-a-dictionary) -- [Files in Nuru](files.md#files-in-vint) +- [Files in vint](files.md#files-in-vint) - [Opening a File](files.md#opening-a-file) - [Reading a File](files.md#reading-a-file) -- [For Loops in Nuru](for.md#for-loops-in-vint) +- [For Loops in vint](for.md#for-loops-in-vint) - [Basic Syntax](for.md#basic-syntax) - [Iterating Over Key-Value Pairs](for.md#iterating-over-key-value-pairs) - [Dictionaries](for.md#dictionaries) @@ -45,19 +45,19 @@ This documentation is intended for people with some experience in programming. I - [Break (Vunja) and Continue (Endelea)](for.md#break-(vunja)-and-continue-(endelea)) - [Break (Vunja)](for.md#break-(vunja)) - [Continue (Endelea)](for.md#continue-(endelea)) -- [Functions in Nuru](function.md#functions-in-vint) +- [Functions in vint](function.md#functions-in-vint) - [Basic Syntax](function.md#basic-syntax) - [Parameters](function.md#parameters) - [Default Parameters](function.md#default-parameters) - [Return (rudisha)](function.md#return-(rudisha)) - [Recursion](function.md#recursion) - [Closures](function.md#closures) -- [HTTP with Nuru](net.md#http-with-vint) +- [HTTP with vint](net.md#http-with-vint) - [Importing](net.md#importing) - [Methods](net.md#methods) - [peruzi()](net.md#peruzi()) - [tuma()](net.md#tuma()) -- [Identifiers in Nuru](identifiers.md#identifiers-in-vint) +- [Identifiers in vint](identifiers.md#identifiers-in-vint) - [Syntax Rules](identifiers.md#syntax-rules) - [Best Practices](identifiers.md#best-practices) - [INTEGERS (NAMBA) AND FLOATS (DESIMALI)](numbers.md#integers-(namba)-and-floats-(desimali)) @@ -65,7 +65,7 @@ This documentation is intended for people with some experience in programming. I - [UNARY INCREMENTS](numbers.md#unary-increments) - [SHORTHAND ASSIGNMENT](numbers.md#shorthand-assignment) - [NEGATIVE NUMBERS](numbers.md#negative-numbers) -- [JSON in Nuru](json.md#json-in-vint) +- [JSON in vint](json.md#json-in-vint) - [Import JSONI](json.md#import-jsoni) - [Decoding JSON with dikodi()](json.md#decoding-json-with-dikodi()) - [Encoding JSON with enkodi()](json.md#encoding-json-with-enkodi()) @@ -76,10 +76,10 @@ This documentation is intended for people with some experience in programming. I - [KEYWORDS](keywords.md#keywords) - [Reserved Keywords](keywords.md#reserved-keywords) - [BuiltIns](keywords.md#builtins) -- [Null (Tupu) in Nuru](null.md#null-(tupu)-in-vint) +- [Null (Tupu) in vint](null.md#null-(tupu)-in-vint) - [Definition](null.md#definition) - [Evaluation](null.md#evaluation) -- [NURU PROGRAMMING LANGUAGE DOCUMENTATION](README.md#vint-programming-language-documentation) +- [vint PROGRAMMING LANGUAGE DOCUMENTATION](README.md#vint-programming-language-documentation) - [Table Of Contents](README.md#table-of-contents) - [OPERATORS](operators.md#operators) - [ASSIGNMENT](operators.md#assignment) @@ -88,7 +88,7 @@ This documentation is intended for people with some experience in programming. I - [MEMBER OPERATOR](operators.md#member-operator) - [LOGIC OPERATORS](operators.md#logic-operators) - [PRECEDENCE OF OPERATORS](operators.md#precedence-of-operators) -- [Strings in Nuru](strings.md#strings-in-vint) +- [Strings in vint](strings.md#strings-in-vint) - [Basic Syntax](strings.md#basic-syntax) - [Concatenating Strings](strings.md#concatenating-strings) - [Looping over a String](strings.md#looping-over-a-string) @@ -98,11 +98,11 @@ This documentation is intended for people with some experience in programming. I - [herufikubwa()](strings.md#herufikubwa()) - [herufindogo](strings.md#herufindogo) - [gawa](strings.md#gawa) -- [Switch Statements in Nuru](switch.md#switch-statements-in-vint) +- [Switch Statements in vint](switch.md#switch-statements-in-vint) - [Basic Syntax](switch.md#basic-syntax) - [Multiple Values in a Case](switch.md#multiple-values-in-a-case) - [Default Case (kawaida)](switch.md#default-case-(kawaida)) -- [Time in Nuru](time.md#time-in-vint) +- [Time in vint](time.md#time-in-vint) - [Importing Time](time.md#importing-time) - [Time Methods](time.md#time-methods) - [hasahivi()](time.md#hasahivi()) @@ -114,7 +114,7 @@ This documentation is intended for people with some experience in programming. I - [Break (vunja) and Continue (endelea)](while.md#break-(vunja)-and-continue-(endelea)) - [Break (Vunja)](while.md#break-(vunja)) - [Continue (Endelea)](while.md#continue-(endelea)) -- [Working with Booleans in Nuru](bool.md#working-with-booleans-in-vint) +- [Working with Booleans in vint](bool.md#working-with-booleans-in-vint) - [Evaluating Boolean Expressions](bool.md#evaluating-boolean-expressions) - [Evaluating Simple Expressions](bool.md#evaluating-simple-expressions) - [Evaluating Complex Expressions](bool.md#evaluating-complex-expressions) diff --git a/repl/docs/en/arrays.md b/repl/docs/en/arrays.md index fffa9d9..24faef2 100755 --- a/repl/docs/en/arrays.md +++ b/repl/docs/en/arrays.md @@ -1,6 +1,6 @@ -# Arrays in Nuru +# Arrays in vint -Arrays in Nuru are versatile data structures that can hold multiple items, including different types such as numbers, strings, booleans, functions, and null values. This page covers various aspects of arrays, including how to create, manipulate, and iterate over them using Nuru's built-in keywords and methods. +Arrays in vint are versatile data structures that can hold multiple items, including different types such as numbers, strings, booleans, functions, and null values. This page covers various aspects of arrays, including how to create, manipulate, and iterate over them using vint's built-in keywords and methods. ## Creating Arrays @@ -11,7 +11,7 @@ orodha = [1, "pili", kweli] ``` ## Accessing and Modifying Array Elements -Arrays in Nuru are zero-indexed. To access an element, use the element's index in square brackets: +Arrays in vint are zero-indexed. To access an element, use the element's index in square brackets: ```s namba = [10, 20, 30] @@ -68,7 +68,7 @@ kwa idx, jina ktk majina { ## Array Methods -Arrays in Nuru have several built-in methods: +Arrays in vint have several built-in methods: ### idadi() @@ -130,4 +130,4 @@ b = a.chuja(unda(x){ andika(b) // [2, 4] ``` -With this information, you can now effectively work with arrays in Nuru, making it easy to manipulate collections of data in your programs. +With this information, you can now effectively work with arrays in vint, making it easy to manipulate collections of data in your programs. diff --git a/repl/docs/en/bool.md b/repl/docs/en/bool.md index 5df0764..08c7539 100755 --- a/repl/docs/en/bool.md +++ b/repl/docs/en/bool.md @@ -1,12 +1,12 @@ -# Working with Booleans in Nuru +# Working with Booleans in vint -Boolean objects in Nuru are truthy, meaning that any value is true, except tupu and sikweli. They are used to evaluate expressions that return true or false values. +Boolean objects in vint are truthy, meaning that any value is true, except tupu and sikweli. They are used to evaluate expressions that return true or false values. ## Evaluating Boolean Expressions ### Evaluating Simple Expressions -In Nuru, you can evaluate simple expressions that return a boolean value: +In vint, you can evaluate simple expressions that return a boolean value: ```s andika(1 > 2) // Output: `sikweli` @@ -16,7 +16,7 @@ andika(1 + 3 < 10) // Output: `kweli` ### Evaluating Complex Expressions -In Nuru, you can use boolean operators to evaluate complex expressions: +In vint, you can use boolean operators to evaluate complex expressions: ```s a = 5 @@ -37,7 +37,7 @@ Here, we create three variables a, b, and c. We then evaluate the expression (a ## Boolean Operators -Nuru has several boolean operators that you can use to evaluate expressions: +vint has several boolean operators that you can use to evaluate expressions: ### The && Operator @@ -71,7 +71,7 @@ andika(!sikweli) // Output: `kweli` ## Working with Boolean Values in Loops -In Nuru, you can use boolean expressions in loops to control their behavior. Here's an example: +In vint, you can use boolean expressions in loops to control their behavior. Here's an example: ```s namba = [1, 2, 3, 4, 5] @@ -94,4 +94,4 @@ kwa thamani ktk namba { Here, we create an array namba with the values 1 through 5. We then loop over each value in the array and use the % operator to determine if it is even or odd. The output will be "is even" for even numbers and "is odd" for odd numbers. -Boolean objects in Nuru can be used to evaluate expressions that return true or false values. You can use boolean operators to evaluate complex expressions and control the behavior of loops. Understanding how to work with boolean values is an essential skill for any Nuru programmer. \ No newline at end of file +Boolean objects in vint can be used to evaluate expressions that return true or false values. You can use boolean operators to evaluate complex expressions and control the behavior of loops. Understanding how to work with boolean values is an essential skill for any vint programmer. \ No newline at end of file diff --git a/repl/docs/en/builtins.md b/repl/docs/en/builtins.md index 5c075ca..2e6b5e0 100755 --- a/repl/docs/en/builtins.md +++ b/repl/docs/en/builtins.md @@ -1,6 +1,6 @@ -# Built-in Functions in Nuru +# Built-in Functions in vint -Nuru has several built-in functions that perform specific tasks. +vint has several built-in functions that perform specific tasks. ## The andika() Function @@ -31,7 +31,7 @@ The `aina()` function is used to determine the type of an object. It accepts one ```s aina(2) // Output: "NAMBA" -aina("Nuru") // Output: "NENO" +aina("vint") // Output: "NENO" ``` ## The fungua() Function diff --git a/repl/docs/en/comments.md b/repl/docs/en/comments.md index 8e69b6b..271ce68 100755 --- a/repl/docs/en/comments.md +++ b/repl/docs/en/comments.md @@ -1,20 +1,20 @@ -# Comments in Nuru +# Comments in vint -In Nuru, you can write comments to provide explanations and documentation for your code. Comments are lines of text that are ignored by the Nuru interpreter, so they will not affect the behavior of your program. There are two types of comments in Nuru: single-line comments and multi-line comments. +In vint, you can write comments to provide explanations and documentation for your code. Comments are lines of text that are ignored by the vint interpreter, so they will not affect the behavior of your program. There are two types of comments in vint: single-line comments and multi-line comments. ## Single-Line Comments -Single-line comments are used to provide brief explanations or documentation for a single line of code. To write a single-line comment in Nuru, use two forward slashes (//) followed by your comment text. Here's an example: +Single-line comments are used to provide brief explanations or documentation for a single line of code. To write a single-line comment in vint, use two forward slashes (//) followed by your comment text. Here's an example: ```s -// This line will be ignored by the Nuru interpreter +// This line will be ignored by the vint interpreter ``` -In this example, the comment text "This line will be ignored by the Nuru interpreter" will be ignored by the interpreter, so it will not affect the behavior of the program. +In this example, the comment text "This line will be ignored by the vint interpreter" will be ignored by the interpreter, so it will not affect the behavior of the program. ## Multi-Line Comments -Multi-line comments are used to provide more detailed explanations or documentation for multiple lines of code. To write a multi-line comment in Nuru, use a forward slash followed by an asterisk ( /* ) to start the comment, and an asterisk followed by a forward slash ( */ ) to end the comment. Here's an example: +Multi-line comments are used to provide more detailed explanations or documentation for multiple lines of code. To write a multi-line comment in vint, use a forward slash followed by an asterisk ( /* ) to start the comment, and an asterisk followed by a forward slash ( */ ) to end the comment. Here's an example: ```s /* @@ -25,6 +25,6 @@ ignored */ ``` -In this example, all the lines between the /* and */ symbols will be ignored by the Nuru interpreter, so they will not affect the behavior of the program. +In this example, all the lines between the /* and */ symbols will be ignored by the vint interpreter, so they will not affect the behavior of the program. -By utilizing single-line and multi-line comments in Nuru, you can make your code more readable and easier to maintain for yourself and others who may need to work with your code in the future. \ No newline at end of file +By utilizing single-line and multi-line comments in vint, you can make your code more readable and easier to maintain for yourself and others who may need to work with your code in the future. \ No newline at end of file diff --git a/repl/docs/en/dictionaries.md b/repl/docs/en/dictionaries.md index e70b4ab..e16e032 100755 --- a/repl/docs/en/dictionaries.md +++ b/repl/docs/en/dictionaries.md @@ -1,6 +1,6 @@ -# Dictionaries in Nuru +# Dictionaries in vint -Dictionaries in Nuru, also known as "kamusi," are powerful and flexible data structures that store key-value pairs. This page provides a comprehensive overview of dictionaries in Nuru, including how to create, access, modify, and iterate over them. +Dictionaries in vint, also known as "kamusi," are powerful and flexible data structures that store key-value pairs. This page provides a comprehensive overview of dictionaries in vint, including how to create, access, modify, and iterate over them. ## Creating Dictionaries @@ -104,4 +104,4 @@ baiskeli chakula ``` -With this knowledge, you can now effectively use dictionaries in Nuru to store and manage key-value pairs, offering a flexible way to organize and access data in your programs. \ No newline at end of file +With this knowledge, you can now effectively use dictionaries in vint to store and manage key-value pairs, offering a flexible way to organize and access data in your programs. \ No newline at end of file diff --git a/repl/docs/en/files.md b/repl/docs/en/files.md index a31ef64..c69036f 100755 --- a/repl/docs/en/files.md +++ b/repl/docs/en/files.md @@ -1,6 +1,6 @@ -# Files in Nuru +# Files in vint -Nuru's ability to deal with files is primitive, and as for now it only allows you to read contents of a file. +vint's ability to deal with files is primitive, and as for now it only allows you to read contents of a file. ## Opening a File diff --git a/repl/docs/en/for.md b/repl/docs/en/for.md index d12ea51..0ff721d 100755 --- a/repl/docs/en/for.md +++ b/repl/docs/en/for.md @@ -1,6 +1,6 @@ -# For Loops in Nuru +# For Loops in vint -For loops are a fundamental control structure in Nuru, used for iterating over iterable objects such as strings, arrays, and dictionaries. This page covers the syntax and usage of for loops in Nuru, including key-value pair iteration, and the use of break and continue statements. +For loops are a fundamental control structure in vint, used for iterating over iterable objects such as strings, arrays, and dictionaries. This page covers the syntax and usage of for loops in vint, including key-value pair iteration, and the use of break and continue statements. ## Basic Syntax To create a for loop, use the kwa keyword followed by a temporary identifier (such as i or v) and the iterable object. Enclose the loop body in curly braces {}. Here's an example with a string: @@ -27,7 +27,7 @@ o ### Dictionaries -Nuru allows you to iterate over both the value or the key-value pair of an iterable. To iterate over just the values, use one temporary identifier: +vint allows you to iterate over both the value or the key-value pair of an iterable. To iterate over just the values, use one temporary identifier: ```s kamusi = {"a": "andaa", "b": "baba"} diff --git a/repl/docs/en/function.md b/repl/docs/en/function.md index cc70da4..4c177d3 100755 --- a/repl/docs/en/function.md +++ b/repl/docs/en/function.md @@ -1,6 +1,6 @@ -# Functions in Nuru +# Functions in vint -Functions are a fundamental part of Nuru programming, allowing you to define reusable blocks of code. This page covers the syntax and usage of functions in Nuru, including parameters, default parameters, return statements, recursion, and closures. +Functions are a fundamental part of vint programming, allowing you to define reusable blocks of code. This page covers the syntax and usage of functions in vint, including parameters, default parameters, return statements, recursion, and closures. ## Basic Syntax @@ -60,7 +60,7 @@ mfano("x") // nimerudi ## Recursion -Nuru also supports recursion. Here's an example of a recursive Fibonacci function: +vint also supports recursion. Here's an example of a recursive Fibonacci function: ```s @@ -79,7 +79,7 @@ The fib function calculates the nth Fibonacci number by recursively calling itse ## Closures -Closures are anonymous functions that can capture and store references to variables from their surrounding context. In Nuru, you can create closures using the unda keyword without assigning them to a variable. Here's an example: +Closures are anonymous functions that can capture and store references to variables from their surrounding context. In vint, you can create closures using the unda keyword without assigning them to a variable. Here's an example: ```s fanya jum = unda(x) { @@ -94,4 +94,4 @@ andika(jum_x(3)) // 8 In the example above, the jum function returns another function that takes a single parameter y. The returned function has access to the x variable from its surrounding context. -Now that you understand the basics of functions in Nuru, including recursion and closures, you can create reusable blocks of code to simplify your programs and improve code organization. \ No newline at end of file +Now that you understand the basics of functions in vint, including recursion and closures, you can create reusable blocks of code to simplify your programs and improve code organization. \ No newline at end of file diff --git a/repl/docs/en/hisabati.md b/repl/docs/en/hisabati.md index 13e4320..cbc2150 100755 --- a/repl/docs/en/hisabati.md +++ b/repl/docs/en/hisabati.md @@ -8,7 +8,7 @@ This in-built module provides various mathematical functions and constants. It i To use the `hisabati` in-built module follow the steps below: -1. You directly import the `hisabati` in-built module and any required in-built modules in your Nuru code using the `tumia` keyword. +1. You directly import the `hisabati` in-built module and any required in-built modules in your vint code using the `tumia` keyword. ```vint tumia hisabati diff --git a/repl/docs/en/identifiers.md b/repl/docs/en/identifiers.md index 0f94880..27409d6 100755 --- a/repl/docs/en/identifiers.md +++ b/repl/docs/en/identifiers.md @@ -1,6 +1,6 @@ -# Identifiers in Nuru +# Identifiers in vint -Identifiers are used to name variables, functions, and other elements in your Nuru code. This page covers the rules and best practices for creating identifiers in Nuru. +Identifiers are used to name variables, functions, and other elements in your vint code. This page covers the rules and best practices for creating identifiers in vint. ## Syntax Rules @@ -28,4 +28,4 @@ When choosing identifiers, it's important to follow best practices to ensure you - Follow a consistent naming convention, such as camelCase (myVariableName) or snake_case (my_variable_name). - Avoid using single-letter variable names, except for commonly accepted cases like loop counters (i, j, k). -By following these best practices when creating identifiers, you will make your Nuru code more readable and maintainable for yourself and others. +By following these best practices when creating identifiers, you will make your vint code more readable and maintainable for yourself and others. diff --git a/repl/docs/en/ifStatements.md b/repl/docs/en/ifStatements.md index 5e74560..5fa83ca 100755 --- a/repl/docs/en/ifStatements.md +++ b/repl/docs/en/ifStatements.md @@ -1,6 +1,6 @@ -# Conditional Statements in Nuru +# Conditional Statements in vint -Conditional statements in Nuru are used to perform different actions based on different conditions. The if/else statement is a fundamental control structure that allows you to execute code based on specific conditions. This page covers the basics of if/else statements in Nuru. +Conditional statements in vint are used to perform different actions based on different conditions. The if/else statement is a fundamental control structure that allows you to execute code based on specific conditions. This page covers the basics of if/else statements in vint. ## If Statement (Kama) @@ -35,4 +35,4 @@ kama (a > 100) { In this example, the first condition a > 100 is false, and the second condition a < 10 is also false. Therefore, the code inside the sivyo block is executed, and the output is 'Thamani ya a ni 10'. -By using if/else statements with the kama, au kama, and sivyo keywords, you can control the flow of your Nuru code based on different conditions. \ No newline at end of file +By using if/else statements with the kama, au kama, and sivyo keywords, you can control the flow of your vint code based on different conditions. \ No newline at end of file diff --git a/repl/docs/en/json.md b/repl/docs/en/json.md index 948abd6..6775a4e 100755 --- a/repl/docs/en/json.md +++ b/repl/docs/en/json.md @@ -1,6 +1,6 @@ -# JSON in Nuru +# JSON in vint -Nuru also makes it easy to deal with JSON. +vint also makes it easy to deal with JSON. ## Import JSONI diff --git a/repl/docs/en/keywords.md b/repl/docs/en/keywords.md index c94365a..90effee 100755 --- a/repl/docs/en/keywords.md +++ b/repl/docs/en/keywords.md @@ -1,10 +1,10 @@ # KEYWORDS -Keywords in Nuru are reserved words that have special meanings and cannot be used as identifiers for variables, functions, or classes. This page covers the syntax and usage of keywords in Nuru, including reserved keywords and built-in functions. +Keywords in vint are reserved words that have special meanings and cannot be used as identifiers for variables, functions, or classes. This page covers the syntax and usage of keywords in vint, including reserved keywords and built-in functions. ## Reserved Keywords -The table below lists the reserved keywords in Nuru. These words have specific meanings in the language and cannot be used as identifiers: +The table below lists the reserved keywords in vint. These words have specific meanings in the language and cannot be used as identifiers: