unasync VS Amp

Compare unasync vs Amp and see what are their differences.

unasync

The async transformation code. (by python-trio)

Amp

A non-blocking concurrency framework for PHP applications. 🐘 (by amphp)
Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • SaaSHub - Software Alternatives and Reviews
unasync Amp
5 4
82 4,131
- 0.6%
0.0 5.1
12 months ago 11 days ago
Python PHP
GNU General Public License v3.0 or later MIT License
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.

unasync

Posts with mentions or reviews of unasync. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2024-01-19.
  • The bane of my existence: Supporting both async and sync code in Rust
    4 projects | news.ycombinator.com | 19 Jan 2024
    Nice! This is similar to the solution here: https://github.com/python-trio/unasync
  • Need advice to design sync version of an async library
    2 projects | /r/learnpython | 3 Jan 2022
    Lastly, I found another project name unasync that is pretty interesting and might works for me. Basically, you write the async version, you run unasync, it generate the sync version from the AST. This project is used by the official elastic search python client.
  • PHP 8.1.0 Release Announcement
    9 projects | news.ycombinator.com | 25 Nov 2021
    Fibers "allow blocking and non-blocking implementations to share the same API"

    That's an interesting contrast to Python where the need to use "value = await fn()" v.s. "value = fn()" depending on whether or not that function is awaitable causes all kinds of API design complexity, all the way up to the existence of tools like https://github.com/python-trio/unasync which can code-generate the non-async version of a library from the async version.

  • Async Python is not faster
    2 projects | news.ycombinator.com | 5 Nov 2021
    Async Python has proven faster in my uses for IO and non-CPU-related stuff. But I think Python, either as a community or within the language, needs to solve the anti-pattern of maintaining separate sync and async versions of a library. I'm thinking specifically of aioredis and redis-py, both of which I've worked on.

    Some people are looking at ways to solve this. I know urllib3, elasticsearch-py, and a few others use unasync (https://github.com/python-trio/unasync) to transform async code into sync code, leaving one codebase supporting both uses in different namespaces. This leaves you with some conditional logic (is_async_mode() -- https://github.com/python-trio/hip/blob/master/src/ahip/util...). I'm seriously considering this approach.

  • unasync – transform your asynchronous code into synchronous code
    1 project | /r/Python | 1 Mar 2021

Amp

Posts with mentions or reviews of Amp. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2022-10-27.
  • Amphp 3.0.0
    1 project | news.ycombinator.com | 3 Jan 2023
  • Is it possible that PHP will ever get async/await functions?
    9 projects | /r/PHP | 27 Oct 2022
    If you want async/await behavior in PHP, you have https://amphp.org/amp/.
  • Monthly "Post your Project" thread
    9 projects | /r/PHP | 6 Dec 2021
    We're working on Amp v3 making heavy use of fibers as shipped in PHP 8.1. We're releasing beta versions for each library currently, and we'd like to share our new amphp/pipeline library. If you're waiting for concurrent I/O without boilerplate, you can start testing now. We're happy about feedback on the new major releases!
  • PHP 8.1.0 Release Announcement
    9 projects | news.ycombinator.com | 25 Nov 2021
    like the sibling comment said, web apps are written in Symfony/Laravel, but the framework abstractions with web apps might not paint you a clear picture of how the core language has improved. it will give you a good idea what it's like to build applications.

    my favorite part of modern PHP is how nice writing libraries is. so it might not be what you're looking for, but I remember being pretty impressed with the code quality of the Amp PHP library recently. the v3 branch is 8.x only and (I believe) is targeting the Fibers feature just introduced in 8.1

    https://github.com/amphp/amp/tree/v3

What are some alternatives?

When comparing unasync and Amp you can also consider the following projects:

jigsaw - Simple static sites with Laravel’s Blade.

React - Event-driven, non-blocking I/O with PHP.

phpmiko - A netmiko implementation in php

Swoole - 🚀 Coroutine-based concurrency library for PHP

blacksmith - REST API Client

Workerman - An asynchronous event driven PHP socket framework. Supports HTTP, Websocket, SSL and other custom protocols.

Ratchet - Asynchronous WebSocket server

Elephant.io - Ça trompe énormément

Icicle - Icicle is a PHP library for writing asynchronous code using synchronous coding techniques

Hoa WebSocket - The Hoa\Websocket library.

http-client - An advanced async HTTP client library for PHP, enabling efficient, non-blocking, and concurrent requests and responses.

Recoil - Asynchronous coroutines for PHP 7.