Skip to main content

Learn by Examples Catalog

● STABLE(Comprehensive, runnable code catalog divided into dedicated topic pages)

Welcome to the Learn by Examples Catalog — the fastest way to see how Adesh actually looks and behaves. Instead of explaining rules in the abstract, every topic is organized into its own dedicated page featuring complete, runnable programs, verified terminal outputs, and detailed engineering breakdowns.


Concept Pages Directory​

Explore complete code snippets, runtime outputs, and syntax breakdowns grouped by core language concept:

CategoryDedicated PageKey Concepts Covered
Basics & Type SystemBasics, Variables & TypesPrimitive types, annotations, as casting, ?? null-coalescing, type()
Control FlowConditionals & Control Flowif/elif/else, ternary operator, 3-part for loops, do-while, forEach
FunctionsFunctions, Closures & RecursionFunction annotations, recursion, lexical closures, higher-order functions
CollectionsArrays, Tuples & CollectionsArray indexing, map, filter, reduce, HashMap, HashSet, VecDeque
Object-OrientedOOP, Structs & Extensionsclass, extends, super, struct, and extend on method extension blocks
EnumsEnums & Pattern MatchingAlgebraic enums with payload variants, structural match patterns
Error HandlingError Handling & GuardingException guarding with throw, try, and catch blocks
Memory & TeardownDefer & Memory ManagementLIFO scope cleanup via defer, borrowing references (&), ownership
ConcurrencyAsync & Parallel Concurrencyasync fn, await, multi-core work-stealing Parallel.map, Parallel.reduce, Parallel.sum, Parallel.sort
Standard LibraryStandard Library EcosystemNative modules: Math, Crypto (SHA-256), JSON serialization, FS
AlgorithmsData Structures & AlgorithmsTwo Sum ($O(N)$ hash lookup), LRU Cache, Graph traversal

How to Execute Examples​

Run any code snippet locally using the adesh CLI tool:

# Execute using default interpreter
adesh run my_program.adesh

# Execute using Native Cranelift JIT
adesh run --jit-native my_program.adesh

# Execute using WebAssembly
adesh run --wasm my_program.adesh

# Execute embedded unit tests
adesh run --test my_program.adesh

For additional programs, check out the Runnable Examples Catalog which indexes 100+ verified examples from the official repository.