Zig vs D generics

IGotD- nise at nise.com
Wed Oct 12 12:41:44 UTC 2022


On Wednesday, 12 October 2022 at 11:27:26 UTC, Ola Fosheim 
Grøstad wrote:
>
> Swift is much higher level, although there has been some talk 
> of making it more capable for machine-level programming.
>

Swift is about just as high level as D, classes come with extra 
metadata both dynamic and static just like D. Managed pointers 
(reference types) are ARC so it should be better suited for 
embedded systems. Unlike D that has @system and unsafe blocks for 
Rust, for direct access to memory, Swift offers 
UnsafePointer/UnsafeMutablePointer, 
UnsafeBufferPointer/UnsafeMutableBufferPointer among others. 
Certainly an interesting approach, maybe that's the only thing 
that is needed. Swift does not have @safe/@trusted/@system for 
foreign functions, you just call them so maybe Walter was right 
after all.

> Many developers distrust languages like C# and Swift for cross 
> platform, you can basically always expect the support on 
> "foreign platforms" to be subpar and if it isn't you have to 
> plan for platforms being dropped in the future for 
> non-technical reasons.
>
> They may technically be cross platform, but they sure ain't 
> politically cross platform :-).

Maybe true but that applies for any platform/library. Just look 
what happened to Qt. In the case of Swift, yes the Linux/Windows 
implementations lag behind Apple.




More information about the Digitalmars-d mailing list