DEV Community

Discussion on: Why Has Extensibility Failed?

Collapse
 
yucer profile image
yucer • Edited

Actually it happens a lot. And they have success.

The object oriented languages that you are talking about, are General purpose programming language.

The ancestor of the actual computers were the Automatons. They had a very specific hardware for a very specific task (e.g.: writing a letter by hand). Nevertheless, they were allowed some flexibility, they were programmed by little holes on a rotating cylinder that were translated by a mechanical system into the task steps(e.g.: moving the pencil to a position). Those codes in the cylinder were actually a representation of a Domain Specific Language.

The general-purpose computer and languages came with the attempt of selling computers to everybody that could be used for most of the people in their daily tasks. The market did need to serialize the production of a single type of computers... and then the general-purpose languages arise.

Reusability is a key concept that drive the OOP, and the first stuff to be reused was the hardware. ;-)

Interestingly when a program designed for one specific domain reach a big complexity, its evolution is so that the designers make it flexible in order to reduce coding time when customizing the software to solve specific problems in its application domain.

They stop being a monolithic software and start to have at least to parts (one that operates as a service and one that serves as a user interface to allow the user to access the features). In order to do that, they usually build an Object Model and expose its objects through interfaces. Usually the services are used by the program that interacts with you, but they can be used by other programs also.

Another way commonly used is that they build a Domain Specific Language with keywords and commands that have only sense in that domain (drawing, education, etc). The program translates that into actions.

One way that has evolved is the visual programming languages. They are domain specific languages with visual a representation. Normally the user can draw the specific behavior and that is later translated to a DSL, and later compiled to code or run as script. Of course the amount of things you can draw or connect depend on what you have implemented in the language.

I hope you are aware that a machine can't do any task in the field of Education without programming it at some extend (including needed educational concepts and actions in the DSL).

You can see a practical example of those paradigms of the Education domain used in Scratch.

One example in mathematics / engineering is the language Simulink of MATLAB that allows to make complex mathematical constructs using drag and drop and interface with devices to be controlled.

One that I like a lot is the Project Harpia that allows to define Image processing pipelines via a visual language, although it doesn't have a DSL, it generates directly the C++ code using OpenCV

Another successful example of a DSL is the one of Gamemaker. The language defines all the meaningful operations to describe the computer game interactions.

Some examples don't have a DSL, but they have a DOM and they use a general scripting language. E.g.: Gimp uses Python to do the automation.

If you want to make your own DSL, you can use: ANTLR or one similar tool like Yacc. They will generate the basic code for your compiler or script parser. Code you can call from your software.