Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

is there a Universal Model for languages?

Many programming languages share generic and even fairly universal features. For example, if you compared Java, VB6, .NET, PHP, Python, then you would find common functions such as control structures, numeric and string manipulation, etc.

What has been done to define these features at a meta-language (or language-agnostic) level?

UML offers a descriptive reference of software in every aspect, but the real-world focus seems to be data processes. Is UML relevant?

I'm not asking "Why we don't have a single language that replaces the current plethora." We need many different tools (at least in this eon).

I'm not asking that all languages fit a template -- assembly vs. compiled languages are different enough to make that unfeasible (and some folks call HTML a language, though I wouldn't). Any attempt would start with a properly narrow scope. In line with this, I wouldn't expect the model to cover even a small selection with full validity.

I would expect however that such a model could be used to transpose from one language to another (with limited goals -- think jist translation).

like image 630
Smandoli Avatar asked Apr 13 '10 16:04

Smandoli


2 Answers

There have been many attempts at this, but none have been very successful. The earliest I'm aware of is UNCOL more than 50 years ago.

You've given a list of languages that have a lot in common because they're pretty similar -- they're all procedural languages with common roots and some OO extensions thrown in, so that's not too suprising. If you start looking at different languages like LISP, haskell, erlang, prolog, or even SQL you start seeing very different things.

like image 73
Chris Dodd Avatar answered Sep 30 '22 12:09

Chris Dodd


What you're describing sounds like the formal semantics of programming languages. There are a variety of approaches and each will give a way to formally specify the meaning of a program in some programming language. In some cases, this specification is essentially a translation into another language such as lambda calculus, or compilation for a formally specified abstract machine such as SECD.

There is so much work here it's hard to pick a specific reference. But I hope I've given you some useful keywords to continue your search.

like image 37
sigfpe Avatar answered Sep 30 '22 13:09

sigfpe