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

Refactor [book chapter Example: Building a hello world program ] #865

Open
abroooo opened this issue May 31, 2023 · 0 comments
Open

Refactor [book chapter Example: Building a hello world program ] #865

abroooo opened this issue May 31, 2023 · 0 comments
Labels
documentation Improvements or additions to documentation refactor internal change, cleanup, code-style-improvement

Comments

@abroooo
Copy link
Contributor

abroooo commented May 31, 2023

Is your refactor request related to a problem? Please describe.
Not a code refactor but documentation. I recently stumbled across the naming of the entrypoint function. It needs to be called main (unless explicitly set to sth else) and it needs to be a FUNCTION to be a stand-alone application. Using a PROGRAM might seemingly work but will end in weird segfaults.

Describe the solution you'd like
Maybe just mention why it needs to be called main and that the type needs to be FUNCTION.

Additional context

We want to print something to the terminal, so we're going to declare external functions for that.
This example is available under `examples/hello_world.st` in the main RuSTy repository.
- `main` is our entry point to the program.
- To link the program, we are going to use the system's linker using the `--linker=cc` argument.
- On windows, replace this with --linker=clang as cc is usually not available.

@abroooo abroooo added the refactor internal change, cleanup, code-style-improvement label May 31, 2023
@volsa volsa added the documentation Improvements or additions to documentation label Sep 5, 2023
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 refactor internal change, cleanup, code-style-improvement
Projects
None yet
Development

No branches or pull requests

2 participants