Follow the steps below to easily install VintLang on your Linux or macOS system.
-
Download the Binary:
First, download the VintLang binary for Linux. You can do this using the
curl
command. This will download thetar.gz
file containing the binary to your current directory.curl -O -L https://github.com/ekilie/vint-lang/releases/download/0.1.0_i/vintLang_linux_amd64_v0.1.0.tar.gz
-
Extract the Binary to a Global Location:
After downloading the binary, you need to extract it into a directory that is globally accessible.
/usr/local/bin
is a commonly used directory for this purpose. Thetar
command will extract the contents of thetar.gz
file and place them in/usr/local/bin
.sudo tar -C /usr/local/bin -xzvf vintLang_linux_amd64_v0.1.0.tar.gz
This step ensures that the VintLang command can be used from anywhere on your system.
-
Verify the Installation:
Once the extraction is complete, confirm that VintLang was installed successfully by checking its version. If the installation was successful, it will display the installed version of VintLang.
vint -v
-
Initialize a vint project:
Create a simple boilerplate vint project
vint init <optional:project-name>
-
Install the vintlang extension from vscode
Install the official vint language support extension int vscode called
vintlang
-
Download the Binary:
Begin by downloading the VintLang binary for macOS using the following
curl
command. This will download thetar.gz
file for macOS to your current directory.curl -O -L https://github.com/ekilie/vint-lang/releases/download/0.1.0_i/vintLang_mac_amd64_v0.1.0.tar.gz
-
Extract the Binary to a Global Location:
Next, extract the downloaded binary to a globally accessible location. As with Linux, the standard directory for this on macOS is
/usr/local/bin
. Use the following command to extract the binary:sudo tar -C /usr/local/bin -xzvf vintLang_mac_amd64_v0.1.0.tar.gz
This allows you to run VintLang from any terminal window.
-
Verify the Installation:
To check that the installation was successful, run the following command. It will output the version of VintLang that was installed:
vint -v
-
Initialize a vint project:
Create a simple boilerplate vint project
vint init <optional:project-name>
-
Install the vintlang extension from vscode
Install the official vint language support extension int vscode called
vintlang
- Download the Binary using
curl
for your system (Linux or macOS). - Extract the Binary to
/usr/local/bin
(or another globally accessible directory). - Verify the Installation by checking the version with
vint -v
. - Initialize a vintlang project by running
vint init <projectname>
. - Install the vintlang extension from vscode install vintlang extension in vscode
// Importing modules
import net // Importing networking module for HTTP operations
import time // Importing time module to work with date and time
// Main logic to split and print characters of a string
let name = "VintLang"
s = name.split("")
for i in s {
print(i)
}
// Demonstrating type conversion and conditional statements
age = "10"
convert(age, "INTEGER") // Convert age string to integer
print(type(age)) // Uncomment to check the type of ageInInt
// Conditional statements to compare the age variable
if (age == 20) {
print(age)
} else if (age == 10) {
print("Age is " + age)
} else {
print((age == "20"))
}
// Working with height variable
height = "6.0" // Height in feet
print("My name is " + name)
// Define a function to print details
let printDetails = func(name, age, height) {
print("My name is " + name + ", I am " + age + " years old, and my height is " + height + " feet.")
}
// Calling the printDetails function with initial values
printDetails(name, age, height)
// Update height and call the function again
height = "7"
printDetails(name, age, height)
// Print the current timestamp
print(time.now())
// Function to greet a user based on the time of the day
let greet = func(nameParam) {
let currentTime = time.now() // Get the current time
print(currentTime) // Print the current time
if (true) { // Placeholder condition, modify for actual logic
print("Good morning, " + nameParam + "!")
} else {
print("Good evening, " + nameParam + "!")
}
}
// Time-related operations
year = 2024
print("Is", year, "Leap year:", time.isLeapYear(year))
print(time.format(time.now(), "02-01-2006 15:04:05"))
print(time.add(time.now(), "1h"))
print(time.subtract(time.now(), "2h30m45s"))
// Call the greet function with a sample name
greet("John")
// Example of a GET request using the net module
let res = net.get("https://tachera.com")
print(res)
// Built-in functions
print(type(123)) // Print the type of an integer
let a = "123" // Initialize a string variable
convert(a, "INTEGER") // Convert the string to an integer
type(a)
print(a) // Check the type of the variable
print("Hello", "World") // Print multiple values
write("Hello World") // Write a string (useful in returning output)
Once you have the sample code files saved, you can run them using the following command:
vint <filename>.vint
Replace <filename>
with the actual name of the file you want to run (e.g., hello.vint
, fibonacci.vint
, etc.).