/snekkyd

Decompiler for Snekky binary files

Primary LanguageHaxeMIT LicenseMIT

Snekky Decompiler

A tool which can be used to decompile Snekky bytecode files (.bite extension). Still in early development.

Installation

Download the latest version for your operating system of choice from the releases page or the latest build from the actions tab.

Alternative: Use the GUI frontend.

Usage

snekkyd <input> <out_folder>

Examples

Source Decompiled
let fact = func(n) {
  return if n <= 1 {
    1
  } else {
    n * fact(n - 1)
  };
};
mut fact = func(n) {
  return if (n <= 1) {
    1
  } else {
    (n * fact((n - 1)))
  };
};
for let i in 0...10 {
   Sys.println(i);
}
mut var0 = Range.Exclusive(0, 10).Iterator();
 
while var0.hasNext() {
  mut i = var0.next();
  Sys.println(i);
}
for let i in 0..100 {
  Sys.println(when {
    i % 3 == 0 && i % 5 == 0 => "FizzBuzz"
    i % 3 == 0 => "Fizz"
    i % 5 == 0 => "Buzz"
    else => i
  });
}
mut var0 = Range.Inclusive(0, 100).Iterator();
 
while var0.hasNext() {
  mut i = var0.next();
 
  Sys.println(if (((i % 3) == 0) && ((i % 5) == 0)) {
    "FizzBuzz"
  } else {
    if ((i % 3) == 0) {
      "Fizz"
    } else {
      if ((i % 5) == 0) {
        "Buzz"
      } else {
        i
      }
    }
  });
}
let animals = [
  {
    name: "axolotl",
    cool: true
  },
  {
    name: "stork",
    cool: false
  }
];
 
let [axolotl, stork] = animals;
let {name} = axolotl;
   
Sys.println(name);
mut animals = [{cool: true, name: "axolotl"}, 
{cool: false, name: "stork"}];
 
mut var1 = animals;
 
mut axolotl = var1[0];
 
mut stork = var1[1];
 
mut var4 = axolotl;
 
mut name = var4.name;
 
Sys.println(name);