Giter VIP home page Giter VIP logo

uwuscript's Introduction

UwuScript

World's first uwu-oriented language.

Logo

Saw a tweet from Uwy and thought it'd be a tasty little meme morsel to actually build with a tokenizer I have lying around. It's basically Brainfuck but with a special token for single-line comments. If you're looking for the plain old Brainfuck interpreter I wrote in C#, it's called ByteRibbon.

Here's a hello world program in UwuScript:

uwu uwu uwu uwu uwu uwu uwu uwu uwu uwu ow< >w> uwu uwu uwu uwu uwu uwu uwu >w> *w* Comment!
uwu uwu uwu uwu uwu uwu uwu uwu uwu uwu >w> uwu uwu uwu >w> uwu <w< <w< <w< <w< 
nwn >wo >w> uwu uwu owo >w> uwu owo uwu uwu uwu uwu uwu uwu uwu owo owo uwu uwu 
uwu owo >w> uwu uwu owo <w< <w< uwu uwu uwu uwu uwu uwu uwu uwu uwu uwu uwu uwu 
uwu uwu uwu owo >w> owo uwu uwu uwu owo nwn nwn nwn nwn nwn nwn owo nwn nwn nwn 
nwn nwn nwn nwn nwn owo >w> uwu owo >w> owo *w* Hello world!

The following table is straight from Wikipedia's table of Brainfuck commands, but modified to show each command's UwuScript equivalent:

UwuScript Brainfuck Meaning
>w> > Increment the data pointer (to point to the next cell to the right).
<w< < Decrement the data pointer (to point to the next cell to the left).
uwu + Increment (increase by one) the byte at the data pointer.
nwn - Decrement (decrease by one) the byte at the data pointer.
owo . Output the byte at the data pointer.
-w- , Accept one byte of input, storing its value in the byte at the data pointer.
ow< [ If the byte at the data pointer is zero, then instead of moving the instruction pointer forward to the next command, jump it forward to the command after the matching ] command.
>wo ] If the byte at the data pointer is nonzero, then instead of moving the instruction pointer forward to the next command, jump it back to the command after the matching [ command.
*w* N/A Denotes a single-line comment.

You're essentially manipulating a Turing machine to produce output. Anything written in Brainfuck is obviously trivial to port over.

Usage

Compile the project in Visual Studio, run it like this:

UwuScript.exe "examples/hello.uwu"

Limitations

Largely untested and very unoptimized, the Turing machine underlying the language is a very hasty port from the PHP version in my ancient Brainfony repository. It's gonna be buggy and slow.

Also, random inline text will break the tokenizer, that's why the single-line comment token was added. It's easy to change this so you can stick non-instructions wherever you like (like I believe Urban Muller's original Brainfuck implementation does) by changing the regular expressions that the tokenizer is initialized with.

Contributing

If you find a bug and would really like to contribute for whatever reason, feel free to fork and submit a pull request.

uwuscript's People

Contributors

lambdacasserole avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

uwuscript's Issues

A custom "UwU" license

Would be great to have it as it goes with the themes of the code...
if it is possible to go that specific route, might be a good idea to modify the BSD license,
since it is very short.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.