Re: Are @safe unittests actually checked for safety?

2020-09-07 Thread Adam D. Ruppe via Digitalmars-d-learn
On Monday, 7 September 2020 at 20:33:26 UTC, 0xEAB wrote: Are unittests that are marked @safe actually checked for safety? https://github.com/dlang/phobos/blob/v2.093.1/std/file.d#L4937 How comes this unittest is @safe when `dirEntries` appears to be @system? I see what happened now: those

Re: Building LDC runtime for a microcontroller

2020-09-07 Thread Adam D. Ruppe via Digitalmars-d-learn
On Monday, 7 September 2020 at 20:55:54 UTC, IGotD- wrote: I guess this was written before betterC existed. Well, -betterC existed even then, but it was *completely* useless. It didn't become useful until 2016 or 2017. But around that same time, going minimal runtime got even easier, so I

Re: Building LDC runtime for a microcontroller

2020-09-07 Thread IGotD- via Digitalmars-d-learn
On Monday, 7 September 2020 at 19:12:59 UTC, aberba wrote: How about an alternative runtime + standard library for embedded systems...with a least bare minimum. I've seen a number of efforts to get D to run in those environments but almost none of them is packaged for others to consume.

Are @safe unittests actually checked for safety?

2020-09-07 Thread 0xEAB via Digitalmars-d-learn
Are unittests that are marked @safe actually checked for safety? https://github.com/dlang/phobos/blob/v2.093.1/std/file.d#L4937 How comes this unittest is @safe when `dirEntries` appears to be @system? Example I: https://run.dlang.io/is/Vf0STw Error: @safe function onlineapp.listdir

Re: Building LDC runtime for a microcontroller

2020-09-07 Thread aberba via Digitalmars-d-learn
On Monday, 7 September 2020 at 16:18:00 UTC, IGotD- wrote: On Monday, 7 September 2020 at 15:23:28 UTC, Severin Teona wrote: [...] Use betterC, which is much better suited for microcontrollers than the full D. The disadvantage is that many great features are disabled in betterC. [...]

Re: Building LDC runtime for a microcontroller

2020-09-07 Thread kinke via Digitalmars-d-learn
On Monday, 7 September 2020 at 15:23:28 UTC, Severin Teona wrote: CMake Error at /snap/cmake/549/share/cmake-3.18/Modules/CMakeTestCCompiler.cmake:66 (message): This is apparently a non-LDC specific issue, a default CMake C compiler sanity check fails. When looking at that file, you'll see

Re: Building LDC runtime for a microcontroller

2020-09-07 Thread IGotD- via Digitalmars-d-learn
On Monday, 7 September 2020 at 15:23:28 UTC, Severin Teona wrote: I would also appreciate any advice regarding ways to build or create a small runtime for microcontrollers (runtime that can fit in the memory of a microcontroller). Thank you very much, Teona [1]:

Building LDC runtime for a microcontroller

2020-09-07 Thread Severin Teona via Digitalmars-d-learn
Hello, I have been trying to build the LDC runtime for a Nucleo-f429zi board with a Cortex-M4 CPU, by following [1]. The target is not dependent on any operating system (as the target board uses a STM32 microcontroller), so the gcc toolchain I have used is arm-none-eabi-gcc(9.3.1). The error

Re: Why is there no throws, @gc, impure, mutable ?

2020-09-07 Thread wjoe via Digitalmars-d-learn
On Monday, 7 September 2020 at 11:44:40 UTC, Paul Backus wrote: On Monday, 7 September 2020 at 11:25:15 UTC, wjoe wrote: It's easy to declare the entire module @safe and functions which can't be can be declared @system. However there is const, immutable, pure, @nogc and nothrow but no mutable,

Re: Why is there no throws, @gc, impure, mutable ?

2020-09-07 Thread Paul Backus via Digitalmars-d-learn
On Monday, 7 September 2020 at 11:25:15 UTC, wjoe wrote: It's easy to declare the entire module @safe and functions which can't be can be declared @system. However there is const, immutable, pure, @nogc and nothrow but no mutable, impure, @gc and throws. Why is that ? Mostly because

Why is there no throws, @gc, impure, mutable ?

2020-09-07 Thread wjoe via Digitalmars-d-learn
It's easy to declare the entire module @safe and functions which can't be can be declared @system. However there is const, immutable, pure, @nogc and nothrow but no mutable, impure, @gc and throws. Why is that ?