ExecuTorch developer here, agreed it's a huge pain to deal with if conditions right now. Part of the pain comes from the vast expressiveness of python on if condition, which causes all ML compiler a lot of headache to be able to capture a sound graph. The rest of the pain comes from the strict requirement of torch.compile itself (no mutation/aliasing behavior in the if branches), which in often times makes torch.cond hard to use or inefficient.
PMunch and summarity both already said this, but because maybe code speaks louder than words (like pictures?)... This works:
from strutils as su import nil
echo su.split "hi there"
(You can put some parens () in there if you like, but that compiles.) So, you can do Python-style terse renames of imports with forced qualification. You just won't be able to say "hi there".(su.split) or .`su.split` or the like.
You can revive that, though, with a
template suSplit(x): untyped = su.split x
echo "hi there".suSplit`
That most Nim code you see will not do this is more a cultural/popularity thing that is kind of a copy-paste/survey of dev tastes thing. It's much like people using "np" as the ident in `import numpy as np`. I was doing this renaming import before it was even widely popular, but I used capital `N` for `numpy` and have had people freak out at me for such (and yet no one freaking out at Travis for not just calling it `np` in the first place).
So, it matters a little more in that this impacts how you design/demo library code/lib symbol sets and so on, but it is less of a big deal than people make it out to be. This itself is much like people pretending they are arguing about "fundamental language things", when a great deal of what they actually argue about are "common practices" or conventions. Programming language designers have precious little control over such practices.
Apple is far gone, macOS has been buggy for a while. At first I thought this was in favor of iOS, but seeing how iOS usability has suffered, and how they are squandering their reasources on pointless redesigns.. I guess they are just another company now.
I guess it's a melancholic reality that only certain outstanding individuals can be relied on to produce greatness. Most of us are just not there.
Another such example is Python. Python is slowly being bloated by the people in charge, since Guido basically gave up, soon to be as shitty as C++ is.
I am afraid Blender and Pytorch will be next, seeing how the original visionaries have left or will leave in the not so distant future.
reply