Reinventing the wheel

“Theorem proofing” may be beside the point (and it is a different can of worms). But regarding this question:

why we can not complete source with intentions or needed knowlegde and derive implemenations for each programming language?

This is basically modifying the original language to extend it with annotations that explicitly describe the intent of the code (“this for loop that contains an ‘if’ is actually a collection partial traversal applying this predicate”, “this pointer here is actually a child-parent reference”, “this enumeration is actually a state machine”). You may also want to forbid using constructs and features that are too implementation oriented and harder to map. You are in effect creating a higher level programming language, one that uses (possibly a subset of) the original language but is much easier to translate to the intermediate language.

Yup, that is totally possible, but you are no longer supporting programs in the original language (most existing code would not be supported). No problem with that, as long as you keep that in mind.

I have been exploring that approach myself using Kotlin+Spring Boot as a source language for model-driven business applications. See this example - that is the entire source of a business application, complete with a functional backend, database persistence, a REST API and a generic UI. The abundance of annotations is hard to miss. You can notice the presence of mechanisms that need to be used to complement the base language, such as a state machine implementation, annotations to describe relationships, entities, query operations so on and so forth, concepts that are part of a more abstract language and lack in the base language.

The formal verification shall be performed outside the language.
https://lamport.azurewebsites.net/tla/tla.html

Will be a real breakthrough exporting formal notations from code.
On the other note, in pony language the type system is formally verified.

1 Like

Thanks for contributing your links. I was not yet able to handle them mentally…

I expressed it wrong, sorry. I meant a entirely new language.
Annotating source code is, I think, not describing enough. You could have some model in mind but you only write down what is needed to fulfill a task. You do not need a concept “bank account” to model a bank application. But you need it to understand the application… hopefully.

I hope I was not wasting the time of everybody here too much ^^* xD. Let’s declare the topic as closed or as X file haha…

To put the headstone on this: OMG tried to create this universal language to describe all languages, so we know it’s a lost cause: https://www.omg.org/spec/KDM/1.3/

1 Like