{"id":18969289,"url":"https://github.com/miguelgargallo/pylar","last_synced_at":"2026-01-25T07:34:31.402Z","repository":{"id":104346375,"uuid":"585274891","full_name":"miguelgargallo/pylar","owner":"miguelgargallo","description":"Pylar Language","archived":false,"fork":false,"pushed_at":"2023-01-05T11:47:31.000Z","size":51,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-10T03:34:28.342Z","etag":null,"topics":["linguist","pylar","tmbundle"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/miguelgargallo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"License.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":"miguelgargallo","tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"lfx_crowdfunding":null,"custom":null}},"created_at":"2023-01-04T18:59:34.000Z","updated_at":"2023-01-05T11:53:18.000Z","dependencies_parsed_at":null,"dependency_job_id":"fa41723e-0aca-4923-a074-b453ccca17a0","html_url":"https://github.com/miguelgargallo/pylar","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/miguelgargallo/pylar","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miguelgargallo%2Fpylar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miguelgargallo%2Fpylar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miguelgargallo%2Fpylar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miguelgargallo%2Fpylar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/miguelgargallo","download_url":"https://codeload.github.com/miguelgargallo/pylar/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miguelgargallo%2Fpylar/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28747611,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-25T05:12:38.112Z","status":"ssl_error","status_checked_at":"2026-01-25T05:04:50.338Z","response_time":113,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["linguist","pylar","tmbundle"],"created_at":"2024-11-08T14:52:27.186Z","updated_at":"2026-01-25T07:34:31.387Z","avatar_url":"https://github.com/miguelgargallo.png","language":null,"funding_links":["https://ko-fi.com/miguelgargallo"],"categories":[],"sub_categories":[],"readme":"# Pylar Lang\n\n- [Pylar Lang](#pylar-lang)\n  - [About Rust](#about-rust)\n  - [About Python](#about-python)\n    - [Comparison points](#comparison-points)\n    - [Comparison table](#comparison-table)\n  - [Keywords](#keywords)\n  - [Building a Compiler for the \"Pylar\" Programming Language](#building-a-compiler-for-the-pylar-programming-language)\n    - [Requirements](#requirements)\n    - [File Structure for a Basic Compiler](#file-structure-for-a-basic-compiler)\n  - [If Statements](#if-statements)\n    - [In Rust](#in-rust)\n    - [In Python](#in-python)\n    - [In Pylar](#in-pylar)\n    - [Comparison](#comparison)\n      - [Comparison points](#comparison-points-1)\n      - [Comparison table](#comparison-table-1)\n    - [Differences](#differences)\n    - [Table of differences (\\*1)](#table-of-differences-1)\n      - [Disclaimer](#disclaimer)\n  - [Loops](#loops)\n    - [In Rust](#in-rust-1)\n    - [In Python](#in-python-1)\n    - [In Pylar](#in-pylar-1)\n      - [Comparison points](#comparison-points-2)\n      - [Comparison table](#comparison-table-2)\n  - [Semantics](#semantics)\n      - [Comparison points](#comparison-points-3)\n      - [Comparison table](#comparison-table-3)\n  - [Algorithms](#algorithms)\n    - [Dijkstra's Algorithm](#dijkstras-algorithm)\n\n## About Rust\n\nRust is a programming language developed by Mozilla. It is designed to be a safe and concurrent language that is suitable for systems programming. Rust has a strong emphasis on safety, performance, and concurrency, and aims to be a viable alternative to C and C++. It is syntactically similar to C++, but has a number of features that are designed to make it easier to write safe and correct code, such as a borrow checker that prevents dangling pointers. Rust also has a growing and active community, with a number of libraries and tools available to help developers build robust and efficient applications.\n\n## About Python\n\nPython is a general-purpose programming language that is widely used for web development, scientific computing, data analysis, and artificial intelligence. It is a high-level language, which means that it is easy to read and write and is more abstracted from the underlying hardware than low-level languages like C and C++. Python has a large standard library that supports many common programming tasks, such as connecting to web servers, reading and writing files, and working with data. There are also many third-party libraries available for Python, which provide additional functionality and make it an attractive choice for a wide range of tasks. Python is known for its simplicity and readability, and it is often used as a first language for people learning to program.\n\n### Comparison points\n\nRust and Python are both popular programming languages, but they have some significant differences. Here are a few points of comparison:\n\n    Syntax: Rust and Python have fairly different syntax. Rust's syntax is more similar to C and C++, with a focus on explicit variable declarations and manual memory management. Python's syntax is more concise and readable, with a focus on readability and simplicity.\n\n    Safety: Rust is designed to be a safe language, with a number of features that help prevent common programming errors such as null or dangling pointers. Python is also a safe language, but it does not have the same level of compile-time checks for issues such as null pointers.\n\n    Performance: Rust is generally considered to be a faster language than Python, due to its emphasis on statically-typed variables and manual memory management. Python is an interpreted language, which means that it is generally slower than compiled languages like Rust. However, Python has a number of optimization techniques that can help improve its performance, and it is often fast enough for many tasks.\n\n    Concurrency: Both Rust and Python have support for concurrent programming, but they approach it in different ways. Rust has a number of language features that make it easier to write concurrent code, such as the std::sync and std::thread libraries. Python has a similar set of tools, including the threading and multiprocessing modules, but it also has a number of third-party libraries that can be used for concurrent programming.\n\n    Use cases: Rust is primarily used for systems programming and applications that require high performance and low-level control. Python is used for a wider range of tasks, including web development, scientific computing, data analysis, and artificial intelligence.\n\n### Comparison table\n\n| Language | Pros                                                                                                      | Cons                                                                                                |\n| -------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- |\n| Rust     | - Fast and efficient\u003cbr\u003e- Safe and concurrent\u003cbr\u003e- Strong support for low-level programming               | - Steep learning curve\u003cbr\u003e- Less mature ecosystem compared to Python                                |\n| Python   | - Easy to learn and read\u003cbr\u003e- Large standard library and active community\u003cbr\u003e- Widely used in many fields | - Can be slower than compiled languages\u003cbr\u003e- Dynamically-typed variables can lead to runtime errors |\n\n## Keywords\n\nHere is a list of the 25 most commonly used keywords in Rust:\n\n    as\n    break\n    const\n    continue\n    crate\n    else\n    enum\n    extern\n    false\n    fn\n    for\n    if\n    impl\n    in\n    let\n    loop\n    match\n    mod\n    move\n    mut\n    pub\n    ref\n    return\n    Self\n    struct\n\nHere is a list of the 25 most commonly used keywords in Python:\n\n    and\n    as\n    assert\n    async\n    await\n    break\n    class\n    continue\n    def\n    del\n    elif\n    else\n    except\n    False\n    finally\n    for\n    from\n    global\n    if\n    import\n    in\n    is\n    lambda\n    None\n    nonlocal\n\nHere are the most common keywords in Pylar:\n\n    say - used to print output to the console\n    ifis - used to specify a condition in an if statement\n    bye - used to break out of a loop\n    rest - used to continue to the next iteration of a loop\n    and - used to specify multiple variables in a for loop\n    also - used to specify multiple variables in a for loop\n    now - used to execute the code block in a loop or conditional statement\n    small - used to find the smallest element in a list or collection\n    is - used to check if a variable is present in a list or collection\n    range - used to specify a range of values in a for loop\n    not - used to negate a condition in an if statement\n    = - used to assign a value to a variable or to check for equality in a condition\n    to - used to specify a range of values in a for loop\n    while - used to specify a loop that continues until a certain condition is met\n    then - used to specify a block of code to be executed if a condition is met\n    begin - used to specify the start of a block of code\n    end - used to specify the end of a block of code\n    fun - used to define a function\n    let - used to define a variable\n    var - used to define a variable\n    do - used to specify the start of a block of code to be executed repeatedly\n    end - used to specify the end of a block of code to be executed repeatedly, also to end a loop or conditional statement\n\nsay - used to print output to the console\nifis - used to specify a condition in an if statement\nbye - used to break out of a loop\nrest - used to continue to the next iteration of a loop\nand - used to specify multiple variables in a for loop\nalso - used to specify multiple variables in a for loop\nnow - used to execute the code block in a loop or conditional statement\nsmall - used to find the smallest element in a list or collection\nbig - used to find the largest element in a list or collection\nis - used to check if a variable is present in a list or collection\nrange - used to specify a range of values in a for loop\nnot - used to negate a condition in an if statement\n= - used to assign a value to a variable or to check for equality in a condition\nto - used to specify a range of values in a for loop\npass - used to lend permissions to the next instruction or now to execute the whole code\nend - used to end a loop\n\n- - used to lend the permissions to read, write and execute only to the next instruction, the next line, one line per instruction\n\n## Building a Compiler for the \"Pylar\" Programming Language\n\nIn order to build a compiler for the \"Pylar\" programming language, which combines elements of Rust and Python, there are a few key requirements that need to be considered.\n\n### Requirements\n\n- Support for Rust-like statically-typed variables and manual memory management: Since \"Pylar\" is intended to combine the safety and performance of Rust with the simplicity and readability of Python, it will need to support Rust's approach to variable declarations and memory management. This will require the use of a type checker and borrow checker similar to Rust's, as well as a way to safely manage memory allocation and deallocation.\n\n- Integration with Python's standard library and third-party libraries: In order to make \"Pylar\" a viable option for Python developers, it will need to be able to make use of the vast ecosystem of libraries and tools available for Python. This will require the compiler to have a way to import and use these libraries, as well as support for Python's dynamically-typed variables and object-oriented programming features.\n\n- Support for concurrent programming: Both Rust and Python have strong support for concurrent programming, and \"Pylar\" will need to offer similar capabilities. This will require the inclusion of language features and libraries for managing threads and synchronization, as well as tools for debugging and testing concurrent code.\n\n- Optimization and performance enhancements: While \"Pylar\" will likely be faster than Python due to its statically-typed variables and manual memory management, there may still be opportunities to optimize the code and improve performance. This will require the use of optimization techniques such as loop unrolling and inlining, as well as the ability to target specific hardware architectures and use specialized instructions and features.\n\n- Ease of use and adoption: In order for \"Pylar\" to be successful, it will need to be easy for developers to learn and use. This will require clear and concise documentation, as well as a friendly and supportive community. It may also be beneficial to provide tools and resources for converting existing Rust and Python code to \"Pylar\", in order to make it easier for developers to adopt the new language.\n\n- Support for web development: \"Pylar\" will need to be able to support web development, since it is a common use case for both Rust and Python. This will require the inclusion of a web framework similar to Flask or Django, as well as a way to compile the code to a format that can be run on a web server.\n\n### File Structure for a Basic Compiler\n\n```\n* compiler\n├── src\n│ ├── lexer.rs\n│ ├── parser.rs\n│ ├── codegen.rs\n│ ├── main.rs\n│ └── util.rs\n└── test\n├── lexer_test.rs\n├── parser_test.rs\n├── codegen_test.rs\n└── util_test.rs\n```\n\nA basic compiler typically consists of several different components that are responsible for different tasks. Some common components include:\n\n- Lexer (src/lexer.rs): The lexer, also known as a tokenizer, is responsible for breaking the source code up into a series of tokens that can be easily parsed. This is typically the first step in the compilation process.\n\n- Parser (src/parser.rs): The parser is responsible for taking the tokens produced by the lexer and turning them into a structured representation of the code, such as an abstract syntax tree (AST).\n\n- Code generator (src/codegen.rs): The code generator is responsible for taking the AST produced by the parser and turning it into machine code or bytecode that can be executed by a computer.\n\n- Main function (src/main.rs): The main function is the entry point for the compiler and is responsible for handling command-line arguments, setting up the necessary data structures, and calling the other components in the correct order.\n\n- Utilities (src/util.rs): The utilities module typically contains a variety of helper functions and data structures that are used by the other components of the compiler.\n\nIn addition to the source files, a basic compiler may also include a set of test files that can be used to ensure that the different components are working correctly. These test files are typically located in a `test` directory and use a testing framework to run a series of tests against the compiler.\n\n## If Statements\n\n### In Rust\n\nThis is a if statement in rust:\n\n```rust\nfn main() {\nlet n = 5;\n\n    if n \u003c 0 {\n        print!(\"{} is negative\", n);\n    } else if n \u003e 0 {\n        print!(\"{} is positive\", n);\n    } else {\n        print!(\"{} is zero\", n);\n    }\n\n    let big_n =\n        if n \u003c 10 \u0026\u0026 n \u003e -10 {\n            println!(\", and is a small number, increase ten-fold\");\n\n            // This expression returns an `i32`.\n            10 * n\n        } else {\n            println!(\", and is a big number, halve the number\");\n\n            // This expression must return an `i32` as well.\n            n / 2\n            // TODO ^ Try suppressing this expression with a semicolon.\n        };\n    //   ^ Don't forget to put a semicolon here! All `let` bindings need it.\n\n    println!(\"{} -\u003e {}\", n, big_n);\n\n}\n```\n\n### In Python\n\n```python\ndef main():\nn = 5\n\n    if n \u003c 0:\n        print(\"{} is negative\".format(n))\n    elif n \u003e 0:\n        print(\"{} is positive\".format(n))\n    else:\n        print(\"{} is zero\".format(n))\n\n    if n \u003c 10 and n \u003e -10:\n        print(\", and is a small number, increase ten-fold\")\n        big_n = 10 * n\n    else:\n        print(\", and is a big number, halve the number\")\n        big_n = n // 2\n\n    print(\"{} -\u003e {}\".format(n, big_n))\n\nmain()\n```\n\n### In Pylar\n\n```pylar\nfor x = 5, ifis \u003e say \"It's higher\" rest \"It's lower\" now\n```\n\n### Comparison\n\n#### Comparison points\n\nThere are a few key differences between Rust and Python that are worth noting:\n\nIn Rust, print! is used to print to the standard output stream, while in Python print is used.\n\nIn Rust, {} is used to placeholders for values that will be printed, while in Python {} is used for the same purpose.\n\nIn Rust, \u0026\u0026 is used for a logical and operator, while in Python and is used.\n\nIn Rust, / is the division operator, while in Python / is the floor division operator. To perform regular division, you can use / in Python 3 or / in Python 2.\n\nIn Rust, ; is used to end a statement, while in Python it is optional.\n\nIn Rust, let is used to bind a value to a variable, while in Python = is used for the same purpose.\n\n#### Comparison table\n\n| Language | Syntax                                                                                                                 |\n| -------- | ---------------------------------------------------------------------------------------------------------------------- |\n| Pylar    | for x = 5, ifis \u003e say \"It's higher\" rest \"It's lower\"                                                                  |\n| Rust     | if x \u003e 5 {\u003cbr\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp;println!(\"It's higher\");\u003cbr\u003e} else {\u003cbr\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp;println!(\"It's lower\");\u003cbr\u003e} |\n| Python   | if x \u003e 5:\u003cbr\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp;print(\"It's higher\")\u003cbr\u003eelse:\u003cbr\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp;print(\"It's lower\")                  |\n\n### Differences\n\nThere are a few key differences between the \"ifis\" statement in Pylar and the if statements in Rust and Python:\n\n    Syntax: The syntax for the \"ifis\" statement in Pylar is significantly different from the if statements in Rust and Python. In Rust and Python, the condition is written first, followed by a block of code that is executed if the condition is true. In Pylar, the condition is written after the loop variable and the loop body, and the keyword \"say\" is used to specify the code that should be executed if the condition is true, while the keyword \"rest\" is used for the code that should be executed if the condition is false.\n\n    Comparison operator: In Rust and Python, the \u003e operator is used to test if a value is greater than another value. In Pylar, it is not clear from the example provided how comparison operators are written or used.\n\n    Loop variable: In the example provided, Pylar appears to have a loop variable x that is assigned the value 5. In Rust and Python, there is no equivalent syntax for assigning a value to a loop variable before the loop begins.\n\n    Loop body: In the example provided, Pylar appears to have a loop body that consists of a single \"ifis\" statement. In Rust and Python, the loop body is typically written as a block of code between curly braces or indentation.\n\n    Output: In Rust and Python, the println! and print functions are used to print to the standard output stream, respectively. In Pylar, the keyword \"say\" is used to specify the output, but it is not clear how the output is actually printed.\n\n### Table of differences [(\\*1)](#Disclaimer)\n\n```\n| Definition       | Python       | Rust       | Pylar      |\n|-----------------|---------------|------------|-------------|\n| Returns a value | `return`      | `return`   | `say`       |\n| Prints output   | `print()`     | `println!()` | `say`     |\n| If statement    | `if`          | `if`       | `ifis`      |\n| Else statement  | `else`        | `else`     | `else`      |\n| Elif statement  | `elif`        | `else if`  | `else`      |\n| For loop        | `for`         | `for`      | `for`       |\n| While loop      | `while`       | `while`    | `while`     |\n| Break loop      | `break`       | `break`    | `bye`       |\n| Continue loop   | `continue`    | `continue` | `rest`      |\n| And operator    | `and`         | `\u0026\u0026`       | `and`       |\n| Or operator     | `or`          | `||`       | `or`        |\n| Not operator    | `not`         | `!`        | `not`       |\n| Is operator     | `is`          | `==`       | `=`         |\n| In operator     | `in`          | `in`       | `in`        |\n| Equal operator  | `==`          | `==`       | `=`         |\n| Assign operator | `=`           | `=`        | `=`         |\n| Lambda function | `lambda`      | `lambda`   | `lambda`    |\n| Function definition | `def`   | `fn`       | `fn`        |\n| Class definition   | `class` | `struct`   | `class`     |\n| Import statement   | `import` | `use`      | `import`    |\n| Class definition       | `class`       | `struct`   | `class`     |\n| Import statement       | `import`      | `use`      | `import`    |\n| Global keyword         | `global`      | `global`   | `global`    |\n| Nonlocal keyword       | `nonlocal`    | `nonlocal` | `nonlocal`  |\n| And operator           | `and`         | `\u0026\u0026`       | `and`       |\n| Or operator            | `or`          | `||`       | `or`        |\n| Not operator           | `not`         | `!`        | `not`       |\n| Is operator            | `is`          | `==`       | `=`         |\n| In operator            | `in`          | `in`       | `in`        |\n| Equal operator         | `==`          | `==`       | `=`         |\n| Assign operator        | `=`           | `=`        | `=`         |\n| Lambda function        | `lambda`      | `lambda`   | `lambda`    |\n| Function definition    | `def`         | `fn`       | `fn`        |\n```\n\n#### Disclaimer\n\n[(\\*1)](#Table-of-differences) Pylar is a work in progress and is not yet complete, it is subject to changes.\n\n## Loops\n\n### In Rust\n\n```rust\nfn main() {\n    // This is a for loop that counts from 1 to 10\n    for i in 1..11 {\n        println!(\"{}\", i);\n    }\n\n    // This is a while loop that counts from 1 to 10\n    let mut i = 1;\n    while i \u003c= 10 {\n        println!(\"{}\", i);\n        i += 1;\n    }\n\n    // This is a loop that counts from 1 to 10 using a loop label\n    'outer: for i in 1..11 {\n        'inner: for j in 1..11 {\n            if i % 2 == 0 {\n                break 'outer;\n            } else if j % 2 == 0 {\n                continue 'inner;\n            }\n            println!(\"i = {}, j = {}\", i, j);\n        }\n    }\n}\n```\n\n### In Python\n\n```python\n\ndef main():\n    # This is a for loop that counts from 1 to 10\n    for i in range(1, 11):\n        print(i)\n\n    # This is a while loop that counts from 1 to 10\n    i = 1\n    while i \u003c= 10:\n        print(i)\n        i += 1\n\n    # This is a loop that counts from 1 to 10 using a loop label\n    for i in range(1, 11):\n        for j in range(1, 11):\n            if i % 2 == 0:\n                break\n            elif j % 2 == 0:\n                continue\n            print(\"i = {}, j = {}\".format(i, j))\n\nmain()\n```\n\n### In Pylar\n\n```pylar\nfor i = 1 to 10, say i pass *\n```\n\nThis is a for loop that counts from 1 to 10 and lend the permissions to read, write and execute only to the next instruction, the next line, one line per instruction, ended with pass to lend permissions to the next instruction or now to execute the whole code.\n\n```pylar\nfor i = 1 to 10, say i now\n```\n\nThis is a for loop that counts from 1 to 10 and ended with now to execute the whole code.\n\n```pylar\nfor i = 1 to 10, say i pass *\n```\n\nThis is a while loop that counts from 1 to 10, then it will pass the permissions to read, write and execute only to the next instruction, the next line, one line per instruction, ended with pass to lend permissions to the next instruction or now to execute the whole code.\n\n```pylar\nwhile i = 1 to 10, say i, +1 pass *\n```\n\nThis is a while loop that counts from 1 to 10 and ended with now to execute the whole code.\n\n```pylar\nfor i = 1 to 10, say i now\n```\n\nThis is a loop that counts from 1 to 10 using a loop label and ended with pass \\* to lend permissions to the next instruction or now to execute the whole code.\n\nBecareful: As you may think in Pylar would be like this:\n\n```not-pylar\nfor i = 1 to 10, for j = 1 to 10, pass * if i / 2 = 0, end, pass * else if j % 2 == 0, continue pass * say \"i = {}, j = {}\".format(i, j) pass *\n```\n\nBut in Pylar would be like this:\n\n```pylar\nfor i = 1 to 10 and j also, ifis / 2 = 0 bye, rest say \"i = {}, j = {}\".format(i, j) pass *\n```\n\nThis loop iterates over the variables i and j simultaneously and prints their values in the format \"i = {}, j = {}\". If the value of i is divisible by 2, the loop breaks using bye. If the value of j is even, the loop continues to the next iteration using rest.\n\n#### Comparison points\n\nHere are the key points of comparison between loops in Rust, Python, and Pylar:\n\n    Syntax: The syntax for loops in Rust, Python, and Pylar is quite different. In Rust, a for loop is written using the for keyword and a range, while a while loop is written using the while keyword and a condition. In Python, for and while loops are written using the for and while keywords, respectively, and the range function or a sequence of values is used to specify the loop iteration. In Pylar, for loops are written using the for keyword, a loop variable, and the keywords to and say or now, while while loops are written using the while keyword, a loop variable, and the keyword do.\n\n    Loop labels: Loop labels are a feature in Rust that allow you to specify a label for a loop and use the break and continue keywords to control the flow of the loop. Python does not have a similar feature. Pylar does not appear to have a similar feature either.\n\n    Break and continue: In Rust, the break and continue keywords can be used to control the flow of a loop. In Python, these keywords have the same function. In Pylar, the break keyword is replaced by the bye keyword, and the continue keyword is not present.\n\n#### Comparison table\n\n| Language | For Loop                                                            | While Loop                                                                                        | Loop Label                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     | Break     | Continue   |\n| -------- | ------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------- | ---------- |\n| Rust     | `for i in 1..11 {`\u003cbr\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp;`println!(\"{}\", i);`\u003cbr\u003e`}` | `while i \u003c= 10 {`\u003cbr\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp;`println!(\"{}\", i);`\u003cbr\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp;`i += 1;`\u003cbr\u003e`}` | `'outer: for i in 1..11 {`\u003cbr\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp;`'inner: for j in 1..11 {`\u003cbr\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;`if i % 2 == 0 {`\u003cbr\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;`break 'outer;`\u003cbr\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;`} else if j % 2 == 0 {`\u003cbr\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;`continue 'inner;`\u003cbr\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;`}`\u003cbr\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;`println!(\"i = {}, j = {}\", i, j);`\u003cbr\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp;`}`\u003cbr\u003e`}` | Yes       | Yes        |\n| Python   | `for i in range(1, 11):`\u003cbr\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp;`print(i)`            | `i = 1`\u003cbr\u003e`while i \u003c= 10:`\u003cbr\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp;`print(i)`\u003cbr\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp;`i += 1`         | `for i in range(1, 11):`\u003cbr\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp;`for j in range(1, 11):`\u003cbr\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;`if i % 2 == 0:`\u003cbr\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;`break`\u003cbr\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;`elif j % 2 == 0:`\u003cbr\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;`continue`\u003cbr\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;`print(\"i = {}, j = {}\".format(i, j))`                                                                                                    | Yes       | Yes        |\n| Pylar    | `for i = 1 to 10, say i pass *`                                     | `while i = 1 to 10, say i, +1 pass *`                                                             | `for i = 1 to 10 and j also, ifis / 2 = 0 bye, rest say \"i = {}, j = {}\".format(i, j) pass *`                                                                                                                                                                                                                                                                                                                                                                                                                  | Yes `bye` | Yes `rest` |\n\nIn Pylar, break is written as bye and continue is written as rest.\n\nFor example, the following Pylar code would print the numbers 1 to 10, except for the number 5:\n\n```pylar\nfor i = 1 to 10, say i, ifis = 5 bye, now\n```\n\nAnd the following Pylar code would print only the even numbers from 1 to 10:\n\n```pylar\nfor i = 1 to 10, ifis even say i now\n```\n\n## Semantics\n\n#### Comparison points\n\nHere is a comparison of key points between Rust, Python, and Pylar:\n\nPointer Access: Rust allows direct pointer access, while Python does not. Pylar also allows direct pointer access.\n\nData Types: Rust has static data types, while Python has dynamic data types. Pylar also has static data types.\n\nStatic/Dynamic: Rust is a static language, while Python is a dynamic language. Pylar is also a static language.\n\nMemory Model: Rust uses manual memory management, while Python uses garbage collection. Pylar also uses manual memory management.\n\nConcurrency: Rust uses a locking model for concurrency, while Python uses threading. Pylar also uses a locking model for concurrency.\n\nPrimitive Functions: Both Rust and Python have primitive functions built into the language. Pylar also has primitive functions built into the language.\n\nParadigm: Both Rust and Python are hybrid languages, combining elements of both functional and object-oriented programming. Pylar is also a hybrid language.\n\nInteroperability: Both Rust and Python can interface with existing libraries and languages using C Foreign Function Interface (FFI). Pylar can also interface with existing libraries and languages using C FFI.\n\n#### Comparison table\n\n| Language | Pointer Access | Data Types | Static/Dynamic | Memory Model       | Concurrency | Primitive Functions | Paradigm | Interoperability |\n| -------- | -------------- | ---------- | -------------- | ------------------ | ----------- | ------------------- | -------- | ---------------- |\n| Rust     | Yes            | Static     | Static         | Manual             | Locking     | Yes                 | Hybrid   | C FFI            |\n| Python   | No             | Dynamic    | Dynamic        | Garbage Collection | Threading   | Yes                 | Hybrid   | C FFI            |\n| Pylar    | Yes            | Static     | Static         | Manual             | Locking     | Yes                 | Hybrid   | C FFI            |\n\n## Algorithms\n\n### Dijkstra's Algorithm\n\nDijkstra's algorithm is an algorithm for finding the shortest paths between nodes in a graph, which may represent, for example, road networks. It was conceived by computer scientist Edsger Dijkstra in 1956 and published three years later.\n\nHere are some new keywords used in Pylar:\n\ncreate: used to create a new variable or data structure, such as create distances = {} or create unvisited = graph.keys()\n\nset: used to assign a value to a variable, such as set distances[node] = 0 or set unvisited.remove(current)\n\nfor each: used to iterate over a sequence, such as for each node in graph or for each neighbor, weight in graph[current]\n\nif is: used to test for a specific value or condition, such as if is neighbor in unvisited or if is alt \u003c distances[neighbor]\n\ndo: used to perform an action, such as do unvisited.remove(current) or do distances[neighbor] = alt, predecessors[neighbor] = current\n\n```pylar\ncreate distances, predecessors = {}, {}\nfor each node in graph, set distances[node] = 0 if is node = start else inf\ncreate unvisited = graph.keys()\nwhile is unvisited,\n    create current = small(unvisited, key=lambda x: distances[x])\n    do unvisited.remove(current)\n    for each neighbor, weight in graph[current],\n        if is neighbor in unvisited,\n            create alt = distances[current] + weight\n            if is alt \u003c distances[neighbor], do distances[neighbor] = alt, predecessors[neighbor] = current\ndistances, predecessors\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmiguelgargallo%2Fpylar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmiguelgargallo%2Fpylar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmiguelgargallo%2Fpylar/lists"}