0

As a learning project I started looking into how to mimic some basic features of a no-code platform. I usually code in Java/Python, have good knowledge over Javascript/HTML, but wanted to use this to pick up React or Vue frameworks. I am more of a backend dev than front end.

I understand the mechanics of the drag and drop of components, and the relationship graph flow representation in JSON for instance. What I am lacking knowledge about is how the JSON object is then loaded into an executable script, and how the execution is managed, especially when you have multiple users or even multiple flow running in parallel from the same user.

Any suggestions on how to accomplish this?

A very basic crude example:

  • Each block is a drag and drop visual component within the web app ui.

  • Which then is turned into its equivalent code script (say in Python)

     def sum(a,b):
       return a+b
    
     x=2
     y=3
    
     print(sum(x,y))
    
  • The script is executed $ python diagramm.py > run1.log

  • run1.log content shown within the web app

enter image description here

3
  • Thank you @DocBrown I am not looking to replicate an existing platform, but rather to learn by implementing a small prototype focusing on fleshing out the code execution aspects.
    – KarlZ
    Commented Aug 27, 2021 at 13:19
  • Ok, I took the freedom to change the title to reflect this, so your question hopefully isn't going to be closed immediately with "needs more focus". I also removed the request for 3rd party resources, which is off-topic here and already triggered a close vote by one of those "buzzword closers" who only scan questions for close justifications without actively trying to curate them.
    – Doc Brown
    Commented Aug 27, 2021 at 13:43
  • 2
    "no code" is just a marketing term. In the end, what you have is still a programming language, and what you are writing is still an interpreter. There's literal bookshelves full of literature about how to implement programming languages. Commented Aug 27, 2021 at 14:25

1 Answer 1

1

In the scenario you describe JSON is being used as a DSL. DSLs interpret "tokens" to create machine readable action. However, unlike real languages they require a custom parsing engine and typically have no IDE for that DSL. This creates issue down the line in areas such as refactoring because the only tool available is Find/Replace editors.

DSL->Tokenizer->Code Generator->Runtime Inerpreter/Compiler->Executed code.

The term no-code is a misnomer ultimately, but refers to the fact the User doesn't have to code. In the end code is generated because computers do nothing without code.

7
  • Indeed, given the UI is in Javascript it was natural to get the overall diagram of blocks represented as a single JSON document. I agree that the JSON needs to be parsed and each element converted into its code block forming an interpreted/complied-then-executed script. But how to run it, it is worth running it in a docker container for instance?
    – KarlZ
    Commented Aug 27, 2021 at 13:29
  • How to run it? Simple, json is parsed at run time and converted into something that executes a javascript function or collection of functions. Commented Aug 27, 2021 at 13:49
  • What's the reason for tokenizing JSON yourself instead of just using a JSON parser? Commented Aug 27, 2021 at 17:55
  • @JörgWMittag: I think it is pretty obvious that KarlZ meant to parse the DSL inside the JSON.
    – Doc Brown
    Commented Aug 28, 2021 at 7:43
  • @KarlZ: executing programs provided by unknown users requires a sandbox. Google for *run yourFavoriteLanguage code in sandbox". For Python, start here. For Javascript, starte here.
    – Doc Brown
    Commented Aug 28, 2021 at 7:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.