3 ms·
Well, you mean the Zen of Python's "There should be one-- and preferably only one --obvious way to do it." In any case, even then, people think in different wa
by logicrook 11y ago
Well, you mean the Zen of Python's "There should be one-- and preferably only one --obvious way to do it."
In any case, even then, people think in different ways: you can model a problem via category theory, geometry, algebra, and those would never translate into the same syntactical constructions, since the abstractions are of fundamentally different natures.
Now I think mostly in a functional way, so my Python code is full of small functions to help write "pythonic functional code", e.g. the function iff(b,x,y) that returns x if b and else returns y. The resulting code could be translated algorithmically to a functional language in a very natural way; the internal def would be translated to where clauses, etc.
The point being, I want to be able to think in the way that is the most adapted to tackle a problem, even if the code seems to be written in two different languages. This is no different from mathematics where each "X theory" is essentially its own language and each implies its own set of natural theorems.
- duncanawoods 11y ago>> This is no different from mathematics where each "X theory" is essentially its own language Nice connection between models and languages. The maths/physics discoveries achieved by using a new representation of a problem don't change the problem, they just present the issue at hand simply enough to be tractable. Each representation moves complexity trade-offs to a different category of problem. I guess that does say something in favour of automatic syntax conversions but it seems too low level. Maybe conversions between the mode of abstraction being used is where it gets interesting.
- logicrook 11y agoIn mathematics, there are fairly few such 'meta-results', and each one is duly celebrated as impressive; the one that comes to mind is Curry-Howard correspondence... but in more 'traditional' maths, it's very hard to find general high-level translations. There are many cases where automatic syntactic low-level constructions can bring huge improvements, in compiler design, etc, it's more that they are less susceptible to be directly useful to laymen.