🚧 Meta Programming language automating multilang communications in a smart way

Overview

Table of Contents

  1. Merge
    1. TLDR
    2. Manifest
      1. merge-lang
      2. Inference
      3. File Structure
      4. Compile
      5. Scheduling Execution
      6. Runtime
    3. Package Manager
  2. API

Merge

NOTE: Any of the features are not implemented yet. It’s planned to do so.

TLDR

New approach to programming languages with generic multilang communication system, allowing you code with multiple programming languages in a project with a modern automated interface.

Manifest

Developing a project using multiple programming languages can easily become a complex task. although there are some Simpler solutions to this problem. They generally lack relaibility, performance, stability etc.

This is a common situation that happens to all of us. For example:

X programming language has a library/framework that I cannot use with Y programming language.

There are some solutions to this problem like:

  • Transpilers: Automated X lang to Y lang converters. (just like .png to .jpeg but more complex)
  • Rewrite: Rewriting the program in X lang. (e.g fish shell was written in C++, now it is getting rewritten in rust)
  • FFI’s (Foreign Function Interface)
  • ABI’s (Application Binary interface)
  • Language Communication Protocols (e.g IPC, Shared Memory, Server)
  • Wrappers: Custom libraries that wrap around the native language using Language Communication Protocols.

One of the few solution’s that I mentioned above are hard to implement in general. Others are:

  • Overall Transpilers: Could generate erroneous output (defective transpilers)
  • Rewrites: Consumes a lot of time & effort. Because of the human factor.

Because of these strenuous ways of implementing multi-lang interfaces We introdoce you merge-lang

merge-lang

A generic meta programming language that automates the process of combining programming languages in a project

Merge takes another approach than the other solutions I mentioned.

  1. Initial Algorithm

    • Inference (understands the data communication points: more on that in the next section)
    • Constructing the file structure (splitting code to it’s pieces by the fewest whispers1)
    • Compiling
    • Scheduling Execution
    • Runtime

Inference

This is probably the most complex part of merge-lang. (Also the most innovative way) Look at the following example:

    #[python]
    use *;

    fn main() {
        python::print("hello, world");

        #[python]
        {
            a = "world"
            print(f"hello {a}")
        }

        python!{
            a = "hello"
            print(f"{a} world!")
            import a from b
            a.hello()

            def python_fn():
                return 5
        };

        let val_py = python!(python_fn());
        let val_py = python::python_fn();

        println!("from rust: {val_py}");
    }

File Structure

Writing our own compiler for all languages that we support would be imposible. Because of this merge compiler will split your code into pieces that external languages can understand.

With this tecnique you can integrate any programming language to merge-lang using It’s API

Compile

Merge language compiles to rust code, then LLVM IR and ASM.

Scheduling Execution

The dependencies need to evaluate in a way that every language can get the value they need at the runtime in a linear way. (Just like single vs multi-thread apps)

Think this as a major surgery with you (the doctor) and Mr. Clumsy (the nurse)

  1. If Mr. Clumsy gives you a cleaver instead of a lancet, the patient’d probably die. So Mr. Clumsy must give you the right tool to do the surgery. But It doesn’t end here.
  2. If Mr. Clumsy’d give you a lancet one minute later (or before) than the time you need it. The patient’d die again because of haemorrhage. So timing is a must too!

And don’t forget that we made a preconception by saying that Mr. Clumsy will give us a thing.

Runtime

It’s wanted to see a nice execution sequience between languages that you use.

Package Manager

merge package manager is pending right now.

API

Merge-lang introduces an API to be able to use more and more languages with it.

Footnotes

1 data transmissions done between programming languages.

You might also like...
Command line utility for controlling LIFX smart lights

lifxc is a command line utility for controlling LIFX smart lights. Currently, communication over the LIFX LAN protocol is supported.

CLI for the Goki Smart Wallet system.

goki-cli CLI for the Goki Smart Wallet system. Installation First, make sure you have the Solana CLI tools installed. Follow the instructions here. Ne

A slightly smart clipboard tool - leverage the filesystem to persist across machines after shutdown.

clipd A slightly smart clipboard using the filesystem under ~/.clipd to persist after shutdown. cowsay "clipd is great" | clipd copy clipd paste ____

Haylou Smart Watch 2 (LS02) reverse-engineering project

Haywatch Haywatch Hello Haylou Watch features Device communication General command structure Pairing Unpairing Battery Firmware Date and time Pulses U

zkPoEX enables white hat hackers to report live vulnerabilities in smart contracts while maintaining the confidentiality of the exploit
zkPoEX enables white hat hackers to report live vulnerabilities in smart contracts while maintaining the confidentiality of the exploit

zkPoEX enables white hat hackers to report live vulnerabilities in smart contracts while maintaining the confidentiality of the exploit, facilitating efficient communication and collaboration between hackers and project owners for a more secure DeFi ecosystem.

Rust implementation of world of warcraft client v3.3.5a (smart CLI)

idewave-cli This is Rust implementation of World of Warcraft client v3.3.5a. Smart CLI. You can use the CLI to debug TCP packets from/to World of Warc

A cute and smart arm warmer sleeve ^_^
A cute and smart arm warmer sleeve ^_^

LuLuu! A cute and smart arm-warmer sleeve with a 1.3" full color TFT display built into the back of the hand ^_^ Hardware Runs on a RaspberryPi RP2040

Configurable, smart and fast CSS/SCSS/Sass/Less formatter.

🌷 Malva Malva is a configurable, smart and fast CSS/SCSS/Sass/Less formatter. Why? Configurable Malva is configurable. It provides several configurat

launchpad smart contract create token, bonding curve, pool creation on solana

Tokenix Smart Contract This repository contains the smart contract for Tokenix, a launchpad project currently under development at https://tokenix.fin

Comments
  • Comment literal

    Comment literal

    Comments

    TLDR

    Looking for a concise way to implement comments.

    I think...

    My initial idea is to use # as single-line comment:

    [pour] -> [scoop] # means: [var_sending_to_python] -> [var_pulling_from_python]
    python! {
       print("[Python]:", scoop)
       var_pulling_from_python = 10
    }
    

    [!NOTE] I don't think merge-lang includes anything that'll make multi-line comment crucial

    Purpose of this thread

    • Should merge use comments?
      • if yes, What literal should merge use? (;, //, --, <!--, /* */, --[ ], <!-- -->)
      • if no, Why?
    help wanted core::syntax 
    opened by UTFeight 0
Owner
camel_case
Whatever minimal, gets simpler to maintain.
camel_case
A modern high-performance open source file analysis library for automating localization tasks

?? Filecount Filecount is a modern high-performance open source file analysis library for automating localization tasks. It enables you to add file an

Babblebase 4 Nov 11, 2022
An Interpreter for Brainfuck programming language implemented in the Rust programming language with zero dependencies.

Brainfuck Hello, Visitor! Hey there, welcome to my project showcase website! It's great to have you here. I hope you're ready to check out some awesom

Syed Vilayat Ali Rizvi 7 Mar 31, 2023
A C-like programming language that is similar to Rust's syntax. Toy programming language.

CRUST This is a hobby project to learn about compilers and language design. I've designed the language to be similar to C and Rust. Heavily inspired b

Mahmoud Almontasser 50 Jul 13, 2024
a universal meta-transliterator that can decipher arbitrary encoding schemas, built in pure Rust

transliterati a universal meta-transliterator that can decipher arbitrary encoding schemas, built in pure Rust what does it do? You give it this: Барл

Catherine Koshka 7 Dec 21, 2022
🐱 HQ9C is a very serioues compiler for HQ9+, it meta-compiles with Rust.

HQ9+ Compiler HQ9c (Or HQ9+ Compiler) is a blockchain-based NFT minting AI machine-learning cloud infraestructure for the compiling of the great progr

Alex 5 Aug 28, 2022
Meta framework. Support for dynamic plug-ins and AOP

Kokoro Dynamic publish-subscribe pattern framework. Support for dynamic plug-ins and AOP Not yet stable, do not use in production !! 下面的内容有些老旧了,但是 exa

Kokoro 18 Mar 1, 2024
Programming language made by me to learn other people how to make programming languages :3

Spectra programming language Programming language made for my tutorial videos (my youtube channel): Syntax Declaring a variable: var a = 3; Function

Adi Salimgereyev 3 Jul 25, 2023
Voila is a domain-specific language launched through CLI tool for operating with files and directories in massive amounts in a fast & reliable way.

Voila is a domain-specific language designed for doing complex operations to folders & files. It is based on a CLI tool, although you can write your V

Guillem Jara 86 Dec 12, 2022
The Amp programming language: a language designed for building high performance systems.

A language designed for building high performance systems. Platform Support x86_64-pc-windows ✅ x86_64-unknown-linux ⚠️ untested x86_64-unknown-darwin

The Amp Programming Language 5 Mar 17, 2023
Nexa programming language. A language for game developers by a game developer

NexaLang Nexa programming language. A language for game developers by a game developer. Features High-Level: Nexa is an easy high level language Two M

Sabe 3 Aug 21, 2023