GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - Dinnerbone/Rascal: Rust ActionScript Compiler (and linker, technically).

BranchesTags
Open more actions menu

Latest commit

 

History

382 Commits
382 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
crates
crates
 
 
samples
samples
 
 
.gitignore
.gitignore
 
 
Cargo.lock
Cargo.lock
 
 
Cargo.toml
Cargo.toml
 
 
LICENSE-APACHE
LICENSE-APACHE
 
 
LICENSE-MIT
LICENSE-MIT
 
 
README.md
README.md
 
 
bacon.toml
bacon.toml
 
 

Repository files navigation

Rascal

License

Rascal is an open source ActionScript 2 compiler, with aspirations for further ActionScript and SWF editing capabilities in the future.

It was primarily developed for use with Ruffle, and allows the authoring and editing of ActionScript 1 and 2 content without the need to hunt down a copy of Flash from eBay.

Command Line Usage

A basic CLI is provided for compiling ActionScript files to SWF files.

Installation

  • Clone the repository
  • Run cargo install --path crates/cli --release

Usage

For full CLI usage, run rascal --help.

There are two kinds of inputs, and they are intermixable.

  • rascal foo.as - Compiles a script (not a class, loose code) into a SWF file.
    • Multiple script files can be specified, and they will execute in the order they are specified.
  • rascal -c some.ClassName - Compiles a class named some.ClassName (expected to be available at some/ClassName.as) into a SWF file.
    • The classpath defaults to working directory, but can be specified via the --classpath flag.
    • Multiple class names can be specified, and they will be loaded in the order they are specified.
    • If one (and only one) class has a static function main(), it will be executed as the entry point to the swf.

Various options about the output are available:

  • -o foo.swf/--output foo.swf - The output SWF file
    • This defaults to either the first script file + .swf, else output.swf
  • -v 10/--swf-version 10 - The version of SWF file to produce
    • This defaults to 15, which corresponds to Flash Player 11.2
  • --frame-rate 30 - The frame rate of the SWF file
    • This defaults to 24

Library

Super simple API right now:

use rascal::ProgramBuilder;
use rascal::provider::FileSystemSourceProvider;
fn main() {
    // A source provider is responsible for resolving files during compilation.
    // A file system source provider is provided for convenience, which takes a root directory as a "class path".
    let source_provider = FileSystemSourceProvider::with_root(PathBuf::from("."));
    let program = ProgramBuilder::new(source_provider)
        .add_script("foo.as") // Adds `foo.as` as a script to run
        .add_class("some.ClassName") // Adds `some/ClassName.as` as a class to load
        .build()?;
    let compiled_program = program.compile(/* swf_version= */ 15);
    let swf = compiled_program.to_swf(/* frame_rate= */ 24.0)?;
    // Do something with the SWF file.
}

License

Rascal is licensed MIT or Apache-2.0, at your option.

About

Rust ActionScript Compiler (and linker, technically).

Resources

Readme
Activity

Stars

22 stars

Watchers

2 watching

Forks

2 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.