Interpreter - The Official Interpreter for the Infant Lang written in Go

Infant Lang Interpreter

Infant Lang

Minimalistic Less Esoteric Programming Language for Infants

How did we get here? πŸ‘‘

Inspired by BrainFuck but does things in a less esoteric way. 😜

  1. More elegant keywords for infants
  2. Manual simplified control over the pointer
  3. Conditional implementation with the simple β€˜if’
  4. Memory for storing temporary data and manipulating it
  5. Easiest one line for loop for repetitive tasks such as multiplication

What can it achieve? πŸ€ͺ πŸ₯³

We <3 developers but love infants more. Infant lang is developed to promote infants to start coding with the stuff they can visualize like moving their toy along a line and storing their toys in a box. With the upcoming support for threads, Infant Lang helps infants understand how multitasking works inside computers and create wonderful things.

Pointer πŸ‘† and Memory πŸ“¦

  • One dimensional array of size 35000 is available all initialized from 0 to 35000.
  • The Pointer is initialized to point the 0 box
  • A single memory block is available to store an integer initialized to zero.
  • Move Pointers with easy commands or with loops.

Pointer πŸ‘† Movement β›΅

Move the pointer with commands so easy that an infant can do.

  • # Moves the Pointer left by 1 box
    • move pointer left
  • # Moves the Pointer right by 1 box
    • move pointer right
  • # Moves the Pointer Left 5 boxes
    • move pointer left 5
  • # Moves the Pointer Right 10 boxes
    • move pointer right 10

Info About the Pointer

  • Default takes 1 but can enter number to move pointers to more than 1
  • Use a loop if you wanted to move the pointer repeatedly…
    • # Moves the Pointer right 15 times with a for loop
      • for 15 move pointer right

The print πŸ–¨οΈ

  • Print stuff to the screen.
  • Print the pointer value or value in the memory or any number.
  • Want to print characters? Use char to print the ASCII.
  • Print a tab, new line or just print a single space all with ease.

Printing πŸ–¨οΈ Methods

  • Print stuff to the output screen with the 'print' keyword. Defaults to a single space.

  • # Prints the pointer value

    • print pointer
  • # Prints the ascii value of the number in the memory

    • print char memory
  • # Prints a number

    • print 15
  • Print a space, tab or a new line with the below keywords space, tab or new

  • # Prints a space

    • print space
  • # Prints a tab

    • print tab
  • # Prints a new line

    • print new

The Memory πŸ“¦

  • Store a number into memory for later use ⌚
  • # Stores a number in the memory
    • memory = 13
  • # Stores the pointer value inside the memory
    • memory = pointer
  • Memory is always initialized to zero for null safety. It can store only integers. No decimals. πŸ’€

Arithmetic βž• βž– βœ– βž—

  • Infant lang supports basic arithmetic of integers.
  • Throws error if a division returns a decimal πŸ’€
  • Throws error if pointer or memory becomes negative πŸ’€
  • Division by zero is still not possible πŸ˜’

Basic all possible arithmetic 🧠

  • Addition, subtraction, multiplication and division of two numbers, with memory or with the pointer and store it in the memory πŸ“¦
  • All Possible Arithmetic Operations
    • # Addition
      • memory = memory + pointer
      • memory = memory + memory
      • memory = memory + 15
    • # Subtraction
      • memory = memory - pointer
      • memory = memory - memory
      • memory = memory - 12
    • # Multiplication
      • memory = memory * pointer
      • memory = memory * memory
      • memory = memory * 8
    • # Division
      • memory = memory / pointer
      • memory = memory / memory
      • memory = memory / 2

The β€˜if’ ❓

  • Do simple stuff with the if keyword.
  • No else block to confuse the infant.
  • Simple arithmetic conditions works. πŸ˜’

Do more with the if πŸ±β€πŸ

Use the β€˜if’ to do conditional stuff like checking if the memory is 79 or the pointer is 320. Give it a try!! But no negative integer thou… πŸ˜–

  • if memory == pointer
  • if pointer == memory
  • if memory == 13
  • if pointer == 13

It also supports logical checking with AND and OR

  • if memory && pointer print memory
  • if pointer && memory print tab
  • if memory || pointer print new
  • if pointer || memory print char pointer

The β€˜for’ πŸƒβ€β™‚οΈ πŸ’¨

  • Do repetitive stuff with the for.
  • No variable initialization.
  • Enter a positive integer or pass the pointer πŸ‘† or memory πŸ“¦
  • Heard of single line for? Bet you haven’t. It's gonna blow your mind 🀯

Repetitive stuff is easy with the β€˜for’ πŸƒβ€β™€οΈ πŸ’¨

The easiest β€˜for’ implementation that doesn’t allow a negative number. Move pointer faster with the single line loops. Pass a number or memory or pointer.

  • for 15 print char memory

  • for pointer print 23

  • for memory print memory

  • # Move pointer twice

    • for 2 move pointer right
  • # Pass an if in the line to do crazy stuff

    • for 15 if memory != pointer print char 15

How Infant Lang Works πŸ€”

  1. Infant Lang is an interpreter inspired by BrainFuck.
  2. Written in GoLang.
  3. It reads the code line by line.
  4. It instantiates two variables:
    • pointer to keep track of the pointer position
    • memory is initialized to zero.
  5. A Lexer splits the code into tokens.
  6. The Lexer then checks if the token is a keyword or a number.
  7. The Lexer sends the token to the Parser.
  8. Parser parses the tokens and executes the code.

Installation πŸ“¦ πŸ”½

The Executable is available only for amd64 Windows Systems.

  • Download the zip file from the Releases page.
  • Unzip the file
  • Open Run and Type %USERPROFILE% and press OK
  • Create a folder bin if not already created.
  • Extract the executable to the bin folder.
  • Open Command Prompt and type the following command:
    • setx INFANT_HOME "%USERPROFILE%\bin\infant"
    • setx PATH "%INFANT_HOME%;%PATH%"
  • Close the Command Prompt.
  • Open a new Command Prompt and type infant -v or infant --version to check if the installation was successful.
  • Now pass any file ending with .infant to the executable.
  • Eg: In the Command Prompt type infant hello.infant

For Future Use

  • Start a Go Project go mod init github.com/USERNAME/project

Build

  • go build .

Arguments

  • filename: The file to be interpreted
  • Eg: infant.exe test.txt
Owner
Infant Lang
Minimalistic Less Esoteric Programming Language for Infants
Infant Lang
Similar Resources

Bf - A brainfuck interpreter written in Go while the programmer was drunk

Bf - A brainfuck interpreter written in Go while the programmer was drunk

BF A (not well tested) brainfuck interpreter written in Go while the programmer

Feb 17, 2022

Pineapple Lang is a simple programming language demo implements by Go

Pineapple Lang is a simple programming language demo implements by Go. It includes a hand-written recursive descent parser and a simple interpreter, although the language is not even Turing-complete. But this repo's main goal is to give beginners of compilation principles a warm up and a simple look at how a programming language is built.

Dec 26, 2022

Prolog interpreter in Go

golog Prolog interpreter in Go with aspirations to be ISO compatible. See the full package documentation for usage details. Install with go get github

Nov 12, 2022

A JavaScript interpreter in Go (golang)

otto -- import "github.com/robertkrimen/otto" Package otto is a JavaScript parser and interpreter written natively in Go. http://godoc.org/github.com/

Jan 2, 2023

Yaegi is Another Elegant Go Interpreter

Yaegi is Another Elegant Go Interpreter

Yaegi is Another Elegant Go Interpreter. It powers executable Go scripts and plugins, in embedded interpreters or interactive shells, on top of the Go

Dec 30, 2022

A shell parser, formatter, and interpreter with bash support; includes shfmt

sh A shell parser, formatter, and interpreter. Supports POSIX Shell, Bash, and mksh. Requires Go 1.14 or later. Quick start To parse shell scripts, in

Jan 8, 2023

Lisp Interpreter

golisp Lisp Interpreter Usage $ golisp foo.lisp Installation $ go get github.com/mattn/golisp/cmd/golisp Features Call Go functions. Print random in

Dec 15, 2022

Toy Lisp 1.5 interpreter

Lisp 1.5 To install: go get robpike.io/lisp. This is an implementation of the language defined, with sublime concision, in the first few pages of the

Jan 1, 2023

Small Clojure interpreter, linter and formatter.

Small Clojure interpreter, linter and formatter.

Joker is a small Clojure interpreter, linter and formatter written in Go. Installation On macOS, the easiest way to install Joker is via Homebrew: bre

Dec 30, 2022
A POSIX-compliant AWK interpreter written in Go

GoAWK: an AWK interpreter written in Go AWK is a fascinating text-processing language, and somehow after reading the delightfully-terse The AWK Progra

Dec 31, 2022
A BASIC interpreter written in golang.
A BASIC interpreter written in golang.

05 PRINT "Index" 10 PRINT "GOBASIC!" 20 PRINT "Limitations" Arrays Line Numbers IF Statement DATA / READ Statements Builtin Functions Types 30 PRINT "

Dec 24, 2022
A simple virtual machine - compiler & interpreter - written in golang

go.vm Installation Build without Go Modules (Go before 1.11) Build with Go Modules (Go 1.11 or higher) Usage Opcodes Notes The compiler The interprete

Dec 17, 2022
Mini lisp interpreter written in Go.

Mini Go Lisp Mini lisp interpreter written in Go. It is implemented with reference to the d-tsuji/SDLisp repository written in Java. Support System Fu

Nov 25, 2022
interpreter for the basic language written in golang
interpreter for the basic language written in golang

jirachi interpreter for the basic language written in golang The plan supports the following functions: Arithmetic Operations (+, -, *, /, ^) Comparis

Sep 17, 2022
◻️ A Whitespace interpreter written in Go.

whitespace-go A Whitespace interpreter written in Go. Whitespace is a esoteric programming language made up entirely of spaces, tabs, and newlines. Th

May 18, 2022
🧠 A Brainfuck interpreter written in Go

brainfuck-go A Brainfuck interpreter written in Go. How Brainfuck works Brainfuck is an esoteric programming language designed to have the simplest co

Sep 30, 2022
A little brainfuck interpreter written in Go

Brainfuck_go_interpreter A little brainfuck interpreter written in Go from what I've done in coding game Usage $ go build brainfuck.go $ ./brainfuck P

Dec 13, 2021
An interpreter written in go for a brainfuck-based language called €*

eurostar-go-interpreter This is an interpreter written in go for a brainfuck-bas

Sep 14, 2022
Simple-lisp - A Simple Lisp Interpreter written in Go

Simple Lisp A simple Lisp interpreter written in Go. The fixed-precision-numbers

Jun 21, 2022