- still under development
- Welcome to Wolf-C, a lightweight compiler with a syntax inspired by Python and C.
- Run
make
to create a Docker container. - Use
docker ps
to find the container ID of the running project. - Access the container using the command:
docker exec -it wcc bash
- modify file.w inside the code directory.
- Run the build command to compile your file:
wcc file.w
- Print Something:
main():
chars str = "user"
output("Hello, world! from ", user, "\n")
- Variables and Data Types:
main():
chars name = "Alice" // string
int age = 25 // integer
float height = 5.6 // float
bool is_student = True // boolean
output(name, age, height, is_student)
- If Statements:
main():
int age = 18
if age >= 18: output("You're an adult!\n")
else: output("You're a minor.\n")
- Loops:
main():
int count = 0
while count < 3:
output("Counting:", count, "\n")
count += 1
- Functions:
func int greet(chars name):
output("Hello, ", name, "\n")
return 42
main():
greet("Alice")
- Structs:
struct Person:
chars name
int age
main():
Person user
user.name = "mohammed"
user.age = 27
- import files:
use config // will import ./config.w
use :config // will import /config.w
usr :src:config // will import /src/config