Mochaccino
Share
Explore

Introducing Mochaccino

image.png
Mochaccino is a strongly-typed non-OOP language with an emphasis on code organisation and easy debugging, giving you a delightful development experience.

package main;
include somePackage;
include anotherPackage;
dock {
dbutils from 'lib/utils/allUtils.mono',
'lib/types/main.mono',
}

module DB implements <Service> {
version = 1;
func getObjectById(id<string>)<promise<map>> async {
var result<map> = await dbutils.runAsyncProcess(id: id);
if (result.statusCode == 200) {
ok;
} else {
notok;
}
}
}

struct Service {
var version<int>;
}

struct DBService extends <Service> {
constructor(data<Service>) {
dbVersion = data.version;
}
#no-null // debug flag throws an error at runtime if the field is referenced when null.
var dbVersion<int>;
}

module main implements <EntryPoint> {
func main()<void> {
var complete<bool> = false;
complete.onChange((newValue<bool>) {
dbutils.debugMessage("complete!");
});
}
}

Pretty nice, isn’t it? Wait till you see what structs have to offer in Mochaccino!
Share
 
Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
CtrlP
) instead.