Re:Ask HN: What would be your “perfect” programming language?
by hyperswine on Wednesday September 14, 2022 @07:17PM
(#32844803)
Having the "same syntax but in multiple different contexts" is a good idea in general I feel
And then one feature that I like which few languages support are some kind of contexts. Scala does this really well for example, but even in Scala it could be improved.
What I mean is that code that looks the same can mean different things in different contexts. The typesystem then ensures that it cannot be used wrongly though.
An example would be how "5 ± 3" can mean different things depending on the context, such as "1 or 8" or "mean of 5 with variance of 3" (in statistics).
Without such a feature it's hard to translate thoughts into code as easy in certain domains.