The Tomo Programming Language
The Language of Tomorrow
Tomo is a fast, simple, and safe programming language that cross-compiles to C with garbage collection. Tomo is statically typed and imperative, but borrows some of the best ideas from functional and array programming languages and some of the conveniences and readability of dynamic languages like Python.
Sample Program
func greeting(name:Text, add_exclamation:Bool -> Text)
:= "hello $name"
message := " ".join([
capitalized .title() for w in message.split_any(" ")
w])
if add_exclamation
++= "!!!"
capitalized return capitalized
func main(name:Text, shout=no)
:= greeting(name, add_exclamation=shout)
to_say say(to_say)
Features
Tomo has a wide range of features aimed to make it a great tool for building programs that are safe, fast, and maintainable:
Performance
- Tomo generates performant C code with minimal overhead and uses the full optimization capabilities of your favorite C compiler.
- Extremely fast incremental and parallel compilation
- Language-level support for correct function caching
- Structs with known-at-compile-time methods, not OOP objects with vtable lookups
Safety
- Memory safety (automatic memory management, compiler-enforced null safety, automatic array bounds checking, and no uninitialized variables)
- High-performance arbitrary-precision integers by default with opt-in fixed-size integers with arithmetic overflow checking
- Type-safe strings representing different languages with automatic prevention of code injection
- Pattern matching with exhaustiveness checking for enumerated types (tagged unions/enums)
- Type-safe optional values with low syntax overhead
- Efficient datastructures with immutable value semantics: lists, tables, sets, and text.
- Privacy-protecting types that help prevent accidentally logging sensitive information
Simplicity
- Simple, low-boilerplate type system with type inference
- Well-defined reference and value semantics and mutability rules
- No polymorphism, generics, or inheritance
User-friendliness
- String interpolation and debug printing builtins
- Built-in datastructures with a rich library of commonly used methods: lists, tables, sets, text.
- Full-featured libraries/modules
- Full UTF8 support for all text operations
- Built-in doctests with syntax highlighting
- Automatic command line argument parsing with type safety
- Easy interoperability with C
- Built-in data serialization and deserialization.
Get started
If this sounds good to you, then why not give it a try?