2 ms·
This is a good example to learn how to use the tools a programming language offers, just saying a programing language has a GC thus bad is meaningless, without
by pjmlp 1y ago
This is a good example to learn how to use the tools a programming language offers, just saying a programing language has a GC thus bad is meaningless, without understanding what is actually available.
Regarding,
> Spans and slice-like structures in are the future of safe memory operations in modern programming languages.
It is sad how long stuff takes to reach mainstream technology, in Oberon the equivalent declaration to partition would be,
PROCEDURE partition(span: ARRAY OF INTEGER): INTEGER
And if the type is the special case of ARRAY OF BYTE (need to import SYSTEM for that), then any type representation can be mapped into a span of bytes.
You will find similar capabilities in Cedar, Modula-2+, Modula-3, among several others.
Modern safe memory langaguage are finally catching up with the 1990's research, pity it always takes this much for adoption of cool ideas.
Having said this, I feel modern .NET has all the features that made me like Modula-3 back in the day, even if some are a bit convoluted like inline arrays in structs.
- whizzter 1y agoEven on the contrary, once you introduce GC usage into languages without direct support you're basically always running a substandard GC because so many advances(enabled by read/write barriers) aren't really available without language support. Then people go around shouting GC's are bad because they used them with a language that made them use some of the worst ones out there.