{"id":16949225,"url":"https://github.com/f4str/neetspeak","last_synced_at":"2025-08-09T01:52:50.623Z","repository":{"id":106168489,"uuid":"184367209","full_name":"f4str/neetspeak","owner":"f4str","description":"A simple pseudocode-based programming language","archived":false,"fork":false,"pushed_at":"2020-01-22T22:45:26.000Z","size":39,"stargazers_count":0,"open_issues_count":6,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-04-05T14:44:28.693Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/f4str.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2019-05-01T04:09:29.000Z","updated_at":"2020-01-22T22:45:28.000Z","dependencies_parsed_at":"2023-06-15T20:45:21.828Z","dependency_job_id":null,"html_url":"https://github.com/f4str/neetspeak","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/f4str/neetspeak","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f4str%2Fneetspeak","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f4str%2Fneetspeak/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f4str%2Fneetspeak/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f4str%2Fneetspeak/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/f4str","download_url":"https://codeload.github.com/f4str/neetspeak/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f4str%2Fneetspeak/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269518567,"owners_count":24430637,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-08T02:00:09.200Z","response_time":72,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2024-10-13T21:53:28.287Z","updated_at":"2025-08-09T01:52:50.581Z","avatar_url":"https://github.com/f4str.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Neetspeak\n\nNeetspeak is an interpreted programming language with syntax based off mathematical pseudocode. Its purpose is to offer simple, easy to read, and runnable pseudocode found in algorithm papers and textbooks without having to transcribe it into another language. Neetspeak is written in Python using the PLY framework. \n\nAlthough the syntax is based off pseudocode, it is very similar to Ruby with the inclusion of the `end` keyword. It should also be noted that due to this, Neetspeak ignores whitespace such as spaces, tabs, and newlines. \n\n## Requirements\n\n* Python 3\n* PLY\n\nOn Ubuntu, all dependencies can be installed using apt and pip:\n```shell\n$ sudo apt install python3 python3-pip\n```\n```shell\n$ pip3 install ply\n```\n\n## How to run\n\nTo run directly from source, use the `interpreter.py` code file on any text file with neetspeak syntax code.\n```shell\n$ python3 interpreter.py test.neet\n```\n\nContext of `test.neet`:\n```ruby\nalgorithm main()\n    print('hello there')\nend\n```\n\n## Data Types\n\nNeetspeak offers all necessary data types to remain simple and barebones without adding too much bloat. Data types are based on those found in Python. Syntax is essentially the same as in Python with the exception of booleans. \n\n* **Integer**: Identical to the Python `int` type\n    ```ruby\n    4, -7, 324234\n    ```\n* **Real**: Identical to the Python `float` type\n    ```ruby\n    0.5, -3.8, 2e5\n    ```\n* **Boolean**: Similar to the Python `bool` type but lowercase\n    ```ruby\n    true, false\n    ```\n* **String**: Identical to the Python `str` type\n    ```ruby\n    \"hello\", 'there'\n    ```\n* **List**: Identical to the Python `list` type\n    ```ruby \n    [4,6,3], ['a',5,], [], [[1,3],[1,3]]\n    ```\n* **Null**: Similar to the Python `None` type\n    ```c#\n    null\n    ```\n\n## Operations\n\nOperations on data types are essentially the same as operations in Python with slight differences in syntax. Let `x` and `y` be two variables that may represent Integers, Reals, Booleans, Strings, or Lists depending on the context. \n\n| Operator | Description                  |\n|----------|------------------------------|\n| a + b\t   | addition                     |\n| a - b    | subtraction                  |\n| a * b    | multiplication               |\n| a / b    | division                     |\n| a % b    | modulus                      |\n| a ** b   | exponentiation               |\n| a := b   | variable assignment          |\n| a or b   | boolean OR                   |\n| a and b  | boolean AND                  |\n| a xor b  | boolean XOR                  |\n| not a    | boolean NOT                  |\n| a = b    | equal to                     |\n| a != b   | not equal to                 |\n| a \u003e b    | greater than                 |\n| a \u003e= b   | greater than or equal to     |\n| a \u003c b    | less than                    |\n| a \u003c= b   | less than or equal to        |\n| a | b    | bitwise OR                   |\n| a \u0026 b    | bitwise AND                  |\n| a ^ b    | bitwise XOR                  |\n| ~a       | bitwise NOT                  |\n| a \u003c\u003c b   | bitwise left shift           |\n| a \u003e\u003e b   | bitwise right shift          |\n| -a       | unary minus                  |\n| +a       | unary plus                   |\n| a[b]     | list indexing                |\n| a()      | function call                |\n| a(b)     | function call with parameter |\n| a in b   | list or string membership    |\n\n## Syntax and Semantics\n\nThe syntax and semantics are the same as mathematical psuedocode found in papers and textbooks. The most notable feature is the use of the `end` keyword to close `if` statements, `for` and `while` loops, and function definitions. \n\n### Print Statement\n\nA simple print statement found in Python. Prints any data type, but only takes a single parameter. Use string concatenation to print multiple statements\n\n```ruby\nprint('1 + 2 equals ' + (1 + 2))\n```\n\n### Comments\n\nComments are C-style and will be ignored when running the program. The start with the `/*` keyword and end with the `*/` keyword. Since Neetspeak ignores whitespace, the multiline comment is necessary. \n\n```c#\n/* this will be ignored */\nprint(\"hello there\")\nx := 5 /* good for documentation */\nprint(x + 1) /* 6 */\n```\n\n### Main function\n\nNeetspeak requires a main function as an entry point to any program. Other functions can also created, but the main function is required for the program to run. \n```ruby\nalgorithm main()\n    print('hello there')\nend\n```\n\n### Variables\n\nVariables are assigned using the `:=` keyword.\n```ruby\nx := 5\ny := 7\nprint('x + y = ' + (x + y))\n\nname := \"Bob\"\nage := 18\nprint('My name is ' + name + ' and I am ' + age + ' years old')\n```\n\nAll variables are global and can be accessed anywhere regardless of where they are declared. \n\n```ruby\nalgorithm main()\n    x := 5\n    access()\nend\n\nalgorithm access()\n    print(x)\nend\n```\n\n### List and String Indexing\n\nNeetspeak is based on mathematical psuedocode so arrays start at 1 instead of 0. List and String indexing is 1 to the length.\n```ruby\na := [5, 3, 7]\nprint(a)\nprint('[' + a[1] + ', ' + a[2] + ', ' + a[3] + ']')\n\nb := 'word'\nprint(b)\nprint(\"'\" + b[1] + b[2] + b[3] + b[4] + \"'\")\n```\n\nLists and Strings are identical to those in Python and Ruby and can be multidimensional.\n```ruby\nx := [[1,2],1,3]\nprint(x[1])\nprint(x[1][1])\n\ns := \"yes i am\"\nprint(s[5])\nprint(s[2][1][1])\n```\n\n### If Statements and Else-If Statements\n\nIf statements use the `if` keyword with the boolean condition followed by the `then` keyword. The statement is followed by an `else` keyword for the else statement or ended using the `end` keyword. \n\n```ruby\nx := 5\ny := 7\n\nif x = y then\n    print('yes')\nend\n\nif x = y then\n    print('yes')\nelse \n    print('no')\nend\n```\n\nElse-if statements are followed by an if statement and use the `elseif` keyword. They are followed by further else-if statements or ended using the `end` keyword. \n\n```php\nx := 2\n\nif x = 1 then\n    print('first if statement')\nelseif x = 2 then\n    print('second if statement')\nelseif x = 3 then\n    print('third if statement')\nelse\n    print('else statement')\nend\n```\n\n### While Loops\n\nWhile loops are the similar to if conditions as they use the `while` keyword with the boolean condition followed by the `then` keyword. They are ended using the `end` keyword. \n\n```ruby\nx := 1\nwhile x \u003c 5 do\n    print(x)\n    x := x + 1\nend\n\ny := 5\nwhile y \u003e= 0 do\n    print(y)\n    y := y - 1\nend\n```\n\n### For Loops\n\nFor loops are a bit different from most programming languages due to their representation in pseudocode. The actual functionality is similar to C-style for loops. For loops use the `for` keyword and are followed by a variable assignment. Afterwards, there will be a `to` or `downto` keyword to indicate whether to count up or down. A values will then need to be specified to count towards, inclusive. The rest of the syntax is the same as a while loop. \n\n```ruby\nfor x := 92 to 97 do\n    print(x)\nend\n\nfor x := 8 downto 4 do\n    print(x)\nend\n```\n\n### Foreach Loops\n\nForeach loops are the same as the Python style for loops and the C# style foreach loop. Foreach loops begin with the `foreach` keyword and use a variable to represent values of a List or String. The `in` keyword is used to access elements of the variable. THe rest of the syntax is the same as a while or for loop. \n\n```c#\nnums := [4, 7, 3, 8, 1]\nforeach x in nums do\n    print(x)\nend\n```\n\n### Functions\n\nFunctions declaration syntax is more like Ruby than Python. However, instead of the `def` keyword, the `algorithm` keyword is used instead. Functions behave exactly the same way as in Python and can take parameters. Functions may return any single value using the `return` keyword. \n```ruby\nalgorithm main()\n    x := double(5)\n    print(x)\nend\n\nalgorithm double(x)\n    return 2 * x\nend\n```\n\nFunctions that do not return anything using the `return` will return a `null` value. \n```ruby\nalgorithm main()\n    x := hello()\n    print(x)\nend\n\nalgorithm hello()\n    print('hello')\nend\n```\n\nFunctions support recursion. Max recursion depth is the default in Python. \n```ruby\nalgorithm factorial(n)\n    if n \u003c= 0 then\n        return 1\n    else\n        return n * factorial(n - 1)\n    end\nend\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ff4str%2Fneetspeak","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ff4str%2Fneetspeak","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ff4str%2Fneetspeak/lists"}