Humal is a programming language with human-readable syntax that uses indentation (like Python) and compiles directly to JavaScript (supporting both ESM and CommonJS standards).
Humal does not add new semantics. It removes the punctuation you don't need:
no {}, no ;, no : after conditions. Everything else is JavaScript.
In Humal's basic syntax, the use of curly and round brackets is optional they can be included or omitted. However, a minimal amount of them is required when working with complex functions, specific methods, and library calls. Humal does not aim to replace JavaScript; instead, the language is designed to make the syntax cleaner, more elegant, and easier to read and understand.
In basic Humal syntax, square and round brackets are optional meaning they can be used or omitted. However, they are required to a minimal extent in complex functions, specific methods, and library calls. Humal does not aim to replace JavaScript; instead, it seeks to make the syntax cleaner, more elegant, and easier to read and understand.
No AST, no parser, no braces for blocks, no semicolons, no colons after control statements. String literals and comments are left untouched, so a keyword inside a string stays a string
The core idea is simple. Humal retains familiar JavaScript syntax but removes unnecessary punctuation and uses indentation to define code blocks, resulting in cleaner code that is easier to learn and understand.
Download the .vsix file, then in VS Code go to the Extensions view, click the three dots, select Install from VSIX..., and choose the downloaded .vsix file.
Install Humal globally:
npm install -g @qvelop444/humalYou can also install Humal locally in a project:
npm install --save-dev @qvelop444/humalCreate a new Humal project:
humal init my-app
cd my-app
npm installStart the development environment:
humal devThis creates a basic project structure:
my-app/
├── src/
│ └── main.hum
├── humal.config.json
├── package.json
└── .gitignore
Run a Humal file directly:
humal main.humUse CommonJS:
humal build main.hum --cjsUse ESM:
humal build main.hum --esmCheck your Humal project with TypeScript and ESLint:
humal checkBuild the project:
humal buildWatch Humal files for changes:
humal watchStart development mode with automatic rebuilding and restarting:
humal devFormat Humal files:
humal fmtWhen no module format is specified, Humal can detect the format from the source code.
print "Hello World!"let name = "Bob"
let age = 25
let city = "Warsaw"
print name
print age
print citylet a = 10
let b = 5
let sum = a + b
let difference = a - b
let product = a * b
let division = a / b
print sum
print difference
print product
print divisionlet years = 20
if years >= 18
print "Adult"
else
print "Underage"let score = 75
if score >= 90
print "Excellent"
elif score >= 70
print "Good"
elif score >= 50
print "Pass"
else
print "Fail"let i = 0
while i < 5
print i
i++let counter = 0
while true
if counter >= 5
break
print counter
counter++let numbers = [1, 2, 3, 4, 5]
for number in numbers
if number == 3
continue
print numberfn greet(name)
print "Hello " + name
greet("Bob")
greet("Alex")fn add(a, b)
return a + b
let result = add(10, 20)
print resultlet user = input "What is your name? "
print "Hello " + userlet user = { name: "Bob", age: 25 }
let { name, age } = user
print name
print agelet value = 2
switch value
case 1
print "one"
break
case 2
print "two"
break
default
print "other"let value = 2
switch value
case 1
case 2
case 3
print "one, two or three"
break
default
print "other"let value = 10
switch value
case 5 + 5
print "expression works"
break
default
print "no match"More code examples and full documentation can be found on the official website: https://humal.netlify.app
