On Saturday, 17 August 2024 at 22:17:59 UTC, Pete wrote:
> Trying some examples, I noted that the compilers are flagging some things as deprecated while the Language Reference has no indication of this.
Could you send a link to those examples?
> Main example, the cent/ucent data types. The compiler (ldc2@1.39.0) indicated cent/ucent as obsolete
Yes, the keywords are deprecated: https://dlang.org/spec/lex.html#keywords
cent
/ucent
as built-in types were never implemented.
> and to use core.int128.Cent, but I couldn't find that in the standard library site (in core)...but found std.Int128.
You probably didn’t find it because you were looking under the std
package, not the core
package.
However, core.int128
is just a plain data type & a bunch of maths functions like add
/div
/mul
/etc. that operate on it—it’s a set of building blocks. std.int128.Int128
turns those functions into appropriate operator overloads. However, I would actually recommend this library because it’s exactly the same except that when using LDC2 it produces significantly faster code.
> Am I missing something?
Is the Language Reference not being updated or the compilers running way ahead of it?
Sometimes the spec misses some information, it’s just human error. In general dmd’s implementation is a higher authority, but sometimes it has bugs too. If you notice something missing from the spec, then please file an issue or submit a PR.