What are the extensible languages people are using today?

4k views Asked by At

Wikipedia says:

Extensible programming is a term used in computer science to describe a style of computer programming that focuses on mechanisms to extend the programming language, compiler and runtime environment.

For example, Tcl lets you write your own control structures. See here.

I'm interested in compiling a list of extensible programming languages that are being used in real-world code. It would be nice if you could supply an example for your language as well.

8

There are 8 answers

0
user3852746 On

The TCL language is a dynamic language with few fundamental rules:

The spirit of Tcl is "Everything is a string", "everything is a command", even control flow constructions.

For instance let to replace while loop with custom one.

# rename original while to orig_while for future usage.
rename while orig_while; 

#redefine while
proc while {cond body} {
# add customization code

# calculate while call count.
global while_call_count;
incr while_call_count;

# call original while in uper level stack 
 uplevel orig_while $cond $body;

# add customization code
}

Tcl has C language interface which allow to integrate Tcl into exists program very easily. Tcl used in EDA tools very extensively.

And finally TCL so powerful that it is not possible to define Tcl BNF, which brings lot of headaches.

1
Patrick Niedzielski On

Languages in the LISP family (Common Lisp, Guile, et cetera), are extremely extensible--more so than any other language I have ever used. Think of it like the C macro system on steroids. If you were bored enough, you could redefine the + operator as subtraction: now that is extensibility!

LISP has fallen out of fashion in many places, but Guile (a dialect of Scheme) is the official extension language of the GNU Project.

0
Matthew Farwell On

Scala is not strictly extensible either, but you can define what look like operators. For instance when defining a Map, you can use:

val romanNumeral = Map(
    1 -> "I", 2 -> "II", 3 -> "III"
)

The -> is actually a method called on the object 1, but looks like an operator.

0
Orion Edwards On

Ruby is not strictly an extensible language, but the syntax is flexible and powerful enough that if you squint, it kind of looks like it is... which for many purposes is plenty good enough.

At any rate, people actually use Ruby :-)

0
Aykut Kllic On

Jetbrains MPS (Meta-programming System) offers a projectional editor based extendible language workbench. It helps you in creating editors, type-systems, constraints, refactorings and code generators for your language extensions. It ships with some Java language implementation and extensions.

mbeddr is a C implementation utilizing this technology. It has component system, send/receive + client/server interfaces, dependency injection, state machines, testing and PLE extensions. It also contains an extensible debugging system so you can map your extensions to gdb and provide a comfortable debugging experience. Almost entire C language features are mapped so code generation can be mostly handled by reduction to C constructs instead of dumb M2T transformations.

Aynth is a simple monophonic synth written using mbeddr for the demonstration of components and send/receive interfaces.

Anyway, the first thing you'll notice if you use it will be, projectional editing isn't as comfortable as text editing in many cases. We're so much used to text based editing. But extensible languages have plenty benefits.

0
AudioBubble On

The Wikipedia article about Extensible programming mentions the language Seed7. The Wikipedia article of Seed7 describes it as:

In addition to many other features it provides an extension mechanism. Seed7 supports the introduction of new syntax and their semantics into the language and it allows new language constructs to be defined using the Seed7 language itself. E.g.: Programmers can introduce syntax and semantic of new statements as well as user defined operator symbols.

Seed7 is designed as extensible language from ground up. The whole language is not hard-coded in the compiler. Instead Seed7 is defined in libraries, which are loaded when the program is compiled. IMHO Seed7 is the only language where extensibility is a basic feature and everything else is based on it. Other approaches use a conventional language, where the compiler uses hard-coded syntax and semantic analysis, and bolt some extension mechanism on it.

0
gridsleep On

Forth, APL, ADA, LisP, COMAL, Oberon, and Eiffel, are extensible languages. Base compiler/runtime instructions may be created and added to the paradigm.

0
Theo On

Jeebox is an extensible language that can describe anything, including code.

It is used purely to describe things, right now...

But an extensible programming language, could be built ontop of Jeebox, very easily.

(I'm building a normal, non-extensible programming language ontop of Jeebox, simply because building extensibility into a programming language is more than just a language feature. It needs a kind of recursion, where you write code that can create more code. And doing this properly would require more time than I have available. But it's nice to know that the language I'm using, Jeebox, can support this, once I have time to do it.)