HNHacker News
TopNewBestAskShowJobs

pdhborges

317 karma · joined November 11, 2010

submissionscomments
pdhborges··on Ruby concurrency is hard: how I became a Ruby on Rails contributor
How does Puma help with the libraries that are not thread safe?
pdhborges··on My Future with Elixir: set-theoretic types
This code example doesn't make much sense. There is already a type to represent a valid email address (EmailAddress), why are we creating a function to make contacts that receives an email as a string. Just change the function to receive EmailAddress in the first place and avoid all the matching mess.
pdhborges··on Jq Internals: Backtracking (2017)
If you can't reach Stephen directly maybe you can try to reach him via Yaron Minsky.
pdhborges··on Introduction to Algorithms (2020)
The problem set covers the material of 6.0001 and 6.042. I guess you can take both in the first semester and do algorithms course in the second semester.
pdhborges··on Metaprogramming in Python
Pydantic uses metaprogramming to generate runtime validations according to the field type annotation.
pdhborges··on 35M Hot Dogs: Benchmarking Caddy vs. Nginx
The author linked to wrk2 but I think he ended up using a k6 executor that exhibits the problem wrk2 was designed to solve.
pdhborges··on A serverless architecture for high performance financial modelling
> While it would certainly have been possible to lift and shift this workload to EC2

Unfortunately I think that the article doesn't make a good case of why this was discarded right off the bat. In particular it is not clear why this wasn't a lift and shift with the NAS storage replaced by S3 and Celery workers placed under an autoscale policy.

Looking at the conclusions the first two are consequences of having on demand compute power while the third one is just surpring (was 70% of the code dedicated to celery infrastructure?).

pdhborges··on Ask HN: Do you use foreign keys in relational databases?
> key upside to complex logic in the application layer vs the database is that the application layer is often much easier to scale out than the db

I think the point of the GP is that all of these application instances are still connected to the DB, doing sub optimal data fetches taxing the database in multiples.

pdhborges··on Can Types Replace Validation?
> Compare it to Haskell, OCaml and Rust and it looks like a toddler tripping all over itself compared to an adult athlete running at a steady 20km/h.

Well that is a pretty tall order. Those languages probably have the most extensive type systems among the languages with significant use. But even so Python's type system has features that some of them don't have: for example Rust doesn't have structural subtyping.

> Also, Python technically has no typing system to speak of so your comment is kind of strange.

Python PEPs define the typing annotations and the typing rules for each annotation. That for me counts as a type system, despite the fact that there is not built in typechecker and you can run programs that you didn't type check.

> Not to mention pattern matching, destructuring and other goodies that improve productivity.

Python has pattern matching now: https://peps.python.org/pep-0636/

pdhborges··on Becoming a Systems Architect
> Any organization where the developers are also the architects are just flying by the seat of their pants and again, aren’t doing anything at scale (yet?).

How did you reach this conclusion? Both Amazon and Google don't structure their software engineering teams around an 'Architect' title.

I also searched the Google Carrera page for Architect positions and the great majority of them are customer facing roles with very few Architect positions assigned to specialized fields.

pdhborges··on Can Types Replace Validation?
The Python typing system is limited compared to what exactly? It already has union types, generics, bounded generics, union types, literal types and structural subtyping.
pdhborges··on Django 4.1
I think you are being down voted because a straight port of this code to async would still run one request after the other.

You would have to queue one task for each request in the event loop and then await for them both to gain some parallelism in the I/O section of the code.

pdhborges··on Oracle is the #1 contributor to the core of Linux in 5.18
To be honest I think the "core" distinction actually makes sense.
pdhborges··on The DynamoDB Paper
People don't need to be scared they just need to do their homework.

In my opinion having more tables and more GSIs available won't help you very much if you started with flawed data model (unless you kept making the same design mistakes 256 times). A team that tries to claw back from a flawed table design by pilling up GSIs is just in for a world of pain.

So if you are planing to go with Dynamo: - Read about the data modeling tecniques - Figure out your access patterns - Check if your application and model can withstand the eventual consistency of GSIs - Have a plan to rework your data model if requirements change: Are you going to incrementally rewrite your table? Are you going to export it and bulk load a fixed data model? How much is that going to cost?

pdhborges··on Implementing Microsoft REST API Filter
My current take on the issue is that REST advantages can only be realized if there a sufficiently smart client (aka human) driving the interaction.
pdhborges··on Python Language Summit: Python Without the GIL
Well for web dev it would be simpler because you can get rid of workers which in turn reduces the overall memory footprint of applications since the code is shared, the local caches are shared and the connections are shared.

Edit: For backend services it would probably put Python around one order of magnitude away from Go in terms of memory usage to serve the same load, enough for teams not to consider switching.

pdhborges··on Modern Python Performance Considerations
We use the ncpu * 2 + 1 formula for the number of workers that serve API requests.

I don't think in 'handling x concurrent requests' terms because I don't even know what that means. Usually I think around thoughout, latency distributions and number of connections that can be kept open (for servers that deal with web sockets).

For example if you have the 4 core computer and you have 4 workers and your requests take around 50ms each you can get to a throughput of 80 requests per second. If the fraction of request time for IO if 50% you can bump your thread count to try to reach 160 request per second. Note that in this case each request consumes 25ms of CPU so you would never be able to get more than 40 requests per second per CPU whether you are using node or python.

pdhborges··on Modern Python Performance Considerations
You can configure gunicorn to use multiple threads to recover quite a bit of concurrency in those scenarios and that is enough for many applications.
pdhborges··on Ask HN: What bits of fundamental knowledge are productivity multipliers?
Maybe because Linear Programming is P-Complete.
pdhborges··on Async I/O for Dummies (2018)
I also have some doubts for some specific scenarios:

- Imagine you have a monolith that mostly talks to the database. You have a primary with multiple read replicas. How are you going to take advantage of millions of async tasks if your IO concurrency ends up being caped at a couple of thousand database connections?

- The second question is: even if you can have a million requests on flight do you really want to have such a large blast radius on a single server?

pdhborges··on Theory of Computation
I think it is cool to contrast Sipser's course with a more "modern" take by Mihai Pătraşcu [1] [2].

[1] https://infoweekly.blogspot.com/2009/02/teaching.html

[2] https://inst.eecs.berkeley.edu/~cs172/sp09/

pdhborges··on What's New in Mercurial 3.0
why not:

[receive] onlyFastForwards = true

pdhborges··on State of Web Inspector
I think it is surprising that the old (Safari 6) inspector UI was not about improving the user experience for web developers but instead it was an effort to align "the design and user experience with Xcode 4."
pdhborges··on A string processing rant
I also corrected my example. Thanks!
pdhborges··on A string processing rant

    std::wstring remove_side_spaces(const std::wstring& str) {
        auto begin = std::find_if_not(str.begin(), str.end(), std::iswspace);
        if (begin == str.end()) {
            return std::wstring();
        } else {
            auto end = std::find_if_not(str.rbegin(), str.rend(), std::iswspace);
            return std::wstring(begin, end.base());
        }
    }
pdhborges··on It is ridiculously easy to refactor Go
And he doesn't even have to define an interface.
pdhborges··on “256 cores by 2013”?
> It is a bit like assembly programming vs compilers. Sure clever programmers can beat most compilers when targeting simple processors, but when you level up with out-of-order executing, multiple instruction pairing, multiple level caches, NUMA, and so on, the compiler optimizer usually wins hands down.

I disagree. Real HP software have their computation kernels hand written (or generated) in assembly. As for relying on the smartness of the compiler to take into account all those factors I invite you to recall or read the story of the itanium architecture.

pdhborges··on How is lazy evaluation in Haskell useful?
Replace the []s by ()s so only generators are returned and the expressions evaluated when consuming the generators.
pdhborges··on Use Probability Models to Predict Pebble Sales (and win a Pebble)
If I make the best guess by just looking at the current chart without using any tool/model do I qualify for the prize?
pdhborges··on What is randomness? Nobody knows..
No. There are plenty of random variables without non-uniform distributions. Plus an event in probability theory is not what you think it is. An event can be any subset of the sample space.
← PreviousPage 5 of 6Next →