-
- Added new function which checks for parsing error
- Now prints error message if parsing error occurs which was not available before thereby making debugging difficult
- Optimized error handling of Grammar matching
- Feature request of
SandboxAPI
-
- Utility function will save it to global message variables.
- Utility function can no longer print to the
stdout. - Added support for the
sandboxAPI - Lexer now supports
#comments - Optimized handling of Tokenization Error by the Lexer
-
- Initial release
- Interpreter uses
stdinfor getting thefileto interpret - Individual functions can print to the
stdout
Minimalistic Less Esoteric Programming Language for Infants
- More elegant keywords for infants
- Manual simplified control over the pointer
- Conditional implementation with the simple ‘if’
- Memory for storing temporary data and manipulating it
- Easiest one line for loop for repetitive tasks such as multiplication
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.
- 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.
# Moves the Pointer left by 1 boxmove pointer left
# Moves the Pointer right by 1 boxmove pointer right
# Moves the Pointer Left 5 boxesmove pointer left 5
# Moves the Pointer Right 10 boxesmove pointer right 10
- 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 loopfor 15 move pointer right
- Print stuff to the screen.
- Print the pointer value or value in the memory or any number.
- Want to print characters? Use
charto print the ASCII. - Print a tab, new line or just print a single space all with ease.
-
Print stuff to the output screen with the 'print' keyword. Defaults to a single space.
-
# Prints the pointer valueprint pointer
-
# Prints the ascii value of the number in the memoryprint char memory
-
# Prints a numberprint 15
-
Print a space, tab or a new line with the below keywords
space,tabornew -
# Prints a spaceprint space
-
# Prints a tabprint tab
-
# Prints a new lineprint new
- Store a number into memory for later use ⌚
# Stores a number in the memorymemory = 13
# Stores the pointer value inside the memorymemory = pointer
- Memory is always initialized to zero for null safety. It can store only integers. No decimals. 💀
- 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 😒
- Addition, subtraction, multiplication and division of two numbers, with memory or with the pointer and store it in the memory 📦
- All Possible Arithmetic Operations
# Additionmemory = memory + pointermemory = memory + memorymemory = memory + 15
# Subtractionmemory = memory - pointermemory = memory - memorymemory = memory - 12
# Multiplicationmemory = memory * pointermemory = memory * memorymemory = memory * 8
# Divisionmemory = memory / pointermemory = memory / memorymemory = memory / 2
- Do simple stuff with the
ifkeyword. - No
elseblock to confuse the infant. - Simple arithmetic conditions works. 😒
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 == pointerif pointer == memoryif memory == 13if pointer == 13
It also supports logical checking with AND and OR
if memory && pointer print memoryif pointer && memory print tabif memory || pointer print newif pointer || memory print char pointer
- 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 🤯
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 twicefor 2 move pointer right
-
# Pass an if in the line to do crazy stufffor 15 if memory != pointer print char 15
- Infant Lang is an interpreter inspired by BrainFuck.
- Written in GoLang.
- It reads the code line by line.
- It instantiates two variables:
pointerto keep track of the pointer positionmemoryis initialized to zero.
- A Lexer splits the code into tokens.
- The Lexer then checks if the token is a keyword or a number.
- The Lexer sends the token to the Parser.
- Parser parses the tokens and executes the code.
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 pressOK - Create a folder
binif not already created. - Extract the executable to the
binfolder. - 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 -vorinfant --versionto check if the installation was successful. - Now pass any file ending with
.infantto the executable. - Eg: In the Command Prompt type
infant hello.infant
- Start a Go Project
go mod init github.com/USERNAME/project
go build .
filename: The file to be interpreted- Eg:
infant.exe test.txt