Skip to content
javascript dialect
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Ribbit (WIP)

Ribbit is a javascript dialect that I've been working on it for a few years now. Originally, Ribbit was a small library that made it easier to define properties on the fly. Now, it has grown into something bigger.

Over the years, it has grown a typing system, a matching system, and lots of other shortcuts that I like to use. This has involved trying to meld Javascript into something quite different, which can result in some very odd-looking code.

When making Ribbit, I always do what makes sense to me, even if I know it won't make sense to other people. Therefore, other people might find it strange or just dumb. Despite this, I'm quite fond of it. I really enjoy using Ribbit to write Javascript.


Ribbit has its own type system.

Type Checking

["Joe", "Flora"].is(Array) == true

Type Conversion

"24".as(Number) == 24

Type Assertion

let age  = Int(24)
let name = String(24) //Error: Type Mismatch

Custom Types

let UpperCase = new Type ({
	base:    Text,
	convert: text => text.toUpperCase(),

"HELLO".is(UpperCase) == true

Static Typing

let scores = new Int[_]
scores.push(4.2) //Type Error!


Define properties easily.

Getter = "Luke"
luke.surname = "Wilson"
luke._.fullname.get = o=> `${} ${luke.surname}`
luke.fullname == "Luke Wilson"

Static Typing = Text = 24 //Type Error!

Full definition = {
	value: 10,
	type: Number,
	set: (v) => { = v
		if (v <= 0) print("You died!")


Use pattern matching to save time and space.


input.match (
	Text,       "It's some text",
	"Luke",     "It's my name",
	[Num, Num], "It's a list of two numbers",
	_,          "It's something else",

Matcher Function

let fibonnaci = matcher (
	[0],   0,
	[1],   1,
	[Int], n => fibonacci(n-1) + fibonacci(n-2),


Ribbit gives you more options for how you work with functions.
Some might seem more useful than others.

You can call functions without brackets.

print.x= "Hello world!"
friends.o.forEach.x= friend => print (`Hello ${friend}`)
friends.o.for.o(10).x= friend => print (`You're in my top 10 friends!`)

You can use arrow notation to make a function-scoped function.

luke.grow = f(self => self.age++)


Use Ribbit's type system to extend and/or create classes.

Extend Class

Number.O.multiply = f((self, num) => self * num)
(3).multiply(2) == 6

Even.O._.half.get = f(self => self / 2)
(4).half == 2
(5).half //Type Error!

Create Class

let Person = new Type ({
	[]: Text
	[X.age]:  Number
	[O.grow]: o=> this.age++

let luke = new Person ("Luke", 24)
You can’t perform that action at this time.