Go to file
Bobby Lucero eacb86ec77 feat: comprehensive language enhancements and code quality improvements
Major additions and improvements across the Bob language ecosystem:

Core Language Features:

- Add comprehensive dictionary support with full CRUD operations

- Implement built-in functions: keys(), values(), has() for dictionaries

- Add string multiplication operator (string * number)

- Enhance error reporting with detailed context and call stacks

- Add ternary operator support (condition ? true_expr : false_expr)

- Implement do-while loops with break/continue support

- Add array increment/decrement operators (++, --)

- Add cross-type comparison operators with proper type coercion

- Implement toInt() function for float-to-integer conversion

- Add float array index auto-truncation (like JavaScript/Lua)

Code Quality & Linter Fixes:

- Remove all "using namespace std;" statements (best practice)

- Add proper std:: prefixes throughout codebase

- Fix const correctness in helper functions

- Resolve class/struct declaration mismatches

- Fix sign comparison warnings in array indexing

- Remove unused lambda captures in built-in functions

- Fix brace initialization warnings in parser

Documentation & Tooling:

- Significantly expand BOB_LANGUAGE_REFERENCE.md with new features

- Update VS Code extension with enhanced syntax highlighting

- Add comprehensive code snippets for new language features

- Update version information and package metadata

Test Suite:

- Add extensive dictionary functionality tests

- Add tests for new operators and built-in functions

- Add comprehensive copy behavior tests (by value vs by reference)

- Add performance and edge case testing

Architecture Improvements:

- Enhance Value system with proper move semantics

- Improve memory management with shared_ptr for complex types

- Add trampoline-based tail call optimization

- Implement proper error context propagation

This represents a major milestone in Bob language development with production-ready dictionary support, comprehensive testing, and significantly improved code quality.
2025-08-07 00:12:04 -04:00
.idea Tidy code, interactive interpreter prints out result of expression without explicit print statement 2023-06-01 17:19:19 -04:00
bob-language-extension feat: comprehensive language enhancements and code quality improvements 2025-08-07 00:12:04 -04:00
headers feat: comprehensive language enhancements and code quality improvements 2025-08-07 00:12:04 -04:00
source feat: comprehensive language enhancements and code quality improvements 2025-08-07 00:12:04 -04:00
tools Various changes 2025-08-06 21:42:09 -04:00
.gitignore More things 2025-08-06 00:57:36 -04:00
benchmark.py Implement functions, closures, standard library, and comprehensive number system 2025-07-30 17:51:48 -04:00
BOB_LANGUAGE_REFERENCE.md feat: comprehensive language enhancements and code quality improvements 2025-08-07 00:12:04 -04:00
Makefile Added if statements, more stdlib functions 2025-07-30 19:31:29 -04:00
pseudo_oop_examples.bob feat: comprehensive language enhancements and code quality improvements 2025-08-07 00:12:04 -04:00
README.md More things 2025-08-06 00:57:36 -04:00
ROADMAP.md More things 2025-08-06 00:57:36 -04:00
tco.bob RAII env 2025-08-05 20:40:40 -04:00
test_bob_language.bob feat: comprehensive language enhancements and code quality improvements 2025-08-07 00:12:04 -04:00
test_bracket_conflict.bob feat: comprehensive language enhancements and code quality improvements 2025-08-07 00:12:04 -04:00
test_fib.bob Various changes 2025-08-06 21:42:09 -04:00
tests.bob Various changes 2025-08-06 21:42:09 -04:00

Bob

A modern programming language focused on safety and clarity.

Design Philosophy

Bob prioritizes safety and functional programming while keeping things practical.

Assignment System

Bob uses two types of assignments to prevent bugs while keeping useful functionality:

Assignment Statements

var x = 5;
x = 10;           // Regular assignment
y += 5;           // Compound assignment

Assignment Expressions (For Loops Only)

for (var i = 0; i < 5; i = i + 1) { }  // Assignment in for loop
for (j = 0; j < 5; j += 1) { }         // Assignment in for loop

Why This Design?

Prevents Common Bugs:

// This would be a bug in many languages:
if (x = 10) { }  // Parse error in Bob - prevents accidental assignment

// Bob forces you to write:
x = 10;
if (x == 10) { }  // Clear comparison

Keeps Expressions Pure:

// Prevents side effects in expressions:
var result = (x = 10) + (y = 20);  // Parse error

// Forces clean code:
x = 10;
y = 20;
var result = x + y;  // Pure expression

Supports Functional Programming:

// Prevents confusing patterns:
var value = condition ? (x = 10) : (x = 20);  // Parse error

// Encourages clean patterns:
x = condition ? 10 : 20;  // Clear assignment

Keeps For Loops Practical:

// For loops work naturally:
for (var i = 0; i < 10; i = i + 1) { }  // Assignment expressions allowed
for (j = 0; j < 10; j += 1) { }         // Assignment expressions allowed

Benefits

  1. Prevents Common Bugs: No accidental assignments in conditionals
  2. Expression Purity: Expressions have no side effects
  3. Clear Semantics: Assignments are clearly statements
  4. Functional Programming: Encourages pure function patterns
  5. Practical For Loops: Maintains useful for loop syntax
  6. Easier Debugging: Clear separation of assignment and expression logic

Features

  • Type Safety: Dynamic typing with runtime type checking
  • Functional Programming: First-class functions, closures, recursion
  • Memory Management: Automatic memory management
  • Error Handling: Comprehensive error reporting
  • Standard Library: Built-in functions for common operations
  • Tail Call Optimization: Efficient recursive function calls

Documentation

See BOB_LANGUAGE_REFERENCE.md for complete language documentation.

Building

make clean && make
./build/bob your_file.bob

Testing

./build/bob test_bob_language.bob