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

branch Zig merge on main #97

Closed
wants to merge 4 commits into from
Closed

branch Zig merge on main #97

wants to merge 4 commits into from

Conversation

eliestroun14
Copy link
Collaborator

Description

merging the zig workshop on main

Changes include

  • Edited the REAME.md for more compliance with the new official workshop template

Checklist

  • I have assigned this PR to myself
  • I have added at least 1 reviewer
  • I have tested this code
  • I have added sufficient documentation in the code

@eliestroun14 eliestroun14 self-assigned this Aug 7, 2024
# Workshop 32 - Introduction to Zig

Welcome to this introductory workshop on Zig! Zig is a modern programming language that emphasizes robustness, performance and clarity. Today, you'll learn :
✔️ how to install Zig
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use a capital letter for all new sentences after the ✔️


Zig is a general-purpose programming language focused on robustness, performance, and simplicity. It offers manual memory management, safety features, built-in cross-compilation, and seamless C interoperability, making it ideal for system programming and high-performance applications.

### Prerequisites
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can remove the Prerequisites, it's not really useful. You can learn a new language even if you don't know C or other programming languages.

About the computer with internet access, if their are seeing this it means they are reading it with internet, they can also clone the repo but that's more rare 🤷🏻‍♂️

Instead you can see what was done for the rust workshop nb 13, they advised people to do the Tour of rust, you could do the same for Zig.


📌 Tasks:

create a file `main.zig` in a folder called `src` with your logic to print the "hello world"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Create instead of create.

You can add this, it makes the instructions more clear even if they are simple :) and if the architecture becomes harder to understand they can use it to see what changed from the beginning to the end.

src
└── main.zig


📚 Documentation:

> 💡 Zig file has `zig` extension.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's pretty obvious that it has the zig extension because you asked the user to create a main.zig file.

📚 Documentation:

> 💡 Zig file has `zig` extension.
> 💡 Now, that you have created a file `main.zig`, you can use other files. To use them in your `main.zig` you have to integrate the module ([read more](https://stackoverflow.com/questions/71186556/how-do-i-include-one-zig-file-from-another-zig-file))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rephrase "you can use other files", like witch type of files, json files, db files, ... When you write something you need to be very explicit even if you think that they will understand. You can say something like, now if you want to use the code that you wrote in another files you can use modueles and then add the link, try to add the more explicit senteces that you can.


When you compile and run palindrome.zig, the output should be:

```sh
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here you are printing "madam is palindrome: true", you should create an main function with the example so the user can understand how you test it even if it seems that the palindrome function returns a boolean and you print it then in the main function.


## Step 3 - Fibonacci sequence

> ❗ We strongly advise you to use the resources given for this exercise.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By the way you don't need to add this warning everytime, use it one time at the beginning.


📑 Description:

For the third exercise, you need to create a function that generates and displays the Fibonacci sequence up to a specified number of elements.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think there could be another exercice that the fibonacci? I don't think imlementing the Fibonacci sequence will use Zig features that are useful + this step has already been done in rust workshop, try to not copy the steps and only change the langage, people comming from the rust workshop will change a few keywords and they will finish the step, they learned nothing but just replace keywords from rurst to zig.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants