HNHacker News
TopNewBestAskShowJobs

electrum

1,230 karma · joined September 30, 2007

Software engineer. Co-creator of Trino (formerly Presto SQL).

https://trino.io/

https://www.linkedin.com/in/electrum

submissionscomments
electrum··on A Little Story About the `yes` Unix Command
write(2) is a blocking call (unless O_NONBLOCK is set), so you should never have a partial write while the descriptor is connected to something valid.
electrum··on COST in the land of databases
The term database or RDBMS here seems to be mean runs SQL or processes [something close to] relational algebra. Based on that definition, Athena is definitely a database.

Athena is built on Presto, which has full support for transactions. Each connector provides varying support (isolation level, multi-statement writes, etc.) for transactions, limited by the underlying data source.

electrum··on Chrome to force .dev domains to HTTPS via preloaded HSTS
It's easy to write a simple HTTP client or server that works for the happy path of the exact software you tested it with. Writing one that follows the RFCs and doesn't allow various security holes when the RFCs are violated is much harder. HTTP is not a simple protocol.
electrum··on Introducing Atom-IDE
> JetBrains' tools have to be rented.

That's not correct. JetBrains subscriptions come with a perpetual fallback license for the version available when you purchased the subscription. This is basically the same as the previous model where you would buy a license for a specific version with free upgrades for some period of time afterwards. Most people would continuously buy the upgrade license they wanted to stay on the latest version.

https://sales.jetbrains.com/hc/en-gb/articles/207240845-What...

electrum··on Swift Local Refactoring
How does this compare to the refactoring support available in AppCode?

https://www.jetbrains.com/objc/features/refactorings-and-cod...

electrum··on 832 TB – ZFS on Linux
The next generation Facebook design for storage is Bryce Canyon, available through the Open Compute Project: https://code.facebook.com/posts/1869788206569924/introducing...
electrum··on Life Is About to Get Harder for Websites Without HTTPS
Allowing transparent downgrades of self-signed certificates would be a big security hole. For example, suppose I add the following to my website:

  <script src="https://cdn.example.com/awesome.js">
By doing so, I am requiring the script to be served securely. If we allow self-signed certificates, anyone could generate a self-signed certificate for example.com and serve a malicious script to my users.
electrum··on Doppio: JVM written in JavaScript
The JVM has a full specification: https://docs.oracle.com/javase/specs/jvms/se8/html/

The specification is dense but still readable. I'd start reading in order, up through the third chapter which explains how to compile various Java snippets to bytecode. Perhaps start there and go back to the second chapter when you need more context.

I've also found this old but still relevant book to be a good guide: http://www.artima.com/insidejvm/ed2/

electrum··on The largest Git repo
Facebook cited similar reasons for having a single large repository: https://code.facebook.com/posts/218678814984400/scaling-merc...
electrum··on Don't use Hadoop when your data isn't that big (2013)
Presto works great for ETL. It supports CREATE TABLE, INSERT and DELETE for Hive data. Many companies use it for ETL. See examples here:

https://prestodb.io/docs/current/connector/hive.html#example...

electrum··on String.intern()
Yes, although Hashtable is legacy from JDK 1.0. New code should use HashMap or ConcurrentHashMap.
electrum··on CPU Utilization is Wrong
The Facebook server design is discussed here: https://code.facebook.com/posts/1711485769063510/facebook-s-...
electrum··on SQL is 43 years old – Here’s why we still use it today
That looks very similar to JDBI for Java: http://jdbi.org/
electrum··on A database built like an operating system: the architecture of FaunaDB
Presto does this as well. Execution is done by "drivers" which move data pages between operators. It's a cooperative push model rather than a Volcano (iterator) style pull model. There are typically more drivers than worker threads. Drivers are assigned to threads using multilevel feedback queues (inspired by OS schedulers).
electrum··on A lawsuit over Costco golf balls
Get LASIK. Having perfect eyesight and not having to deal with contacts or glasses is worth every penny.
electrum··on Show HN: How to write a recursive descent parser
ANTLR4 automatically generates a visitor for your grammar that you can use to translate into your own idiomatic objects: http://jakubdziworski.github.io/java/2016/04/01/antlr_visito...

We use this in Presto for parsing SQL and generating an immutable AST:

https://github.com/prestodb/presto/blob/master/presto-parser...

https://github.com/prestodb/presto/blob/master/presto-parser...

electrum··on The Cult of DD
Don't cat a file and pipe it into pv. Use "pv file" as a replacement for "cat file" and it will show you the progress as a percentage. When it's in the middle of a pipeline, it doesn't know the total size (unless you tell it with -s), so it can only show the throughput.
electrum··on PostgreSQL Parallel Query v2
Presto, which is designed for analytics, does JIT to bytecode on every query and still works fine on sub-second queries. One potential difference with LLVM is that the JVM will profile and only generate machine code for hot code, so short queries might use JVM interpreted bytecode.

But you are absolutely correct that for long running analytic queries, the up front cost of generating optimized code pays off.

electrum··on Better Compression with Zstandard
The License FAQ covers question #2: https://code.facebook.com/pages/850928938376556

Does termination of the additional patent grant in the Facebook BSD+Patents license cause the copyright license to also terminate?

No.

electrum··on Zcoin implementation bug enabled attacker to create over 500K Zcoins
The commit that fixes it does not change any tests:

https://github.com/zcoinofficial/zcoin/commit/0359bcb2ead7fe...

This indicates that the code in question is not covered by tests. I work on a database, for which correctness is paramount, so it's unnerving to see any code fixes not associated with test additions or changes. I would have thought that cryptocurrency had similar standards.

electrum··on Cloudflare Reverse Proxies Are Dumping Uninitialized Memory
Instagram has been part of Facebook for over four years, so they are covered by the Facebook Bug Bounty: https://www.facebook.com/whitehat
electrum··on From AST to Lossless Syntax Tree
IDEs like IntelliJ need to do this as they support all sorts of transformations (refactorings) while preserving the original source code as much as possible. Their syntax trees must also handle errors, as they need to work robustly in the editor while the user is typing or otherwise has syntax errors. IntelliJ can even perform refactorings while the code has syntax or semantic errors.

See this for more details: http://www.jetbrains.org/intellij/sdk/docs/basics/architectu...

electrum··on Why Databases Are Not for Docker Containers
Amazon has fully managed database containers: https://aws.amazon.com/rds/
electrum··on What Happens When You Mix Java with a 1960 IBM Mainframe
You can write modern software on Java without using "enterprise" features: https://github.com/prestodb/presto
electrum··on Galileo satellites experiencing multiple clock failures
Very accurate time is important for some applications: https://www.wired.com/2012/09/google-spanner/
electrum··on 15'' MacBook Pro with Kaby Lake and 32GB of Desktop-Class RAM, Later This Year
Bring back the 17" MacBook Pro! Having a retina 17" would be great for those of us that need more screen real estate. For example, when debugging in an IDE.
electrum··on Rust is more than safety
Fortunately, that mistake isn't possible in Java with lambda expressions or anonymous classes. It is a compile error if any captured variables are not "effectively final".

Prior to Java 8, which introduced lambdas, variables used with anonymous classes were required to be final. That restriction is now relaxed as the compiler can infer it.

Interestingly, the for-each loop variable is effectively final, unless you explicitly modify it, so this code is legal (and correct):

  for (String v : values) {
      executor.execute(() -> System.out.println(v));
  }
electrum··on A Little Known SQL Feature: Use Logical Windowing to Aggregate Sliding Ranges
Presto implements the SQL standard, so the syntax is identical: https://prestodb.io/docs/current/functions/window.html
electrum··on SQL Server on Linux public preview
The Microsoft JDBC driver is MIT licensed: https://github.com/Microsoft/mssql-jdbc
electrum··on IPv6 Support for EC2 Instances in Virtual Private Clouds
> Could you explain? How does it help to use IPv6 internally if you're using IPv4 publicly?

See this presentation about IPv6 at Facebook: https://www.facebook.com/groups/2234775539/10152303014725540...

> IPv4 offers more than enough address space within its private ranges for your private network

While theoretically true from a raw numbers standpoint, it breaks down at Facebook's scale when you have many gigantic data centers all over the world and start thinking about how you assign the addresses and manage the network that uses them.

As the presentation says, there was lots of wastage due to racks being /24 and clusters being /n (where n < 24).

← PreviousPage 3 of 9Next →