Skip to content

Latest commit

 

History

History
125 lines (70 loc) · 4.02 KB

README-en.md

File metadata and controls

125 lines (70 loc) · 4.02 KB

Der Kompilierer Der Deutschen Programmiersprache (Compiler for the german programming language)

"Die Deutsche Programmiersprache" (DDP) is a (joke-)programming language by NotLe0n and bafto, which was designed so that programs written in it read like almost proper german.

The Bedienungsanleitung (documentation) is a good starting point to get to know DDP; you can also find installation instructions there.

The Playground makes it possible to try out DDP without having to install the compiler.

If you want to work on the Compiler see CONTRIBUTING-en

Installation

To install DDP, all you have to do is download the current release for the desired operating system from Github here, Unpack the archive and run the installer (ddp-setup.exe).

Detailed installation instructions are available here.

Feature overview

DDP is a statically typed, modular and imperative language. Most of the features will be familiar to programmers.

Expressions

Every expression in DDP produces a value of fixed type.

Variables also have a fixed type.

DDP also has Listen

Instruction blocks

In DDP, multiple instructions can be grouped together in a block.

As you can see, each block begins with a ":". Variables are transferred to sub-blocks, but overshadow new declarations with the same name old declarations.

Since {} are not symbols of German texts, the Indentation depth (4 spaces or 1 tab) is used to determine when a block is finished.

If statements

For simple branches, DDP offers If statements.

Of course, this can also be done without instruction blocks, but only for single instructions.

Loops

DDP supports most known loops.

While loops:

Do-While loops:

and most importantly, for loops:

So that you don't always have to write a long for loop there are also repetitions:

Just like with if statements, this can all be done with single instructions.

Functions

Functions are by far the most important feature of DDP, because they allow you to turn almost any German sentence or expression into code.

This is due to the way they are called, namely via so-called aliases.

As you can see, the function foo was called like a normal German expression without violating the grammatical rules.

Functions are a very big topic in DDP and this small example shows only a fraction of their complex syntax.

For more details, I strongly recommend reading this article from the documentation thoroughly, or at least skimming the examples.

Modules

In DDP, source code is organized into modules, where a module is simply a source file.

In fact, all of the examples above already have used the Module "Duden/Ausgabe" to be able to use the Schreibe x function.

When you include a module, only the functions/variables marked as 'public' become visible.

You can also just include the functions/variables that you need.

include.ddp:

main.ddp: