|
hoshi-lang dev
Yet another programming language
|
This document provides a specification of the Hoshi-lang programming language.
Identifiers start with a letter or underscore, followed by any number of letters, numbers, or underscores.
The following are reserved keywords and cannot be used as identifiers:
use, interface, struct, impl, func, let, if, else, for, while, return, true, false, null, typeid, interfaceof, dyn_cast, template, operator, alias, finalizer, callable
123, -456123u123s3.14, -0.01true, false"hello" **Null Literal:**null`Hoshi-lang is a statically-typed language. The following are the built-in types:
int: A 64-bit signed integer.unsigned: A 64-bit unsigned integer.short: A 16-bit signed integer.deci: A 64-bit floating-point number.bool: A boolean value (true or false).string: A string of characters.char: A single character.ptr: A raw pointer.Structs are user-defined data types that can contain fields and methods.
Interfaces define a contract of methods that a struct can implement.
Functions are defined with the func keyword.
See Operator Overloading.
See Generic Programming with Templates.
See Standard Library.