October 28

On Monday, 2 October 2023 at 17:28:19 UTC, Mike Parker wrote:

>

It's been a long, long while since I published anything on the blog. I do intend to get pick it up again down the road, but Walter recently surprised me with plans of his own. He's taken the topic of his DConf '23 talk and derived a blog post from it:

https://dlang.org/blog/2023/10/02/crafting-self-evident-code-with-d/

I guess he got impatient with the pace at which I'm getting the talk videos uploaded :-)

And for anyone who'd like to engage in any Reddit discussion that comes up:

https://www.reddit.com/r/programming/comments/16y2h36/crafting_selfevident_code_in_dlang/

I wonder if Walter has an opinion on this. In a .c file:

void *(STDVEC_DATAPTR)(SEXP x) {
    if (ALTREP(x))
	error("cannot get STDVEC_DATAPTR from ALTREP object");
    if (! isVector(x) && TYPEOF(x) != WEAKREFSXP)
	error("STDVEC_DATAPTR can only be applied to a vector, not a '%s'",
	      type2char(TYPEOF(x)));
    CHKZLN(x);
    return STDVEC_DATAPTR(x);
}

CHKZLN(x) only does some checks. It doesn't have any side effects. After scratching my head for a bit, I used grep to locate this in a .h file:

#define STDVEC_DATAPTR(x) ((void *) (((SEXPREC_ALIGN *) (x)) + 1))

And of course, there were no comments to explain what is going on. Very self-evident.

October 29
On 10/28/2023 1:54 PM, bachmeier wrote:
> I wonder if Walter has an opinion on this. In a .c file:

It looks like the author is self-taught with little exposure to other programmers.
October 29

On Thursday, 26 October 2023 at 03:39:19 UTC, Walter Bright wrote:

>

I've heard from an expert insider source that Scala macros destroyed the language.

The worst stuff I've ever heard about Scala, apart from compile-speed anecdotes, is "Scala Collections: Why Not?" https://www.youtube.com/watch?v=uiJycy6dFSQ . It's really hard to imagine a macro problem more off-putting than this video.

scala> List(1, 2, 3).toSet()
res0: Boolean = false

scala> List(1, 2, 3) contains "your mom"
res2: Boolean = false
1 2 3 4 5
Next ›   Last »