Giter Site home page Giter Site logo

bolang's Introduction

BO-LANG (Bo Programming Language)

BoLang is a Toy Programming Language implemented in Go.

What Does Toy Language Mean? Toy language refers to any computer programming language that is not considered to be suitable or capable for building general purpose and high-end software and applications. It can be any programming language that lacks the advanced features, capabilities, programming constructs and paradigms of high level language. Toy language may also be termed esoteric programming language.

Techopedia Explains Toy Language Toy language was primarily created as a means of programming language research and education, proof of concept for a computer science or programming theory and to create a prototype for a new programming language. Typically, toy language has all the capabilities to perform simple to complex mathematical and programming computations. However, it has an incapability in terms of lesser or no library programs support, missing programming constructs such as pointers and arrays, which limits it in creating general-use programs and applications. Pascal, Treelang and Logo are popular examples of toy language.

Quote from Techopedia

This project is inspired by the book Writing An Interpreter In Go by Thorsten Ball. The goal of this project is to learn more about programming languages, interpreters, and compilers. BoLang is a toy programming language that is simple and easy to understand. It is not intended to be used in production.

Features

  • Arithmetic operations
  • Variables
  • Functions
  • Control structures (if, else, for, forever)
  • Comments
  • Error handling
  • Coming soon...

Getting Started

# Clone the repository
git clone [email protected]:fatfatcocofat/bolang.git
cd bolang

# Build the interpreter
go build

# Run the interpreter
./bo

# Install the interpreter
go install

Examples

# Run the interpreter
❯ bo # assuming you have the interpreter installed in your PATH environment variable

   _____    _____
  /\  __/\  ) ___ (
  ) )(_ ) )/ /\_/\ \
 / / __/ // /_/ (_\ \
 \ \  _\ \\ \ )_/ / /_
  ) )(__) )\ \/_\/ //_/\
  \/____\/  )_____( \_\/

Welcome to BoLang v0.1.0.
Type !help to see the help message.
>> print("Hello, World!")
Hello, World!
nil
>> let x = 10
nil
>> print(x)
10
nil
>> let add = fn(a, b) { return a + b }
nil
>> print(add(10, 20))
30
nil
>> if (x > 5) { print("x is greater than 5") } else { print("x is less than or equal to 5") }
x is greater than 5
nil
>> ...and so on

Resources

Contributing

Contributions to BoLang are welcome. Please feel free to submit a pull request or open an issue.

bolang's People

Contributors

fatfatcocofat avatar dependabot[bot] avatar

Watchers

 avatar

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.