ware

version 4.0

a clean, readable scripting language with built-in GUI support. write less, do more — ware reads like plain english and runs on python.

readable syntax built-in GUI python runtime VS Code extension 35+ snippets
hello.ware
// a taste of ware function greet which has name, greeting = "Hello", show f"{greeting}, {name}!" . name is "skyware" version is 4.0 greet(name) greet("world", "hey") // lists work naturally langs is ["ware", "python", "shell"] for each lang in langs, show f" - {lang}" . // error handling try, result is number("oops") catch err, show f"caught: {err}" .
language reference

syntax overview

variables & constantsware
name is "Alice" age is 25 active is true nothing_val is nothing constant PI is 3.14159 constant APP is "ware"
control flowware
if score is bigger than 90, show "A grade" else, show "try again" . while count is smaller than 5, show f"count: {count}" count is count + 1 .
loopsware
// counted range during i, range(10), show f"{i} squared = {i * i}" . // for each fruits is ["apple", "banana"] for each fruit in fruits, show f" - {fruit}" .
functionsware
function greet which has name, msg = "Hello", show f"{msg}, {name}!" . // multiple return values function min_max which has nums, return min_of(nums), max_of(nums) . lo, hi is min_max([3, 1, 9, 4])
classesware
class Animal, function init which has name, sound, self.name is name self.sound is sound . function speak which has, show f"{self.name} says {self.sound}!" . . dog is new Animal("Rex", "woof") dog.speak()
errors & file i/oware
try, result is number("not a number") catch err, show f"caught: {err}" . // file i/o open "data.txt" as content show content write("out.txt", "hello!\n") append("log.txt", f"entry: {msg}\n")
closures & dictionariesware
function make_counter which has start, count is start function increment which has by = 1, count is count + by return count . return increment . c is make_counter(0) show c() // 1 show c(5) // 6
scores is {"Alice": 95, "Bob": 78} for each name in scores, show f"{name}: {scores[name]}" . show has_key(scores, "Alice") show keys(scores) show values(scores) // import other files import "utils.ware"
standard library

built-in functions

functiondescription
sqrt(x)square root
abs(x)absolute value
round(x, n)round to n decimal places
floor(x) / ceil(x)floor / ceiling
power(x, n)x to the power n
log(x) / sin(x) / cos(x)logarithm / trig functions
clamp(x, min, max)constrain value to range
random()random float between 0 and 1
random_int(a, b)random integer between a and b
to_fixed(x, n)format number to n decimal places
to_hex(x) / to_bin(x)convert to hex or binary string
functiondescription
length(s)character count
upper(s) / lower(s)case conversion
trim(s)remove surrounding whitespace
strip_chars(s, chars)remove specific edge characters
replace(s, old, new)replace substring
contains(s, sub)true if substring present
starts(s, prefix)starts with test
ends(s, suffix)ends with test
find(s, sub)position of substring (1-based, 0 if not found)
count(s, sub)count occurrences of substring
slice(s, start, end)extract substring (1-based)
char_at(s, i)character at position (1-based)
repeat(s, n)repeat string n times
pad_left(s, n, c) / pad_right(s, n, c)pad string to width n with char c
split(s, delim)split into list
join(list, sep)join list into string
words(s) / lines(s)split on whitespace / newlines
to_chars(s)explode into character list
number(s) / text(x)parse string to number / any value to string
functiondescription
is_empty(s)true if length 0
is_upper(s) / is_lower(s)case check
is_numeric(s)true if string is a valid number
is_alpha(s)true if only letters
functiondescription
size(x)length of list, string, or dict
first(list) / last(list)first / last element
reverse(list)reversed copy
sort(list)sorted copy
remove(list, i)remove element at index i (1-based)
has(list, item)true if item in list
index_of(list, item)position (1-based, 0 if not found)
unique(list)deduplicated copy
flatten(list)flatten one level
sum_list(list)sum of numeric list
max_of(list) / min_of(list)maximum / minimum value
any_true(list) / all_true(list)boolean aggregation
count_in(list, item)count occurrences of item
functiondescription
keys(dict)list of keys
values(dict)list of values
has_key(dict, key)true if key exists
functiondescription
type_of(x)returns "text", "number", "list", "dict", "bool", "object", or "nothing"
is_text(x) / is_number(x)type predicates
is_list(x) / is_dict(x)type predicates
is_bool(x)boolean type check
graphical interface

built-in GUI

all GUI apps start with make window. widgets are added top-to-bottom. use make row for horizontal layout. read widget values using the variable name directly.

⌨️
input widgets
textbox, password, number input, multiline, checkbox, slider, dropdown, color picker
make textbox myVar
📊
display widgets
label, progress bar, status, badge (info/ok/warn/err), listbox, table, image
make badge myVar, "ok", "ok"
📐
layout
row, column, separator, spacer — compose complex layouts with simple nesting
make row, ... .
🎨
canvas & drawing
draw rectangles, circles, lines, text and clear on a canvas widget
draw board rect 10, 10, 100, 60
🔘
buttons & dialogs
buttons with inline click handlers, alert popups, and confirm dialogs
make button "Submit" on click, .
dynamic updates
set any widget's value, text, visibility, color, or disabled state at runtime
set myVar visible false
full GUI example — login formware
make window "Login" size 360, 300 make label "Username" make textbox username make label "Password" make password password make separator make row, make button "Login" on click, if username is "" or password is "", alert "please fill in all fields." else, show f"logging in as {username}..." alert f"welcome, {username}!" . . make button "Clear" on click, set username value "" set password value "" . .
getting started

install ware

run the REPL
$ git clone https://github.com/SkywareSW/ware
$ cd ware
$ python3 ware.py
run a .ware file
$ python3 ware.py myapp.ware
VS Code extension

install ware-language-2.0.0.vsix for syntax highlighting, the Ware Dark theme, and 35+ code snippets.

1. open the Extensions panel in VS Code
2. click the ··· menu → "Install from VSIX…"
3. select ware-language-2.0.0.vsix from the repo
download .vsix ↗
ecosystem

related repos