Expanded Data Types Introduced in V15
PBXB64 V18 retains the complete managed UN family introduced in V15 alongside standard PowerBASIC types and specialized numeric, COM, string, and wide-integer extensions: UNL, UNF, UNB, UNC, UNI, and UNQ.
Complete Type Reference
| Type | Size | Description | Status |
|---|---|---|---|
BYTE | 8-bit | Unsigned integer (0-255) | Standard |
WORD | 16-bit | Unsigned integer (0-65535) | Standard |
INTEGER | 16-bit | Signed integer (-32768 to 32767) | Standard |
LONG | 64-bit | Signed integer (PBXB64 default is 64-bit) | Standard |
DWORD | 32-bit | Unsigned integer | Standard |
QUAD | 64-bit | Signed integer alias | Standard |
SINGLE | 32-bit | IEEE-754 float | Standard |
DOUBLE | 64-bit | IEEE-754 double | Standard |
EXTENDED | 80-bit | Extended precision float | Standard |
CURRENCY | 64-bit | Fixed-point (×10000) | Standard |
CURRENCYX | 16-byte | Extended fixed-point (V12) | NEW |
STRING | Dynamic | ANSI variable-length string | Standard |
WSTRING | Dynamic | Wide-character (UTF-16) string | Standard |
STRINGZ | Dynamic | Null-terminated ANSI string | NEW |
WSTRINGZ | Dynamic | Null-terminated wide string | NEW |
DEC128 | 16-byte | Decimal fixed-point, 18-digit precision | NEW |
RATIONAL | 16-byte | Exact rational (int64 num/den, auto-GCD) | NEW |
UNL | Managed | Arbitrary-precision signed integer | V15 |
UNF | Managed | Arbitrary-precision decimal | V15 |
UNB | Managed | Arbitrary-precision big float | V15 |
UNC | Managed | Complex number with two UN components | V15 |
UNI | Managed | Interval value with lower and upper components | V15 |
UNQ | Managed | Four-component quaternion | V15 |
VARIANT | 16-byte | COM-compatible (VT_I8, VT_R8, VT_BSTR) | NEW |
OBJECT | 8-byte | COM object reference | NEW |
GUID | 16-byte | 128-bit UUID | NEW |
128-bit int | 16-byte | Inline 128-bit arithmetic | NEW |
256-bit int | 32-byte | Inline 256-bit arithmetic | NEW |
512-bit int | 64-byte | Inline 512-bit arithmetic | NEW |
The V15 UN Family
These managed types store numbers beyond the fixed limits of native machine types. They support declarations, assignments, conversions, arithmetic, comparisons, globals, parameters, return values, fixed and dynamic arrays, and automatic cleanup.
| Type | Purpose | String form | Conversion |
|---|---|---|---|
UNL | Arbitrary-precision signed integer. Also supports FOR, INCR, DECR, SWAP, division, remainder, bitwise operations, and shifts. | -123456789... | VALUNL() / UNL$() |
UNF | Arbitrary-precision decimal. UNFPRECISION() reads or sets the decimal precision used by operations such as division. | 12.34 | VALUNF() / UNF$() |
UNB | Arbitrary-precision big floating-point value. | -7.5 | VALUNB() / UNB$() |
UNC | Complex number with real and imaginary UN components. | real;imag | VALUNC() / UNC$() |
UNI | Interval value represented by lower and upper UN components. | lower;upper | VALUNI() / UNI$() |
UNQ | Quaternion represented by four UN components. | a;b;c;d | VALUNQ() / UNQ$() |
Scalar assignment to UNC, UNI, or UNQ fills the first component and initializes the remaining components to zero. Invalid UN literals and conversions produce explicit diagnostics.
UNL and UNx in Real Code
The UN family is superior when a fixed native type would overflow, lose required precision, or force several related numeric components into a hand-built structure. The values remain strongly typed, work with PBXB64 expressions and calls, and clean up their managed storage automatically. Native integers and floating-point types remain the faster, smaller choice when their range and precision are sufficient.
UNL - integers beyond 64 bits
Why it is better here: no 64-bit overflow and no manual digit-array code. UNL also participates in loops, division, MOD, bit operations, shifts, INCR, DECR, and SWAP.
UNF - controlled decimal precision
Why it is better here: precision is selected for the problem instead of being fixed by DOUBLE. This is useful for long decimal calculations and repeatable high-precision results.
UNB - arbitrary-precision big float
Why it is better here: large floating-point-style values stay in a native PBXB64 type, with parsing, arithmetic, comparison, and string conversion built in.
UNC - native complex arithmetic
Why it is better here: real and imaginary components travel as one managed value. Multiplication, calls, returns, arrays, and conversion do not require a custom UDT or external complex-number package.
UNI - lower and upper bounds together
Why it is better here: lower and upper components cannot accidentally be separated. Interval values can be assigned, compared, passed, returned, and converted as one typed unit.
UNQ - four-component quaternions
Why it is better here: all four components remain one first-class value for arithmetic, arrays, parameters, and returns, avoiding repetitive component-management code.
Native H-Lib Data Structure Types
PBXB64 also treats the native H-Lib containers as first-class managed data types. All 22 core families plus the Safe synchronized wrapper are built into the compiler, require no COM object or external library, use dot-method syntax, and release their internal storage automatically when the declaring scope ends.
| Group | Families | Typical use |
|---|---|---|
| Sequences | Arr, Stk, Que, Lst, Str, 2D | Dynamic arrays, stacks, queues, linked lists, string builders, and two-dimensional arrays. |
| Maps and search | Hsh, Tre, DTre, Tri | Hash maps, ordered AVL maps, bidirectional maps, and prefix tries. |
| Priority and sets | Heap, Deque, Set, Multiset, SkipList, B+ Tree | Priority queues, double-ended queues, unique or counted sets, and ordered indexes. |
| Graphs and spatial | Graph, Union-Find, Quadtree | Graph traversal, disjoint sets, and two-dimensional spatial indexing. |
| Specialized | LRU Cache, Ring, Bloom Filter, Safe | Bounded caches, circular buffers, probabilistic membership tests, and synchronized stacks. |
Type prefixes select the stored PB value: for example LnArr stores LONG, DbArr stores DOUBLE, SsArr stores ANSI strings, and WsArr stores Unicode strings. Up to 13 element variants across the families provide more than 125 recognized container types; supported families can also use UDT element forms such as AS LnArr OF MyType.
DEC128 - 18-Digit Decimal Precision
PBXB64 Addition A 16-byte decimal fixed-point type with 18-digit precision. Ideal for financial calculations where binary floating-point rounding errors are unacceptable.
DEC128 stores values as decimal digits, not binary fractions. 19.99 + 0.01 equals exactly 20.00, not 19.999999999999996.
RATIONAL - Exact Arithmetic
PBXB64 Addition Stores numbers as int64 numerator/denominator pairs with automatic GCD normalization. 1/3 + 1/3 = 2/3 exactly. No rounding, ever.
RATIONAL automatically reduces fractions (GCD normalization) and supports all arithmetic operations: +, -, *, /, comparison, conversion to/from DECIMAL/DOUBLE.
VARIANT - COM-Compatible Values
PBXB64 Addition Full VARIANT implementation with VT_EMPTY, VT_I8, VT_R8, VT_CY, VT_BOOL, VT_BSTR. Supports scalar, fixed arrays, and dynamic arrays with REDIM PRESERVE.
VARIANT arrays support element-wise lifecycle management. REDIM PRESERVE performs deep element copy.
Wide Integers - 128 / 256 / 512 Bit
PBXB64 Addition Inline arithmetic on 128, 256, and 512-bit integers. No library calls, no heap allocation - pure register-based operations.
Wide integers support addition, subtraction, multiplication, division, comparison, and bitwise operations. All done inline in the x64 backend without external libraries.
Datatype Competition: Where They Lead, Where PBXB64 Wins
No compiler is universally superior in every meaning of “datatype.” GHC is more expressive at the type level, Rust is stronger at compile-time memory safety, Ada/SPARK at constrained types and formal assurance, and Julia in scientific dispatch and ecosystem depth.
PBXB64's defensible lead is out-of-the-box concrete datatype breadth in one native Windows toolchain:
UNL, UNF, UNB, UNC, UNI, UNQ, DEC128, RATIONAL, 128/256/512-bit integers, Windows/COM types, and 22 H-Lib families with 125+ typed variants.
| Compiler / language | Their datatype strength | Where PBXB64 wins |
|---|---|---|
| GHC / Haskell | GADTs, algebraic data types, type families, DataKinds, kind polymorphism, and advanced type-level programming. | PBXB64: a much broader ready-made concrete numeric and container arsenal for native Windows programs, without requiring type-level programming. |
| Rust | Ownership, borrowing, lifetimes, algebraic enums, traits, generics, and excellent compile-time memory safety. | PBXB64: arbitrary-precision decimal/big-float, interval, quaternion, 256/512-bit, and managed H-Lib types are integrated; Rust normally adds crates for these domains. |
| Julia | BigInt, BigFloat, Rational, Complex, parametric types, multiple dispatch, and a deep scientific package ecosystem. | PBXB64: UNI intervals, UNQ quaternions, extra-wide integers, H-Lib, COM types, and direct standalone PE32+ output are delivered together. |
| Ada / SPARK | Range-constrained subtypes, fixed and decimal fixed point, discriminated records, contracts, and formal verification. | PBXB64: broader arbitrary-precision and extra-wide numeric families plus a larger integrated collection repertoire and ten frontends. |
| C++ (MSVC / GCC / Clang) | Templates, concepts, variants, tuples, user-defined literals, compile-time programming, and the largest native library ecosystem. | PBXB64: specialized numerics and managed containers are first-class compiler types instead of templates or third-party dependencies. |
| C# / .NET | Generics, nullable references, records, pattern matching, reflection, and a broad framework including BigInteger and Complex. | PBXB64: arbitrary decimal/big-float, rational, interval, 256/512-bit, and H-Lib types produce native programs without a .NET runtime. |
| F# / .NET | Discriminated unions, units of measure, records, pattern matching, inference, and functional composition. | PBXB64: more specialized built-in numerical representations and managed data structures in a standalone native Windows toolchain. |
| Swift | Protocol-oriented generics, optionals, expressive enums, value semantics, and strong pattern matching. | PBXB64: stronger Windows-native positioning and a much wider integrated large-number, scientific, COM, and container range. |
| D (DMD / LDC / GDC) | Templates, ranges, compile-time function execution, mixins, static introspection, and systems-level value types. | PBXB64: direct UN, DEC128, RATIONAL, wide-integer, and H-Lib support with simpler PowerBASIC-style declarations. |
| Nim | Generics, concepts, variant objects, distinct types, macros, and selectable memory-management models. | PBXB64: more concrete high-precision numeric and managed collection families built directly into the release. |
| Fortran (ifx / gfortran / Flang) | Kind-parameterized numerics, complex values, multidimensional arrays, coarrays, and mature HPC optimization. | PBXB64: arbitrary precision, intervals, quaternions, general-purpose containers, COM, GUI, and multi-language frontends in one toolchain. |
| Common Lisp (SBCL) | Arbitrary-size integers, rationals, complex numbers, dynamic typing, CLOS, and exceptionally powerful macros. | PBXB64: static native declarations, UNI/UNQ, explicit wide integers, managed H-Lib types, and direct Windows executable production. |
| Delphi / Free Pascal | Sets, variants, records, classes, generics, properties, native compilation, and mature RAD libraries. | PBXB64: the complete UN family, DEC128/RATIONAL, 128/256/512-bit integers, H-Lib breadth, and ten source frontends. |
| Go | Simple structs and interfaces, generics, slices/maps, garbage collection, and built-in concurrency primitives. | PBXB64: substantially broader concrete numeric, scientific, Windows/COM, and managed container datatypes. |
| Zig | Comptime, explicit layouts, optionals, error unions, allocator control, and predictable low-level representations. | PBXB64: high-level managed numerics and collections are ready to use with automatic cleanup and less manual memory work. |
Scope: major relevant compiler families in their standard or commonly shipped form, not every research compiler or third-party package. “PBXB64 wins” means the capability is integrated in the V18 compiler/package and fits the stated use case; it is not a claim that PBXB64 has the world's most expressive type system. Comparison anchors: GHC GADTs, Rust generics, traits and lifetimes, Julia types, and Ada 2022.
Datatype Feature Availability Matrix
This matrix compares the concrete PBXB64 datatype families above with the same 15 toolchains. An orange tools symbol is only awarded when a named, established package or platform route supplies a practical equivalent. A type that could merely be hand-written from scratch remains unavailable here.
Swipe horizontally to compare every compiler.
| PBXB64 feature | PBXB64 | GHC | Rust | Julia | Ada | C++ | C# | F# | Swift | D | Nim | Fortran | Lisp | Delphi / FPC | Go | Zig |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
UNLArbitrary-precision integer |
num-bigint | Boost | BigInt pkg | bigints pkg | MPFUN / GMP | Big-int lib | ||||||||||
UNFArbitrary-precision decimal |
Decimal pkg | bigdecimal | Decimals.jl | Boost | EDecimal | EDecimal | apd | |||||||||
UNBArbitrary-precision binary float |
MPFR | rug | Boost / MPFR | EFloat | EFloat | MPFR | MPFR | MPFUN | ||||||||
UNCComplex arbitrary-precision value |
Complex + MPFR | rug | Boost | MPFUN | ||||||||||||
UNIInterval arithmetic |
data-interval | interval crate | IntervalArithmetic | Boost.Interval | Compiler ext. | |||||||||||
UNQQuaternion value |
linear | nalgebra | Quaternions.jl | Boost.Math | Accelerate | Quaternion lib | Math lib | Gonum quat | ||||||||
DEC128Exact decimal / fixed 18 digits |
rust_decimal | DecFP.Dec128 | Boost.Decimal | varDecimal | apd | |||||||||||
RATIONALExact rational arithmetic |
num-rational | Boost.Rational | ERational | ERational | ||||||||||||
| 128 / 256 / 512-bitFixed-width integer family | wide-word | i128 + crates | BitIntegers.jl | Big_Integer | Boost | Int128 + BigInteger | Int128 + BigInteger | DoubleWidth | Int128 + BigInt | bigints / stint | kind 16 + MPFUN | Bounded integer | Int128 + libs | big.Int masks | ||
VARIANT / COMWindows automation and platform types |
Win32 / FFI | windows crate | FFI / PyCall | Win32Ada | WinSDK | winim | go-ole | C import | ||||||||
| H-Lib familiesManaged map, set, deque, graph, trie and specialist containers | containers + pkgs | std + crates | Base + pkgs | Containers + libs | STL + Boost | .NET + NuGet | .NET + NuGet | Collections + pkgs | FSet / cl-containers | RTL / FCL + libs | std + GoDS |
“Built in” includes the language's normal standard or official platform library. “Library / emulation” means the green result depends on the named package, binding, or composition and may not match PBXB64's syntax, precision model, lifecycle, or deployment profile exactly. Evidence anchors include Julia numbers, .NET numerics, D BigInt, Go math/big, and Zig integer types.
Try It Yourself
All test files are in examples/basic/ - compile and run them to verify.