abbyEVM

AbbyScript Examples

This directory contains example programs demonstrating various features of AbbyScript.

Console Logging Examples (NEW!)

console_logging.abs

Comprehensive demonstration of the new console.log functionality:

variables_demo.abs

Simple demonstration of variable assignment and console output:

number_literals.abs

Tests different ways to output numbers:

Memory and Storage Examples

memory_operations.abs

Demonstrates memory and storage operations:

Language Features

arithmetic.abs

Basic arithmetic operations

conditional.abs

If/else conditional statements

functions.abs

Function declarations and calls

storage.abs

Storage operations

simple_js_syntax.abs

JavaScript-like syntax examples

simple_js_no_loops.abs

JavaScript syntax without loops

Usage

Compile and run any example:

# Compile only
./target/debug/abby_evm compile --file examples/abbyscript/console_logging.abs

# Compile and execute
./target/debug/abby_evm execute --bytecode $(./target/debug/abby_evm compile --file examples/abbyscript/variables_demo.abs 2>/dev/null | grep 'Bytecode:' | cut -d' ' -f2)

Recent Updates

Console.log with Variables: Console logging now supports both string literals and variables
Multi-argument Support: console.log("text:", variable) with automatic spacing
Single-digit Numbers: Full support for displaying numbers 0-9
Mixed Output: Can combine strings and variables in the same program

Current Limitations