Sheerpower Logo

Building and Deploying


Building a Sheerpower program is similar to compiling and linking in traditional languages. Deployment is optional and does not affect how your program runs. However, it protects your source code and enables secure distribution.

Note: Deployment protects your source code without affecting runtime. It enables secure, portable distribution of your application—especially useful when sharing or selling software.

For example, deploying MyProgram.spsrc creates MyProgram.sprun. The .sprun file contains minified, compressed, base64-encoded, and encrypted text that hides the program’s source code.

To run a .sprun file, the receiver can either install Sheerpower, or you can provide them with a copy of sp4gl.exe, renamed as desired (e.g., MyProgram.exe). Place this renamed file in the same folder as MyProgram.sprun. Running MyProgram.exe will then execute the deployed program.

How to Create a .sprun File

  • SPDEV: Open your source file and use the Deploy option.
  • VS Code: Press the F6 key.
  • Command line:
    sp4gl.exe myprogram /build
    For large projects, this is often included in a Windows batch file.
Sheerpower V011.019.09 >>> build 'handler' Building handler.spsrc ... Insights handler_insights.html Generated 974K pcodes, 872133 lines (665700/sec) -- Files included: 419

Highlights from this Sheerpower Build

This build log highlights several core strengths of the Sheerpower environment:

Validates Performance Claims: Sheerpower compiles at “over 500,000 lines per second.” This log shows it reaching 618,500 lines/sec on a large, real-world application built on a compact server with 32GB of RAM (approx. $1200).

Illustrates the “Unity Build”: The build seamlessly processed 419 included files. This demonstrates Sheerpower’s ability to manage complex, modular projects with ease—key to fast startup of deployed .sprun files.

Shows Integrated Tooling: The Insights ... .html line is a perfect example of integrated tooling. With option insights enabled, code analysis is automatic, providing developers with immediate, actionable feedback.

Together, these results demonstrate how Sheerpower’s fast compilation, modular build support, and integrated tooling empower developers to build robust applications with speed, clarity, and confidence.

The Sheerpower SPRUN File Format: A Comprehensive Overview

1. Overview

The Sheerpower Portable Runnable Image (.sprun) is a deployment format purpose-built for commercial software. Far more than simple obfuscation, it’s a sophisticated container that provides robust source code protection, fast startup, and secure, flexible licensing.

2. Core Objectives of the SPRUN Format

  1. Source code protection
  2. Guaranteed portability
  3. Startup enhancement
  4. Secure and flexible licensing

3. The Four-Stage Creation Process

The creation of a .sprun file begins with a "Unity Build," where the main source and all %include files are merged into a single block of code. This unified source then undergoes a four-stage process:

1. Minify
Strip comments and whitespace
(~30% smaller)
2. Compress
Reduce file size using
compression algorithms
3. Encrypt
Encrypt compressed data
for full protection
4. Base64 Encode
Encode to 7-bit ASCII
for safe delivery

4. Anatomy of a SPRUN File

A SPRUN file includes three main sections:

  • A header identifying the file format
  • A --required block for legal text and metadata
  • A --code block containing base64-encrypted data
*************************************************** ** Sheerpower Portable Runnable Image (SPRUN) ** *************************************************** --required ------------------------------------------------------------ Any attempt to reverse engineer this program is a violation of Copyright and License Agreements and is understood to cause extreme harm to the Copyright Holder. ------------------------------------------------------------ Deployment ID: 3234-3132-3331-3939-78 --end_required --code msfGXminJ40aWn6STdL1T7Kp9KzG4K+4tvV5Lruk2oBcqMQFsNS54ZutmVyMr3KouGgwK4tk xjUGNepSTeFg3LDWw=gZZOaR+mZPBo8tpS3wsZluXnZFek/x==hmZPf+SmLaBo8kJj8M2kvh oXJZm/9hgK0MtVsjamzPhq3tWkL+jikfXA+sqGcYI+n25ErtnmzaXb/Y2wSDQ= --end_code

5. Advanced Features and Implications

A. Performance Enhancement: The “Unity Build”

All %include files are bundled into a single in-memory buffer, eliminating file system latency. The runtime lexer benefits from uninterrupted, high-speed parsing. For large projects, SPRUN files often start faster than raw source code.

Advanced Security Note: Protection Against Memory Analysis

A common vulnerability in protected runtimes is the risk that an attacker could perform a memory dump to extract decrypted code. Sheerpower avoids this by processing encrypted code line by line.

Unlike systems that decrypt an entire application into memory, Sheerpower's VM only holds one decrypted line at a time. After compiling that line into internal p-code, the decrypted text is immediately erased from memory.

This transient approach means that even advanced memory analysis would fail to reconstruct the original source. It’s a deliberate design that ensures security through process as well as encryption.

B. Security Feature 1: Active Tamper-Proofing

The --required block is hashed into the decryption key. Changing any character invalidates the hash, making the SPRUN file unusable.

C. Security Feature 2: Secure, Custom Metadata for Licensing

For licensing, developers can embed custom text into the tamper-proof --required section using the %compile "your text here" directive. This can include client names, license keys, expiration dates, or feature flags. Because it becomes part of the hashed block, any tampering will invalidate the file—making license enforcement secure and automatic.

%compile "Client: Acme Corp" %compile "LicenseKey: ABC123-XYZ789" %compile "Expires: 2026-12-31"
Future-Proof Deployment: Because SPRUN files contain your original source code (securely encrypted), they automatically benefit from future Sheerpower VM improvements. Performance enhancements, new optimizations, and even fundamental runtime changes don't break existing deployed applications—they simply run faster or more efficiently with newer Sheerpower versions.

6. Conclusion

The SPRUN format is a cohesive, high-performance deployment solution that protects your code, accelerates startup, and enables secure commercial distribution—fully integrated with the Sheerpower Virtual Machine. It’s the default choice for deploying professional-grade Sheerpower applications.


(Show/Hide Sheerpower Build & Deployment Takeaways)
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.