[m-users.] My experiences with inst declarations and making them more user-friendly

Dirk Ziegemeyer dirk at ziegemeyer.de
Fri Mar 15 07:54:38 AEDT 2019


> Am 14.03.2019 um 14:54 schrieb Charles Shuller <charles.shuller at gmail.com>:
> 
> Regarding syntactic sugar:   Most of the syntactic sugar I've encountered has been a source of problems, not a resolution for them.   Of course, this may just be because "good" semantic sugar is completely transparent, and never gets in my way, but it seems the most difficult "features" and biggest sources of bugs I've encountered in many languages is a direct result of the semantic sugar.
> 
> 	• Good syntactic sugar (highly constrained, small translation unit, easy to explain to users):  hello[1:3] -> slice(hello, 1, 3).
> 	• Bad syntactic sugar (broad in scope, large translation unit, hard to explain to users):   Haskell do-block notation
> 	• Bad syntactic sugar (limited in scope, large translation unit, hard to explain to users): Async and Await in JavaScript -- These wind up being small words that wrap things up in promises, and using them properly WITHOUT already knowing about how promises work is next to impossible.
>     

Hi Charles,

I see your point about syntactic sugar.

I’m just looking for some way to take advantage of subtype-insts without facing the issues described in my post. In more than 95 percent of my code, I’m perfectly fine without subtype-insts. But rarely I would like to use them to improve static error checking.

Dirk



More information about the users mailing list