Recent

Author Topic: Using Lazarus for languages/compilers different from Fpc  (Read 599 times)

gidesa

  • Full Member
  • ***
  • Posts: 196
Using Lazarus for languages/compilers different from Fpc
« on: October 15, 2025, 03:39:48 pm »
Hello,
is it possible to configure Lazarus as an IDE for languages different from Pascal, and their compilers?
For example, Modula-2, Oberon, Ada, C ....

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 12524
  • FPC developer.
Re: Using Lazarus for languages/compilers different from Fpc
« Reply #1 on: October 15, 2025, 05:37:31 pm »
There are some simple syntax highlighter options for other language (which can be handy in a mixed language project), but afaik no, no other build systems supported, and I assume codetools is also pascal only.

n7800

  • Hero Member
  • *****
  • Posts: 547
Re: Using Lazarus for languages/compilers different from Fpc
« Reply #2 on: October 15, 2025, 10:35:16 pm »
I think the most you can use is the "Execute before"/"Execute after" options in Project Options > Compiler Options > Compiler Commands.

You can simply specify the command line to call your compiler, like "gcc main.c".

There's also a command for the compiler itself, but it seems to be specific to FPC (just another path/version). I sometimes use it to specify a trunk compiler for a test project without changing the IDE's options.



Otherwise, Lazarus seems to be tailored for Pascal - from the project file itself to all the possible specific options and much more...

Theoretically, packages could be written to extend the capabilities (Source Editor completion/hints, a different compiler, and run method), but this no has practical value - there are other editors/IDEs for that.

MarkMLl

  • Hero Member
  • *****
  • Posts: 8504
Re: Using Lazarus for languages/compilers different from Fpc
« Reply #3 on: October 16, 2025, 10:30:25 am »
is it possible to configure Lazarus as an IDE for languages different from Pascal, and their compilers?
For example, Modula-2, Oberon, Ada, C ....

This has definitely been discussed before, although I can't find it. Basically, and deferring heavily towards anything that Martin says, there are so many places inside the IDE that the behaviour of Pascal- as a language- and FPC- as an implementation- are assumed, and so little documentation on how the IDE works internally, that getting it working with a different language or implementation is probably not viable.

Consider in particular the way that the form designer generates and interprets Pascal syntax, ditto for the debugger, and also the assumptions that things like .lfm files make about what the language can do.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Logitech, TopSpeed & FTL Modula-2 on bare metal (Z80, '286 protected mode).
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

 

TinyPortal © 2005-2018