Thread overview
Are there sizeable examples of code that builds and runs when compiled in betterC mode?
Nov 21, 2020
Dibyendu Majumdar
Nov 22, 2020
Dennis
Nov 22, 2020
Dibyendu Majumdar
Nov 23, 2020
Jacob Carlborg
Nov 24, 2020
sarn
November 21, 2020
I am looking for examples that are betterC only.

Thanks and Regards
November 22, 2020
On Saturday, 21 November 2020 at 23:50:50 UTC, Dibyendu Majumdar wrote:
> I am looking for examples that are betterC only.

I'm not sure exactly what you're looking for, but here are some things that might interest you:

BindBC-bindings are pretty sizeable:
https://github.com/BindBC

However, they're simply interfaces for C libraries so they're not really complex or interesting as a code example.

I recently translated most of glfw and libsoundio, two C libraries, resulting in ~50 000 lines of D code:
https://github.com/dkorpel/glfw-d
https://github.com/dkorpel/libsoundio-d
They have `buildOptions "betterC"` in the dub.sdl.

If you're looking for betterC libraries with brand new code, check out:
https://github.com/libmir

If you're looking for an application instead of library specifically, I don't have a good example currently.

November 22, 2020
On Sunday, 22 November 2020 at 16:09:34 UTC, Dennis wrote:
> On Saturday, 21 November 2020 at 23:50:50 UTC, Dibyendu Majumdar wrote:
>> I am looking for examples that are betterC only.
>
> I'm not sure exactly what you're looking for, but here are some things that might interest you:


Okay thank you. I am just trying to see what language features are used as a way of figuring out what works in betterC
November 23, 2020
On Saturday, 21 November 2020 at 23:50:50 UTC, Dibyendu Majumdar wrote:
> I am looking for examples that are betterC only.

The DMC compiler [1]. The backend of DMD [2].

[1] https://github.com/DigitalMars/Compiler
[2] https://github.com/dlang/dmd/tree/master/src/dmd/backend

--
/Jacob Carlborg
November 24, 2020
On Saturday, 21 November 2020 at 23:50:50 UTC, Dibyendu Majumdar wrote:
> I am looking for examples that are betterC only.
>
> Thanks and Regards

It's useless, and I'm sure there are things that could be better done today, but it's a complete, non-trivial program using betterC techniques:
https://gitlab.com/sarneaud/xanthe

(NB: it's more low-level than most betterC code because it doesn't even use libc.  E.g., all memory allocation is static or using freelists, but you can use malloc() in normal betterC code https://dlang.org/phobos/core_stdc_stdlib.html#.malloc)