Showing posts with label Domain specific language. Show all posts
Showing posts with label Domain specific language. Show all posts

August 21, 2019

Creating Artificial Intelligence with domain specific languages


Artificial Intelligence is sometimes described as a machine who is able to think by it's own. This understanding is not completely wrong, because the robot doesn't need a remote control but the device finds the path autonomously. But the description is not complete because it doesn't tell the audience how to build an AI from scratch. The more elaborated way in teaching Artificial Intelligence is to focus on human machine interaction. Before a computer can take decision he needs to be programmed first. The programmer defines before the run of the robot, what the machine will do. He writes down a program and the computer executes the plan.
The amount of techniques to program computers are endless. In modern times, different programming languages like Python, Java and C++ were invented. In most cases, the operating system of the computer is written in C. For describing robotics movements a different kind of notation is needed which is usually called a behavior oriented language. The interesting point is, that a behavior script is the opposite of “the robot acts autonomously”. Instead, the script tells for each situation what to do. That means, the robot's movements are not the result of Artificial Intelligence, but it was written down by the programmer in advance.
The trick to build advanced robotics systems is located within the domain specific language for describing the behavior. If the language is efficient, it's much easier to describe a complex behavior. The more realistic way in describing what AI is about
A robotic script has two stakeholders. The first one is the computer who has to execute the script. That means, the high level behaviors are converted into assembly language. The second stakeholder is the programmer who likes to describe a certain problem within the notation. The domain specific language is located in the middle. It translates the intention of the programmer into a stream of machine language instructions.

June 21, 2019

The difference between a Domain specific language and a library


On the first look it seems, that both are similar. If somebody would like to realize a game he needs some kind of game library for painting lines to the screen. And if he likes he can call the library a Domain specific language (DSL) which contains the same functions. But there is large difference which can be explained in the programming game “Karel the robot”. Karel is a robot in a maze which has to be programmed, and Karel works with a domain specific language. The interesting point is, that the script which controls Karel runs inside the main program. Which means, that first the environment is started and then the karel1-scripts gets startet which moves the robot 4 steps upwards and 2 steps sidewards. The Karel script is executed by an abstract machine.
As a consequence a DSL is a something which runs in a box separate from the main program. The question is if Karel the robot can be realized as a library? The problem would be that the Karel program can't stopped independent from the game simulator, both are connected together. In most implementations, Karel runs as a thread independent from the main program. The working thesis is, that a DSL is equal to a subthread which runs in a program.