Rick-Lang / rickroll-lang

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/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Standard Library (built-in modules)

Rudxain opened this issue · comments

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!

I have read all your issues, and I think your proposal is amazing. I haven’t worked on this for a long time, and I am ready to accept the challenge to rewrite in Rust 👍
I will start building a standard library, and thank you for all these issues!