by davesque · 4y ago · 0 comments
Honestly, I think people are too hard on languages (and especially Python) for having new features that challenge the status quo. And then there's also too much drama when it turns out that a scripting language is, in fact, a scripting language! So you can do weird things with stateful ABCs and such. I mean yeah, it's strange. But it probably also has some perfect use case in a very specific circumstance. At the end of the day, if you understand how a feature really works, you can do creative things with it. I'm glad we have it!
I've been thinking about programming language development, and some weird things from the typing front.
This could be easily used to achieve unions.
But another thing that I was thinking about was the return from unsafe land.
You have some class or object that you want to do some quasi-illegal fucky bullshit to - send it off and do what you will.
But what comes back might not have the guarantee that it's still the 'shape' of the thing that you sent away.
This could be used to validate that what comes back is sane.
They are great examples. Great examples of what not to do.
The only use case I can think of is meta programming which most people don't need.