| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
_____ __ __ _____ _____ _____ _____ _____ | | | |___| __ | _ | __| | | | | | |_ _|___| __ -| |__ |- -| --| |_|_|_| |_| |_____|__|__|_____|_____|_____|
Copyright (C) 2011 - 2022 Tony Wang
MY-BASIC is a lightweight BASIC interpreter written in standard C in dual files. It aims to be embeddable, extendable and portable. It is a dynamic typed programming language, reserves structured syntax, supports a style of prototype-based programming (OOP), also implements a functional paradigm by lambda abstraction. The core is written in a C source file and an associated header file. It's easy to either use it as a standalone interpreter or embed it with existing projects in C, C++, Java, Objective-C, Swift, C#, etc. and totally customizable by adding your own scripting interface.
MY-BASIC offers a wide range of features including:
Get BASIC8 - the Fantasy Computer powered by MY-BASIC - on Steam for game and other program development in an integrated environment.
See awesome user creations.
A "Hello World" convention in MY-BASIC:
input "What is your name: ", n$
def greeting(a, b)
return a + " " + b + " by " + n$ + "."
enddef
print greeting("Hello", "world");Read the MY-BASIC Quick Reference to get details about how to program in MY-BASIC.
This repository contains precompiled binaries for Windows, macOS and Linux, the easiest way is to download to get a direct playground. Or you can make a build by:
Follow these steps to compile an interpreter binary manually for other platform:
The standalone interpreter supports three running modes:
Just copy core/my_basic.c and core/my_basic.h to your project and add them to the build pipeline. You can link with MY-BASIC as a lib as well.
For details about using MY-BASIC after integration, see MY-BASIC Quick Reference and read the Wiki pages.
MY-BASIC's workflow diagram can be concluded in a single image.
A simple setup:
#include "my_basic.h"
int main() {
struct mb_interpreter_t* bas = NULL;
mb_init();
mb_open(&bas);
mb_load_string(bas, "print 22 / 7;", true);
mb_run(bas, true);
mb_close(&bas);
mb_dispose();
return 0;
}The manual explains most of the fundamental topics, however it doesn't cover everything; read the Wiki for supplements, like machinism behind MY-BASIC, efficient practice, etc:
Consider supporting MY-BASIC development with a donation if you like this project.
One-off donation via PayPal.
| Back | FazBrowse Home | New Git URL |