Home
Hot++ is a scripting language for C++ programs. A script is a .hot file that looks like C#.
The hotc tool turns a script into C++. The engine reloads a changed script while it runs.
- Introduction: what Hot++ is, a
.hotand a.cppscript side by side, and howhotcmakes the features work. -
Getting started: write a class, check it and compile it.
- Hot reload: how a reload swaps the code of a running object.
Hot script
- Types: builtin types, variables, C++ types, collection literals and arrays.
- Handles, references and pointers: handles, weak handles, values and handles of script classes, references and pointers.
- Borrowing: where
ref,in,T*and&xare allowed or rejected, and handles.- Borrowed locals, calls and fixes: borrowed locals, borrowed values in calls, the escape hatch and quick fixes.
- Classes: fields, methods,
=>bodies, default values, constructors, properties, structs.- Mutual use, this and access words: classes that use each other,
thisas a value, access words and renamed fields.
- Mutual use, this and access words: classes that use each other,
- Inheritance: native bases, virtual methods, script parents, abstract classes, interfaces.
- Module level:
using, enums, structs, module variables, native stubs. - Statements: control flow, string
switch,foreachand structured bindings.- try, catch and runtime errors:
try,catch,finallyand the errors that the runtime throws. - Strings, casts and patterns: string interpolation, casts,
??,?.,isandas.
- try, catch and runtime errors:
- Lambdas: arrow functions with a block body or an expression body.
- Native interop: how a script calls engine code directly, native objects and the fallback handle.
- Scope of a stub and C++ insertions: the scope of a stub and the C++ insertions.
- operator->, stub checks and index bounds: types with
operator->, the checks on a stub and the bounds check on an index. - Module attributes and other limits: module attributes, the array type and other limits.
- Diagnostics: the error format of the tools.
- Limits: what version 1 does not support.
C++ scripts
- C++ scripts: a script as a plain
.cppfile that also compiles in a normal build. - Example: two generations of a
.cppscript and the CMake commands that build them. - How hotc edits C++: the edits of a method body, lambdas and namespaces.
- Script classes: what a class can have, static members, definitions outside the class, member initializer lists.
- Types and inheritance: a script class as a type, casts and script class inheritance.
- Limits and errors: the unsupported forms with the messages of
hotc, and the known limits.
More
- Embedding: load scripts with a
Loader, and which hosting situation fits.- Rules, errors and traceback: ownership, threads, symbol export, error reports and the traceback.
- Run-time compile and precompiled library: the two situations that load a library.
- Reload API:
request_reload, the status values and the full reload. - JIT, clang files and AOT: the JIT, the clang files backend, AOT and AOT with overrides.
- File system of the host: the virtual file system for imports and headers.
- Backend interface and options: the backend interface and the options structs.
- CMake: use Hot++ in a host project, and the quick start.
- Setup and targets: the requirements, how to consume Hot++ and the targets.
- Options and standard: the build options, the C++ standard and the format library.
- Hosts with hot_add_host: the keywords and the modes.
- Script functions:
hot_add_scriptsandhot_script_host. - SDK and portable binaries: install the SDK, and build a host without build paths.
- Presets, tests and troubleshooting: sanitizers, presets, the table of errors and
hot_gtest.
- Tools: the
hot-lslanguage server. - Benchmarks: the run-time cost of script code against native C++, and how to measure it.
- Development notes: the milestones, the source layout, the tests, the translator and the
hotccommand line. - Language server internals: the script hosts, the index and the features of
hot-ls. - Runtime internals: the JIT backend, threads, closures and debug information.
- Type design: the approved design of the HotScript types, with the type mapping, the nullability rules and the migration table.
License
Hot++ uses the MIT license. See LICENSE.