docLang
Fantom language documentation
Fundamentals
- Structure
pod::type.slot program structure
- Literals
syntax for literal types
Overview, Bool, Int, Float, Decimal, Str, Duration, Uri, Type, Slot, Range, List, Map
- Expressions
syntax for expressions
Operator Precedence, Shortcut Operators, Same Operators, Conditional Operators, Ternary Operator, Null Convenience Operators, Type Checking, Indexing, Bitwise Operators, Serialization Expressions, Advanced Operators
- Statements
syntax for statements
Overview, Expression Statements, Return Statement, Local Variables, If Statements, Loop Statement, Switch Statement, Exception Handling
- Exceptions
exception handling
Overview, Err Class, Throw Statement, Try-Catch Statement, Finally Blocks
Type System
- TypeSystem
static type system with bit of dynamic thrown in
Overview, Types, Pure Object Oriented, Nullable Types, Value-Types, Statically Typed, Implicit Casts, Type Signatures, Collections, Generics, Subtype Substitution
- CompilationUnits
organization of source code
Organization, Char Encoding, Anatomy of Source File, Using, Comments
- Pods
creating pods
- Classes
creating class types
- Mixins
creating mixin types
- Enums
creating enum types
Overview, Range, Enum Constructors, Enum Modifiers, Reflection
- Slots
slot model
- Methods
deep dive into method slots
Overview, This, Constructors, Static Initializers, Default Parameters, Operators, Virtual Methods, Abstract Methods, Once Methods, Covariance, This Returns, Dynamic Invoke, Native Methods
- Fields
deep dive into field slots
Overview, Simple Fields, Accessor Methods, Calculated Fields, Const Fields, Static Fields, Protection Scope, Readonly Fields, Virtual Fields, Abstract Fields, Definite Assignment, Overriding a Method, Mixins, Native Fields
- Inheritance
rules for slot inheritance
Overview, Syntax, Inheritance Rules, Inheritance Restrictions, Overrides, Covariance, Super
- Facets
annotating types and slots with metadata
Overview, Facet Classes, Annotations, Reflection, Inheritance
Functions
- Functions
functional programming
Overview, Function Signatures, Calling Functions, Type Compatibility, Methods, Immutable Functions
- Closures
deep dive into closures
Overview, Syntax, Binding Locals, Closure Parameters, Iteration, Closure Type Inference, It-Blocks, This Functions, With-Blocks
Interop
- JavaFFI
Java foreign function interface
Overview, Interop Summary, How it Works, Class Path - Compiler, Class Path - Runtime, Primitives, Reflection, Arrays, Nullable, Overloaded Methods, Constructors, Subclassing, Overrides, Inner Classes, Dynamic Calls, Functions as Interfaces, Annotations
- Natives
implementing methods and fields in Java and C# code
Overview, Native Classes, Native Peers, Native Methods, Native Fields
- JavaScript
compiling to JavaScript
Overview, Js Facet, Deployment, Browser Runtime, Alternative Runtimes, Invoking Fantom from JavaScript, Natives, Testing
Advanced
- Deployment
how to deploy pods and applications
- Env
customizing the Fantom environment
Overview, Directory Structure, BootEnv, Setting Env, PathEnv, JarDistEnv, Indexed Props
- Serialization
reading/writing objects
Overview, Data Model, Serializable, Simple, Collection, Streams, Syntax
- Concurrency
model for sharing data between threads
- Actors
message passing concurrency
Overview, Actors, Actor Locals, Message Passing, Futures, Message Error Handling, Timers, Chaining, Coalescing Messages, Flow Control, Actor Pools
- Naming
URI naming system
- Logging
logging APIs
Log Creation, Log Statements, Log Levels, Log Handlers, Log Setup
- Localization
localization APIs
- DSLs
domain specific language and compiler plugins
- DateTime
date and time APIs
Overview, Ticks, DateTime, Localization and Formatting, TimeZone, Trade-offs
Appendix
- Appendix
additional detailed notes
- Conventions
coding conventions we use
Overview, Source Files, Naming, Common Names, Indention, Statements, Comments
- Grammar
formal BNF syntax grammar
Legend, Compilation Unit, Type Def, Slot Def, Facets, Stmt, Expr, Type, Misc, Keywords, Position Keyword