|
A Brief Introduction |
This tutorial introduces key features of Sheerpower, such as high-precision math, fast compiling, dynamic data clustering, and a built-in web server.
Sheerpower is designed primarily for business and data-intensive applications that value correctness, throughput, and long-term maintainability.
Sheerpower lets you write straightforward code with a simple, consistent syntax. There is no manual memory management, no deep type system to navigate, and no low-level housekeeping to worry about. The language surface is deliberately small and uniform—you can hold the entire feature set in your head while coding.
This design philosophy serves two audiences equally well: humans in flow state can write fast without breaking concentration, and AI assistants can generate correct code without hallucinating edge cases. Named parameters, explicit scoping, and built-in guards mean both you and your AI pair programmer produce maintainable code by default—often with far less cognitive load than systems languages or mainstream dynamic languages with sprawling ecosystems.
Performance: Internal benchmarks show Sheerpower's REAL data type is
50—100× faster than Python decimal/Java
BigDecimal (even faster when the fraction is zero).
Actual results depend on CPU, operation mix, and data.
REAL type is a fixed-precision
decimal number composed of two integer components.
This representation is ideal for business and financial math where pennies matter. All arithmetic is performed using integer math (including fast multiply-and-shift for division), ensuring that addition, subtraction, multiplication, and division are exact for values that fit within the combined 18+16 digit precision budget.
Example: 0.1 + 0.2 in Sheerpower is exactly
0.3. No tolerance checks or "epsilon" comparisons are
needed for equality tests in business logic.
This ensures reliable calculations for applications like financial software.
Memory reuse in Sheerpower happens continuously as part of normal string operations. String buffers are retained and reused whenever possible, rather than being constantly allocated and discarded. Because unused memory is reclaimed incrementally through reuse instead of periodic cleanup passes, the runtime never needs to stop execution to recover memory.
This results in smooth, predictable performance with no garbage collection pauses even under sustained text-heavy workloads. For instance, on a modern PC, parsing a 10-million-row CSV file in under two seconds.
Sheerpower compiles at over 500,000 source lines per second on a modern PC — meaning even large business applications compile within a second or two. For example, a build of 872,133 lines (with 419 include files) compiled in under 2 seconds on a $1200 mini-server. This speed virtually eliminates the compile—wait—test cycle that slows development in other languages.
Sheerpower's cluster feature works like an in-memory spreadsheet, processing hundreds of thousands to millions of rows per second on a modern PC depending on data complexity and available system resources.
Sheerpower includes over 30 statistical functions that operate directly on cluster data—no export or import steps required. Calculate means, standard deviations, correlations, and regression analysis across millions of rows instantly. Ideal for financial analysis, quality control, trend detection, and data-driven decision making. For details, see Sheerpower Statistics .
Sheerpower includes a built-in web server optimized for memory-to-memory data transfers. This enables thousands of requests per second for web-based transactions with minimal resource usage on a modern PC. For more details, see the tutorials on Sheerpower Internet Services (SPINS) , Browser Scripting , and Fast-CGI for RESTful Endpoints .
A source file may begin with an optional PROGRAM
statement. This sets the program name used in crash reports,
profiling output, and other system-generated files. The file
may end with an optional END statement, which
marks the logical end of the program.
Use STOP or END to terminate a
program. Both perform a normal shutdown: open files are
closed, buffers flushed, and resources released.
STOP — may appear anywhere; execution
halts at that line.END — typically appears once at the
bottom to mark the program's end. If omitted, the
physical end of the file is treated as the logical end.
Building a Sheerpower program is like compiling and linking in traditional languages. Deployment is optional and does not change runtime behavior. It packages your app for delivery, protects your source, enables secure distribution, and reduces startup times.
include files.include files
shorten cold-start time.
Terminology: A "unity image" is a single packaged artifact
containing the program plus its required include files.
Sheerpower is designed for business applications, with a focus on speed, precision, and long-term reliability. It is not intended for system-level programming or memory-limited environments. Key features include:
REAL numbers handle decimals exactly—16 digits of precision without the rounding
errors that cause 0.1 + 0.2 ≠ 0.3 in other languages.PROGRAM, STOP, or END statements.|
Hide Description
|
|
|
Enter or modify the code below, and then click on RUN |
|
Looking for the full power of Sheerpower?
Check out the Sheerpower website. Free to download. Free to use. |