r/Compilers • • Jul 05 '26

Tungsten - A fast, expressive programming language

https://tungsten-lang.org
0 Upvotes

22 comments sorted by

View all comments

Show parent comment

3

u/Hjalfi Jul 05 '26

I notice it makes a lot of things implicit, like the argument names (e.g. the distance method in the example). This worries me a bit because most programming is an exercise in making implicit behaviour explicit. For example, how does it know that the parameter is another Point? What if it's actually a four -dimensional vector with x', y', z' and w', except w' isn't used? What if the parameter is a three dimensional vector which isn't a Point? It feels like a lot of focus has gone into the syntactic sugar but there hasn't been much emphasis on the fundamental semantics of the language.

e.g. physics support: 1234 m/s is a number with a unit. But it's also 1234 metres, divided by the variable s. How is this disambiguated? Whitespace?

1

u/thecompanygardener Aug 11 '26

Yes, whitespace. Division ("/") is surrounded by whitespace. 1/2 is a rational.

Regarding your question about Point, it has type-aware multi-dispatch. Folks who want everything explicit will really hate the free-arg binding in blocks. But others may find some idioms that feel right.