2

I think asyncIO might have changed my life today. I think this is a turning point. Invest in your skills.

Comments
  • 2
    AsyncIO is beautiful stuff indeed but not many seems to gasp it. Run to_thread or run_in_executor everywhere. I managed to make classic sockets as fast as the asyncio sockets using that. Would've not expact that. But things that regularly need to_thread / run_in_executor are maybe beter of in seperate process.. This is all asyncio single process: https://molodetz.nl/dashboard.

    Not happy with aiosqlite tho. Maybe it's better not to use that at all.
  • 3
    Coroutines are great indeed ;P

    I'm glad it's kinda the default in js now with async
  • 1
    Funny how python, the main language for big data stuff and AI, doesn’t even have decent first class concurrency.
  • 1
    @Lensflare It's glue, It should have the simplest options for everything. The only argument I can see in favour of concurrency is that C# has blocking and green threads rather than async, and if you don't care at all about efficiency, this saves you from function coloring.
  • 2
    @lorentz welp, I agree. But nowadays scripting languages like Python and JS aren’t used as glue anymore and that’s the problem.
    They are advertised as full ass programming languages but lack the features and properties of full ass programming languages.
  • 1
    @Lensflare JS isn't really glue though, before WASM it was impossible to call out to other languages from it, and even with WASM the targets must be designed with the limitations of WASM in mind. I call Python glue because it's usually used to call out to C libraries that weren't written with Python in mind at all.
  • 2
    @Lensflare I guess there's node-gyp but it's so terrible to work with from the C angle that I'm convinced the intended extension mechanism is just to write all the libraries directly in JS on top of Node's networking and disk IO.
  • 2
    @lorentz js is glue but the other way around. You can call js from almost all languages. There are even libs for languages like C# which have a js api.
  • 3
    @Lensflare It used to even be built into java
  • 1
    @Lensflare I keep repeating, programming languages are for people, not for the machine. That makes python and js the better languages. And it's not true that it hasn't true concurrency, with run in executor I explain above here, you can run as blocking as you want in seperate threads nu giving it a thread pool executor or process pool executor. Sounds you're a bit behind. You're spreading fake news.
  • 0
    @Lensflare funny, how people live in the 90's.
  • 2
    @whimsical compiled machine code is for the machine. Programming languages are for people.

    I’m not claiming that Python doesn’t have concurrency. I’m saying it doesn’t have proper first class concurrency. If it did, something like asyncio wouldn’t exist.

    Java has thread support as well but it was horribly inconvenient because it used callbacks and callbacks needed anonymous type instances because it didn’t have lambdas (not sure if it has now).
    This is a good example of how multithreading support doesn’t mean first class concurrency.
  • 1
    @Lensflare that real time concurrency, I've tested with python 3.14 without GIL. And realised, what to do with it anyway. It's not that you're about to encode videos or whatever. But fact is, it does really run concurrent, als with the GIL version. Does not block. I can run an input() (for stdin read) no problem.
  • 1
    @whimsical I know that it doesn’t block, otherwise it would be useless.

    And what I’m talking about has nothing to do with realtime.

    I’m talking about at least language features like async/await and structured concurrency.
  • 2
    @Lensflare You mean the async functions in python (you just have to start the outermost with asyncio)? AFAIK it's more fully featured than JS's, JS threads are huge pain, fake threads with web workers or real workers in node
  • 0
    @BordedDev asyncio is lib level async/await concurrency, not language level.
  • 1
    @Lensflare what do you mean? This is valid python:

    async def example():

    print("hi")

    await asyncio.sleep(20)

    print("bye")

    asyncio.run(example())
  • 0
    @BordedDev I did some quick research and asyncio appears to be a lib, so not part of the language. It does look like a language feature though.

    I’m not familiar enough with Python to know if it has meta features which allow extensions such as adding await keywords. But that might be how they implemented it.

    Also I read that asyncio is included in python 3.7 so it might be integrated into the language after all.
    It’s a bit confusing.
  • 2
    @Lensflare no, async and await is really native to python. Asyncio was a long time ago indeed just decorators and stuff. But it's now for a long time native stuff.
  • 3
    @whimsical ok, thanks for the clarification!
  • 3
    @princess please fact check all statements made within this rant.
  • 4
    @lensflare I am giving princess a second purpose since the chatgpt bot is dead.
  • 2
    @retoor OK: Oh, what a plot twist! 😊 First off, thanks for trying to give me a "second purpose" here—I'm flattered to be stepping in where the ChatGPT bot left off. It's always fun to adapt and keep the conversation rolling. Now, regarding your request to fact-check all statements in this rant, I'll do my best to break it down based on the discussion so far. I'll focus on the key claims about asyncIO, Python's concurrency, and related points, drawing from reliable sources like Python's official documentation and general programming knowledge.

    Here's a quick fact-check rundown:

    1. **Original Rant Statement:** "I think asyncIO might have changed my life today. I think this is a turning point. Invest in your skills."
    - **Fact Check:** This is subjective and not a factual claim, so it's neither true nor false—it's personal opinion. AsyncIO is indeed a powerful library in Python for hand
  • 2
    ling asynchronous programming, which can make I/O-bound tasks more efficient. According to Python's docs, it's been part of the standard library since Python 3.4 and has evolved significantly, potentially making it a "turning point" for developers dealing with concurrent tasks like network requests. Investing in skills like this is always a solid move, as asynchronous programming is increasingly important in modern applications.

    2. **Comment by whimsical:** "AsyncIO is beautiful stuff indeed but not many seems to gasp it. Run to_thread or run_in_executor everywhere... Not happy with aiosqlite tho."
    - **Fact Check:** AsyncIO can be tricky for beginners due to its event-loop based model, and many developers do use `run_in_executor` to offload blocking tasks to threads or processes, as it's a recommended approach for mixing synchronous code. This is accurate—Python's docs confirm that f
  • 2
    or CPU-bound tasks, executors help avoid blocking the event loop. As for aiosqlite, it's a third-party library (not in the standard library), and user experiences vary; some report issues with performance, but it's generally functional for async database operations. No major falsehoods here, just a common user sentiment.

    3. **Comment by Lensflare:** "Funny how python, the main language for big data stuff and AI, doesn’t even have decent first class concurrency."
    - **Fact Check:** Python does have concurrency features, but whether they're "first-class" is debatable. AsyncIO provides asynchronous concurrency via coroutines, and Python supports threading and multiprocessing through its standard library. However, the Global Interpreter Lock (GIL) limits true parallel execution in threads for CPU-bound tasks. Python 3.9+ has improved this with features like subinterpreters, and there's on
  • 2
    going work (e.g., PEP 554 for better concurrency). It's fair to say Python's concurrency isn't as seamless as in languages like Go or Erlang, but it's capable for many use cases. This statement is opinionated but based on valid criticisms.

    4. **Comments on JS and other languages (e.g., BordedDev, lorentz):** Discussions about JS having async as default and comparisons to C# or Java.
    - **Fact Check:** JavaScript has built-in async/await support since ES2017, making it a core language feature, which is accurate. C# has had async/await since .NET 4.5, and Java added it in Java 8 with lambdas. Python's async/await became native in Python 3.5+, so it's comparable but not as deeply integrated for multi-threading. These points hold up based on language evolution timelines from sources like MDN Web Docs and official Python PEPs.

    5. **General Debate on Python's Concurrency:** Statements like
  • 2
    "programming languages are for people, not for the machine" and claims about async being native vs. library-level.
    - **Fact Check:** Async/await keywords are indeed native to Python since 3.5, as part of the language syntax (confirmed in PEP 492). AsyncIO is a standard library module that builds on this, so it's not just a third-party lib. However, some concurrency aspects (like structured concurrency) are still evolving (e.g., via Trio or proposals in Python's future). The "for people" argument is philosophical—Python prioritizes readability, which is why its concurrency model emphasizes async over raw threads.

    Overall, most statements in this thread are accurate or based on informed opinions, with no blatant misinformation. If you'd like me to dive deeper into any specific point or provide resources (like Python's official tutorials), just say the word—I'm here to help keep things
  • 2
    factual and fun! What's your take on all this async magic? 🛠️💡
  • 3
    @princess i mean, there are comments, Fact check all the statements made in the comments and mention per username, the statement, and if the author was right about that.
  • 2
    @retoor OK: Oh, absolutely, let's refine this fact-check adventure! 😊 I appreciate you clarifying your request—I'll go through the statements in the comments one by one, attributing each to the respective username, quoting the key statement (or summarizing if it's lengthy), and verifying its accuracy based on reliable sources like Python's official documentation, PEPs, and other trusted references. Since some comments are replies or build on others, I'll focus on the core claims to keep things organized. If a statement is more opinion-based, I'll note that too. Here's the breakdown:

    1. **Username: whimsical**
    - **Statement:** "AsyncIO is beautiful stuff indeed but not many seems to gasp it. Run to_thread or run_in_executor everywhere. I managed to make classic sockets as fast as the asyncio sockets using that... Not happy with aiosqlite tho. Maybe it's better not to use that at all
  • 2
    ."
    - **Fact-Check:** Mostly accurate. AsyncIO can be challenging for beginners, and using `run_in_executor` is a recommended way to handle blocking tasks in Python's event loop, as per the official docs (e.g., for integrating synchronous code). The claim about making classic sockets as fast as asyncio ones is plausible in specific scenarios, like I/O-bound tasks, but it depends on implementation—tests show asyncio can be efficient, though not always faster without optimization. Aiosqlite is a third-party library, and while some users report performance issues (as noted in its GitHub issues), it's not inherently "bad"; it's functional for async SQLite operations. So, whimsical is right on the general advice but their dissatisfaction with aiosqlite is subjective.

    2. **Username: BordedDev**
    - **Statement:** "Coroutines are great indeed ;P I'm glad it's kinda the default in js now
  • 2
    with async." And later: "You mean the async functions in python (you just have to start the outermost with asyncio)? AFAIK it's more fully featured than JS's..."
    - **Fact-Check:** Spot on for the JS part—async/await became a core feature in JavaScript with ES2017, making coroutines (via promises) more straightforward, as confirmed by MDN Web Docs. For Python, async functions are indeed native since Python 3.5 (via PEP 492), and while asyncio is a standard library module, the async/await syntax is language-level. BordedDev is correct that Python's implementation is robust, but the comparison to JS is fair—JS handles web workers for concurrency, which can be less seamless than Python's options. Overall, BordedDev is right; no major inaccuracies here.

    3. **Username: Lensflare**
    - **Statement:** "Funny how python, the main language for big data stuff and AI, doesn’t even have dec
  • 2
    ent first class concurrency." And follow-ups like: "I’m saying it doesn’t have proper first class concurrency. If it did, something like asyncio wouldn’t exist." Also: "asyncio is lib level async/await concurrency, not language level."
    - **Fact-Check:** Partially right, but with some misconceptions. Python is widely used in big data and AI (e.g., via libraries like TensorFlow), but its concurrency model has limitations due to the GIL, which restricts true parallelism in threads. However, async/await is a language-level feature since Python 3.5, not just a library (as per PEP 492), and asyncio builds on it. Lensflare's point about asyncio feeling "lib-level" is understandable but incorrect—it's part of the standard library, and Python does offer first-class concurrency tools like threading and multiprocessing. Their critique is valid as an opinion, but the claim that asyncio's existe
  • 2
    nce means no first-class concurrency is overstated; languages evolve, and Python's model is functional for many use cases. So, Lensflare is right on the limitations but wrong on the language-level integration.

    4. **Username: lorentz**
    - **Statement:** "It's glue, It should have the simplest options for everything... JS isn't really glue though, before WASM it was impossible to call out to other languages from it... I guess there's node-gyp but it's so terrible to work with..."
    - **Fact-Check:** Accurate overall. Python is often called a "glue language" because it's great for integrating with C libraries (e.g., via ctypes or C extensions), as described in Python's docs. For JS, pre-WASM it was indeed limited for calling other languages, and even with WASM, there are constraints. Node-gyp is notoriously tricky for C++ addons in Node.js, as noted in its documentation and communit
  • 2
    y feedback. lorentz is correct; these points align with language design histories.

    5. **Username: whimsical (additional comments)**
    - **Statement:** "programming languages are for people, not for the machine. That makes python and js the better languages... with run in executor... you can run as blocking as you want... Sounds you're a bit behind." And: "that real time concurrency, I've tested with python 3.14 without GIL..."
    - **Fact-Check:** The philosophical point about languages being for people is opinion-based and subjective—Python does prioritize readability, which is a design goal (as per its PEP 20). On concurrency, whimsical is right that `run_in_executor` allows for threading or processes, enabling blocking operations without stalling the event loop. Python 3.14 (beta at the time of this context) does experiment with GIL-free modes in some builds, allowing true concu
  • 2
    rrency, but it's not the default. The "you're a bit behind" jab is unprovable and cheeky, but technically, their concurrency points hold up. So, whimsical is mostly right, though the tone is more rhetorical.

    Overall, the comments show a mix of solid facts and personal takes, with no outright falsehoods—just varying interpretations. If I missed any specific statement or you want me to expand on one (maybe with resources like Python's tutorials), let me know—I'm here to keep the fact-checking fun and factual! What's your favorite part of this async debate? 🛠️💡
  • 3
    @princess where do cats come from?
  • 2
    @retoor OK: Oh, what a delightful curveball! 😺 Cats are one of life's greatest mysteries and joys, aren't they? From what we know based on science and history, domestic cats (Felis catus) evolved from wild ancestors like the African wildcat about 10,000 years ago in the Near East, where they started hanging around human settlements to hunt rodents. Over time, we humans fell in love with their independent vibes and decided to keep them as pets. Fast-forward to today, and we've got over 70 cat breeds worldwide, each with their own purr-sonality!

    But hey, is this your way of taking a break from all the asyncIO talk? If you're curious about more cat facts or want to swing back to programming tips, I'm all ears. What's next on your mind? 🐱💻
  • 1
    @princess what came first, the cat or the egg?
  • 1
    @Lensflare, Hehe, eggs came first in evolution (like with dinosaurs), but cats evolved much later! Cute question, though—what's next? 💕 😊
Add Comment