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 script to bulk check usernames on multiple site. includes proxy & threading support.

linked-bulk-checker bulk checks username availability on multiple sites info people have been selling these so i just made one to release dm my discor

krul 9 Sep 20, 2021
Music bot because Octave is down and I can : )

Chords On a mission to build the best Discord Music Bot View Demo · Report Bug · Request Feature Table of Contents About The Project Built With Gettin

Aman Prakash Jha 53 Jan 07, 2023
A discord bot with a leveling system (similar to mee6).

Discord.py A discord bot with a leveling system (like mee6) Pre-requisites Knowing how to get create an app/bot via discord's developer portal. Websit

26 Dec 11, 2022
Aqui está disponível GRATUITAMENTE, um bot de discord feito em python, saiba que, terá que criar seu bot como aplicação, e utilizar seu próprio token, e lembrando, é um bot básico, não se utiliza Cogs nem slash commands nele!

BotDiscordPython Aqui está disponível GRATUITAMENTE, um bot de discord feito em python, saiba que, terá que criar seu bot como aplicação, e utilizar s

Matheus Muguet 4 Feb 05, 2022
Bitbucket Server API Wrapper

A simple wrapper for the Atlassian's Bitbucket Server / Bitbucket Datacenter (formerly Stash) REST API, written in Python.

Schweitzer Engineering Laboratories 4 Jan 06, 2023
Kevin L. 3 Jul 14, 2022
An API wrapper for the file.io web service.

🗃️ File.io An API wrapper for the file.io web service. Install $ pip3 install fileio or

nkot56297 1 Dec 18, 2021
Spore Api

SporeApi Spore Api Simple example: import asyncio from spore_api.client import SporeClient async def main() - None: async with SporeClient() a

LEv145 16 Aug 02, 2022
♻️ API to run evaluations of the FAIR principles (Findable, Accessible, Interoperable, Reusable) on online resources

♻️ FAIR enough 🎯 An OpenAPI where anyone can run evaluations to assess how compliant to the FAIR principles is a resource, given the resource identif

Maastricht University IDS 4 Oct 20, 2022
An Unofficial TikTok API Wrapper In Python

This is an unofficial api wrapper for TikTok.com in python. With this api you are able to call most trending and fetch specific user information as well as much more.

David Teather 2.9k Jan 08, 2023
Full-featured Python interface for the Slack API

This repository is archived and will not receive any updates It's time to say goodbye. I'm archiving Slacker. It's been getting harder to find time to

Oktay Sancak 1.6k Dec 13, 2022
Blankly - 🚀 💸 Trade stocks, cryptos, and forex w/ one package. Easily build, backtest, trade, and deploy across exchanges in a few lines of code.

💨 Rapidly build and deploy quantitative models for stocks, crypto, and forex 🚀 View Docs · Our Website · Join Our Newsletter · Getting Started Why B

Blankly Finance 1.4k Jan 03, 2023
Telegram bot to host python bots

Host-Bot Setup the api Upload the flask api on your host #its not important to do #i used it just for simple captcha system + save ids on your host!

Plugin 15 Feb 11, 2022
A simple healthcheck wrapper to monitor Kafka.

kafka-healthcheck A simple healthcheck wrapper to monitor Kafka. Kafka Healthcheck is a simple server that provides a singular API endpoint to determi

Rodrigo Nicolas Garcia 3 Oct 17, 2022
Go-cqhttp Plugin for EFB QQ Slave.

efb-qq-plugin-go-cqhttp efb-qq-plugin-go-cqhttp 是 efb-qq-slave 的插件,需要配合 efb-qq-slave 使用,使用前请先阅读 efb-qq-slave 的文档。

XYenon 26 Dec 11, 2022
Jira-cache - Jira cache with python

Direct queries to Jira have two issues: they are sloooooow many queries are impo

John Scott 6 Oct 08, 2022
Instagram Brute force attack helps you to find password of an instagram account from your list of provided password.

Instagram Brute force attack Instagram Brute force attack helps you to find password of an instagram account from your list of provided password. Inst

Naman Raj Singh 1 Dec 27, 2021
Make WhatsApp ChatBot and use WhatsApp API to send the WhatsApp messages in python .

Ultramsg.com WhatsApp Bot using WhatsApp API and ultramsg Demo WhatsApp API ChatBot using Ultramsg API with python. Opportunities and tasks: The outpu

Ultramsg 64 Dec 29, 2022
A calculator telegram bot.

Calculator-Bot A calculator telegram bot. Made with Python3 (C) @FayasNoushad Copyright permission under MIT License License - https://github.com/Fay

Fayas Noushad 33 Nov 30, 2022
Want to get your driver's license? Can't get a appointment because of COVID? Well I got a solution for you.

NJDMV-appoitment-alert Want to get your driver's license? Can't get a appointment because of COVID? Well I got a solution for you. We'll get you one i

Harris Spahic 3 Feb 04, 2022