Harneet Programming Language - Beginner's Guide
Welcome to Harneet! This guide will teach you everything you need to know about the Harneet programming language, designed especially for newcomers to programming. Inspired by Go and some Python.
What is Harneet?
Harneet is a simple, easy-to-learn programming language that's perfect for beginners. It has clean syntax inspired by Go and includes essential programming concepts like variables, arithmetic, and decision-making.
Think of Harneet as a friendly way to learn programming fundamentals before moving on to more complex languages.
Note: Harneet is actively evolving, and some features common in other languages may not yet be available. It is not intended for production use.
Getting Started
Installation & Running Programs
-
Build Harneet (one-time setup):
-
Try the interactive mode (REPL):
-
Run a program file:
Example 1: Your First Program
Let's start with the classic "Hello, World!" program:
What this does: - import fmt loads the formatting module (needed for printing) - fmt.Println() is a command that prints text to the screen - The text inside quotes "Hello, World!" is what gets printed - Every statement in Harneet can be on its own line
Try it yourself: 1. Save this code in a file called hello.ha 2. Run it with: ./harneet hello.ha
Example 2: Simple Calculator
| Simple Calculator | |
|---|---|
Example 3: Grade Checker
Example 4: Multiline Strings
Getting Help
- Run examples:
just testruns all example programs - Try interactive mode:
just replfor experimenting - Browse the documentation: Use the left navigation to explore topics
- Practice: The
examples/folder has more programs to study
Congratulations!
You now know the basics of the Harneet programming language! That said, there are still more things to learn. We encourage you to go through the remaining of this document, to know more Harneet Programming language. Remember: - Programming is like learning a new language - it takes practice - Every expert was once a beginner - The most important thing is to keep experimenting and having fun!
Happy coding! 🚀