Skip to content

Fragmenta-Company/SquidVM

Repository files navigation

SquidVM Logo

Rust

GitHub commit activity (branch) GitHub last commit (by committer) GitHub Release Date GitHub License

  _____             _     ___      ____  __ 
 / ____|           (_)   | \ \    / /  \/  |
| (___   __ _ _   _ _  __| |\ \  / /| \  / |
 \___ \ / _` | | | | |/ _` | \ \/ / | |\/| |
 ____) | (_| | |_| | | (_| |  \  /  | |  | |
|_____/ \__, |\__,_|_|\__,_|   \/   |_|  |_|
           | |                              
           |_|                              

What is the SquidVM?

SquidVM is a Stack-based VM made from the ground up using Rust for its implementation.

The VM will contain a programming language with the name Squid and a simpler scripting language called Squipt. Both will be made for working together and also both will be statically and strongly typed.

The main difference between them is that int, unsigned int, float, [...] will be replaced with number, unsafe blocks will not be supported and some other changes made for simplicity in Squipt.

I'm also thinking of implementing a dynamically typed language.

That one will also be made for working together with the other two natively.

How to install it?

Linux

Download the installation script for:

After that, you will need to make the script executable:

foo@bar:~$ chmod +x ./install-svdk.sh

Then run the setup:

foo@bar:~$ sudo ./install-svdk.sh

For a more specialized setup

I would rather recommend compiling from source and installing to a desired folder.

Windows

todo!();

MacOS

todo!();

How to use?

If you are trying to run your compiled SquidVM bytecode:

# Try this command to learn a bit
foo@bar:~$ squidvm --help

# If you are a VM developer or trying to debug
# Try this instead:
foo@bar:~$ svdk --help

What is a .sqd file?

It's the binary file that contains the instructions and data the VM will use to run your program!

Want to know more about the instruction set, working stack, return stack, function cache, heap regions, the global repository and more? Access the documentation here.

I'll probably make a simple wiki for that in some time! Just wait for it.

How to open .sqd files

The command requires tags now!

# For binary files
foo@bar:~$ squid-vm -b testbinary
# For SARs
foo@bar:~$ squid-vm -s sarfile

Both don't need the extension to be typed.

Versions 0.9.0-alpha and older use .sqdbin instead of .sqd. The change was made for simplification.

# Run like this
foo@bar:~$ ./squid-vm(.exe) testbinary.sqdbin
# Older versions use the `.sqdbin` extension

Here ya go!

Hope it helps. : )

What are .sar files?

SARs, or Squid ARchives, are files that group binaries into a single archive containing types, metadata, and native libraries.

They are designed so that instead of sharing numerous bytecode files, each with different metadata, you can share a single file containing all the bytecode.

Can SARs be compressed or encrypted?

For now, it's just a plan, but if all goes well, it will have support for all that and more in the future.

IT'S NOT IMPLEMENTED YET!

The above warning will be removed when SARs are made available!

What is Spark?

Spark is a benchmarking, profiling and debugging tool for the SquidVM.

It will be used like this:

# For debugging
foo@bar:~$ squidvm spark --debug -b ./binary # or -s ./sar
# For benchmarking
foo@bar:~$ squidvm spark --bench -b ./binary # or -s ./sar
# For profiling
foo@bar:~$ squidvm spark --profile -b ./binary # or -s ./sar

IT'S NOT IMPLEMENTED YET!

The above warning will be removed when Spark is ready!

todo!();