{"id":20112008,"url":"https://github.com/vexcited/frr","last_synced_at":"2025-07-30T19:35:42.130Z","repository":{"id":211796092,"uuid":"702247146","full_name":"Vexcited/frr","owner":"Vexcited","description":"A bytecode interpreter for French pseudocode, specifications are from the lessons I had at the IUT of Limoges.","archived":false,"fork":false,"pushed_at":"2024-03-17T15:49:19.000Z","size":24,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-04-13T16:13:49.711Z","etag":null,"topics":["french","interpreter","language","pseudocode","pseudocode-interpreter","school","zig"],"latest_commit_sha":null,"homepage":"","language":"Zig","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Vexcited.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":null,"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},"funding":{"github":"Vexcited","liberapay":"Vexcited"}},"created_at":"2023-10-08T23:10:28.000Z","updated_at":"2024-04-14T17:54:17.818Z","dependencies_parsed_at":null,"dependency_job_id":"d1d2e797-c357-45dd-9345-865182b4626d","html_url":"https://github.com/Vexcited/frr","commit_stats":null,"previous_names":["vexcited/frr"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vexcited%2Ffrr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vexcited%2Ffrr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vexcited%2Ffrr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vexcited%2Ffrr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Vexcited","download_url":"https://codeload.github.com/Vexcited/frr/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241556495,"owners_count":19981874,"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","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":["french","interpreter","language","pseudocode","pseudocode-interpreter","school","zig"],"created_at":"2024-11-13T18:18:33.582Z","updated_at":"2025-03-02T18:41:25.023Z","avatar_url":"https://github.com/Vexcited.png","language":"Zig","funding_links":["https://github.com/sponsors/Vexcited","https://liberapay.com/Vexcited"],"categories":[],"sub_categories":[],"readme":"# `frr`\n\n\u003e `frr` stands for **FR**ench interprete**R**.\n\n## Install\n\n### Windows\n\n\u003c!-- #### Automated\n\nYou can also use the automated script to download the latest build and add it to your PATH.\n\nSimply open a PowerShell terminal and run the following command:\n\n```ps1\niwr -useb https://raw.githubusercontent.com/Vexcited/frr/main/scripts/install.ps1 | iex\n``` --\u003e\n\n\u003c!-- #### Manual\n\nYou can download the latest build from GitHub Actions. It's a `.zip` file containing the `.exe` binary. Just add it to your PATH.\n\n[Download the latest build](https://nightly.link/Vexcited/frr/workflows/binary/main/windows-latest.zip) --\u003e\n\nNo binary is released for now, please see the [BUILD](#build) section below.\n\n### Linux and macOS\n\n\u003c!-- #### Automated\n\nYou can also use the automated script to download the latest build and add it to your PATH.\n\nSimply open a terminal and run the following command:\n\n```sh\ncurl -fsSL https://raw.githubusercontent.com/Vexcited/frr/main/scripts/install.sh | sh\n```\n\n#### Manual\n\nYou can download the latest build from GitHub Actions. It's a `.zip` file containing the binary as `frr-unix`.\nJust add it to your PATH.\n\n- [Linux latest build](https://nightly.link/Vexcited/frr/workflows/binary/main/ubuntu-latest.zip)\n- [macOS latest build](https://nightly.link/Vexcited/frr/workflows/binary/main/macos-latest.zip) --\u003e\n\nNo binary is released for now, please see the [BUILD](#build) section below.\n\n## Usage\n\nRunning `frr` will give you the usage instructions.\n\n```console\n$ frr\nUtilisation: frr \u003cdestination/fichier/script.fr\u003e\n```\n\nYou can find examples in the [`examples`](./examples) directory.\n\n## Documentation\n\nSince this language is based on pseudocode, and pseudocode doesn't have any specification, we have to make sure we all use the same syntax.\n\nHere, I used the syntax my school uses but yours may be different. If it slightly differs (like a builtin function name is named differently) you can [open an issue](https://github.com/Vexcited/frr/issues) and explain what's different to help me implement aliases.\n\nLet's start with a summary of the syntax. When it's checked in front of it means it's implemented.\n\n- [ ] [Comments](#comments)\n- [ ] [Variable types](#variable-types)\n- [ ] [Variable declaration](#variable-declaration)\n- [ ] [Built-in functions](#built-in-functions)\n  - [ ] [afficher](#afficher)\n  - [ ] [saisir](#saisir)\n\n### Comments\n\nTo write a comment, use the `#` character.\nIt'll make the rest of the line a comment.\n\n```fr\n# This is a comment.\nafficher \"Hello World\" # This is also a comment.\n```\n\nThis is the only way to make a comment.\nThere's no way to make a comment like `/* ... */`.\n\nSo multi-line comments should be written like this:\n\n```fr\n# Start to write your comment on a line\n# then start a write another comment\n# to continue your comment.\n```\n\n### Variable types\n\nWhen you define a variable, you have to define its type. Here are the available types.\n\nThose types are **case sensitive**, so always in lowercase.\n\n| Type                       | Alias in C (or Python) |\n| -------------------------- | ---------------------- |\n| `entier`                   | `int`                  |\n| `réel`                     | `float`                |\n| `caractère` (alias: `car`) | `char`                 |\n| `chaîne`                   | `str` in Python        |\n| `booléen`                  | `bool` in Python       |\n\n### Variable declaration\n\nWhen you're writing a function, a procedure or a program you **must** declare any variable you're going to use.\n\nThis is happening right after the `début` keyword. To initiate a \"variable declaration block\" using the `avec` keyword.\n\n```fr\nprogramme Déclarations\ndébut\n  # You can declare a variable on the same line as `avec`.\n  avec in_line: entier\n    a : entier\n    # By the way, spacing is not important.\n    b : réel\n    # And indentation is not important either.\n      c : chaîne # Works\nd : chaîne # Also works\n    e : booléen\n    f, g, h : caractère # You can also declare multiple variables on the same line.\n    # Same as above -\u003e f, g, h : car \nfin Déclarations\n```\n\n**Note that if you're not using any variable in your program, you don't need to declare any.** And so, you don't need to use the `avec` keyword and you can just start writing your code.\n\n### Built-in functions\n\n#### `afficher`\n\nTo print something in the console, use the `afficher` keyword.\n\nNote that **there's no newline at the end of the printed text**.\nSo if you want to print a newline, you have to do it manually.\n\n```fr\n# This is the \"official\" way to do it.\nafficher \"Hello, World!\\n\"\n\n# Otherwise, those also work.\nafficher(\"Hello, World!\")\nafficher (\"Hello, World!\")\n```\n\nYou can pass multiple arguments to `afficher`.\nEach argument will be printed with a space between them.\n\n```fr\nafficher \"Hello\", \"World!\" # \u003e\u003e\u003e Hello World!\n```\n\nYou can also pass variables, expressions.\n\n```fr\nusername \u003c- \"Vexcited\"\nafficher \"Hello \" + username # \u003e\u003e\u003e Hello Vexcited\nafficher \"Réponse:\", 21 * 2  # \u003e\u003e\u003e Réponse: 42\n```\n\nPassing a boolean will print `vrai` or `faux`.\n\n```fr\nafficher vrai # \u003e\u003e\u003e vrai\nafficher faux # \u003e\u003e\u003e faux\n\n# So you can print conditions like this:\nafficher \"Yes ?\", vrai = vrai # \u003e\u003e\u003e Yes ? vrai \n```\n\n#### `saisir`\n\nTo get user input, use the `saisir` keyword.\n\n```fr\navec username : chaîne\nsaisir username\n```\n\n`saisir` will **always cast the input to the type of the variable you're assigning it to**.\nIf the input can't be casted to the type of the variable, the interpreter will throw an error.\n\n```fr\navec age : entier\nsaisir age\n# If you enter \"21\", `age` will be equal to 21.\n# If you enter \"21.5\", `age` will be equal to 21.\n# If you enter \"Hello\", the interpreter will throw an error.\n```\n\n```fr\navec x : réel\nsaisir x\n# If you enter \"21\", `x` will be equal to 21.0.\n# If you enter \"21.5\", `x` will be equal to 21.5.\n# If you enter \"Hello\", the interpreter will throw an error.\n```\n\n## Build\n\n`frr` is made with [Zig](https://ziglang.org/). \\\nThe version of Zig used in this project is `0.12.0-dev.2858+7230b68b3`.\n\n```bash\n# Clone the project if not already done.\ngit clone https://github.com/Vexcited/frr\ncd frr\n\n# Build and run the binary directly.\nzig build run -- ./examples/hello-world.fr\n\n# Or you can simply build...\nzig build\n# ...then execute the binary manually.\n./zig-out/bin/frr ./examples/hello-world.fs\n```\n\n## Resources\n\n- [Build a simple interpreter](https://ruslanspivak.com/lsbasi-part1/) : `frr` was written in TypeScript before using this guide as reference to understand how a language is made using AST ;\n- [Crafting Interpreters](https://craftinginterpreters.com/chunks-of-bytecode.html) : a guide I used as reference to build the current version of `frr` where I learned how bytecode interpreters were made ;\n- [`jwmerrill/zig-lox`](https://github.com/jwmerrill/zig-lox): an implementation of the Lox programming language (from Crafting Interpreters) in Zig. Very helpful to use as reference since I am learning Zig at the same time as writing this language ;\n- [Algorithm Lessons from `cril.univ-artois.fr`](http://www.cril.univ-artois.fr/~koriche/Algorithmique-2012-Partie7.pdf) to know a bit more about how other universities are understanding pseudocode in their lessons.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvexcited%2Ffrr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvexcited%2Ffrr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvexcited%2Ffrr/lists"}