KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Running Compiled versus Running Interpreted
PRODUCT: 4D Developer | VERSION: 11 | PLATFORM: Mac & Win
Published On: March 12, 2008

When a database is running interpreted, another layer runs to execute the code during runtime. This layer interprets or translates the human readable code (4D code) to machine code so it can be executed. A 4D structure file's extension is .4DB when running interpreted. Ideally, an interpreted structure should only be used to design the structure and not deploy.

Advantages of an Interpreted Structure:

-Can see code in action immediately and make modifications during runtime.
-4D ignores simple programming mistakes such as Typing variables.

Disadvantages:

-Slower than compiled because of the layer that translates the 4D code to machine code.
-Because it fixes simple programming mistakes, it produces bad programming habits. Thus, it is recommended to always compile code even when running interpreted.

The following licenses permit the use of a 4D Interpreted structure file:

4D Developer Standard
4D Developer Professional
4D SQL Desktop
4D Web Application Server
4D OEM Desktop

When a database is running compiled, the 4D code has been translated to machine code. The file extension can either be a .4DB or .4DC. Compiled structures are meant for deployment purposes. Note: To use a compiled database for both platforms, the compiler needs its preference to be set to "Compile for PPC and Intel processors (Mac Intel and Windows)"

Advantages of a Compiled Structure:

-Runs faster than an interpreted structure because no interpreted layer is needed.
-With a compiled structure (.4DC) the source code is removed and cannot be accessed.

Disadvantages:

-Harder to troubleshoot since the code cannot be traced.

The following licenses allow the use of a 4D compiled structure file:

4D Developer Professional
4D SQL Desktop
4D Web Application Server
4D OEM Desktop

Related resources:

What happened to Compiled Application command?