eliassjogreen / Bird

🐦 A programming language written entirely in Microsoft's batch scripting language. Yeah it's stupid

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bird

GitHub GitHub code size in bytes

Bird = Batch is really bad
Not that a language written in it is any better

Bird is a toy programming language written entirely in Microsoft's batch scripting language. It adds amazing features such as functions and importing libraries like any other programming language at the cost of stuff like arithmetic and if statements.

Features

  • Functions with parameters
  • Importing libraries
  • Compilation to batch

Examples

use Console

define Main
    Console.Println "Hello World"
end

# Prints 'Hello World'
use Console String Math "Library"

define Main $name
    Console.Println String.Concat "Hello " $name
    Console.Println TimesTwo "16"
    Library.PrintHello
end

define TimesTwo $1
    $out Math.Mul $1 "2"
    return $out
end

# First prints 'Hello ' + your first command line parameter
# Then prints '32'
# And lastly prints 'Hello'
use Console Math

define Main
    Console.Println Math.Add "1" "2"
    Console.Println Math.Mul "19" "5"
    Console.Println Math.Sub "7" "3"
    Console.Println Math.Div "10" "2"
    Console.Println Math.Mod "20" "5"
end

# Prints:
# 3
# 95
# -3
# 5
# 0
use Console String

define Main $name
    $name Console.Prompt "What is your name: "
    Console.Println String.Concat "Hello " $name
end

# Prompts 'What is your name: ' then prints 'Hello <name>'

Usage

Clone or download this repo and then enter the new folder

$ git clone https://github.com/eliassjogreen/Bird.git
$ cd .\bird-master\

Then compile the libraries in the .\lib\ folder

$ .\bird.bat install

And you are ready to go! For example:

$ .\bird.bat run .\examples\HelloWorld.bird
Hello World

Or:

$ .\bird.bat compile .\examples\Function.bird .\examples\Function.bat
$ .\examples\Function.bat Elias
Hello Elias
32

TODO

  • Arithmetic
  • Expand std (Added replacing libraries instead of expanding std (std is now removed))
  • Loops
  • If-statements

Batch is pain. Batch is pain. Batch is pain.

About

🐦 A programming language written entirely in Microsoft's batch scripting language. Yeah it's stupid

License:MIT License


Languages

Language:Batchfile 100.0%