Jump to page: 1 2 3
Thread overview
Language Reference
Aug 17
Pete
Aug 18
monkyyy
Aug 19
monkyyy
Aug 20
monkyyy
Aug 18
IchorDev
Aug 18
Pete
Aug 19
monkyyy
Aug 19
user1234
Aug 19
monkyyy
Aug 20
IchorDev
Aug 21
IchorDev
Aug 25
Renato
Aug 25
monkyyy
Aug 21
IchorDev
Aug 21
IchorDev
August 17

I'm starting to learn the D language and started reading the Language Reference. Trying some examples, I noted that the compilers are flagging some things as deprecated while the Language Reference has no indication of this. Main example, the cent/ucent data types. The compiler (ldc2@1.39.0) indicated cent/ucent as obsolete and to use core.int128.Cent, but I couldn't find that in the standard library site (in core)...but found std.Int128. Am I missing something? Is the Language Reference not being updated or the compilers running way ahead of it?

Thanks

August 18

On Saturday, 17 August 2024 at 22:17:59 UTC, Pete wrote:

>

I'm starting to learn the D language and started reading the Language Reference

dont; spec is full of lies and slaunder

my thing is over here: https://github.com/crazymonkyyy/dingbats

I think this book over hyped, and if I dont link it 10 poeple will yell at me(as opposed to the 3 who will anyway) the book is better then the spec https://ddili.org/ders/d.en/index.html

August 18

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.

August 18

On Sunday, 18 August 2024 at 08:28:48 UTC, IchorDev wrote:

>

On Saturday, 17 August 2024 at 22:17:59 UTC, Pete wrote:

>

[...]

Could you send a link to those examples?

>

[...]

Yes, the keywords are deprecated: https://dlang.org/spec/lex.html#keywords
cent/ucent as built-in types were never implemented.

[...]

Calling them examples was not quite correct - I just did simple programs. Appreciate the link to speedy-int128. Thank you.
PS. will submit an issue.

August 19

On Saturday, 17 August 2024 at 22:17:59 UTC, Pete wrote:

>

I'm starting to learn the D language and started reading the Language Reference.

I've never read the reference, but I can tell you that The Book (over-hyped or not) gives you a solid grounding. It's the only D reference/tutorial that's kept more-or-less up-to-date (I say at the risk of excessive hyphenation). You may or may not find it slow going, depending on your taste, but at this point, it's the best we have for getting in there are getting your feet wet.

If you're new to computer science, it covers basics I first learned back in the mid-1980's, the kind of stuff rarely mentioned these days that lends one a solid understanding of these machines we all love to tinker with.

August 19

On Sunday, 18 August 2024 at 01:31:37 UTC, monkyyy wrote:

>

spec is full of lies and slaunder

If you know of specific inaccuracies or omissions, please file bugs.

August 19

On Monday, 19 August 2024 at 16:03:59 UTC, Nick Treleaven wrote:

>

On Sunday, 18 August 2024 at 01:31:37 UTC, monkyyy wrote:

>

spec is full of lies and slaunder

If you know of specific inaccuracies or omissions, please file bugs.

You should only ask for bug reports of people who dont have active year old ones; I will cynically pick and choose when I bother

August 19

On Monday, 19 August 2024 at 06:47:10 UTC, Ron Tarrant wrote:

>

The Book
If you're new to computer science, it covers basics I first learned back in the mid-1980's,

Which is terrible

No one needs yet another explanation on what floats are

The core d languge should be a light 50 pages; templates can then be dense 500 pages

August 19

On Monday, 19 August 2024 at 19:14:19 UTC, monkyyy wrote:

>

On Monday, 19 August 2024 at 06:47:10 UTC, Ron Tarrant wrote:

>

The Book
If you're new to computer science, it covers basics I first learned back in the mid-1980's,

Which is terrible

No one needs yet another explanation on what floats are

The core d languge should be a light 50 pages; templates can then be dense 500 pages

So much less is required. Templates are much more easy to get that you think. A single page is enough. To be a bit provocative it's jut about filling the holes.
Then it becomes a bit more complex when it's about overloading... but essentially templates are incomplete syntax trees that you complete with arguments. Dead stupid.

Now sure D adds a bit of complexity over that simple concept. How ?

  1. constraints. Well well well, isn't that thing just made to deal with overloading ;)
  2. eponymous declarations

Otherwise, the other big thing to get is that template instances can insert new things in the AST. The compiler deals with that quite nicely because it's "multi-pass".

August 19

On Monday, 19 August 2024 at 20:17:58 UTC, user1234 wrote:

>

On Monday, 19 August 2024 at 19:14:19 UTC, monkyyy wrote:

>

The core d languge should be a light 50 pages; templates can then be dense 500 pages

So much less is required. Templates are much more easy to get that you think. A single page is enough. To be a bit provocative it's jut about filling the holes.
Then it becomes a bit more complex when it's about overloading... but essentially templates are incomplete syntax trees that you complete with arguments. Dead stupid.

Now sure D adds a bit of complexity over that simple concept. How ?

  1. constraints. Well well well, isn't that thing just made to deal with overloading ;)
  2. eponymous declarations

Otherwise, the other big thing to get is that template instances can insert new things in the AST. The compiler deals with that quite nicely because it's "multi-pass".

I havnt yet seen coherent explanations for the bugs features I know, much less concise ones. Spooky quantum effects, the order of compilation, the syntax of sequences, the mix file having effects, breaking down overload sets, traits and honestly their bad api, is statements, etc.

Im quite sure it isnt only a page

« First   ‹ Prev
1 2 3