www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Are there sizeable examples of code that builds and runs when compiled

reply Dibyendu Majumdar <mobile majumdar.org.uk> writes:
I am looking for examples that are betterC only.

Thanks and Regards
Nov 21 2020
next sibling parent reply Dennis <dkorpel gmail.com> writes:
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.
Nov 22 2020
parent Dibyendu Majumdar <mobile majumdar.org.uk> writes:
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
Nov 22 2020
prev sibling next sibling parent Jacob Carlborg <doob me.com> writes:
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
Nov 23 2020
prev sibling parent sarn <sarn theartofmachinery.com> writes:
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)
Nov 23 2020