A stack-based systems language that supports structures, functions, expressions, and user-defined operator behaviour

Overview

GeneralBasic

A stack-based systems language that supports structures, functions, expressions, and user-defined operator behaviour. Currently compiles to URCL with plans to add additional formats in the future.

Why Python?

The initial implementation of this compiler is written in Python. This allowed for flexibility during development and guaranteed portability across major platforms. This compiler may be ported to other languages in the future should the need arise.

Invoking the Compiler

python gb.py -o MyProgram.urcl MyProgram.gb
Argument Description
gb.py This is the main compiler script.
-o This is the output flag, which indicates the argument that should be used for the name of the output file.
MyProgram.urcl The name of the output file.
MyProgram.gb The name of an input source file. Multiple source files can be included.

GeneralBasic Syntax

Structures

Structures are a data type that can store multiple pieces of information, called fields.

Structure Ball
	Dim X As Integer
	Dim Y As Integer
End Structure

Pointers

Pointers are declared by adding an asterisk (*) to the end of the referenced type name.

Dim ballAddress As Ball*

A pointer can be dereferenced by using the ValueOf operator.

Dim ballAddress As Ball*

...

Dim ball As Ball
ball = ValueOf(ballAddress)

A pointer to a variable can be obtained using the AddressOf operator.

Dim ball As Ball

...

Dim ballAddress As Ball*
ballAddress = AddressOf(ball)

Type Casting

Type casting can be performed with the As operator.

Dim ballAddress As Ball*
ballAddress = 0x100 As Ball*

Functions and Subroutines

Functions can be declared with pass-by-value parameters and a return value.

Function AddNumbers(a As Integer, b As Integer) As Integer
	Return a + b
End Function

If a return value is not required, a subroutine can be used instead.

Sub PrintNumbers(a As Integer, b As Integer)
	Print(a)
	Print(b)
End Sub

Parameters can be made to pass-by-reference by adding ByRef before the parameter name.

Sub Bounce(ByRef this As Ball)
	this.Y = this.Y * -1
End Sub

Inline Assembly

Inline assembly allows for custom operations not supported by the compiler to be implemented on the target platform. Each command is prefixed with the Asm keyword followed by one of three command names: Load, Save, or Exec.

Load accepts one variable as an argument and pushes it onto the local stack.

Save accepts one variable as an argument and pops a value from the local stack into it.

Exec accepts one or more arguments and emits them as a raw instruction.

Sub AddOne(ByRef value As Integer)
	Asm Load value
	Asm Exec pop R1
	Asm Exec inc R1 R1
	Asm Exec psh R1
	Asm Save value
End Sub

Inline assembly statements are not exempt from emitter-level optimization and may be simplified or modified in cases such as extraneous stack operations or unused registers. Care should be taken to not modify the program's base pointer, as doing so could lead to unexpected or unsafe behaviour.

Owner
Lucida Dragon
Lucida Dragon
A web app via which users can buy and sell stocks using virtual money

finance Virtual Stock Trader. A web app via which users can buy and sell stocks using virtual money. All stock prices are real and provided by IEX. Fe

Kiron Deb 0 Jan 15, 2022
S3-cleaner - A Python script attempts to delete the all objects/delete markers/versions from specific S3 bucket

Remove All Objects From S3 Bucket This Python script attempts to delete the all

9 Jan 27, 2022
A Telegram bot that searches for the original source of anime, manga, and art

A Telegram bot that searches for the original source of anime, manga, and art How to use the bot Just send a screenshot of the anime, manga or art or

Kira Kormak 9 Dec 28, 2022
Telegram Link Wayback Bot. This bot archives a web page thrown at itself with wayback Machine (Archive.org).

Telegram Link Wayback Bot. This bot archives a web page thrown at itself with wayback Machine (Archive.org).

Hüzünlü Artemis [HuzunluArtemis] 11 Feb 18, 2022
Tiktok-bot - A tiktok bot with python

Install the requirements pip install selenium pip install pyfiglet==0.7.5 How ca

Ukis 5 Aug 23, 2022
A template that everyone can use for the start of their discord bot

Python Discord Bot Template This repository is a template that everyone can use for the start of their discord bot. When I first started creating my d

2 Nov 01, 2021
Download archived malware from ActiveState's source code mirror

malware-archivist (ma) Tool to aid security researchers in dissecting malware. Often, repository maintainers will remove malicious packages entirely f

ActiveState Software 28 Dec 12, 2022
Código para trabalho com o dataset Wine em Python

Um perceptron multicamadas (MLP) é uma rede neural artificial feedforward que gera um conjunto de saídas a partir de um conjunto de entradas. Um MLP é

Hemili Beatriz 1 Jan 08, 2022
The program for obtaining a horoscope in Python using API from rapidapi.com site.

Python horoscope The program allows you to get a horoscope for your zodiac sign and immediately translate it into almost any language. Step 1 The firs

Architect 0 Dec 25, 2021
⚔️ Fastest tibia bot API

📝 Description tibia bot api using python ⌨ Development ⚙ Running the app python bot.py ✅ ROADMAP Add confidence to floor level to have more accuracy

Lucas Santos 133 Dec 28, 2022
Python bindings to the Syncthing REST interface.

python-syncthing Python bindings to the Syncthing REST interface. Python API Documentation Syncthing Syncthing REST Documentation Syncthing Forums $ p

Blake VandeMerwe 64 Aug 13, 2022
An Advanced Python Playing Card Module that makes creating playing card games simple and easy!

playingcards.py An Advanced Python Playing Card Module that makes creating playing card games simple and easy! Features Easy to Understand Class Objec

Blake Potvin 5 Aug 30, 2022
Bot Telegram per creare e gestire un Babbo Natale Segreto con amici ecc

Babbo Natale Segreto: Telegram Bot Bot Telegram per creare e gestire un Babbo Natale Segreto con amici ecc. Che cos'è? Il Babbo Natale Segreto è un gi

Francesco Ciociola 2 Jul 18, 2022
Scrapping malaysianpaygap & Extracting data from the Instagram posts

Scrapping malaysianpaygap & Extracting data from the posts Recently @malaysianpaygap has gotten quite famous as a platform that enables workers throug

Yudhiesh Ravindranath 65 Nov 09, 2022
The Simple Google Colab Notebook to Download Files from Direct Link to Google Drive with custom name and bulk link support.

Direct Link to Google Drive (Advanced! 🔥 ) The Most Advanced yet Simple Google Colab Notebook to Download Files from Direct Link to Google Drive. 🆕

Dr.Caduceus 14 Jul 26, 2022
WhatSender is a python package that allows you to send Whatsapp messages at a given time.

WhatSender is a python package that allows you to send Whatsapp messages at a given time.

IdoBarel 0 Apr 21, 2022
Requests based multi-threaded script for increasing followers on Spotify

Proxyless Spotify Follow Bot Requests based multi-threaded script for increasing followers on Spotify. Click here to report bugs. Usage Download ZIP h

397 Jan 03, 2023
An asyncio Python wrapper around the Discord API, forked off of Rapptz's Discord.py.

Novus A modern, easy to use, feature-rich, and async ready API wrapper for Discord written in Python. A full fork of Rapptz's Discord.py library, with

Voxel Fox 60 Jan 03, 2023
Anime Streams Scrapper for Telegram Publicly Available for everyone to use

AniRocks Project Structure: ╭─ bot ├──── plugins: directory stored all the plugins ├──── utils: a directory of Utilities to help bot Client to create

ポキ 11 Oct 28, 2022
Tracks twitter spaces and sends it to a discord webhook.

Tracks twitter spaces and sends it to a discord webhook. Uses the twitter api to find twitter spaces and then the m3u8 url for the space is found using selenium and will have it posted using a discor

Sam Phung 20 Dec 17, 2022