Giter Club home page Giter Club logo

rodrigodornelles / 3bc-lang Goto Github PK

View Code? Open in Web Editor NEW
230.0 9.0 25.0 1.14 MB

Low-level language, tiny virtual machine, minimal runtime, intermediate representation, embeddable, easy for beginners. (Friendly Punched cards)

Home Page: https://3bc-lang.org

License: GNU General Public License v3.0

C 77.74% Makefile 1.19% Ruby 20.20% Shell 0.76% Dockerfile 0.12%
virtual-machine language arduino compiler microcontrollers programming-language esoteric-language interpreter punchcard 3bc-lang

3bc-lang's Introduction

3BC Language

sponsors version license covarage

Low-level language, tiny virtual machine, intermediate representation, embeddable, easy for beginners. (Friendly Punched cards)

Documentation

Directory structure

If you are interested in exploring or contributing to the language, follow the monolithic organization.

docs/           Website made with jekyll (Ruby)
examples/       Syntax sampling codes (3bc, Arduino with C++)
programs/       Embbed programs sampling codes (C)
scripts/        Development and installation tools (Bash, Ruby)
src/            Library source code (C)
tests/          Language work check (Ruby)

How to build

Download interpreter source code and manually compile from scratch.

git clone https://github.com/RodrigoDornelles/3bc-lang
make build

How to install

Directly download interpreter as executable command for mac/linux/bsd.

sudo bash -c "$(wget -qO- https://raw.githubusercontent.com/RodrigoDornelles/3bc-lang/master/scripts/install_vm.sh || curl -fsSL https://raw.githubusercontent.com/RodrigoDornelles/3bc-lang/master/scripts/install_vm.sh)"

3bc lang logo This project is licensed under GNU GPL 3.0 or higher, please read the LICENSE.txt file.

3bc-lang's People

Contributors

allansiqueira avatar darkx32 avatar drack112 avatar fernandounger avatar flavioipiranga avatar higorbds avatar kadu avatar lrv-dev avatar marcusmmmz avatar microhobby avatar rodrigodornelles avatar yugal41735 avatar yxqsnz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

3bc-lang's Issues

white space is not detectable.

whitespace character is not being understood by the interpreter.

Not working

MODE NILL 6
STRC NILL ' '

Workable

MODE NILL 6
STRC NILL 0x20

add cpu mode inverse (binary & decimal)

Binary inverse

binary 0110110010000-> 1001001101111
Integer 3472 -> 4719

Decimal inverse

Integer 3472 -> 2743
binary 0110110010000-> 1110100001000

I must thank the @profbrunolopes algorithm class to understand more about decimal inversion.

decimal_inverter

Average helper may fail eventually

eventually the average calculation is returning a wrong value and must be corrected.

Test Math Average Helper
AssertionError: Values are not equal:


    [Diff] Actual / Expected


-   "N1: 2\nN2: 4\nN3: 6\nA:38\n"
+   "N1: 2\nN2: 4\nN3: 6\nA:4\n"

O codigo só é rodado uma vez no console

Fui rodar o codigo para inverter variaveis:

mode nill 0x06
aloc 0x01 'A'
aloc 0x02 'B'
aloc 0x03 'C'

mode nill 0x08
push 0x01 nill
pull 0x04 nill
push 0x03 nill
pull 0x01 nill
push 0x04 nill
pull 0x03 nill

mode nill 0x02
strc 0x01 nill
strc 0x02 nill
strc 0x03 nill

E só consigo rodar 1 vez por console, video de teste:

Video_1609529094.mp4

blank line causes code repetition

Example

MODE    NILL    0x08    # MODE_MEM_AUX
ALOC    NILL    2

MODE    NILL    0x0b    # MODE_MATH_SUM
MATH    NILL    1

MODE    NILL    0x08    # MODE_MEM_AUX
PULL    'r'     NILL

MODE    NILL    0x02    # MODE_STRING
STRI    NILL    'r'

Output

4

Valor de variaveis errado

Estava testando a 3BC mas detectei um erro na versão compilada hoje dia 31/12/2020

Ao execultar muitas vezes um script em 3bc as varias vezes a variavel é retornada de forma errada

Codigo:

mode nill 0x6
aloc 0X01 'A'
aloc 0X02 'B'
aloc 0X03 'C'

mode nill 0x02
strc 0X01 nill
strc 0X02 nill
strc 0X03 nill

Video de testes anexado:

Video_1609429452.mp4

visual identity design discussion

I am raising a discussion about the development of the IDE, what are the color ideas, layouts, and how we are going to present the documentation to the public.

cpu mode 20 move

cpu average its not a math algebraic, is better move to other groups modes.

Nenhum código compila

Quando tento compilar qualquer código, inclusive os exemplos ele me dá erro na linha 1 com código de erro 15, dizendo "INVALID REGISTER"

feature for add to 3bc lang - add terminal mode

add a mode where we can pass commands to the terminal such as: cls, pause

And it would be interesting that the command was compatible with the 'nt' family (windows) and based on unix (Mac and Linux)

Wrong Gramatic

Have some gramatical errors on the text, one of them is on Documentation area, where have "clice here" hyperlink.
The other error is on How to Compile windows area, in the hyperlink, the same error.
preview_2
preview_1

printing doesn't work on git bash

upper left: git bash
upper right: windows powershell
lower left: cmd
lower right: cmd (opened by right clicking 3bc.exe)
image

Windows 10, 64 bit

array of instructions wastes a lot of memory

In arduino this is a serious problem, the storage of register registers in functions must be changed for selections, this change will impact in 50% of memory economics and avoid a brief lack of compatibility with limited space in arduino.

implement similar cpu mode for scanf

cpu input modes 3, 4, 5 only allow single character get, it would be interesting to have a way to allow a buffer to store numbers greater than 1 digit.

possibility of configuration to the memory address

remove srev register and change it with a new one, idea of ​​using bitwise to disable, minimum and maximum value and reversal, in addition to the possibility of being signed or not.

name int bit
value min 1 0b0001
value max 2 0b0010
reversable 4 0b0100
signed 8 0b1000

fix jump to future

MODE NILL 0x9
GOTO NILL 0x1
MODE NILL 0x2
STRC NILL 'H'
NILL NILL 0x1
STRC NILL 'O'
STRC NILL 'L'
STRC NILL 'A'
STRC NILL '!'

must expected

OLA!

occurs

HOLA!

possibility of an eventual wild pointer

there is a possibility when expanding the memory that some dirty place is allocated, which allows for erroneous notes between pointers.

struct pointer_s {
    struct memory_s* p;
    bool allocated; 
};

if allocated are other than false it allows * p to erroneously point to null or invalid address.

solution

force initialization to 0 when dynamically allocated.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.