digitalmars.D - Are there sizeable examples of code that builds and runs when compiled
- Dibyendu Majumdar (2/2) Nov 21 2020 I am looking for examples that are betterC only.
- Dennis (18/19) Nov 22 2020 I'm not sure exactly what you're looking for, but here are some
- Dibyendu Majumdar (3/8) Nov 22 2020 Okay thank you. I am just trying to see what language features
- Jacob Carlborg (7/8) Nov 23 2020 The DMC compiler [1]. The backend of DMD [2].
- sarn (10/12) Nov 23 2020 It's useless, and I'm sure there are things that could be better
I am looking for examples that are betterC only. Thanks and Regards
Nov 21 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.
Nov 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:Okay thank you. I am just trying to see what language features are used as a way of figuring out what works in betterCI 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:
Nov 22 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
Nov 23 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 RegardsIt'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