{"id":13804251,"url":"https://github.com/fermarsan/aixt","last_synced_at":"2025-05-13T17:32:00.129Z","repository":{"id":211664552,"uuid":"729683629","full_name":"fermarsan/aixt","owner":"fermarsan","description":"Microcontrollers programming framework based on Vlang.","archived":false,"fork":false,"pushed_at":"2025-05-06T02:15:38.000Z","size":155570,"stargazers_count":74,"open_issues_count":0,"forks_count":44,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-05-06T02:28:26.346Z","etag":null,"topics":["compiled-language","microcontrollers","programming-language","transcompiler","transpiler","v-like","v-programming-language","vlang"],"latest_commit_sha":null,"homepage":"","language":"V","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/fermarsan.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","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,"zenodo":null}},"created_at":"2023-12-10T02:20:35.000Z","updated_at":"2025-05-06T02:15:42.000Z","dependencies_parsed_at":"2025-04-27T15:38:21.227Z","dependency_job_id":null,"html_url":"https://github.com/fermarsan/aixt","commit_stats":null,"previous_names":["fermarsan/aixt"],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fermarsan%2Faixt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fermarsan%2Faixt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fermarsan%2Faixt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fermarsan%2Faixt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fermarsan","download_url":"https://codeload.github.com/fermarsan/aixt/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253993124,"owners_count":21996239,"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":["compiled-language","microcontrollers","programming-language","transcompiler","transpiler","v-like","v-programming-language","vlang"],"created_at":"2024-08-04T01:00:44.516Z","updated_at":"2025-05-13T17:31:55.115Z","avatar_url":"https://github.com/fermarsan.png","language":"V","funding_links":[],"categories":["Applications"],"sub_categories":["Interpreters/Compilers"],"readme":"\u003cdiv align=\"center\"\u003e\n\u003cimg src=\"assets/text-logo-sh.png\" width=\"24%\" height=\"24%\"\u003e\n\u003ch1\u003eV-based Programming Framework for Microcontrollers\u003c/h1\u003e\n\u003c/div\u003e\n\nAixt is a programming framework for microcontrollers which implements a subset of the [_V_](https://vlang.io/) programming language, and is able to be used by low-resource devices. Aixt is composed by 3 main components:\n\n- The **Aixt's V** programming language which is a subset of the original [_V language_](https://vlang.io/).\n- The **V to C Transpiler**, which translate the **V** source code to _C_, for the specific _C_ compiler of each microcontroller.\n- The **Aixt API** (almost all written in V), which makes the programming easy by standardizing the setup and I/O functions.\n\nThis diagram shows the Aixt blocks and their interactions:\n\n```mermaid\nstateDiagram-v2\n\n    Aixt: V\n    state Aixt {\n        source: Source code\n\n        API: Microcontroller API\n        state API {\n            PICs: PIC\n            ATM: AT\n            ESP\n            RP2040\n            PSoC\n            others2: ...\n            NXT: NXT brick\n        }\n    }\n\n\n\n    Aixt2C: Transpiler\n    state Aixt2C {\n        state V {\n            Transpiler: Transpiler\n        }\n\n        state json {\n            setup: Setup files\n        }\n    }\n\n    C: C\n    state C {\n        Tr_Code: Transpiled code\n    }\n\n    state Compiler {\n        XC8\n        XC16\n        Arduino\n        GCC\n        others: ...\n        nbc: nbc (NXC)\n    }\n\n    state machine {\n        BF: Binary file\n    }\n\n    source --\u003e Aixt2C\n    API --\u003e Aixt2C\n    Aixt2C --\u003e C\n    C --\u003e Compiler\n    Compiler --\u003e machine\n```\n\nAixt is designed to be as modular as possible to facilitate the incorporation of new devices and boards. This is mainly possible by using a configuration files (in _json_ format) instead of creating new source code for each new device. That `.json` file contains the specific parameters of each device, board or compiler such as: variable types, initialization commands, compiler paths, etc.\n\n\n## Aixt to C Transpiler\n\nThe transpiler is written in [_V_](https://vlang.io/) and uses the _V's_ self native compiler in order to transpile from _V_ to _C_. This is implemented in the folder `src\\` and the main source code is the `src\\aixt.v` file. **Aixt** generates code for 3 different backends:\n- **c**: for the microcontroller native C compiler\n- **nxc**: for the NXC compiler (LEGO Mindstorms NXT)\n- **arduino**: for the Arduino CLI\n\n\n## Aixt's V Language\n\n**Aixt's V** programing language implements a subset of the [_V language_](https://vlang.io/). The main differences are show as follows:\n\nfeature               | V                                 | Aixt's V\n----------------------|-----------------------------------|----------------------------------------------------------------------\nstrings               | dynamic-sized                     | fixed-sized and dynamic-sized if supported\narrays                | dynamic-sized                     | fixed-sized and dynamic-sized if supported\ndefault integers size | 32 bits                           | depends on the device\nstructs               | allow functions (object-oriented) | do not allow functions (only structured programming)\nfunctions             | multiple return values            | only one return value\ntext macros           | not allowed                       | allowed by using '@[as_macro]' attribute, for functions and constants\n`C` variables access  | not allowed                       | allowed by using 'C.var_name' syntax\n\n\n### Example with `main` function\n\n```v\n/* Turning ON by 5.5 seconds the B7 on a\nPIC16F84A microcontroller (XC8 compiler) */\nimport time\nimport pin\n\nfn main() {\n    pin.setup(pin.b7, pin.output)\n\n    pin.high(pin.b7)    //turn ON the LED on PORTB7\n    time.sleep_ms(5500)\n    pin.low(pin.b7)\n}\n```\n\n### Example without `main` function (Script mode)\n\n```v\n// ADC value to serial port on Raspberry Pi Pico (Arduino backend)\nimport time\nimport uart\nimport adc\n\nuart.setup(9600)    // baud rate\nadc.setup(12)       // resolution\n\nfor { // infinite loop\n\tanalog := adc.read(adc0)\n\tuart.println('ADC channel 0: ${analog}') // use string interpolation\n\ttime.sleep_ms(500)\n}\n```\n\n## Aixt API\n\nThe **Aixt API** is inspired by _Micropython_, _Arduino_ and _Tinygo_. The API for all the ports includes at least functions for:\n\n- Digital input/output\n- Analog inputs (ADC)\n- PWM outputs\n- Serial port (UART)\n\n## Using Aixt\n\n### Installing Aixt from source\n```\ngit clone https://github.com/fermarsan/aixt.git\ncd aixt\nmake # make.bat on Windows\n```\n\n### Running Aixt\nrun it in a Linux-based system as:\n```\n./aixt \u003ccommand\u003e \u003cdevice_or_board\u003e \u003csource_file\u003e\n```\nor in Windows:\n```\naixt.exe \u003ccommand\u003e \u003cdevice_or_board\u003e \u003csource_file\u003e\n```\n\n### Generating a Symbolic Link\nFor running the command `aixt` from any folder in the file system you can create a symbolic link of it in this way:\n\nrun it in a Linux-based system as:\n```\n./aixt symlink\n```\nor in Windows:\n```\naixt.exe symlink\n```\n\n### Running examples:\n\n```\n./aixt -t Emulator test.v\n```\n```\n./aixt -b NXT ports/NXT/projects/1_motor_forward.v\n```\n\n## Project's name\n\nThe project's name is inspired in _Veasel_, the Weasel pet of _V Language_, and at the same time is a tribute to _Ticuna_ people who live in the Amazon forest between the borders of _Colombia_, _Brasil_ and _Perú_. Weasels are _mustelids_ just like otters, so the name **Aixt** comes from _Aixtü_, which is a way to say otter in [_Ticuna_](https://www.sil.org/system/files/reapdata/90/20/51/90205190508691852389084667097660892450/tca_Ticuna_Dictionary_2016_web.pdf) language.\n\n## Have questions?\n\nNice, you can contact me via mail.\n\nEmail: fmartinezsanta@gmail.com\n\u003c!-- Discord : https://discord.gg/--\u003e\n\n## Want to contribute?\n\nCool, go ahead and make the contributions you want, then submit a new pull request\n\nThe microcontroller or board that you use is not listed [here](docs/Devices%20and%20Boards.md) and you know how to program it in C?... You can easily add it to Aixt, please check [CONTRIBUTING.md](CONTRIBUTING.md).\n\nTake a look at [TODO.md](TODO.md) to find a task for you.\n\nPlease check [CONTRIBUTING.md](CONTRIBUTING.md) to learn how you can contribute.\n\n\n\n# License\n\nThe Aixt project is licensed under the [MIT](LICENSE), which is attached in this repository.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffermarsan%2Faixt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffermarsan%2Faixt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffermarsan%2Faixt/lists"}