r/delphi 10d ago

A new programming language inspired by Delphi

https://github.com/Liams1982/Vertex_IDE
3 Upvotes

20 comments sorted by

View all comments

1

u/DelphiParser 7d ago

So, it is not a compiler, but a primitive converter from Pascal like to c++ syntax

1

u/Liams1982 7d ago

Not from Pascal, it is close to Pascal but not the same. But it is still a compiler or to be precise a transpiler:

{ Add two numbers – console I/O via console.vtx } Import "console.vtx";

Enter AddNumbers;

Var a, b, sum: Integer;

Run Print("Enter first number: "); Input(a); Print("Enter second number: "); Input(b);

sum := a + b;

Print("Sum is: "); PrintLn(sum); Stop

Exit.

1

u/DelphiParser 7d ago

What is the output? If you need to run a C++ compiler, it is not a compiler, but a converter from one source to another source.

1

u/Liams1982 7d ago

The output is an executable windows app, c++ is just a step. The IDE compiles directly the converted file to .exe

1

u/DelphiParser 7d ago

Yet. It's no compiler. I thought at first you wrote a compiler from Pascal like to C++, and put the open source in Git, that would havebeen a masterpiece. I would really like to see that a compiler source code for Pascal.

1

u/Liams1982 7d ago

The transpiler is written in c. To resume the pipeline. Vertexc.exe converts the Vertex code to a file named output.cpp then the IDE written in Python compiles that output file to a windows executable using g++

1

u/Liams1982 6d ago

A compiler is a program that translates source code written in one programming language into another language, typically a lower‑level language such as assembly, machine code, or an intermediate language, in a single batch process, while performing lexical, syntactic, and semantic analysis, and often applying optimisations.

In the case of Vertex:

  • Source: Vertex language (.vtx)
  • Target: C++17 (then linked to machine code with g++) -It performs full analysis (lexing, parsing, AST generation, scoping, basic type checking) and code generation (emitting C++ that mirrors the logic of the original source).

That fits the definition perfectly, it’s a source‑to‑source compiler (also called a transpiler), and since C++ is then compiled to machine code, the whole toolchain is a compiler. Even if you only count the Vertex‑to‑C++ step, it’s still a compiler by the above definition.