soc

joined 2 years ago
[–] soc@programming.dev 1 points 1 hour ago

That's still a workaround to try and keep a completely artificial distinction alive.

Even if I didn't need [] for types, I still wouldn't want "some functions use (), some functions use []" as a language rule.

[–] soc@programming.dev 1 points 4 hours ago

Oh, good idea ... any preference on the first? :-)

[–] soc@programming.dev 1 points 1 week ago (2 children)

Wasting a perfectly good pair of brackets on some random function call and then suffering for it in many other places sounds more like syntactic salt.

[–] soc@programming.dev 1 points 1 week ago (4 children)

What's a form of access but a function from some index type to some element type?

[–] soc@programming.dev 3 points 1 week ago

Happily using it for presentation slides.

[–] soc@programming.dev 1 points 2 weeks ago (1 children)

If you read more than just the headings, you'd find out that your objections have been addressed in the article. ;-)

[–] soc@programming.dev 1 points 4 weeks ago* (last edited 4 weeks ago)

Sure, there are some worse/more limited predecessors – my design was partially motivated by a desire to improve upon these.

For instance, that ML-derivative you are using for your examples

  • very likely still has if then else in the language, thus making it not unified
  • desperately tries to emulate functionality with guards that simply comes out of the box with my approach
  • relies on the ultimate hack of "match on unit", because match is very limited in which coding patterns it can express

Also, none of the examples are "more clear" or "have less magic":
Maybe they are more "familiar" to you personally, but that's about it.

Too me they just look clunky, full of accidental complexity and trying to work around a poor/limited language design.

[–] soc@programming.dev 1 points 2 months ago* (last edited 2 months ago) (1 children)

That –at best– gives you the same performance.

EDIT: Ok, I misunderstood – you meant the performance of "case insensitive in kernel" vs. "case insensitive in userspace". I get your point now.

 

A design that subsumes the various syntactic forms of

  • if statements/expressions
  • switch on values
  • match on patterns and pattern guards
  • if-let constructs

and scales from simple one-liners to complex pattern matches.

view more: next ›