VintLang is a modern, expressive programming language designed for clarity and productivity. It combines familiar syntax with powerful features for building robust applications.
// If expressions - use if as both statement and expression
let status = if (user.isActive) { "Online" } else { "Offline" }
// Pattern matching with guards
match user.role {
"admin" => {
print("Full access granted")
}
"user" => {
print("Standard access")
}
_ => {
print("Guest access")
}
}
// Switch with variable binding
switch (response.status) {
case code if code >= 200 && code < 300 {
print("Success:", code)
}
default {
print("Error occurred")
}
}// For-in loops with arrays, strings, dictionaries
for item in items {
process(item)
}
for key, value in data {
print(key + ":", value)
}
// While loops with break/continue
while (condition) {
if (shouldSkip) {
continue
}
process()
}
// Repeat loops
repeat 5 {
print("Iteration:", i)
}// Arrays with built-in methods
let numbers = [1, 2, 3, 4, 5]
let doubled = map(numbers, func(x) { return x * 2 })
let evens = filter(numbers, func(x) { return x % 2 == 0 })
// Dictionaries
let config = {
"app": {"name": "myapp", "port": 8080},
"features": ["web", "logging"]
}// Static imports
import os
import json
import time
// Dynamic imports at runtime
let yaml = import("yaml")
let math = import("math")
// Custom packages
import my_package
my_package.doSomething()// Read and write files
let content = os.readFile("config.yaml")
os.writeFile("output.json", json.encode(data))
// Check file existence
if (os.fileExists("config.json")) {
// load config
}import os
import json
import time
// Dynamic imports
let yaml = import("yaml")
let math = import("math")
// Load or create configuration
let cfgStr = ""
if (os.fileExists("config.yaml")) {
cfgStr = os.readFile("config.yaml")
} else {
let defaultCfg = {
"app": {"name": "vint-app", "port": 8080},
"features": ["web", "logging"]
}
cfgStr = yaml.encode(defaultCfg)
os.writeFile("config.yaml", cfgStr)
}
let cfg = yaml.decode(cfgStr)
let pow = math.pow(2, 10)
let summary = {
"generated_at": time.format(time.now(), "2006-01-02T15:04:05"),
"app": yaml.get(cfg, "app.name"),
"value": pow
}
os.writeFile("summary.json", json.encode(summary))Run this example:
vint examples/comprehensive_showcase.vintFollow 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
curlcommand. This will download thetar.gzfile containing the binary to your current directory.curl -O -L https://github.com/vintlang/vintlang/releases/download/v0.2.0/vintLang_linux_amd64.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/binis a commonly used directory for this purpose. Thetarcommand will extract the contents of thetar.gzfile and place them in/usr/local/bin.sudo tar -C /usr/local/bin -xzvf vintLang_linux_amd64.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 <optional:project-name>
Note: Install the vintlang VSCode extension for language support (syntax highlighting, snippets, and tooling).
-
Download the Binary:
Begin by downloading the VintLang binary for macOS using the following
curlcommand. This will download thetar.gzfile for macOS to your current directory.curl -O -L https://github.com/vintlang/vintlang/releases/download/v0.2.0/vintLang_mac_amd64.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.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>
Note: Install the vintlang VSCode extension for language support (syntax highlighting, snippets, and tooling).
- Download the Binary using
curlfor 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
We welcome contributions to VintLang! Whether you're fixing bugs, adding features, or improving documentation, your help is appreciated.
Created by Tachera Sasi