diff --git a/CMakeLists.txt b/CMakeLists.txt index a807f1b..0ff1c06 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.12) +cmake_minimum_required(VERSION 3.25) project( ovum diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ab40fc1..d635b0a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,6 +2,9 @@ - Contributing to The Ovum Language is fairly easy. This document shows you how to get started +> Note that this repository contains ONLY the toolset integration. That means that the actual tool implementations are in different repositories. For example, the compiler is in the [OvumCompiler](https://github.com/Ovum-Programming-Language/OvumCompiler) repository. +> DO NOT submit PRs to this repository, only to the repositories of the actual tools, unless you are sure that the change is applicable to the toolset integration itself (e.g. introduction of a new tool). + ## General - The [Codebase Structure](./CODEBASE_STRUCTURE.md) has detailed information about how the various files in this project are structured - Please ensure that any changes you make are in accordance with the [Coding Guidelines](./CODING_GUIDELINES.md) of this repo diff --git a/README.md b/README.md index 9b23c05..f557c07 100644 --- a/README.md +++ b/README.md @@ -3,12 +3,12 @@ Ovum is a strongly statically typed, single-threaded language focused on safety, clarity, and performance. It uses Kotlin-like syntax, immutability by default, a GC + JIT VM, interface-based polymorphism, and support for pure functions and functional objects. - Contribute: see [`CONTRIBUTING.md`](CONTRIBUTING.md). -- Project docs: [Online](https://ovum-programming-language.github.io/OvumDocs/) or [`docs/README.md`](docs/README.md). -- Full language reference: [Online](https://ovum-programming-language.github.io/OvumDocs/reference/) or [`docs/reference/README.md`](docs/reference/README.md). +- Project docs: [Online](https://ovum-programming-language.github.io/OvumDocs/). +- Full language reference: [Online](https://ovum-programming-language.github.io/Ovumhttps://ovum-programming-language.github.io/OvumDocs/reference/). --- -## [Overview](docs/reference/design.md) +## [Overview](https://ovum-programming-language.github.io/OvumDocs/reference/design) - Memory safety via GC; no manual memory management. - Immutable by default; explicit mutation with `var`. @@ -20,7 +20,7 @@ Ovum is a strongly statically typed, single-threaded language focused on safety, --- -## [Syntax at a Glance](docs/reference/syntax.md) +## [Syntax at a Glance](https://ovum-programming-language.github.io/OvumDocs/reference/syntax) - Files: `.ovum`. Names: PascalCase for types/methods. - Functions: `fun Name(a: T): U { ... }`; pure: `pure fun ...`. @@ -30,7 +30,7 @@ Ovum is a strongly statically typed, single-threaded language focused on safety, --- -## [Types](docs/reference/types.md) and [Nullability](docs/reference/nullable.md) +## [Types](https://ovum-programming-language.github.io/OvumDocs/reference/types) and [Nullability](https://ovum-programming-language.github.io/OvumDocs/reference/nullable) - **Fundamental types**: `int`, `float`, `byte`, `char`, `bool`, `pointer` (value types, not nullable, not Objects) - **Primitive reference types**: `Int`, `Float`, `Byte`, `Char`, `Bool`, `Pointer` (reference wrappers, nullable, Objects) @@ -42,18 +42,18 @@ Ovum is a strongly statically typed, single-threaded language focused on safety, --- -## [Control Flow](docs/reference/control_flow.md) +## [Control Flow](https://ovum-programming-language.github.io/OvumDocs/reference/control_flow) - `if/else`, `while`, `for (x in xs)`. - `return`, `break`, `continue`; no `goto`. --- -## [Expressions and Operators](docs/reference/expressions_and_operators.md) +## [Expressions and Operators](https://ovum-programming-language.github.io/OvumDocs/reference/expressions_and_operators) - Arithmetic: `+ - * / %` - Comparison: `== != < <= > >=` -- Boolean: `&& || ! xor` (short‑circuit `&&`/`||`). +- Boolean: `&& || ! ^` (short‑circuit `&&`/`||`). - Assignment: `=` (reference assignment), `:=` (copy assignment) - Member/calls: `. ()` and safe `?.` - Null handling: `?. ?:` @@ -62,7 +62,7 @@ Ovum is a strongly statically typed, single-threaded language focused on safety, --- -## [Object Model](docs/reference/object_model.md) +## [Object Model](https://ovum-programming-language.github.io/OvumDocs/reference/object_model) - Classes implement interfaces; no class inheritance. - Methods declare access; support `override` and `pure`. @@ -75,7 +75,7 @@ Ovum is a strongly statically typed, single-threaded language focused on safety, --- -## [Runtime and Tooling](docs/reference/runtime.md) +## [Runtime and Tooling](https://ovum-programming-language.github.io/OvumDocs/reference/runtime) - Pipeline: `.ovum` → bytecode → Ovum VM. - GC for memory safety; JIT compiles hot paths. @@ -87,7 +87,7 @@ Build & Run (conceptual): write `.ovum`, compile (parse, type‑check, enforce c --- -## [System Library and Interop](docs/reference/system_library.md) +## [System Library and Interop](https://ovum-programming-language.github.io/OvumDocs/reference/system_library) - `sys::Print(msg: String): Void` - `sys::Time(): Int` @@ -97,7 +97,7 @@ Build & Run (conceptual): write `.ovum`, compile (parse, type‑check, enforce c --- -## [Unsafe (recap)](docs/reference/unsafe.md) +## [Unsafe (recap)](https://ovum-programming-language.github.io/OvumDocs/reference/unsafe) Only inside `unsafe { ... }`: - Global `var` and `static var` writes. @@ -107,7 +107,54 @@ Only inside `unsafe { ... }`: --- -## [Code Examples](docs/reference/code_examples.md) +## [Bytecode](https://ovum-programming-language.github.io/OvumDocs/reference/bytecode) + +Bytecode is the intermediate representation of the Ovum program. It is generated by the compiler and executed by the Ovum VM. + +**Ovum Bytecode:** +```oil +// Simple program that prints numbers 1 to 5 +function _Global_Main_StringArray { + PushInt 1 + SetLocal 1 + + while { + LoadLocal 1 + PushInt 5 + IntLessEqual + } then { + LoadLocal 1 + CallConstructor Int + Call _Int_ToString_ + PrintLine + LoadLocal 1 + PushInt 1 + IntAdd + SetLocal 1 + } + + PushInt 0 + Return +} +``` + +**Ovum Source Code:** +```ovum +fun Main(args: StringArray): Int { + var i: int = 1 + + while (i <= 5) { + sys::PrintLine(Int(i).ToString()) + i = i + 1 + } + + return 0 +} +``` + +--- + +## [Code Examples](https://ovum-programming-language.github.io/OvumDocs/reference/code_examples) ### Entry point (`StringArray`) diff --git a/cmake/SetCompilerOptions.cmake b/cmake/SetCompilerOptions.cmake index 86de13c..4d44a5b 100644 --- a/cmake/SetCompilerOptions.cmake +++ b/cmake/SetCompilerOptions.cmake @@ -1,4 +1,4 @@ -set(CMAKE_CXX_STANDARD 20) +set(CMAKE_CXX_STANDARD 23) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS OFF) diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index b55ff1b..be3ced6 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -1,4 +1,2 @@ -cmake_minimum_required(VERSION 3.25) - add_subdirectory(mylib) add_subdirectory(ui)