HNHacker News
TopNewBestAskShowJobs

alexhutcheson

3,780 karma · joined February 17, 2013

Nothing I post reflects the views or policies of my employers, past or present.
submissionscomments
alexhutcheson··on Cuckoo++ – High-Performance Hash Tables for Networking Applications (2017)
Interesting, thanks for pointing that out - it wasn't obvious to me from skimming the paper.

In their "Conclusion" section, they write:

"We thus propose Cuckoo++ which adds a bloom filter in the primary bucket, allowing to prune unnecessary accesses to the secondary bucket without requiring expensive computation. Cuckoo++ hash tables have a uniformly good performance when compared to both pessimistic and optimistic implementation, and an improved performance over DPDK and Horton tables for all cases.

We also describe a variant of Cuckoo++ that integrate support for entry expiration directly in the hash table, avoiding the need for external management of timers and the associated overheads. This relies on a new memory layout more compact than DPDK’s original one, and on the use of 16-bit timestamp."

That seems to imply that the timer/expiration feature is an optional added bonus, rather than a core feature of Cuckoo++.

alexhutcheson··on Cuckoo++ – High-Performance Hash Tables for Networking Applications (2017)
It would be interesting to see this benchmarked against absl::flat_hash_map[1] and folly::f14:F14FastMap[2].

[1] https://abseil.io/about/design/swisstables

[2] https://github.com/facebook/folly/blob/master/folly/containe...

alexhutcheson··on MetricsDB: TimeSeries Database for storing metrics at Twitter
Veneur[1] can compute approximate global percentiles (among other things) during metric collection, and the percentiles can be stored and queried in even in a datastore that doesn't know anything about distributions.

[1] https://github.com/stripe/veneur

alexhutcheson··on SQLite as an Application File Format (2014)
https://en.wikipedia.org/wiki/Web_SQL_Database
alexhutcheson··on Async Python is not faster
A lot of the debate and discussion here seems to come from the fact that the example program demonstrates concurrency across requests (each concurrent request is being handled by a different worker), but no concurrency within each request: The code to serve each request is essentially one straight line of execution, which pauses while it waits for a DB query to return.

A more interesting example would be a request that requires multiple blocking operations (database queries, syscalls, etc.). You could do something like:

    # Non-concurrent approach
    def handle_request(request):
      a = get_row_1()
      b = get_row_2()
      c = get_row_3()
      return render_json(a, b, c)
   

    # asyncio approach
    async def handle_request(request):
      a, b, c = await asyncio.gather(
        get_row_1(),
        get_row_2(),
        get_row_3())
      return render_json(a, b, c)

    # Naive threading approach
    def handle_request(request):
       a_q = queue.SimpleQueue()
       t1 = threading.Thread(target=get_row_1(a_q))
       t1.start()
       b_q = queue.SimpleQueue()
       t2 = threading.Thread(target=get_row_2(b_q))
       t2.start()
       c_q = queue.SimpleQueue()
       t3 = threading.Thread(target=get_row_3(c_q))
       t3.start()

       t1.join()
       t2.join()
       t3.join()

       return render_json(a_q.get(), b_q.get(), c_q.get())


    # concurrent.futures with a ThreadPoolExecutor 
    def handle_request(request, thread_pool):
      a = thread_pool.submit(get_row_1())
      b = thread_pool.submit(get_row_2())
      c = thread_pool.submit(get_row_3())
      return render_json(a.result(), b.result(), c.result())
These examples demonstrate what people find appealing about asyncio, and would also tell you more about how choice of concurrency strategy affects response time for each request.
alexhutcheson··on Jim Keller Resigns from Intel, Effective Immediately
https://www.elsevier.com/books/computer-architecture/henness...
alexhutcheson··on Speeding up a Git monorepo
Facebook has a Mercurial clone named EdenSCM[1], which includes a scalable backend named Mononoke[2].

[1] https://github.com/facebookexperimental/eden

[2] https://github.com/facebookexperimental/eden#mononoke

alexhutcheson··on Performance of modern Java on data-heavy workloads
> Getting the JVM on a machine may or may not be a hurdle.

jlink[1] makes it pretty easy if you're using a recent JDK.

[1] https://docs.oracle.com/javase/9/tools/jlink.htm

alexhutcheson··on Guide to Python Debugging
Andreas Zeller’s Software Debugging course on Udacity is excellent and also free: https://www.udacity.com/course/software-debugging--cs259
alexhutcheson··on Guide to Python Debugging
If you’re not using an IDE, then I’d highly recommend trying PuDB: https://github.com/inducer/pudb/blob/master/README.rst
alexhutcheson··on Hypermodern Python
Bazel bundles a private Java runtime, so you don’t need to install the JDK unless you plan to compile Java code: https://docs.bazel.build/versions/master/install.html
alexhutcheson··on Hypermodern Python
Agreed that Bash is (relatively) fine, although error prone. My comment was about POSIX shell, which has none of the features (arrays, [[ instead of [, etc.) that make programming tolerable in Bash.

One drawback is that if you want your Bash script to work on macOS, you need to restrict yourself to features that exist on version 3.2 (from 2006) because that's the latest version that will ever be included on macOS by default.

> If I could take my currently running Python code and produce some artifact that would run with nothing other than the python binary I think we'd be in a much better place.

See my other comment: https://news.ycombinator.com/item?id=23338316

alexhutcheson··on Hypermodern Python
absl.flags[1] is another pretty good option.

[1] https://abseil.io/docs/python/guides/flags

alexhutcheson··on Hypermodern Python
jlink[1] solves this for JDK 9 and later.

[1] https://docs.oracle.com/javase/9/tools/jlink.htm

alexhutcheson··on Hypermodern Python
You can use Bazel to build a self-contained Python binary that bundles the interpreter and all its dependencies by using a py_runtime rule[1]. It's fairly straightforward and doesn't require much Bazel knowledge - there are simple examples on GitHub[2].

There are a couple other tools that take the same approach, including PyOxidizer[3], which was written by a Mercurial maintainer.

[1] https://docs.bazel.build/versions/master/be/python.html#py_r...

[2] https://github.com/erain/bazel-python-example

[3] https://pyoxidizer.readthedocs.io/en/stable/overview.html

alexhutcheson··on Hypermodern Python
POSIX shell is miserable for programming anything beyond a couple lines. It doesn't even have arrays[1], so you have no available container types within the interpreter itself.

[1] Well, it has $@, which you can use as a general-purpose array with some hacks[2], but that's no way to live.

[2] http://www.etalabs.net/sh_tricks.html

alexhutcheson··on EA will be releasing the C&C Tiberian Dawn and Red Alert source code under GPL3
https://opensource.org/licenses/0BSD
alexhutcheson··on The State of the AWK
As far as I know, it supports all the awk features specified in POSIX, but doesn’t include the extensions added in gawk or mawk.
alexhutcheson··on The State of the AWK
There are two use-cases I’ve run into where awk really shines, and is hard to replace:

1. Writing scripts for environments that only have Busybox. Technically you can write scripts in ash, but I don’t recommend it for anything beyond a couple lines. It’s missing a lot of the features from Bash that make scripting easier, and it’s easy to get mixed up if you’re used to Bash and write things that don’t work. Awk is the best scripting language available, even if you’re doing things that don’t exactly match what it was designed to do.

2. Snippets that are meant to be copy+pasted from documentation or how-to articles. In that case, it’s often not easy to distribute a separate script file, so a CLI “one-liner” is preferred. You also can’t count on Perl, Python, etc. being available on the user’s system, but awk is pretty universal.

For most other cases, I tend to create a new .py file and write a quick Python script. Even if it’s a little more overhead, it helps keep my Python skills sharp, and often it turns out that what I actually want is a little more complicated than my initial idea anyway.

alexhutcheson··on Bosque Programming Language
If the library were written in modern C++, then it also wouldn't be a problem. It would have given you a std::unique_ptr, ownership would have been clear, and deletion would have been handled automatically.
alexhutcheson··on The modern HTTPS world has no place for old web servers
That seems like a case where a reverse proxy like NGINX[1] would be useful. The configuration would basically be:

User->HTTPS over public internet->NGINX->HTTP on your private network->Custom appliances

The most vulnerable link (the public internet part) would still be encrypted, and browsers won't show the scary warnings. The HTTP connection would be confined to your private network, where MITM is less of a concern.

You can use one NGINX instance to reverse proxy multiple different appliances, so the maintenance overhead wouldn't be that high.

[1] https://docs.nginx.com/nginx/admin-guide/web-server/reverse-...

alexhutcheson··on Sciter – Multiplatform HTML/CSS UI Engine for Desktop and Mobile Applications
GWT hasn't had a new release since 2017: http://www.gwtproject.org/release-notes.html
alexhutcheson··on First stable release of Ubuntu Unity 20.04
Yeah that's literally the goal of the project.

Also sounded like what the commenter I was replying to would want.

alexhutcheson··on First stable release of Ubuntu Unity 20.04
Have you tried Cinnamon[1]?

[1] https://github.com/linuxmint/Cinnamon

alexhutcheson··on Racket is 25
You could describe PHP as the primary interface to Apache. It would be straining the the metaphor a bit, but I'd say it's still a reasonable way to explain PHP's popularity. mod_php enabled shared hosting with reasonable performance. If mod_perl had been usable in an untrusted shared environment, then PHP might never have taken off the way it did.
alexhutcheson··on Making Emacs Popular Again
> In emacs, I have absolutely no idea how to discover features

The built-in "help" functionality[1] is really great. C-h a will find useful documentation for what you need 90% of the time, and the manual is there for most of the rest. It's particularly useful for keybindings - C-h w for "what's the keyboard shortcut for this command" and C-h k for "what command does this keyboard shortcut run.

[1] https://www.gnu.org/software/emacs/manual/html_node/emacs/He...

alexhutcheson··on Making Emacs Popular Again
Unfortunately the rest of the software world settled on keybindings for cut and copy that generate almost the greatest possible pain for Emacs to migrate to them. C-c and C-x are used for dozens of the most important commands. It's technically feasible, but switching would be hard and existing users would be really upset.
alexhutcheson··on Making Emacs Popular Again
You pretty much need an extension that runs in a separate window. You can already use Emacs through the Secure Shell[1] Chrome extension, but if you run it in a tab the browser eats too many key combinations for it to be useful. If you launch it in a separate window, then very few key combinations get intercepted and it works quite well.

[1] https://chrome.google.com/webstore/detail/secure-shell/iodih...

alexhutcheson··on Initial Impressions of WSL 2
The one (big) caveat is that some Emacs commands that start subprocesses will incorrectly try to start the process in your local environment (in this case, on the Windows side), rather than the remote environment (within the WSL VM). This mainly occurs when elisp functions are implemented using call-process or make-process when they should use process-file[1] or start-file-process[2].

This isn't an issue for most code within Emacs itself, but it pops up occasionally when using packages from ELPA or MELPA.

[1] https://www.gnu.org/software/emacs/manual/html_mono/elisp.ht...

[2] https://www.gnu.org/software/emacs/manual/html_mono/elisp.ht...

alexhutcheson··on Bill Joy's greatest gift to man – the vi editor (2003)
Not OP, but that hasn't come up for me very often. If a command output is really long or takes a long time to run I'll normally run it using M-& (async-shell-command) instead of running it in a shell buffer.

Long lines are a more general issue with Emacs, but there's changes in Emacs 27 that should mostly solve it.

← PreviousPage 7 of 29Next →