Recent

Author Topic: cppdecl examples  (Read 4186 times)

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11383
  • FPC developer.
Re: cppdecl examples
« Reply #15 on: December 15, 2019, 07:20:50 pm »

I'm a BSD user but I've to admit they are insignificiant. Mac is always it own problem. On Linux, GCC still is the default compiler. So nothing to worry. Support GCC first, then Clang, then others.

This frame of mind is fine if you are commercial, and that first release will get you buy in of most of the users.

However in case of open source you need to keep the long view. Solutions that don't work for all targets or have otherwise limited lifetime is just not worth it.

Quote
It's also weird. The fact both of you (GCC and FPC) are GPL-ed but why I found you hate each other.

Not slavishly copying it, or making a cult out of the other doesn't mean it is hate. You can perfectly respect eachother at a distance :-)

Quote
Only LLVM Pascal could have the right to said GCC is the past and the future is Clang. But indeed there is no LLVM Pascal.

Well, there is the LLVM backend of euh, FPC ?

Quote

This also proved Pascal is a insignificiant language, because nearly all of other languages, if having GCC frontend, also have LLVM frontend. Where is my LLVM Pascal? Oh, I think if it exists it should be called LLVM PLang or something like that  ;)

Ask yourself why so little other frontends that Clang actually are even somewhat in the same category as CLang. Maybe it is not a problem of the "others", but of the Clang-LLVM complex?

A bit like GTK which purports to be an universal GUI api, but in practice only catered to Gnome and GIMP, and bugs for other applications linger forever.

guest64953

  • Guest
Re: cppdecl examples
« Reply #16 on: December 16, 2019, 05:37:18 am »
So clang is a potential target to support. Don't care about MSVC, it will be the past soon  ;D

The fact that a new MSVC might be clang based, does not mean the result will be compatible with the OSS clang. They probably will have compatible MSVC name mangling in that Clang based derivate, so that it changes the compiler inner workings really doesn't mean compatibility

So the near future goal is just GCC  ;)
It's not about the compiler, that I used "GCC" and "MSVC" is a bit misleading in fact. What is important is the ABI. And there we have two big ones that need to be supported: Sys V ABI (which is used by GCC and clang (on non-Windows)) and the MS ABI (which is used by MSVC as well as clang on Windows). And yes, support for the MS ABI is important as well, cause this feature is about supporting third party C++ libraries which are often provided in a MS ABI flavor for Windows (e.g. Qt).

Also there is no "near future goal". This is a long term, low priority feature.

I was trying to find an alternative way to use some C++ business logic that I am sharing across different platforms. Ideally, I would use some code generation tools (like Swig) to generate a pure C api, but there doesn't seem to be any decent option (prototype old branches in Swig doesn't count). Do you happen to know any? If it makes any difference, I only need Windows compatibility.
It might be best to extend Swig to finally generate Delphi/FPC wrappers. I had given it a try some years ago as well, but then I stumpled upon some problems and lost interest again...

Thanks for clarify. Anyway, Qt also offers MinGW compiled version  :)

guest64953

  • Guest
Re: cppdecl examples
« Reply #17 on: December 16, 2019, 05:45:26 am »
Quote
Only LLVM Pascal could have the right to said GCC is the past and the future is Clang. But indeed there is no LLVM Pascal.

Well, there is the LLVM backend of euh, FPC ?

Well, I know FPC has support for the LLVM backend. But it doesn't count. The LLVM PLang must be also BSD licensed. FPC is GPL-ed. Any derivation works, including this LLVM backend, must be GPL-ed, too. The fact is why many corporations switched to Clang, not only because of a more modern codebase and newer innovations, is because of the BSD license. I myself also prefer the BSD license over the communist GPL. If someone up with a LLVM Pascal and a decent IDE also BSD licensed or any other kind of permissive license based, I will ditch FPC and Lazarus immediately  :)

valdir.marcos

  • Hero Member
  • *****
  • Posts: 1106
Re: cppdecl examples
« Reply #18 on: December 16, 2019, 06:08:25 am »
Quote
Only LLVM Pascal could have the right to said GCC is the past and the future is Clang. But indeed there is no LLVM Pascal.
Well, there is the LLVM backend of euh, FPC ?
Well, I know FPC has support for the LLVM backend. But it doesn't count. The LLVM PLang must be also BSD licensed. FPC is GPL-ed. Any derivation works, including this LLVM backend, must be GPL-ed, too. The fact is why many corporations switched to Clang, not only because of a more modern codebase and newer innovations, is because of the BSD license. I myself also prefer the BSD license over the communist GPL. If someone up with a LLVM Pascal and a decent IDE also BSD licensed or any other kind of permissive license based, I will ditch FPC and Lazarus immediately  :)
Interesting.
« Last Edit: December 16, 2019, 02:12:48 pm by valdir.marcos »

PascalDragon

  • Hero Member
  • *****
  • Posts: 5446
  • Compiler Developer
Re: cppdecl examples
« Reply #19 on: December 16, 2019, 09:22:04 am »
Quote
Only LLVM Pascal could have the right to said GCC is the past and the future is Clang. But indeed there is no LLVM Pascal.

Well, there is the LLVM backend of euh, FPC ?

Well, I know FPC has support for the LLVM backend. But it doesn't count. The LLVM PLang must be also BSD licensed. FPC is GPL-ed. Any derivation works, including this LLVM backend, must be GPL-ed, too. The fact is why many corporations switched to Clang, not only because of a more modern codebase and newer innovations, is because of the BSD license. I myself also prefer the BSD license over the communist GPL. If someone up with a LLVM Pascal and a decent IDE also BSD licensed or any other kind of permissive license based, I will ditch FPC and Lazarus immediately  :)
Why is that important for you? The GPL guarantees that improvements to FPC are available for everyone and that a company can't hoard their changes without the community benefitting. Thus as a user you benefit directly.
Also the license of FPC does in no way affect the generated code. You want to create a closed source application? Go for it! The license of the RTL and the LCL allows it.

avra

  • Hero Member
  • *****
  • Posts: 2514
    • Additional info
Re: cppdecl examples
« Reply #20 on: December 16, 2019, 09:46:10 am »
I was trying to find an alternative way to use some C++ business logic that I am sharing across different platforms. Ideally, I would use some code generation tools (like Swig) to generate a pure C api, but there doesn't seem to be any decent option (prototype old branches in Swig doesn't count).
Have you checked this SWIG 3.0 effort:
http://www.fmxexpress.com/create-wrapper-interfaces-for-c-and-c-libraries-using-swig-with-delphi-support/
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11383
  • FPC developer.
Re: cppdecl examples
« Reply #21 on: December 16, 2019, 10:43:35 am »
Quote
Only LLVM Pascal could have the right to said GCC is the past and the future is Clang. But indeed there is no LLVM Pascal.

Well, there is the LLVM backend of euh, FPC ?

Well, I know FPC has support for the LLVM backend. But it doesn't count. The LLVM PLang must be also BSD licensed. FPC is GPL-ed. Any derivation works, including this LLVM backend, must be GPL-ed, too. The fact is why many corporations switched to Clang, not only because of a more modern codebase and newer innovations, is because of the BSD license. I myself also prefer the BSD license over the communist GPL. If someone up with a LLVM Pascal and a decent IDE also BSD licensed or any other kind of permissive license based, I will ditch FPC and Lazarus immediately  :)

That is a reason to not fork FPC for commercial purposes. It is no limitation in using GPL compilers at all.

I'm also a bit of a BSD bent, but IMHO this is a gigantic over exaggeration of a small detail (except for a few very, very large companies, but we are not in that ballpark anyway, nor we will for a very very long time)
« Last Edit: December 16, 2019, 10:45:12 am by marcov »

guest64953

  • Guest
Re: cppdecl examples
« Reply #22 on: December 17, 2019, 11:39:42 am »
I prefer the BSD license or any permissive licenses just because of ideology. Most of us, the BSD OS users share this ideology. Nothing wrong with you, though.

MarkMLl

  • Hero Member
  • *****
  • Posts: 6676
Re: cppdecl examples
« Reply #23 on: December 17, 2019, 11:47:56 am »
The important thing is that several jurisdictions now accept that if you start to use a piece of software it is implicit acceptance of the license. There are probably things which would be disqualified as "unreasonable contract terms" (i.e. "please send me a postcard and two virgins") but by and large a user can no longer say "I think this is silly and unenforceable" with impunity.

It's also important to recognise that copyright remains with the authors, who are free to publish under multiple licenses. In other words, "if you download it from Github it's (L)GPL and you get no support, if you get it from us a commercial license and support contract applies".

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

 

TinyPortal © 2005-2018