Native alpha.16 · experimental
Language features
Exact answers, without hidden rounding
A third should stay a third until your program decides otherwise.
Panackelty supports arbitrary-precision whole numbers, exact base-10 decimals and exact fractions. Calculations preserve their meaning without silently substituting floating-point approximations.
main(): Void {
third = 1/3
print((third * 30).nat()) // 10
print((1/8).dec()) // 0.125
}
Choose Nat, Int, Dec or Rat to describe the values you need. Conversions are explicit: an exact conversion that cannot represent its input fails rather than quietly rounding.
Use exact values for totals, proportions, unit calculations and algorithms where a small approximation can change the answer.
Types that express your rules
“An integer” is often too broad. Your program may need a positive quantity, a bounded index or a valid port number.
Guarded types put those constraints into the type itself:
type Positive = Int where value => value > 0
type Port = Nat where value => value >= 1 && value <= 65535
The compiler checks that values satisfy supported constraints before accepting their use. It can reason from literals and facts established by surrounding conditions.
Alpha.15 also supports string length and text constraints, collection sizes and numeric relationships between record fields. For external input, validate[Type](input) returns either a checked value or structured failures. See validated domain types and migration examples.
The current proof system is deliberately bounded. It does not prove arbitrary properties or silently add runtime validation for untrusted input.
Data models with every case accounted for
Records give related values named fields. Tagged unions describe alternatives explicitly. Exhaustive pattern matching makes you account for every variant.
Represent a result, a state or a command as the data it actually is, then handle its possibilities with match.
When a type describes several cases, the compiler checks that your match covers them. Missing a case becomes something you fix while writing the program.
Write longer conditional chains
Repeated else if arms let a function express an ordered set of alternatives directly. Each condition is checked in order, and only the selected branch runs; a final else is optional when the result does not need to exist on every path.
Try the alpha.12 conditional example →
Reusable code, checked across types
Generic functions and data types let one implementation work with different value types.
Build reusable containers, helpers and transformations while retaining checks on what goes in and what comes out. Where enough information is available, type inference keeps calls and local declarations concise.
Explicit annotations remain available where they clarify the contract or resolve ambiguity.
Pure calculations. Explicit interactions.
Panackelty makes the boundary between calculation and interaction part of the function’s type.
pure twice(n: Nat): Nat {
n * 2
}
A pure function cannot print, read files, inspect the clock or call effectful code. The compiler enforces that boundary.
You can still use loops and local mutable variables inside a pure function. Purity controls interaction with the outside world; it does not force every algorithm into the same shape.
Pure functions can still fail—for example through an invalid index. Purity is an effect guarantee, not a promise that execution cannot trap.
Pass behaviour without losing its contract
Functions can accept named functions as typed callbacks.
The callback’s type describes its arguments, result and whether it is pure, effectful or asynchronous. Those distinctions remain checked when the callback is called.
That lets collection operations and reusable algorithms accept behaviour without weakening the surrounding effect rules.
Current callbacks use named function references. Capturing closures and references to generic functions are not yet supported.
Transform data without changing the original
Arrays, maps and sets support everyday data processing. Their persistent operations produce new values while preserving the original collection.
Use iteration, map, reduce and stable sorting to organise and transform data. Method-style calls keep operations close to the values they act on.
Keeping earlier values intact makes it easier to follow how a result was produced and reason about what each part of a program can change.
Make absence and failure visible
A lookup might find nothing. A file operation might fail. Those possibilities belong in the function’s contract.
Option[T] represents a value that may be absent. Result[T,E] represents either a successful value or an error.
pure value_or(option: Option[Nat], fallback: Nat): Nat {
match option {
Some(value) => value,
None() => fallback
}
}
Callers can inspect the result, choose a fallback or pass the error onward.
Panackelty currently handles recoverable failures through explicit results. It has no try/catch, and runtime traps remain distinct from returned errors.
Async/await as a language feature
Declare asynchronous functions with async and use await to compose operations that may suspend.
Inputs, results and error values remain typed. Asynchronous functions can call other asynchronous functions, keeping a sequence of waiting operations readable.
The runtime supports suspension and resumption, while the compiler checks where asynchronous calls are allowed.
An async declaration does not automatically launch work in the background or make a calculation parallel. General-purpose task spawning is not available yet.
Text and bytes, with an explicit boundary
Work with Unicode strings, interpolation and familiar text operations. Use byte values when the contents are binary.
String indexing follows Unicode code points. Explicit UTF-8 encoding and decoding make it clear when a program crosses between text and bytes.
That distinction matters for file formats, command output and network protocols. Code points are not always the same as the visible characters a reader perceives.
Native alpha.16 · experimental
Practical access to the host
The native toolchain provides typed paths, filesystem operations, process execution and elapsed-time measurement.
Read and write files, inspect directories and work with temporary resources. Run commands with explicit arguments, working directories, environment overrides, output limits and timeouts.
Duration represents exact nanosecond durations. Monotonic Instant values support elapsed-time calculations and deadlines.
Host APIs expose expected failures through structured results. Availability depends on the runtime: the browser playground does not offer unrestricted filesystem or process access.
Bounded TCP clients and servers
Native alpha.11 puts async/await to work with TCP request/response operations and finite servers with concurrent handlers.
Connection limits, payload bounds, deadlines and shutdown rules are explicit parts of the API.
This is a working, experimental networking foundation. Alpha.14 adds a routed HTTP server framework and type-owned methods. The HTTP client supports bounded GET and verified HTTPS; the cleartext server supports typed GET/POST/PUT/DELETE handlers, explicit limits and graceful shutdown. Server TLS is not included. These host capabilities are unavailable in the browser playground.
HTTP clients and services
Native alpha.16
Request data with bounded HTTP/1.1 GET and verified HTTPS. Responses and errors are typed; deadlines, cancellation and response-size limits are explicit. Certificate and hostname verification use the native platform’s libcurl transport.
Build cleartext HTTP services with typed GET, POST, PUT and DELETE handlers, checked message framing and bounded concurrent requests. Continuous services announce readiness after binding and drain active requests on shutdown. Server TLS is not included.
Serve files over HTTP
Native alpha.16
The installed panack-http-server tool serves any chosen folder. It provides confined asynchronous reads, directory indexes, redirects, MIME types and GET support. Use it to serve static content such as documents, generated reports or websites; website preview is one application.
It starts on loopback by default and offers no-cache and noindex options. Requests, responses and clients are bounded; directory listings, ranges, TLS, file watching and automatic rebuilds are outside its contract.
Serve your first files →
Manage package dependencies
Available in alpha.16
Reuse local libraries through strict panack.json manifests, dependency aliases and explicit public exports. Applications can check, compile and run through a project entry point, and the complete package tree can move without changing declaration identity.
Manifests select the exact matching toolchain. Conflicting versions and roots are rejected. Use panack deps lock to record local, HTTPS or pinned Git dependencies, and panack deps restore to restore them. A public package registry is outside this release.
Create a library and use it from an application →
Build programs across files
Imports let you organise code into separate source files and use the standard library.
Logical paths such as stdlib/path and project/shared/module keep imports independent of where the toolchain is installed.
Alpha.12 adds executable file-based namespaces. Import modules explicitly from project/ or stdlib/, use aliases or selected imports, qualify names, and expose public declarations or re-exports. The compiler keeps declarations from different modules distinct through checking and code generation; source and saved-v9 bytecode run only the selected entry module.
Alpha.13 adds local reusable packages with strict panack.json manifests, dependency aliases and explicit public exports. Package graphs stay within their configured roots and retain identity when moved together. Manifests pin the exact toolchain version. Alpha.15 adds locked local folders and archives, HTTPS archives and Git dependencies pinned to commits. Restore dependencies before building; Git is optional unless fetching a Git dependency.
Run the namespace examples →
A compiler you can question
Checking a program is useful. Understanding the reason behind a decision is useful too.
Native alpha.16
Alpha.15 opens an interactive explorer for function-checking decisions, including types, calls, inference, callbacks, proofs and effects. Start with a source statement, inspect its decisions and follow the supporting source. Accepted programs also expose generated instructions and their origins.
Use --text for a plain report. Explore the compiler’s decisions →
This is static analysis: it does not execute your program or show runtime values. Parsing and name-resolution failures remain frontend diagnostics, and decisions that checking cannot reach are marked unavailable with a reason.
The panack command supports source checking, execution, compilation to saved bytecode and disassembly.
Optional source maps and panack locate connect a bytecode instruction with its source. This provides a foundation for investigation; it is not yet an interactive debugger or an automatic source-level stack trace.
The testing library provides assertions, reporting and helpers for command and filesystem tests.
Programs execute through a bytecode VM that verifies bytecode before running it.
Written in the language it compiles
Panackelty’s compiler is written in Panackelty.
The project uses its own language to implement a substantial compiler, alongside bootstrap and reproducibility checks. The language is exercised by the toolchain that develops it, not only by demonstration programs.
Testing includes compiler, runtime and complete-program checks. The coverage site reports the native C VM and measured .panack source separately, with explicit revisions and test scope. Source coverage is reported weekly or on demand, separately from releases. Read each report’s revision and declared measured scope; it is not whole-suite coverage.
Read the coverage scope and reports →