https://github.com/eliassjogreen/bird
🐦 A programming language written entirely in Microsoft's batch scripting language. Yeah it's stupid
https://github.com/eliassjogreen/bird
batch bird cmd compiler programming-language scripting-language windows
Last synced: 2 months ago
JSON representation
🐦 A programming language written entirely in Microsoft's batch scripting language. Yeah it's stupid
- Host: GitHub
- URL: https://github.com/eliassjogreen/bird
- Owner: eliassjogreen
- License: mit
- Created: 2019-02-28T01:24:42.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-11-18T17:02:27.000Z (over 5 years ago)
- Last Synced: 2025-03-29T06:22:15.115Z (3 months ago)
- Topics: batch, bird, cmd, compiler, programming-language, scripting-language, windows
- Language: Batchfile
- Homepage:
- Size: 93.8 KB
- Stars: 16
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Bird
 
> **Bird** = **B**atch **i**s **r**eally ba**d**
> 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](examples/Function.bird) and [importing libraries](examples/HelloWorld.bird) 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
### [HelloWorld.bird](examples/HelloWorld.bird):
```
use Consoledefine Main
Console.Println "Hello World"
end# Prints 'Hello World'
```
### [Function.bird](examples/Function.bird):
```
use Console String Math "Library"define Main $name
Console.Println String.Concat "Hello " $name
Console.Println TimesTwo "16"
Library.PrintHello
enddefine 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'
```
### [Math.bird](examples/Math.bird):
```
use Console Mathdefine 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
```
### [Prompt.bird](examples/Prompt.bird):
```
use Console Stringdefine Main $name
$name Console.Prompt "What is your name: "
Console.Println String.Concat "Hello " $name
end# Prompts 'What is your name: ' then prints 'Hello '
```## Usage
Clone or download this repo and then enter the new folder
```console
$ git clone https://github.com/eliassjogreen/Bird.git
$ cd .\bird-master\
```
Then compile the libraries in the `.\lib\` folder
```console
$ .\bird.bat install
```
And you are ready to go! For example:
```console
$ .\bird.bat run .\examples\HelloWorld.bird
Hello World
```
Or:
```console
$ .\bird.bat compile .\examples\Function.bird .\examples\Function.bat
$ .\examples\Function.bat Elias
Hello Elias
32
```## TODO
- [x] Arithmetic
- [x] Expand std (Added replacing libraries instead of expanding std (std is now removed))
- [ ] Loops
- [ ] If-statementsBatch is pain. Batch is pain. Batch is pain.