Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release v0.1.0 #5

Open
7 of 11 tasks
Gashmob opened this issue Jul 25, 2024 · 0 comments
Open
7 of 11 tasks

Release v0.1.0 #5

Gashmob opened this issue Jul 25, 2024 · 0 comments
Labels
documentation Improvements or additions to documentation
Milestone

Comments

@Gashmob
Copy link
Member

Gashmob commented Jul 25, 2024

Variables + types + operations

This first release should allow user to use variables (and constants) and basic operations (aka arithmetic). The whole code is in one file considered as a main. So user can write very basic scripts.

Please note that IO and files operation are not available, so the produced script is pretty limited. The return value of the script will be the last expression.

Task splitting

Create a basic executable which takes a file path as argument. It can also take some options to set verbose level, output file name, etc.

Parser written with Antlr4, it instanciates an abstract syntax tree. The parser grammar will consist of a list of expression (variable declaration, binary operation, assignation, ...).

  • Visitor pattern

Best way to use the AST for next parts is visitor pattern. We need a visitor 'library' to travel 🚀 accross the structure easily. This pattern need to be generic as much as possible to be used in different purpose.

User code cannot be fully trusted as good, it can contains error and they should be catched. So the AST must be validated. Using the previously created visitor structure we can check the whole structure.

AST should be parsed to LLVM IR. Then this representation can be used to render an object file which can be linked (ld) and then executed.

Introduce new keyword to be able to new i32(25) for example.

  • Arrays

Array initialization [1, 2, 3] and array access my_array[0]

Reminder: it's pretty evident, but all code produced to complete these tasks MUST be fully tested.

Other tasks

Package to debian and rpm at least. If possible add a docker image and a nixpkg

@Gashmob Gashmob added the enhancement New feature or request label Jul 25, 2024
@Gashmob Gashmob added this to the v0.1.0 milestone Jul 25, 2024
@Gashmob Gashmob added documentation Improvements or additions to documentation and removed enhancement New feature or request labels Jul 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

1 participant