Dawg
- This article is not detailed enough and needs to be expanded. Please help us by adding some more information.
Dawg: Python for thugs
For thugs that like to code.
Description
Aye, holda! You didnt choose the thug life but the thug life chose you? You also like to code?
Look no mo' you made it. Dawg is your fella, an implementation of a Python dialect that feels you and follows your orders.
Some would even say dats a dime, I wouldnt disagree.
Using Dawg
Get Dawg from github
git clone https://github.com/kaftejiman/dawg.git
Dawg is a Python3 program.
Install dependencies:
pip3 install -r requirements.txt
Run Dawg program
$ ./dawg example.dawg SUP?
Run or Convert Dawg program with Debug mode
Use (-d or –debug) flag for enabling debug mode.
$ ./dawg -d example.dawg [DEBUG] argv: {'--argument': [], '--convert': False, '--debug': True, '--help': False, '--interact': False, '--version': False, '<filename>': ['example.dawg']} [DEBUG] Process LexToken(COMMENT,'CHILL DUMMY EXAMPLE',1,0) at_line_start Process LexToken(NEWLINE,'\n',1,19) at_line_start must_indent Process LexToken(RESERVED,'print',2,20) at_line_start must_indent Process LexToken(OP,'(',2,32) must_indent Process LexToken(STRING,'SUP?',2,37) must_indent Process LexToken(CLOSE,')',2,44) must_indent Process LexToken(NEWLINE,'\n',2,46) must_indent [DEBUG] Converted code: import sys as _sys #LL DUMMY EXAMPLE print ( 'SUP?' ) SUP?
Convert Dawg program to Python equivalent
Use (-c or –convert) flag for conversion of Dawg code to the equivalent Python code the resulting Python code will be available in converted folder.
$ ./dawg -c example.dawg
Convert multiple Dawg programs to Python equivalent
Use (-c or –convert) flag for conversion of Dawg code to the equivalent Python code the resulting Python code will be available in converted folder.
$ ./dawg --convert example1.dawg example2.dawg
Syntax
Most of Python is supported by Dawg but not everything, it should be enough to get your feet wet bro, check Grammar and Implementation sections fo mo details. Most of da syntax is spelling mistake proof to a certain degree, for instance character repetition is supported.
Variable assignment:
FINGERS BEE LIIKE TEN
-> Python equivalent:
FINGERS = 10
Print message onto the screen:
BLING BLING THIS "SUP" YO
-> Python equivalent:
print("SUP")
Read from user:
TYRONE BE LIKE GIMME 'WHOS IN DA CLUB? ' YO
-> Python equivalent:
TYRONE = input('WHOS IN DA CLUB? ')
Function definition:
OPERASHYON GREETINGS READY LIKE BLING BLING THIS "AYE SUP" YO HIT DEM HOMIE
-> Python equivalent:
def GREETINGS(): print("AYE SUP?") return
Arithmetic operations:
DOUBLEG BE LIKE SIKS BRO DOUBLEG GANGBUMPIN DOUBLEG BRO DOUBLEH BE LIKE TWO DOUBLEH GANGBANG DOUBLEH HOMIE S COOL DOUBLEG STEADY LIKE 36 S COOL DOUBLEH STEADY LIKE NOTHIN
-> Python equivalent:
DOUBLEG = 6 DOUBLEG *= DOUBLEG DOUBLEH = 2 DOUBLEH -= DOUBLEH assert DOUBLEG == 36 assert DOUBLEH == 0
Iterations:
NUMBZ BE LIKE BANCH O X LOOK ALL DIZ MOFOS X IN NUMBAHZ FITTY YOO BLING BLING THESE NUMBZ YO
-> Python equivalent:
NUMBZ = [ X for X in range(50 )] print ( NUMBZ )
Fillers:
For your entertainment, filler words that serves nothing, use them anywhere you please.
LIL BOI SAM BE LIKE 'EYY YO ' HOMIE PIMPIN 'WHAT UP?' YOU KNOW WHAT AM SAYINNN
-> Python equivalent:
SAM = 'EYY YO ' + 'WHAT UP?'
Examples
Fibonacci number generator (examples/fib.dawg):
$ ./dawg examples/fib.dawg --argument 1000 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987
Math operations (examples/meth.dawg):
$ ./dawg examples/meth.dawg ('PI BE LIKE', 3.141592653589793) ('EULA IS HELLA', 2.718281828459045) 300 DOUBLEG LEVELD UP ATE TIMES YO 308
Python division brought from the future:
$ ./dawg examples/future.dawg 50.0
TheNotoriusBIG Warning song
$ ./dawg examples/TheNotoriusBIG_Warning.dawg Number of Beatz: 26 Notorious B.I.G - Warning B.I.G: SOMEONE PAGING ME THROUGH YOUR WINDPIPEAT 5:46 IN THE MORNING CRACK OF DAWN B.I.G: I AM YAWNING B.I.G: I WIPE COLD OUT MY EYE B.I.G: SOMEONE PAGING ME WHY? B.I.G: IT IS MY NIGGA POP FROM THE BARBERSHOP B.I.G: HE TOLD ME HE WAS IN THE GAMBLING SPOT B.I.G: HE HEARD THE INTRICATE PLOT OF NIGGAS B.I.G: WANNA STICK ME LIKE FLYPAPER B.I.G: SLOW DOWN LOVE B.I.G: CHILL B.I.G: YOU DROP THE CAPER B.I.G: YOU REMEMBER THEM NIGGAS FROM THE HILL UP IN BROWNSVILLE B.I.G: YOU ROLLED DICE WITH B.I.G: YOU SMOKED BLUNTS WITH B.I.G: YOU GOT NICE WITH B.I.G: MY NIGGA FAME UP IN PROSPECT B.I.G: LOVE WOULD NOT DISRESPECT B.I.G: I DID NOT SAY THEM B.I.G: THEY SCHOOLED ME TO SOME NIGGAS B.I.G: YOU KNEW FROM BACK THEN WHEN YOU WAS CLOCKING MINOR FIGURES B.I.G: THEY HEARD YOU ARE BLOWING UP LIKE NITRO B.I.G: THEY WANNA STICK THE KNIFE THROUGH YOUR WINDPIPE SLOW B.I.G: THANK FAME FOR WARNING ME B.I.G: I WARNING YOU B.I.G: I GOT THE MAC B.I.G: NIGGA TELL ME WHAT YOU GONNA DO B.I.G: Damn, niggas wanna stick me for my paper B.I.G: Damn, niggas wanna stick me for my paper B.I.G: Damn, niggas wanna stick me for my paper B.I.G: Damn, niggas wanna stick me for my paper
an mo examples in examples foldah.
Grammar
todo
Implementation
todo
Notes
todo