Giter Site home page Giter Site logo

rick-lang / rickroll-lang Goto Github PK

View Code? Open in Web Editor NEW
735.0 12.0 53.0 43.16 MB

The Rick Roll programming language is a rickroll based, process oriented, dynamic, strong, esoteric programming language. All of the keywords/statements are from Rick Astley's lyrics. Check our tutorial site, https://rick-lang.github.io/programming-language-explainer/

Home Page: https://rick-lang.github.io/rickroll-lang/

License: MIT License

Python 100.00%
interpreter compiler esoteric-language esoteric-programming-language programming-language rickroll language rick-astley rick-roll-language transpiler

rickroll-lang's Introduction


Rickroll Programming Language

License Build RickRoll PL Community Original Server Python Vscode Installs Vscode Downloads HitCount
Rick Roll Programming Language, a language that is rickroll-based!

Hello World

Although Rickroll can be transpiled into Python3, their syntaxes are not completely similar

  1. Rickroll-lang doesn't need indentation
  2. The code must be written inside the main method, otherwise the interpreter will not execute
  3. The keywords can be separated freely

Rickroll-Lang:

take me to ur heart
    give msg up "Never gonna give you up, never gonna let you down~\n"
    i just wanna tell u how im feeling msg
say goodbye

Equivalent to Python

if __name__ == '__main__':
  msg = "Never gonna give you up, never gonna let you down~\n"
  print(msg, end='')

Equivalent to C++

#include<iostream>
using namespace std;
int main(int argc, char* argv[]){
    string msg = "Never gonna give you up, never gonna let you down~\n";
    cout<<msg;
}

And you can get the output on your terminal:

⡀⠛⠉⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣴⣿⣿⣿⣿⣿⣿⣿⣿⣶⣤⣄⣀⠀⠀⠀⠀⠀⠀⠀⠉⠁⠀⣀⣀⠀⣀⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣄⡀⠀⠀⠀
⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣾⣿⣿⣿⣿⣿⣛⣿⣿⣷⣿⣿⣯⠉⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀⠸⣏⠉⣿⠉⢹⠟⢉⠉⢻⣿⠉⢻⠋⠙⡏⣿⠋⢻⡏⠉⣿⠉⣉⣻⠀
⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣧⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣻⡀⠈⢀⣿⠀⢸⠀⠀⣿⠀⢸⠀⠰⣿⣿⠀⢸⠁⢀⡟⠀⢹⣿⠀
⠇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢠⣿⣿⣿⣿⡿⠿⠿⢿⣿⣿⣿⣿⣿⡿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠘⣧⠀⣼⣿⠀⢸⡀⠀⣏⠀⢸⠀⠀⣿⣿⡄⠘⠀⢸⡇⠀⢰⣾⠀
⡄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⣿⡿⠋⠀⠀⠀⠀⠀⠈⠉⠉⠁⠀⠀⠈⢻⡆⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⣀⣿⣿⣆⡈⢁⣰⣿⣄⠘⢀⣼⣿⣿⣇⣀⣀⣼⣧⣀⣈⣹⡇
⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⣿⠃⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⣿⡄⠀⠀⠀⠀⠀⠀⠀⠀⠈⠉⣿⣿⣿⣿⣿⣿⠟⠿⢿⣿⠿⠛⠛⠻⠿⠿⠻⠛⠉⠉⠉⠀
⠇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⣿⠀⠀⢀⣀⣀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠹⣧⣄⠀⠀⠀⠀⠀⠀⣴⠶⡶⠿⣿⣿⠿⠿⢿⡿⠿⠿⣿⠿⢿⡿⢿⡿⠀⠀⠀⠀⠀⠀⠀
⡄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠰⣿⣿⠀⠀⢨⣭⣽⣿⡇⠀⢠⣾⣿⣿⣷⣆⠀⠀⢸⣿⠀⠀⠀⠀⠀⠀⣿⠀⢱⡆⠈⣿⠀⢴⣾⡇⠀⣶⣿⠀⠘⡇⠀⡇⠀⠀⠀⠀⠀⠀⠀
⠇⠀⠀⠀⠀⠀⠀⠀⠀⠀⢰⣿⠉⠛⠀⠀⠀⠀⠉⠁⠀⠀⠘⡏⠉⠉⠛⠋⠀⣠⣼⣿⠀⠀⠀⠀⠀⠀⣿⠀⢨⡁⠺⣿⠀⣈⣹⡇⠀⣉⣿⠀⡀⠁⠀⡇⠀⠀⠀⠀⠀⠀⠀
⡄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⡀⠀⠀⠀⠀⠀⣀⠀⠀⠀⠀⢹⡄⠀⠀⠀⠀⣿⣿⡿⠀⠀⠀⠀⠀⠀⣿⠀⠸⠇⠀⣿⠀⠹⢿⡇⠀⠿⢿⠀⢸⡀⠀⡇⠀⠀⠀⠀⠀⠀⠀
⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠸⢷⣄⡀⠀⢠⡾⠋⠀⠛⢶⣶⣾⡇⠀⣠⠄⢰⣿⠟⠀⠀⠀⠀⠀⠀⠀⠻⢶⣶⡶⠚⠓⠶⠶⠾⠷⠶⠶⠾⠶⠾⠳⠾⠟⠀⠀⠀⠀⠀⠀⠀
⡆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⣹⡷⣠⠏⠙⢷⣶⠲⠶⠶⣷⣶⡿⠋⢀⣾⠃⠀⠀⠀⠀⠀⠀⠀⠀⢀⣀⣹⣧⡀⢀⠀⠀⣀⣀⣀⡀⢀⣀⣀⣀⣀⣀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣴⠟⣫⣽⠃⠀⠀⠀⠉⠉⠙⠛⠋⠀⠀⢀⣾⡃⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⠉⢉⡉⠻⡏⠉⣿⠟⢉⡉⠙⣿⠉⢹⡏⢉⡿⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⢀⡴⠛⠁⠀⣼⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣼⡏⢳⡄⠀⠀⠀⠀⠀⠀⠀⠀⣿⠀⠸⠇⣰⡇⠀⣿⠀⢸⣧⣀⣿⠀⠈⠀⣼⠁⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⢀⣴⠏⠀⠀⠀⢸⣿⣿⡀⠀⠀⠰⣦⣄⡀⣀⣤⡾⣿⣿⣧⠀⠻⢦⣄⡀⠀⠀⠀⠀⠀⣿⠀⢸⠀⠈⡇⠀⣿⠀⢸⡟⠛⣿⠀⢠⠀⢹⣆⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠘⠁⠀⠀⠀⠀⣾⣿⣿⣷⣄⡀⠀⠙⠿⣿⣏⣽⣿⣿⣿⣿⠄⢸⣧⠈⠙⠶⣤⣀⠀⠀⣿⣀⣸⣄⣠⣷⣀⣿⣦⣀⣁⣠⣿⣀⣸⣧⣀⣿⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣿⣿⣿⣿⣿⣿⣶⣶⣶⣿⣿⣿⣿⣿⣿⣿⠀⠀⠹⣆⠀⠀⠀⠉⠳⣦⡀⠉⠉⠙⠻⣿⠉⠁⠀⠉⠉⠀⠀⠈⠉⠀⠉⠹⠇⠀⠀⠀⠀⠀⠀
⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠛⢻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠀⠀⠀⢿⡆⠀⠀⠀⠀⠻⣿⠓⠒⠲⢦⣹⠷⠒⠲⣶⡖⠒⣶⣶⠒⢶⣾⠗⠒⠲⡶⠒⡖⠶⣄
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇⠀⠀⠀⡞⣿⠀⠀⠀⠀⠀⢹⠀⢹⡀⢈⡏⠀⣿⠀⢸⡇⠀⣿⡟⠀⢸⣿⠀⢸⣶⡇⠀⢳⠀⢸
⠀⠀⠀⠀⠀⠀⠀⢀⠀⠀⠀⠀⠀⣻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠁⠀⢀⣰⠃⢹⡆⠀⠀⠀⠀⢸⠀⢠⠀⠛⡇⠀⣿⠀⢸⡇⠀⣿⡇⠀⢸⣿⠀⢠⣬⡇⠀⢸⠀⢸
⠀⠀⠀⠀⠀⠀⠀⠙⠛⠛⠋⠉⠀⠺⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠃⠶⠞⠋⠀⠀⠀⢿⠀⠀⠀⠀⣸⠀⢸⠀⢰⣧⠀⠛⠀⣸⡇⠀⠛⣧⠀⠘⢻⠀⠘⠛⡇⠀⠚⠀⢸

Sorry, it's this:

Never gonna give you up, never gonna let you down~

The keywords can be separated freely

takemetourheart
    give msg up "Never gonna give you up, never gonna let you down~\n"
    i justwanna telluhowim feeling msg
say good bye

This is also executable

Run Code

Execute by converting .rickroll to Python

python RickRoll.py [Source Code File Name]

Execute by converting .rickroll to C++ (Requires g++ compiler and has numerous bugs)

python RickRoll.py -cpp [Source Code File Name]

Execute by interpreter

python RickRoll.py -intpr [Source Code File Name]

If you want to know the execution time:

Add "--time"

python RickRoll.py [Source Code File Name] --time

Generate and play audio from .rickroll

python RickRoll.py [Source Code File Name] --audio

Requirements

Features

Generate Audio

Command:

python RickRoll.py [Source Code File Name] --audio

After running this command, the generator is gonna generate audio from the .rickroll program and play it on your terminal

Documentation

English
简体中文
Русский
Francais
हिंदी
عربي
Português
Español
ภาษาไทย

Rickroll-lang Editor

  1. A well-coded code editor by RedEnder666: https://github.com/RedEnder666/RickRoll_IDE
  2. The VSCode extension by FusionSid: https://github.com/FusionSid/Rickroll-Lang-VScode-Extension and https://marketplace.visualstudio.com/items?itemName=FusionSid.rickroll-lang

Todo!

In order to make RICKROll becoming a world heritage, YOU and I still have a bunch of things to do!

  1. Add more keywords and built-in functions
  2. Write algorithms in RickRoll-Lang and upload them to examples folder.
  3. Make syntax highlights for VS Code and Sublime!
  4. Improve the current audio generator!
  5. Improve the RickRoll interpreter!
  6. Support "writing code by singing"!
  7. Design a better icon!
  8. SPREAD RICKROLL EVERYWHERE!!!

Rickroll Language Website

https://rickroll-lang.tech/introduction/
or
https://rick-lang.github.io/rickroll-lang/

Offcial Discord Server/Contact

https://discord.gg/bRrbZPjVDH Join this server to chat with cool people or for support

Wechat/微信: SatinWuker540
Discord: satinwuker
microsoftenjoyer

Purpose

Despite the fact that the Rickroll Language is considered an esoteric programming language, it has its unignorable significance. I believe that rickroll is not only the source of happiness for the younger generation but also the most elegant and paramount art in human history, and the cardinal stepping stone to the transition toward a much more advanced civilization. The purpose of the Rickroll Language is to introduce this art to people in a distinctive way – programming. Just kidding haha, the Rickroll Language is actually an educational project for introducing various ways of implementing programming languages in a humorous and interactive way, without any painful processes of memorizing unfamiliar and complicated concepts! Our website for programming language tutorials: https://rick-lang.github.io/programming-language-explainer/.

Related Repos

Here are the projects that are inspired by Rickroll-lang

  1. Ricky
  2. Rickroll-lang API
  3. RickRoll IDE
  4. Rick Astley Bot
  5. Rickroll Lang Vscode extension
  6. The Rickroll-language Interpreter and Compiler Kit

Credit: Rick Astley

Youtube: https://www.youtube.com/channel/UCuAXFkgsw1L7xaCfnd5JJOw
Twitter: https://twitter.com/rickastley
Facebook: https://www.facebook.com/RickAstley
Spotify: https://open.spotify.com/artist/0gxyHStUsqpMadRV0Di1Qt

rickroll-lang's People

Contributors

adiyenuubarii avatar calebrwalk5 avatar dfmaaa avatar error-cezar avatar fusionsid avatar henriqueritter avatar hsiangnianian avatar jerry-py avatar kaqtus14 avatar keowu avatar micfun123 avatar redender666 avatar rudxain avatar satinwukerorig avatar sherlockcxk avatar stepfenshawn avatar tantatorn-dev avatar tinarskii avatar valcan3344 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  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  avatar  avatar  avatar  avatar  avatar

rickroll-lang's Issues

Standard Library (built-in modules)

What it is

These are just *.rickroll files that the interpreter can conditionally embed into userland *.rickroll files. They are assigned to a special namespace, which the interpreter/compiler knows exactly where to locate unambiguously.

What it ISN'T

This isn't a generalized module system, as there's no support for userland scripts. This shall be implemented in a separate proposal (#75), for simplicity's sake.

Why

  • Portability
    • RR programs would no longer need 3rd-party lang-specific libraries, so they can work exactly the same on any implementation.
  • Abstraction
    • Everything is self-contained.
  • Fun!
    • We'll have freedom to name modules however we want! Example: core.math.pie is the π constant from the math module.

How

The implementation details are yet to be stabilized. I have a rough idea of how we could do it: RR modules would be inlined in a C-like manner, which is quite simple, but not perfect.

The reason behind a "special namespace" for built-in modules, is to simplify the module-resolution algorithm for when we add support for userland RR libs:

  • Userland libs would be imported using file-system path-string-literals, such as we know the "./FILE_NAME" and we're gonna play it (notice how the extension is optional)
  • Built-ins would be imported using similar (maybe exactly the same?) syntax as we know the std.MOD_NAME and we're gonna play it (notice the prefix to disambiguate between C/Py and built-in)

We could take inspiration from Rust by having different namespace-prefixes:

  • core
    • for self-contained stuff, such as
      • math processing
      • string formatting
      • list iteration and sorting
      • etc...
  • std
    • for abstractions over platform-specific and impl-specific code, such as
      • file handling
      • network communication
      • threads (and possibly async (#32)?)
      • etc...

std would CONSIDERABLY reduce the need for importing Py libs/mods such as sys and os

Outro

I'm willing to contribute modules. We could even use stuff from the examples folder as a starting point. Even better, core/std could become examples themselves!

Virus?

McAfee says that this is a virus. i ALWAYS trust McAfee so sorry but I'm not gonna use it.

Userland modules and libraries

This is just a follow-up to #74. I've opened this to clarify that both issues should be solved separately, despite being related.

We could use whatever module-system we end up with #74 as the base for developing a generalized module-system, which implies this issue depends on #74

threaded-code could simplify (and optimize) the interpreter

Source: https://github.com/wasm3/wasm3/blob/main/docs/Interpreter.md#the-m3-strategy-for-other-languages-is-rad

The link points to a heading/anchor, but I recommend reading the full document.

However, I'm afraid this may (sometimes?) require TCO, which Py, C (unless we use Clang instead of GCC), and Rust don't support :(

Further resources:

Smallest valid program?

I want to know for 2 reasons:

  1. I'm too lazy to test it myself (lol), and I want to ensure that all implementations (1st-party/"official", and 3rd-party) are consistent, and that the spec itself is consistent and explicit about this
  2. I opened this PR at /mathiasbynens/small, and want to make sure the file is extremely minified

specialized `enum`s for interpreter impl

I was just reading this, and found this. And I realized it would be a good idea to replace the string-only enums by this, to avoid the generic Enum class.

We also get some benefits, such as:

  • auto(), to reduce boilerplate
  • implicit string conversion, to avoid appending .value suffix every-time

I opened this issue to remind myself to open a PR for this. So I want to be "assigned" (in the GitHub context) to this issue.

I'll implement this later. I'm busy right now

Make a JIT compiler

Make a JIT compiler for the code,ik there is a c transpiker but that would become too difficult when you add more features. (You can use the llvm toolchain)

`async`

This isn't a new proposal. I've just opened this to organize stuff. Other issues have already mentioned it: #32 and #74.

However, I'll take this opportunity to explain why I believe asynchronous code should be part of std rather than core or as a reserved Keyword. I've took inspiration from Gleam:

This lack of lock-in is important as typing message passing is an area of active research, we may discover an even better approach at a later date!

This way, std can have its own API, while the community can make different APIs designed for different use-cases. It can be:

  1. Colorblind
  2. "Somewhat" colored
  3. 🌈Colorful

https://www.thecodedmessage.com/posts/async-colors

More technical info needed

Hi, I recently saw that you have a .rickroll file type. I have a question about it:

  1. What is the mime type for it?
  2. What programs can open the .rickroll

Rust rewrite?

Yeah, I know, this has become a meme 💀. I'm willing to do the rewrite (maybe with the help of @FusionSid ?), but definitely not now as I'm busy IRL and need to develop some unfinished PRs.

I'm proposing RIIR for 3 reasons:

  • The project is relatively "small", so a rewrite would be "easy" and not so disruptive.
  • This would make it more maintainable when we add more features.
  • We could reduce our dependency on Python
    • which would allow us to (for example) use an LLVM backend (in the far future) to transpile RR to any lang (or native machine code)
      • We would have to resolve #74 first, as Python libs would no longer be available

While loop with condition broken

not sure if this was intentional but for some reason the [togetherforeverwithi] keyword is no longer valid when i try the bubble sort example

Discrepancy/inconsistency between compilers

all of these test results are from this commit in my branch, but most of it applies to main branch

The following is valid for both the Py transpiler (pyrickroll) and the real-time interpreter, but not for CPP:

takemetourheart
saygoodbye

Terminal:

echo takemetourheart > test.rr
echo saygoodbye >> test.rr
./RickRoll.py -cpp test.rr
Traceback (most recent call last):
  File "/home/rudxain/Documents/GitHub/rickroll-lang/src-py/./RickRoll.py", line 67, in <module>
    main()
  File "/home/rudxain/Documents/GitHub/rickroll-lang/src-py/./RickRoll.py", line 40, in main
    run_in_cpp(args.file)
  File "/home/rudxain/Documents/GitHub/rickroll-lang/src-py/crickroll.py", line 247, in run_in_cpp
    TranslateToCpp(types=tok.t_types, values=tok.t_values)
  File "/home/rudxain/Documents/GitHub/rickroll-lang/src-py/crickroll.py", line 152, in __init__
    raise SyntaxError(f'Exception in line {current_line}: [{self.values[0]}] is neither a keyword nor function\n')
SyntaxError: Exception in line 1: [takemetourheart] is neither a keyword nor function

But this is a syntax error for everyone, except intpr:

takemetourheart saygoodbye

CPP raises the same error as before. But py is different:

echo 'takemetourheart saygoodbye' > test.rr
./RickRoll.py test.rr
Exception in line 1
    if __name__ == "__main__":
                              ^
IndentationError: expected an indented block after 'if' statement on line 1

Even this thing is valid for intpr!

takemetourheart

Also, CPP thinks empty files are a syntax error, even after fixing the content[-1] out-of-bounds access. This happens because int main(){} is not appended

#60 (ignore. this is for GH to link this issue to the PR)

Proposition for key words

class Rick : Singer{
  // constructor
  gonna_make_you()
    i.hariColor=red
  understand
  // private variables
  Inside var hairColor;
  // public variable 
  Stranger var concertLocation {
    // getter
     get_this_from {
      return I.concertLocation
    }
  }

  
  // member functions
  gonna sing(){
    tell_you_how_im_feeling ("we're no strangers to love")
  }

  gonna giveYouUp(){
    fatalError()
  }
  gonna letYouDown(){
    fatalError()
  }
}

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.