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

Implement the base #25

Closed
21 tasks done
thi8v opened this issue Jun 4, 2023 · 2 comments · Fixed by #58
Closed
21 tasks done

Implement the base #25

thi8v opened this issue Jun 4, 2023 · 2 comments · Fixed by #58
Labels
A-Lang Area: related to the overall Language, his syntax, grammar etc documentation Improvements or additions to documentation enhancement New feature or request
Milestone

Comments

@thi8v
Copy link
Member

thi8v commented Jun 4, 2023

Here is the list of things related to the language, that is needed to be implemented for the v0.1.0 milestone. And with there own RFC, -> #22

  • Function definition, declaration, and call #40
    • return statement
  • var and const #41
  • operators + unary expression -> Tracking Issue for Operators #47
  • control flow
    • if / else if / else
  • loops
    • for loop -> not sure what they will be, an issue will be created when i know
    • while loop
    • loop loop -> use less, it just add a new keyword, use while (true) { .. } instead.
    • continue statement -> expression
    • break statement -> expression
  • comments -> Add support for comments #14
  • primitive types -> Type checker and type inference  #10
  • remake blocks, no more 'automatically' returned expr, and the semicolon necessary : move sc parsing in stmts and make them optional for some expression instead of forbidden and make list expr { expr, expr, expr, ... }
  • defer statements -> will be done in another version. Their is things more important for now
  • remake call expression -> from $ident(...) to $expr(...).
  • .* deref operator and right unary operation
  • member access expr a.b
  • string expr literal
  • char expr literal
@thi8v thi8v added documentation Improvements or additions to documentation enhancement New feature or request A-Lang Area: related to the overall Language, his syntax, grammar etc labels Jun 4, 2023
@thi8v thi8v added this to the 0.1.0 milestone Jun 4, 2023
@thi8v
Copy link
Member Author

thi8v commented Jul 15, 2023

For the code generation and compilation (LLVM related crates), in the Zom compiler. We could replace it with the C++ library, because it's the official way to use LLVM, there is some issues in this project that is related to LLVM not working : #24, #20, #23, #21. If we replace it with an a C++ package, we could just follow the doc and not wasting its time to found the function in Inkwell, etc ..

Pros

Cons

  • Safety, C++ is safer than C but C++ is not safe as Rust is.
  • Some layer between Rust and C++ is needed, you can find some solution below,

Solution N°1

Write a serializer that serialize the result of the type checking (or the end of the compilation pipeline that doesn't need LLVM). And the C++ program will be executed in a child process, with the serialized input, and we deserialize and return the output desired by the compiler.

Solution N°2

Write a C++ lib that uses LLVM and emit the desired output by the compiler, and his functions is called by the the Zom compiler with the Rust FFI to C++.

@thi8v thi8v mentioned this issue Jul 26, 2023
@thi8v thi8v linked a pull request Feb 22, 2024 that will close this issue
46 tasks
@thi8v
Copy link
Member Author

thi8v commented Mar 1, 2024

Done.

@thi8v thi8v closed this as completed Mar 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Lang Area: related to the overall Language, his syntax, grammar etc documentation Improvements or additions to documentation enhancement New feature or request
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant