The Argo's repo: where the ArgoCompiler and the ArgoVM find their home.

Overview

Argo

ArgoVM is a stack-based virtual machine similar to JVM.

It runs the file provided by ArgoC (Argo Compiler) which transform the argo-lang into an executable byte-code format.

Instruction Set

OP Usage Function
HLT HLT Terminate the program
NOP NOP Nothing
PSH PSH, value Pushes value on the stack
POP POP Pops value from stack
ADD ADD Pops the last two values from the stack, it sums then push the result
SUB SUB Pops the last two values from the stack, it subtracts then push the result
MUL MUL Pops the last two values from the stack, it multiplies then push the result
DIV DIV Pops the last two values from the stack, it divides then push the results (value and rest)
NEG NEG Pops the last value from the stack, it negate then push the results
SWP SWP Pops the last two values from the stack, it swap them then push the result on the stack
CMP CMP Peeks the last two values from the stack, then set the CMP register to one of these values: (EQUALS, LESSER, GREATER)
JMP JMP, idx Jumps at given instruction index
JEQ JEQ, idx Jumps at given instruction index only if the CMP flag is set to EQUALS
JNE JNE, idx Jumps at given instruction index only if the CMP flag is NOT set to EQUALS
JMG JMG, idx Jumps at given instruction index only if the CMP flag is set to GREATER
JML JML, idx Jumps at given instruction index only if the CMP flag is set to LESSER
JGE JGE, idx Jumps at given instruction index only if the CMP flag is set to EQUALS or GREATER
JLE JLE, idx Jumps at given instruction index only if the CMP flag is set to EQUALS or LESSER
CLL CLL, idx Executes the given routine identifier
RET RET Routine specific instruction, it's used to terminate the current routine flow
PRINT PRINT Peeks the last value from the stack and print it.

Grammar

Basics

Let's see some syntax in action

# sum.argo
#
# Define the main function (entry point)

:main {
    PSH, 5
    PSH, 4
    ADD
    PRINT
    HLT
}

Iteration

You can reproduce any conditional-structure you like with the following instructions

# iterate.argo
#
# function main() {
#   for(var i = 0; i <= 100; ++i) {
#     print(i); 
#   }
# }
#

:main {
  PSH, 1
  PRINT
  PSH, 1
  ADD
  PSH, 100 
  CMP
  POP
  JLE, 2
  HLT
}

Routines

Splitting the code workflow among other calls, arguments should be pushed on stack before calling the function meanwhile the return address is managed automatically.

# The following .argo equals to this code:
# 
# function printer(var x){
#   print(x);
# }
#
# function sum(var a, var b) {
#   return a + b;
# }
#
# function main() {
#   printer(sum(5, 4));
#   return;
# }
#

:main {
    PSH, 5
    PSH, 4 
    CLL, sum 
    HLT
}

:sum {
    ADD
    CLL, printer
    RET
}

:printer {
    PRINT
    RET
}

The workflow

This is how its expected to work at the end of development:

Argonauts (Lang) -> Argo (ASM) -> Bytecode (ArgoCode) -> ArgoVM

Currently there is no Argonauts lang, I'm still working on Argo.

Project

Structure

The current ArgoVM is written in C meanwhile the compiler ArgoC is written using Java, some additionals dev-tools are made in Perl.

src
|
|-- assembler  # The ArgoC  home directory
|-- vm         # The ArgoVM home directory

TODO ...

You might also like...

java deep learning algorithms and deep neural networks with gpu acceleration

Deep Neural Networks with GPU support Update This is a newer version of the framework, that I developed while working at ExB Research. Currently, you

Jan 6, 2023

statistics, data mining and machine learning toolbox

statistics, data mining and machine learning toolbox

Disambiguation (Italian dictionary) Field of turnips. It is also a place where there is confusion, where tricks and sims are plotted. (Computer scienc

Jun 11, 2022

SparkFE is the LLVM-based and high-performance Spark native execution engine which is designed for feature engineering.

SparkFE is the LLVM-based and high-performance Spark native execution engine which is designed for feature engineering.

Spark has rapidly emerged as the de facto standard for big data processing. However, it is not designed for machine learning which has more and more limitation in AI scenarios. SparkFE rewrite the execution engine in C++ and achieve more than 6x performance improvement for feature extraction. It guarantees the online-offline consistency which makes AI landing much easier. For further details, please refer to SparkFE Documentation.

Jun 10, 2021

A Common Criteria (CC) and FIDO certified FIDO U2F javacard applet.

A Common Criteria (CC) and FIDO certified FIDO U2F javacard applet.

de.fac2 - FIDO U2F Authenticator Applet v1.34 de.fac2 is a Javacard applet which implements a Fido U2F token. It was designed and implemented based on

Nov 20, 2022

CompreFace is a free and open-source face recognition system from Exadel

 CompreFace is a free and open-source face recognition system from Exadel

CompreFace can be easily integrated into any system without prior machine learning skills. CompreFace provides REST API for face recognition, face verification, face detection, landmark detection, age, and gender recognition and is easily deployed with docker

Dec 31, 2022

A scale demo of Neo4j Fabric spanning up to 1129 machines/shards running a 100TB (LDBC) dataset with 1.2tn nodes and relationships.

A scale demo of Neo4j Fabric spanning up to 1129 machines/shards running a 100TB (LDBC) dataset with 1.2tn nodes and relationships.

Demo application instructions Overview This repository contains the code necessary to reproduce the results for the Trillion Entity demonstration that

Nov 23, 2022

💻 Machine Coding - leetcode LLD (coding blox) - It is an Online Coding Platform that allows a user to Sign Up, Create Contests and participate in Contests hosted by Others.

leetcode-lld-flipkart-coding-blox Machine coding - leetcode LLD (coding blox) My Approach : https://leetcode.com/discuss/interview-question/object-ori

Sep 15, 2022

A Simple movies app using JAVA,MVVM and with a offline caching capability

A Simple movies app using JAVA,MVVM and with a offline caching capability

IMDB-CLONE A simple imdb clone using JAVA,MVVM with searching and bookmarking ability with offline caching ability screenshots Home Screen 1 Home Scre

Aug 16, 2022
Owner
Giuseppe B.
Logic is the brush I use to paint a part of the world of tomorrow
Giuseppe B.
Chih-Jen Lin 4.3k Jan 2, 2023
Bazel training materials and codelabs focused on beginner, advanced and contributor learning paths

Bazel-learning-paths This repo has materials for learning Bazel: codelabs, presentations, examples. We are open sourcing the content for training engi

null 18 Nov 14, 2022
👄 The most accurate natural language detection library for Java and the JVM, suitable for long and short text alike

Quick Info this library tries to solve language detection of very short words and phrases, even shorter than tweets makes use of both statistical and

Peter M. Stahl 532 Dec 28, 2022
Detection, Classification, and Localisation of marine mammal and other bioacoustic signals

This is the main code repository for the PAMGuard software. This repository was created on 7 January 2022 from sourceforge SVN repository at https://s

PAMGuard 8 Nov 4, 2022
This repository holds the famous Data Structures (mostly abstract ones) and Algorithms for sorting, traversing, and modifying them.

Data-Structures-and-Algorithms About Repo The repo contains the algorithms for manipulating the abstract data structures like Linked List, Stacks, Que

Zaid Ahmed 14 Dec 26, 2021
Stream Processing and Complex Event Processing Engine

Siddhi Core Libraries Siddhi is a cloud native Streaming and Complex Event Processing engine that understands Streaming SQL queries in order to captur

Siddhi - Cloud Native Stream Processor 1.4k Jan 6, 2023
Model import deployment framework for retraining models (pytorch, tensorflow,keras) deploying in JVM Micro service environments, mobile devices, iot, and Apache Spark

The Eclipse Deeplearning4J (DL4J) ecosystem is a set of projects intended to support all the needs of a JVM based deep learning application. This mean

Eclipse Foundation 12.7k Dec 30, 2022
Datumbox is an open-source Machine Learning framework written in Java which allows the rapid development of Machine Learning and Statistical applications.

Datumbox Machine Learning Framework The Datumbox Machine Learning Framework is an open-source framework written in Java which allows the rapid develop

Vasilis Vryniotis 1.1k Dec 9, 2022