Brain Script - The Ultimate Programming Language

This is what the future looks like without Human BS. 

Introducing Brain Script (BS): A New Paradigm in Programming

Programming languages have evolved significantly over the years, each aiming to improve on aspects such as readability, efficiency, and ease of use. HA HA That's funny. No they are not. Readability went out the window a long time ago. New languages these days are more of an excuse for some blowhard or company of blowhards to slap their name on something that we already had a way to do. 

So Today, I introduce a novel concept in the programming world: Brain Script (BS), a language designed to simplify the programming experience, while enhancing the power and expressiveness available to developers. It's so easy, you probably already use it. 

What is Brain Script (BS)?

Brain Script is a fictional programming language that exists purely in your imagination. And on paper. And on your computer. I mean, you can put it anywhere really. BS is designed to be intuitive and flexible, breaking away from the rigid syntactical rules of traditional programming languages, and instead doing what you expect it to do. Because that's how it works. It just does what you expect it to do. 

Its core philosophy is to reduce the cognitive load on programmers, allowing for a more natural coding process that aligns closely with human thinking and logical reasoning. And you can write it while you're high or drunk, but I highly recommend stimulants over downers, if you want to write reusable code. It's like they say at <redacted computer company>, a picture's worth a thousand words, but a line of white powder gets you a thousand lines of code. Or so. 

Unlike traditional languages, BS doesn't require a pesky "compiler" or "computer" or "understanding of anything" to work. It just works in your head. You can write it down, save it for later, and it will still work in your head. In fact, you've probably already used BS to solve a problem before, and didn't realize it. You thieving bastard. But we're cool, you didn't know, so I forgive you. I am magnanimous like that. 

Here's an example of BS:

write "hello world"

or

print "hello world"

or

print ("hello world")

...just not...

printf(@"#1",@"hello world")!;

... unless that's how it needs to work in your head. 


Core Features of BS

  • Untyped Variables: In BS, variables are untyped unless explicitly specified, simplifying variable declaration and usage.
  • Simplified Syntax: BS eliminates the need for semicolons to end statements and uses a more natural syntax for assignments and logic operations.
  • Flexible Function Calls: Functions in BS are called using a straightforward syntax that can adapt to various contexts and arguments.

Unique Elements of BS

  • Declarative Syntax Elements: BS incorporates (but doesn't require) elements of declarative programming, so if you're a SQL dude, you can slap that everywhere. It allows programmers to express what they want to achieve without detailing how to do it. For example, querying a data structure might look like this:
    select name, age from users where age > 20
    or
    remember the name and age of every user where age > 20
    or
    get the user's name and age if the age > 30
    or
    get the user's name and age if they're older than Leo likes 'em

  • Macro System: BS allows the creation of custom syntactic constructs through macros, empowering users to extend the language to meet their specific needs. A macro to iterate over a collection could be defined as:
    macro foreach(item, collection, action) {
        for (index = 0; index < len(collection); index++) {
          item = collection[index];
          action;
        }
    }
    foreach (user, users, print(user.name))

    ... good lord that's complicated. But some of you freakin love Macros so I threw
    it in. Magnanimous, that's what I alway say. 

  • Reflection and Meta-programming: This feature lets BS programs introspect and modify their own structure and behavior dynamically, making the language highly adaptable to complex, changing requirements.
Okay I'll be honest here I don't understand how Reflection works and BS is already super Meta, but I mean, if you gotta use it, go use it. 

  • Interactive Programming: BS supports an interactive mode (akin to a REPL), facilitating a seamless, immediate way to write and test code snippets in real time.
Obviously. 

Why Use Brain Script?

  • Intuitiveness: BS closely mirrors natural language and logical thinking, making it easier for beginners to learn and for experts to implement complex algorithms. Actually, it IS logical thinking, written down. It's what you already do. I'm just packaging and legitimizing it, so you can now add that as one of your mastered skills, on your CV. 

  • Flexibility: With features like first-class functions and macro systems, BS is highly adaptable to various programming paradigms and domains. With features like Waveform compression based optimization and compilation, BS can do a bunch of other stuff I haven't even thought of yet. You might've though, so it falls in that category.

  • Efficiency: BS's simplicity and power allow for rapid development and prototyping, significantly reducing the time from concept to execution.
  • Educational Tool: As a conceptual language, BS is an excellent tool for teaching fundamental programming concepts in a way that is accessible and engaging.

Example Program in BS

To demonstrate the simplicity and power of BS, here’s a small example program:

bob = 1
Tim = 5
Dee = 10
put bob, Tim, and Dee into Everyone
sendInvites(everyone)

function sendInvites(who)
{
    if (who>9) {
        email who and invite them to my party
    }
}

... okay here's a more formal one...

// Define a function to calculate factorial
function factorial(n) {
  if (n == 1) {
    return 1
  }
  return n * factorial(n - 1)
}
// Use the function
print(factorial(5))

...or this one...
CalculateDirection()
LerpLegToLocalPosition()
MoveLegUntilDirectionStops()
LerpOtherLeg()
MoveOtherLegForThisLong(.4)
Profit()

... really it's anything you want. But now it's formalized into an official language.
Wait, do I need to register that somewhere? I should look into it.

Conclusion

Brain Script (BS) offers a refreshing take on programming, focusing on ease of use and expressiveness. While it remains a conceptual language, the ideas behind BS could inspire future programming languages or tools designed to make coding more accessible and enjoyable. And you already use it. 

Whether you're a seasoned developer or a newcomer to the world of programming, BS invites you to rethink what it means to communicate with computers — all in the realm of your imagination.

So go on, go use it right now. Oh, you probably already are!

And yes, CodeWalker will support a limited version of BS in the future. 


Comments

Popular posts from this blog

Why most companies post fake job offers. Often. Constantly.

Glycon 3D Motion Capture - History of the VR Based motion capture system