An esoteric programming language, in TypeScript for heaven's sake.
- To run a specific file:
npm run bullshit <FILENAME> - To run in repl mode (Bullshit only):
npm run Bullshit
You can find an example at /examples/main.bs
We, at bullshit, believe everyone should be entertained while coding. Meet our alternative: .bsx.
Inside Bullshit X, you can use BS syntax, however, it's recommended to use the BSX syntax described below.
lit n be fake rnwill createnasnull.- Object property setting is fixed!
lit obj be {} rn obj.e = nocap waffle(obj) - Better error messages
Mutable variables are created with:
lit x be 0 rnYou can also create a constant variable:
mf x be 0 rnNote: You can only use rn on variables.
Strings can be created with:
lit x be "Hello, World!" rnYou can also insert variables by using:
lit x be 0 rn
lit y be strcon("Hello, ", x) rnOr you can format your string to include variables:
waffle(format("Hello, ${}", "World"))However, you must use your regional currency symbol.
waffle(format("Hello, ${}", "World"))
waffle(format("Hello, €{}", "World"))
waffle(format("Hello, £{}", "World"))
waffle(format("Hello, ¥{}", "World"))Numbers are simple:
lit x be 34 rn
lit y be 12 rn
lit z be x - y rnNote: We, at Bullshit X, believe decimals are redundant. You can only use positive values too.
lit abc be fake rnBooleans are also simple:
lit x be nocap rn
lit y be cap rnObjects are essential in programming languages. Bullshit X supports them too:
lit x be cap rn
lit obj be { key: nocap, x } rn
obj.key be cap
waffle(obj.key)We, at Bullshit X, believe arrays are redundant.
We, at Bullshit X, believe comments are redundant. Code must be understandable without English.
Functions in programming are intricate entities that serve as modular units of code designed to perform specific tasks with a high degree of abstraction and reusability. These multifaceted constructs encapsulate a series of instructions, often comprising algorithmic operations and logical conditions, which execute a well-defined purpose within a larger program. Functionality is delineated through a meticulously crafted signature, encompassing parameters and return types, allowing for parameterization and value transmission between the calling code and the function body. The complexity further burgeons as functions may exhibit a plethora of characteristics, including but not limited to recursion, closures, and the ability to manipulate variables within their designated scopes. Their utility extends beyond mere procedural decomposition, often intertwining with the paradigms of object-oriented, functional, or imperative programming, depending on the programming language employed. The orchestration of functions, with their nuanced interplay, results in the orchestration of intricate software systems, promoting maintainability, readability, and the efficient allocation of computational resources. In essence, functions epitomize the sophisticated essence of programming, embodying the elegance and subtlety required to navigate the intricacies of algorithmic design and software engineering. You can create functions by using:
bruh perform(x, y) {
x - y
}We, at Bullshit X, think return statements are redundant. Instead, our superior functions return the last value emitted.
bruh perform(x, y) {
x + y // will do nothing
x - y
}If statements in Bullshit X are very intuitive:
sus (1 fr 1){
waffle("1 is 1")
} impostor sus (1 nah 2){
waffle("1 is NOT 2")
} impostor sus (1 fr 3 carenot 1 fr 1){
waffle("1 is 1 or 3")
} impostor sus (1 fr 3 btw 1 fr 1){
waffle("1 is 1 and 3. how's that possible hello??")
} impostor {
waffle("How did we get here?")
}Loops in Bullshit X are very easy:
yall(lit i be 0 rn i smol 10 rn i be i + 1){}Because we, at Bullshit X, believe programmers should be responsible for their code, we did not add any break or continue keyword functionality to loops.
Types in Bullshit X are very important!
lit num: number be 0 rnYou can assign types on non-matching values too.
lit num: object be 0 rnYou can also assign types on values themselves.
lit x be nocap: boolean rnYou can assign types on types too.
lit x: number: number: object: string be 3 rnIn fact, you can use types anywhere!
yall: number(lit: object i: number be 0: object rn i smol 10 rn i be i + 1){
waffle(strcon("Currently at ", i): object)
}: object: object: stringNote: Types don't do anything, in fact, they're removed before the lexer kicks in.
Bullshit X also supports try catch statements:
fuck_around {
waffle(null + hogrider)
} find_out {
waffle(error)
}Cannot resolve 'hogrider' as it does not exist.
Note: find_out doesn't return anything, "error" is a global variable.
You can utilize the math helper by using:
waffle(nerd.random())
waffle(nerd.sqrt(144))
waffle(nerd.pi)Even though Bullshit X doesn't support negative (-) or decimal (.) numbers, we added helper functions for your anxiety:
waffle(nerd.ceil(3.4))
waffle(nerd.round(3.9))
waffle(nerd.abs(-2))You can access the current time by using:
waffle(time())You can run terminal commands by using our Blazingly Fast 🚀 ClapBack() feature:
mf res be clapback("ls") rn
waffle(res)Note: Clapback will throw an error if failed. Better pair it with fuck_around & find_out.
fuck_around {
lit insult be clapback("rm -rf /") rn
waffle(insult)
} find_out {
waffle(error, ":(")
}lit x be yap("watcho name > ") rn
waffle(x)Note: The user won't see the text they type, but you will successfully receive the text after the user presses Enter.
- Huge thanks to Tyler Laceby for creating the Guide to Interpreters!
- Thanks to Linker for showing me his compiler
- macromates.com for documenting TextMate Language syntax
- DreamBerd for the inspiration
- AST explorer for the helpful tool
Created with pure fucking hate by Dean ♥