Skip to content

Releases: saksham-joshi/SRON

SRON v2.3

03 Jan 03:18

Choose a tag to compare

🚀 SRON v2.3

The Evolution Continues: Stability, Performance & Cross-Platform Power

Version
Platform
License
Release Date

SRON 2.3 marks a significant milestone with Linux support, a complete file I/O system, enhanced stability, and refined developer experience. This release brings 33+ improvements across compilation, execution, safety, and usability.

📘 Documentation🌐 Website💬 Discussions🐛 Report Issues


🎯 Release Highlights

🐧 Cross-Platform Support

SRON is now officially available on Linux, extending its reach beyond Windows with native support and optimized performance.

📁 Complete File I/O System

New FileReader and FileWriter types with 11+ functions for comprehensive file manipulation.

🛡️ Enhanced Stability

Critical bug fixes including stack overflow handling, proper error messages, and signal interrupt management.

Performance Improvements

  • 2000 call stack size (2x Python's 996)
  • Millisecond-precision execution timing
  • Optimized semantic analysis
  • Return value optimization enhancements

🎨 Developer Experience

  • Colorized terminal output
  • Clearer error messages
  • Consistent naming conventions
  • Platform-specific code blocks

✨ What's New

🌍 Platform & System Improvements

Linux Support

SRON now runs natively on Linux systems, bringing the same performance and features to Unix-based platforms.

Platform-Specific Code Blocks

{
    name : Main

    // Execute code only on Windows
    windows : {
        print("Running on Windows!");
    }

    // Execute code only on Linux
    linux : {
        print("Running on Linux!");
    }
}

Signal Handling

Proper handling for system signals ensures safety and prevents memory leaks:

  • SIGINT - Interrupt from keyboard (Ctrl+C)
  • SIGTERM - Termination request
  • SIGKILL - Force kill signal
  • SIGSEGV - Segmentation fault
  • SIGABRT - Abort signal
  • SIGBREAK - Break signal

New exit codes (7-13) syndicate signal interrupts for better debugging.


🔧 Core Language Enhancements

Expanded Call Stack

// Call stack size increased to 2000
// (Python: 996, SRON 2.3: 2000)
  • Stack overflow now reports exit code 6 with proper error messages
  • No more silent program termination

Precise Execution Timing

{
    name : Main
   
    // Your code here
    Any endTime = getExecTime();
    
    print("Execution time: " + getExecTime() + "ms");
}

getExecTime() now returns milliseconds instead of seconds for precise profiling.

Flexible Main Function Return

{
    name : Main

    // Return custom exit codes
    return : 0  // Success
    return : 1  // Error
    return : 42 // Custom code
}

📝 Syntax Updates

Mathematical Block Syntax

// Old syntax (≤ v2.2)
Any result = ~{a + b * c}~;

// New syntax (v2.3)
Any result = ${a + b * c};

Bitwise Operators

// Updated operators for consistency
Any bitwiseAnd = x & y;    // Previously: x and y
Any bitwiseOr = x | y;     // Previously: x or y
Any bitwiseNot = ~x;       // Previously: not x

Escape Sequences

Added support for:

  • \r - Carriage return
  • \b - Backspace

ANSI Color Codes

Pre-defined compile-time variables for terminal colors:

{
    name : Main

    print(CLI_COLOR_BLUE, "Blue text" , CLI_DESIGN_RESET)
    print(CLI_COLOR_RED , "Red text" , CLI_DESIGN_RESET)

}

📁 File I/O System (New)

New Data Types

Type Purpose
FileReader Read text files with various methods
FileWriter Write and manipulate text files
LiteralString Zero-copy string literals from bytecode

File Operations

File Management

File Information

Reading Operations

Writing Operations

Type Checking Functions


🐛 Bug Fixes

Critical Fixes

Stack Overflow Handling

  • Fixed vulnerability causing silent program termination
  • Now displays proper error messages
  • Returns exit code 6 for stack overflow

Compiler Error Reporting

  • Fixed incorrect line numbers in error messages
  • Accurate source code location tracking

Function Fixes

  • sizeof() - Now returns correct size values
  • at() - Fixed vulnerability causing program halt on out-of-bounds
  • Mathematical block semantic analysis corrected

Type System Improvements

  • Removed implicit String to List conversion for predictable behavior
  • Enhanced type checking consistency
  • Stricter type enforcement

🎨 Developer Experience Improvements

Colorized Output

Message Type Color Purpose
🔴 Errors Red Critical issues
🟡 Warnings Yellow Potential problems
🔵 Information Blue General messages

Naming Convention Standardization

All built-in functions migrated from snake_case to camelCase:

// Old (≤ v2.2)          // New (v2.3)
get_exec_time()      →   getExecTime()
is_file_reader()     →   isFileReader()
is_alpha_num()       →   isAlphaNum()
f_read_line()        →   freadLine()

Enhanced Error Messages

  • Clearer, more informative error descriptions
  • Better context for debugging
  • Actionable suggestions

Improved Version Display

$ sronc --version

Now displays beautifully formatted version information with details.


🏗️ Internal Improvements

Codebase Quality

  • More readable and intuitive code structure
  • Enhanced maintainability
  • Better organization and modularity
  • Improved documentation

Type System Refinement

  • Interpreter typing conventions standardized
  • Better consistency across operations
  • More predictable behavior

Memory Safety

  • Proper signal handling prevents memory leaks
  • Graceful shutdown procedures
  • Resource cleanup guarantees

📊 Performance Metrics

Metric v2.2 v2.3 Improvement
Call Stack Size 1000 2000 +100%
Time Precision Seconds Milliseconds 1000x
Platform Support Windows Windows + Linux +100%
Built-in Functions ~40 ~55 +37.5%
Exit Codes 6 13 +117%

🚀 Migration Guide

From v2.2 to v2.3

Update Mathematical Blocks

// Change all occurrences
~{expression}~  →  ${expression}

Update Bitwise Operators

x and y  →  x & y
x or y   →  x | y
not x    →  ~x

Update Function Names

// Update to camelCase
get_exec_time()  →  getExecTime()
// ... and other snake_case functions

Review String-to-List Conversions

...

Read more

SRON v2.2

29 Jun 11:10

Choose a tag to compare

SRON v2.2 – Faster, Smarter, and More Secure 🚀

We’re excited to release SRON version 2.2, bringing major performance improvements, codebase modernization, new features, and better security.
This version marks a significant upgrade over v2.1 and further strengthens SRON’s position as a powerful programming language for high-performance applications.


🔧 Overall Changes

  • Removed deprecated 'free' attribute
  • SRON v2.1 is now open source!
  • Enhanced overall security
  • Function calls are now strictly case-sensitive
  • Compiler moved from GCC to Clang
  • Migrated codebase from C++11 to modern C++23
  • Introduced OBUFFER keyword for output buffering
  • Added internal runtime tuning codes for interpreter optimization

🧠 Compiler Enhancements

  • Fixed several bugs and vulnerabilities
  • Improved analysis of variables within the 'rotate' attribute
  • Introduced scope-based error analysis
  • More precise and accurate code analysis
  • Refactored for cleaner and more intuitive source code

⚙️ Interpreter Improvements

  • Fixed multiple bugs and vulnerabilities
  • Resolved 'variable not found' in 'rotate' attribute
  • Significantly faster function calls and variable access
  • Added bytecode caching & mapping for improved performance during recursion and multiple calls
  • Optimized memory allocation and mathematical operations
  • Removed 'free' attribute from runtime
  • Optimized 'rotate' and 'console' attributes
  • SRON now blocks execution with mutating bytecodes
  • Faster printing of list values
  • Added sron_cmd() for interacting with internal interpreter components
  • Renamed display_exception() to throw_exception() for clarity

This release improves not just speed and reliability but also sets the foundation for future innovations in SRON.
Thank you for supporting the development!

SRON v2.1

01 Dec 02:53
40078fa

Choose a tag to compare

SRON v2.1 Release Notes 🎉

December 1, 2024

I, Saksham Joshi is excited to announce the release of SRON version 2.1! This version brings a range of powerful new features, optimizations, and bug fixes, making SRON faster, safer, and more efficient than ever before. Below is a detailed list of updates included in this release:


🚀 New Features

🗑️ Added Garbage Collector

  • Description: SRON now manages memory automatically with a Garbage Collector, ensuring no memory leaks. This feature significantly enhances the language's safety and stability.

📊 Added New Datatype: Collective

  • Description: Collective is an abstract base type for String and List. While it cannot be instantiated directly, it works in the background to unify and simplify type handling for String and List.

🛡️ Strict Argument Passing

  • Description: Ensure runtime type safety with keywords like Int_s, Double_s, Char_s, String_s, Bool_s, and List_s. Functions will throw exceptions if arguments are not of the expected type.

📜 Static Typing Support

  • Description: SRON now supports both static and dynamic typing. Use Int, Double, Char, Bool, String, and List for statically typed variables.

🧠 Better Semantic Analysis

  • Description: The 3-phased vector-based compiler ensures better syntax checks and provides highly accurate error messages for an enhanced developer experience.

🧮 Bitwise Operators

  • New Operators: xor, lsft (left shift), rsft (right shift), and (bitwise AND), or (bitwise OR), and not (bitwise NOT).
  • Purpose: Optimize code with low-level, efficient operations.

🌀 Foreach Loop

  • Description: Simplify value access with the new foreach loop, offering faster iteration with clean syntax.

Compiler and Interpreter Optimizations

Compiler Enhancements

  • Optimization: Memory usage reduced by 75%.
  • Compile-Time Features:
    • Dead code elimination.
    • Optimized bytecode generation.
    • Variable and function hashing for faster execution.

Interpreter Enhancements

  • Optimization:
    • Memory usage reduced by 72%.
    • Power consumption decreased by 50%.
    • Speed increased by 48% for multiple scenarios.

🛠️ Changes and Improvements

Console Attribute

  • Description: Use the console attribute for faster and more efficient value printing in the command line. It eliminates overhead and writes constants directly for reduced memory usage.

Math Block Syntax Update

  • New Syntax: Declare mathematical blocks using ~{ }~ instead of just ~.

New Assignment Operators

  • Added: +=, -=, *=, /=, %=, ^=.
  • Benefit: These operators offer quick and efficient updates without altering the underlying variable type.

Strict Compare Operator (===)

  • Description: Use === to check both type and content equality for strict comparisons.

Returning Specific Value Types

  • Description: Functions can now specify return types using the type attribute for added clarity and type safety.

Rotate Attribute

  • Description: Optimize variable swapping or shifting multiple values with the new rotate attribute, improving performance at compile time.

Precedence Update

  • Changes: Operators <=, >=, <, > now have higher precedence than == and !=.

Added attribute 'type'

  • 'type' attribute will define what type of value, the function will return.

🗑️ Deprecated Features

  • Removed comment Attribute: Comments are now handled using the @ symbol.
  • Numeric Attributes: Removed for faster and more readable code.

🔒 Security Enhancements

  • Secure Bytecode: Bytecode is now generated in binary format, making decompilation and unauthorized changes nearly impossible.
  • Memory Ownership Model: All the memory allocated during the runtime is owned by one owner only and the rest of other variables just has the ability to read and manipulate the data but cannot change the owner of the memory. If the owner is destructed, then the memory will be deallocated and if the other variables tries to access it, the program will exit with code -1.

🐞 Bug Fixes

  • Fixed 54+ bugs, including memory leaks and vulnerabilities from SRON v1.5, ensuring a more stable and secure language.

🌍 Open Source

SRON is now open source! Visit Github to access the source code and contribute to the project.


Thank you for your continued support! Dive into SRON v2.1 and explore its enhanced features and capabilities.