Skip to content

fatfatcocofat/bolang

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 git@github.com: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.

About

Bo-Lang Programming Language

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages