lysdexic

joined 2 years ago
MODERATOR OF
[–] lysdexic@programming.dev 2 points 2 years ago

Electron apps created with React can definitely push the boundaries of what ‘acceptable’ memory usage is.

I have a pet theory that webview-based apps are popular only because currently there is absolutely no usable multiplatform desktop GUI framework. Therefore, developers have to resort to the one thing that works: load a webpage in a web browser.

Even React Native feels like a kludge in a way it converts React components to UI components.

[–] lysdexic@programming.dev 21 points 2 years ago (1 children)

These small proof of concept projects just go to show how fundamentally important are projects such as GCC and LLVM, which considerably lowered the barrier to entry of monumental tasks such as developing a programming language that targets basically all platforms under the sun.

Kudos GCC and LLVM.

[–] lysdexic@programming.dev 1 points 2 years ago (6 children)

In practice, Protocols are a way to make “superclasses” that you can never add features to (for example, readinto despite being critical for performance is utterly broken in Python).

Not really, and this interpretation is oblivious to the concept of protocols and misses the whole point of them.

The point of a protocol is to specify that a type supports a specific set of methods with specific signatures, aka duck typing, and provide the necessary and sufficient infrastructure to check if objects comply with a protocol and throw an error in case it doesn't.

Also, protocol classes can be inherited, and protocols can be extended.

https://peps.python.org/pep-0544/

[–] lysdexic@programming.dev 2 points 2 years ago

It’s very weird to me that Python, as an inherently untyped language

I don't think this is true. Python is dynamically typed, but types exist. More importantly, Python is the poster child of duck typing. What is duck typing if not a way to implicitly specify protocols? If you're relying on protocols to work, why not have tests for it? If you want to test protocols, aren't you actually doing type checks?

If typing is a good thing,

...which undoubtedly is.

(...) why not make it an optional first-class part of the language?

It already is, isn't it?

But some people already have Python code that does not do type checking. What would be the point of refusing to run that code?

view more: ‹ prev next ›