Are there programming languages ​​that simultaneously extend multiple languages? [Question edited]

AspectJ expands the Java language with new concepts.

Are there other languages ​​that simultaneously expand multiple languages? If yes, please give me an example.

.


EDIT: I was not clear enough. The Java program is still considered a valid AspectJ program.

I am looking for this type of extension:

The language A , which extends B and C , but a program written only in B or C , is still a valid program A

+4
source share
3 answers

PFront (and its base language MBase ) extends several target languages ​​— the .NET CLR directly (via a Csharp-like embedded DSL), Lisp running on top of this CLR, and LLVM IR (and virtually any target platform supported by LLVM) through C-like built-in DSL.

Any language created within the framework of this structure can be oriented to any of the basic platforms or languages ​​and can be expanded with another language - that is, languages ​​form a hierarchy, with each new language expanding one or more already defined languages.

Update : to reflect an updated question - there are two ways to expand languages ​​in pfront. First, simply expand the language by adding new designs and forms. Secondly, it is an implementation of a limited superset of a language that allows only a subset of the target language. Both methods are used β€” for example, most Csharp programs are valid subsets of PFront, as well as Lisp.

+2
source

Clojure is a dialect of Lisp that runs on the JVM. JRuby is a Ruby implementation that runs on the JVM. Scala is a very cool language that (you guessed it!) Also works on the JVM. Everyone can call existing Java APIs, so you might think that the "extension" of the Java language.

+1
source

Source: https://habr.com/ru/post/1338554/


All Articles