Skip to content
edanickPublic

About

The Silver compiler for turning limitless imagination into software, powerful creations, tools, and experiences. One Language, Many Possibilities.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

841 Commits

Folders and files

Repository files navigation

Silver Compiler

A modern, expressive systems language for turning limitless imagination into powerful creations, tools, command-line applications, and experiences.

Silver brings familiar C-style structure together with concise syntax, strong types, native compilation, and a growing standard library, giving you one language for many possibilities.

Credits

  • Author: Edan M.
  • Version: 0.7.15
  • Copyright: © 2025 Edan M.

Mac OS Version

  • Credit: Stav A (2026) - Mac OS support, initial QA of the Mac OS version.
  • Enabling Silver compiler support on Mac OS (Rosetta x86_64 backend)
  • Programming language creator: Edan M.

Quick start

The macOS stage-1 executable is in executables/macos/. The macOS workspace's test fixtures are in Mac Tests/. See their READMEs for the known test failures and unsuccessful stage-3 bootstrap.

Put silverc on your PATH

Windows

Pick either a global binaries directory or a per-user one under AppData.

Option 1 - global C:\bin (needs admin to create):

mkdir C:\bin
setx PATH "$env:PATH;C:\bin"

Download or copy silverc.exe into C:\bin.

Option 2 - per-user %appdata%\silver\bin (no admin needed):

mkdir "$env:APPDATA\silver\bin"
setx PATH "$env:PATH;$env:APPDATA\silver\bin"

Download or copy silverc.exe into %appdata%\silver\bin.

Reopen the terminal afterwards, then verify with silverc --version.

Linux and macOS

Both use the same location, ~/.local/bin:

test -d ~/.local/bin || mkdir -p ~/.local/bin

Copy it from your Downloads folder:

cp ~/Downloads/silverc ~/.local/bin/silverc
chmod +x ~/.local/bin/silverc

Or download it straight there with curl:

curl -L -o ~/.local/bin/silverc <download-url>
chmod +x ~/.local/bin/silverc

Make sure ~/.local/bin is on your PATH:

export PATH="$HOME/.local/bin:$PATH"

Add that line to ~/.bashrc (Linux) or ~/.zshrc (macOS, the default shell) so it persists. Most Linux distributions pick up ~/.local/bin automatically once it exists (re-login to apply); macOS always needs the export line above, then source ~/.zshrc.

Verify with silverc --version.

Build a Silver program

Run these commands from the workspace root. Place the compiler on your PATH under the command name silverc, then compile a program:

# Example after installing/renaming the compiler to `silverc`
silverc path/to/program.sr -o program.exe

Silver source files use the .sr extension. Programs begin at void main():

void main() {
    string message = "Hello from Silver";
    printline(message);
}

Run Silver code directly

For immediate execution without a native compilation step, use the Silver interpreter in silveri/:

silveri path/to/program.sr

Language highlights

  • Native compilation for fast, standalone applications
  • Clear, type-first declarations with optional inference through var
  • Mutable and immutable variables using explicit mut
  • Dynamic arrays with expressive collection operations
  • Classes, constructors, properties, inheritance, and foundations
  • Nullable types with ? and union types with <type1 | type2>
  • Pattern matching, ternary expressions, loops, and recursion
  • String interpolation with $"..."
  • Modules and imports with a simple import syntax
  • Standard-library support for filesystem, networking, JSON, system, and other APIs
  • A cross-platform design direction for compilers, interpreters, and native tooling

A small example

class Greeter {
    public prop string name;

    construct (string name) {
        this.name = name;
    }

    public string greet() {
        return $"Hello, {this.name}!";
    }
}

void main() {
    Greeter greeter = new Greeter("Silver");
    printline(greeter.greet());
}

License

Edan M. © 2025 All Rights Reserved Proprietary

About

The Silver compiler for turning limitless imagination into software, powerful creations, tools, and experiences. One Language, Many Possibilities.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages