Skip to content
/ cwat Public

WATT πŸ’‘ - functional programming language, written in Cpp.

Notifications You must be signed in to change notification settings

kilwatt/cwat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

65b3072 Β· Apr 15, 2025

History

1 Commit
Apr 15, 2025

Repository files navigation

Watt πŸ’‘

Watt is a dynamically typed scripting language that combines functional and object-oriented programming paradigms. ⚑ It is designed to be expressive, flexible, and easy to use for scripting and application development.

New πŸš€

Watt is compiled to its own virtual machine, VoltVM. VoltVM offering great flexibility for Watt development, and, of course, great reflection.

Examples πŸ”‹

πŸͺΆ hello_world.wt

import 'std.io'
io.println('Hello, world!')

πŸͺΆ pie_recipe.wt

import 'std.io'
import 'std.convert'

type Pie(weight) {
    fun cook() {
        io.println('πŸ₯§ Cooking pie...')
        io.println('⚑ Pie cooked! Weight: '
                    + convert.to_string(weight)
        )
    }
}
unit Bakery {
    fun bake(pies) {
        io.println('πŸͺ Cooking: ')
        for i in 0 to pies.size() {
            pies.get(i).cook()
        }
        io.println('πŸŽ‰ Successfully cooked all pies!')
    }
}
pies := [new Pie(3.6)]
Bakery.bake(pies)

πŸͺΆ fibonacci.wt

fun fib(n) {
    cache := {}

    fun fib_inner(n) {
        if n <= 1 {
            return n
        }
        if cache.has_key(n) {
            return cache.get(n)
        }
        result := fib_inner(n - 1) + fib_inner(n - 2)
        cache.set(n, result)
        return result
    }
    return fib_inner(n)
}

io.println(fib(1000))

Documentation 🌺

Work in progress, stay soon!

Looking to the feature πŸ”­

Our current tasks is:

  • finish std lib
  • create utils lib
  • start work on arc2d lib

Thanks you πŸ”₯️

About

WATT πŸ’‘ - functional programming language, written in Cpp.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published