Recent

Author Topic: Is Lazarus 100% Pascal ?  (Read 1376 times)

440bx

  • Hero Member
  • *****
  • Posts: 4742
Is Lazarus 100% Pascal ?
« on: July 17, 2024, 06:36:30 am »
I am under the impression that Lazarus is _entirely_ written in Pascal (specifically FPC) but, I wondered if maybe there were one or more object files that were actually the product of C code (or some other language.)

Basically, that's the question, is there any part of Lazarus that is not written in Pascal ?

Thank you for your help.
(FPC v3.0.4 and Lazarus 1.8.2) or (FPC v3.2.2 and Lazarus v3.2) on Windows 7 SP1 64bit.

AlexTP

  • Hero Member
  • *****
  • Posts: 2488
    • UVviewsoft
Re: Is Lazarus 100% Pascal ?
« Reply #1 on: July 17, 2024, 06:40:15 am »
No C codes at all, because that would need precompiled C object files for different OSes/CPUs and it is very hard.
Inline Asm - maybe in some components, yes.

TRon

  • Hero Member
  • *****
  • Posts: 3646
Re: Is Lazarus 100% Pascal ?
« Reply #2 on: July 17, 2024, 06:44:46 am »
Depends on what you meant by Lazarus he IDE or also the (default) components ?

There are a few components that link to c objects and as mentioned by AlexTP there is definitely some inline assembler present in some components.

I am not aware of any code present in the source-tree in c that is written specifically for Lazarus (which doesn't mean there isn't any).
« Last Edit: July 17, 2024, 06:46:43 am by TRon »
This tagline is powered by AI (AI advertisement: Free Pascal the only programming language that matters)

440bx

  • Hero Member
  • *****
  • Posts: 4742
Re: Is Lazarus 100% Pascal ?
« Reply #3 on: July 17, 2024, 07:17:20 am »
Thank you. 

I just wondered and, now it is very clear that having all in Pascal, avoids a good number of problems (inline assembly is handled by the Pascal compiler, so in a way, it's still Pascal.)
(FPC v3.0.4 and Lazarus 1.8.2) or (FPC v3.2.2 and Lazarus v3.2) on Windows 7 SP1 64bit.

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11944
  • FPC developer.
Re: Is Lazarus 100% Pascal ?
« Reply #4 on: July 17, 2024, 07:29:02 am »
I am under the impression that Lazarus is _entirely_ written in Pascal (specifically FPC) but, I wondered if maybe there were one or more object files that were actually the product of C code (or some other language.)

For FPC:

The biggest non pascal factor is makefiles. On some targets, an external assembler and/or linker is used (typically GNU AS and LD or their LLVM equivalents), but on Windows it is typically not. Same for some other tools used in building.

Besides that there is a bunch of assembler, both in performance versions of primitives per architecture(move/indexbyte etc) and startup code. The latter has shrunk over the years however, due to more and more startup code being in Pascal. If the startup code is in assembler, it is typically an external one (like GAS).

In upcoming versions, the resource compiler windres will be replaced by a Pascal equivalent.

For Lazarus:
It uses widget sets (GTK/QT) or win32 GDI.  It all depends on where you place the line lazarus to "system".
« Last Edit: July 17, 2024, 07:31:40 am by marcov »

440bx

  • Hero Member
  • *****
  • Posts: 4742
Re: Is Lazarus 100% Pascal ?
« Reply #5 on: July 17, 2024, 02:12:07 pm »
Thank you Marco. 
(FPC v3.0.4 and Lazarus 1.8.2) or (FPC v3.2.2 and Lazarus v3.2) on Windows 7 SP1 64bit.

 

TinyPortal © 2005-2018