Re: [Development] Could support for C be added to Qt?

2022-09-10 Thread samuel ammonius
> This is something where C and C++ developers learn very different > philosophies that they have each put a lot of effort into. In C++, > casting between pointer types is considered quite dangerous if the > compiler doesn't check for human error. This is a basic concept > learned early on and adhe

Re: [Development] Could support for C be added to Qt?

2022-09-10 Thread Karl Semich
On Sat, Sep 10, 2022 at 2:14 PM samuel ammonius wrote: > > > First, your own example of not having compile-time checking of the means > > that > > those programmers are accepting less security for the sake of staying in the > > same language. > > How? It's just the equivalent of static_cast(), an

Re: [Development] Could support for C be added to Qt?

2022-09-10 Thread samuel ammonius
> First, your own example of not having compile-time checking of the means that > those programmers are accepting less security for the sake of staying in the > same language. How? It's just the equivalent of static_cast(), and I'm talking about types with the same sizes. If the types were of diff

Re: [Development] Could support for C be added to Qt?

2022-09-10 Thread Thiago Macieira
On Saturday, 10 September 2022 10:02:05 PDT samuel ammonius wrote: > These may not seem like huge issues, but the fact > that the > language has no problem with anything that the actual computer doesn't have > a > problem with is something very valuable for most C developers, so they > probably > w

Re: [Development] Could support for C be added to Qt?

2022-09-10 Thread samuel ammonius
> Allan’s proposal to keep the code C but ensure it builds with a C++ > compiler likely had precisely this kind of scenario in mind. It does > help others to make a generic interface. It is likely a lot more work. > Experience with an AI-assisted IDE could speed things. > And what's the gain here?

Re: [Development] Could support for C be added to Qt?

2022-09-10 Thread Thiago Macieira
On Saturday, 10 September 2022 07:05:46 PDT Karl Semich wrote: > Qt has such a strong C++ basis that I personally might take the small > performance hit of keeping C bindings more separate, to make merging > forward easier. What performance hit? You have to wrap ALL functions and none of them can

Re: [Development] Could support for C be added to Qt?

2022-09-10 Thread Karl Semich
> its apps and users. Many of these programs are built on top of years of C > code, > so I don't think it would be easy for the developers of those programs to > switch > from C to C++ even if they wanted to. Allan’s proposal to keep the code C but ensure it builds with a C++ compiler likely had p

Re: [Development] Could support for C be added to Qt?

2022-09-10 Thread samuel ammonius
> In C, constructors/destructors usually become alloc/free functions. C > has macros and code generation but these aren’t directly analogous to > templates. The problem is that C++ doesn't let you get the address of constructors/destructors. The only option might be to make a function that calls "