cgtjsiwy

joined 3 years ago
[–] cgtjsiwy@programming.dev 7 points 1 month ago* (last edited 1 month ago) (1 children)

Agreed on all points except possibly semicolons. Automatic semicolon inference has a very big language footprint, similar to the range syntax that the author disliked.

That said, I don't think the vararg suggestion belongs in this list of syntax changes. For this feature to be useful, it has to be at least powerful enough to replace format!, but the current type system isn't even remotely expressive enough to do this. I imagine this would require something like C++-style templates or comptime reflection, which goes well beyond syntax changes.

I added the author's other texts to my reading backlog too. Looks interesting.

[–] cgtjsiwy@programming.dev 12 points 7 months ago

This is missing the biggest difference: ISO 8601 costs 190-450€, whereas RFC 3339 is free.

[–] cgtjsiwy@programming.dev 1 points 8 months ago* (last edited 8 months ago)

Very few languages (or programmers!) are able to check that a function doesn't have side effects. In particular, checking that a function doesn't diverge generally requires a proof assistant, like in F* and Lean.

Your definition of functional programming is as valid as any, but it's so strict that even Haskell would be mid-tier in the functional ranking.

[–] cgtjsiwy@programming.dev 1 points 10 months ago

I didn't really understand the details of what you're making, but if you want to generate a random variable with entropy x, the straightforward approach would be to use Σ = { n | 1≤n≤⌈2^x⌉ } as the alphabet and start with a uniform distribution (which overshoots the entropy target) and slightly skew the distribution to reduce entropy to hit the target x. Then you can map Σ to your desired set (f64 or Vec in your case?) using an injection, since that preserves entropy.