PitchHut logo
Streamlined backend automation and scripting in a lightweight language.
Pitch

B.A.S.E. (Backend Automation & Scripting Environment) is a minimalistic programming language designed for backend development. Built with Go, it compiles to a single binary, encapsulating everything needed to run HTTP servers, interact with databases, and automate tasks without the hassle of dependencies.

Description

B.A.S.E. (Backend Automation & Scripting Environment) is an innovative, lightweight programming language designed specifically for backend development and server-side scripting, built using Go. This standalone language compiles into a single, efficient binary of just 22MB, eliminating the need for additional dependencies such as npm or pip. With B.A.S.E., developers can effortlessly create HTTP servers, access databases, and automate tasks without complex setup procedures.

Key Features

Easy to Use

B.A.S.E. provides a straightforward REPL to quickly test ideas or run scripts. Start exploring by simply entering:

base

You can also execute scripts directly:

base my_script.base

Comprehensive Standard Library

With a rich standard library, B.A.S.E. streamlines backend development:

Web Server

Easily set up an HTTP server or serve static files:

// Serve files on port 8080
server.static(8080, "./public")

// Define a custom API route
server.listen(3000, "/api", function(req, res) {
    if req.method == "GET" {
        res.send(200, {"message": "Server is running"})
    }
})

HTTP Client

Efficiently communicate with other APIs while handling custom headers, timeouts, and retries:

let data = http.get("https://api.example.com/data", {
    "headers": {"Authorization": "Bearer token123"},
    "timeout": 5,
    "retries": 3
})

Database Support

Connect naturally with databases such as SQLite, MySQL, PostgreSQL, or MongoDB:

db.connect("main", "sqlite", "./data.db")
db.exec("main", "CREATE TABLE users (name TEXT)")
db.insert("main", "users", {"name": "Igor"})

let users = db.query("main", "SELECT * FROM users")

Notifications

Send alerts through Discord or email with simple commands:

// Discord webhook notification
notify.discord("https://discord.com/api/webhooks/...", "Server deployment finished!")

// Email notification
notify.email("smtp.gmail.com", "587", "you@gmail.com", "password", "target@email.com", "Alert", "Server is down!")

Background Tasks

Run tasks concurrently with ease, supported by a built-in auto keep-alive system:

let results = chan()

spawn function() {
    let ping = http.ping("https://google.com")
    results.send(ping)
}()

wait_all()
print(results.read_all())

Schedule Tasks

Automate routine functions using cron jobs:

schedule("0 * * * *", function() {
    log("Running hourly task", "INFO")
})

Syntax Similar to JavaScript and C

B.A.S.E. features an intuitive syntax that resembles JavaScript and C, making it accessible for many developers:

let username = "Igor"
let active = true
if active {
    print("Welcome " + username)
}

For a complete reference on built-in functions and modules, execute base help for an overview of the capabilities across HTTP, database interactions, file handling, cryptography, and more.

Contact Information: For any inquiries or support, reach out at igor@igorkalen.dev.

Contributions: Developers interested in enhancing B.A.S.E. can clone the repository, make adjustments, and submit pull requests following the established contribution guidelines in the README.

0 comments

No comments yet.

Sign in to be the first to comment.