|
A Brief Introduction |
Sheerpower is a programming language designed for business applications. It offers fast compilation, accurate math (16 decimal digits of guaranteed accuracy), and a simple syntax. Developers can build scalable, efficient programs for handling large volumes of data.
This tutorial introduces key features of Sheerpower, such as high-precision math, fast compiling, dynamic data clustering, and a built-in web server.
A source file may begin with an optional PROGRAM statement.
This sets the program name used in crash reports, profiling, and other
system-generated files. The file may end with an optional END
statement that 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 — can appear anywhere; execution halts at that line.END — typically appears once at the bottom to mark the
file’s end. If omitted, the physical end of the file is treated as
the program’s end.
Sheerpower’s REAL type is a fixed-precision decimal
number. Internally it stores two 64-bit integers: one for the whole
part (up to 18 decimal digits) and one for the fractional part
(up to 16 decimal digits). Because values are kept in base-10—not
binary—REAL produces exact decimal results within those
limits and avoids the tiny round-off artifacts common to IEEE
floating-point.
This design is ideal for business and financial math where pennies matter. Operations use integer arithmetic (including fast multiply-and-shift for division), so typical add/subtract/multiply/ divide on values that fit the 18+16 digit budget are exact. When a result would exceed that fixed precision, it is deterministically rounded using decimal rules.
Performance: Internal benchmarks show REAL 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.
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.
REAL for money, invoices, tax and
accounting logic. For heavy trigonometry or very large exponents,
hardware floating-point remains faster.
This ensures reliable calculations for applications like financial software.
Sheerpower is optimized for the heavy text work common in business apps. It manages memory so efficiently that it never needs to pause to "clean up," a process that can cause frustrating garbage collection pauses in many other languages. This approach ensures your application is always fast and responsive.
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 a built-in statistics package with over 30 functions for analyzing data. These functions can be used to identify trends, variability, and relationships in large datasets. Applications include finance, manufacturing, science, and more. For details, see Sheerpower Statistics .
Sheerpower includes a built-in web server optimized for memory-to-memory data transfers. This enables very fast web-based transactions with minimal resource usage. For more details, see the tutorials on Sheerpower Internet Services (SPINS) , Browser Scripting , and Fast-CGI for RESTful Endpoints .
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. |