HNHacker News
TopNewBestAskShowJobs

chrisaycock

4,568 karma · joined September 3, 2010

I've worked across various tech companies and quant firms. My specialties are programming languages, high-performance computing, and systematic trading.

https://www.chrisaycock.com

submissionscomments
chrisaycock··on Making your own programming language is easier than you think (but also harder)
Yes, it's true that someone can put together a simple language like in a university course. The difficulties, as mentioned at the bottom of the post, are things like metaprogramming features or optimizing compilers.

The tail ends of a language implementation (parsing and code generation) are a fixed cost; the "middle end" can grow unbounded as more production-quality items are added.

My language: https://www.empirical-soft.com

chrisaycock··on Young People Are Falling Behind, but Not Because of AI
The conclusion from the article is that broader economic uncertainty from tariffs and the Iran war have a bigger effect than just AI.
chrisaycock··on C++26 is done: ISO C++ standards meeting Trip Report
std::execution is very interesting, but will be difficult to get started with, as cautioned by Sutter. This HPC Wire article demonstrates how to use standard C++ to benefit from asynchronously parallel computation on both CUDA and MPI:

https://www.hpcwire.com/2022/12/05/new-c-sender-library-enab...

Overlapping communication and computation has been a common technique for decades in high-performance computing to "hide latency", which leads to better scaling. Now standard C++ can be used to express parallel algorithms without tying to a specific scheduler.

chrisaycock··on U.S. Government's Ban on Anthropic Looks Like Punishment Attempt, Judge Says
The government is free to cancel its own contracts. The judge is saying that the government cannot prohibit other entities (like private contractors) from doing business with Anthropic.
chrisaycock··on Parallel Perl – Autoparallelizing interpreter with JIT
The project relies on Rayon [1] for scheduling parallel tasks and Cranelift [2] to JIT the hot loops.

There are plenty of other interesting features like auto-FFI, bytecode caching (similar to Python's .pyc files), and "daemonize" mode (similar to mod_perl or FastCGI).

[1] https://docs.rs/rayon/latest/rayon/

[2] https://cranelift.dev

chrisaycock··on A Survival Guide to a PhD (2016)
The one piece of advice I give new PhD students is to maintain a list of your references for a bibliography ahead of time. For every paper you read, copy the citation in BibTeX format and write a couple of sentences to remind yourself what the paper was about. Do this for every source, even if it doesn't seem important at the time.
chrisaycock··on Young billionaires are behind the prediction market boom. They hate each other
I hadn't realized that Kalshi is a YC company:

https://news.ycombinator.com/item?id=33696486

chrisaycock··on Better JIT for Postgres
> I think it would be the best to start interpreting the query and start compilation in another thread

This technique is known as a "tiered JIT". It's how production virtual machines operate for high-level languages like JavaScript.

There can be many tiers, like an interpreter, baseline compiler, optimizing compiler, etc. The runtime switches into the faster tier once it becomes ready.

More info for the interested:

https://ieeexplore.ieee.org/document/10444855

chrisaycock··on Programming in K
Indeed, my very first attempt used numpy.searchsorted:

https://numpy.org/doc/2.2/reference/generated/numpy.searchso...

I couldn't figure-out how Arthur's bin matched on symbol though, so I switched to a linear scan on the right table to record the last-seen index for each "by" element. While it worked, my hash table was messy because I relied on Python to handle a whole tuple as a key, which had some issues during initial testing.

The asof join I wrote for Empirical properly categorizes the keys before they are matched. That approach worked far better.

https://www.empirical-soft.com/tutorial.html#dataframes

chrisaycock··on Programming in K
I first encountered q/kdb+ at a quant job in 2007. I learned so much from the array semantics about how to concisely represent time-series logic that I can't imagine ever using a scalar language for research.

Fun fact: the aj (asof join) function was my inspiration for pandas.merge_asof. I added the extra parameters (direction, tolerance, allow_exact_matches) because of the limitations I kept hitting in kdb.

https://code.kx.com/q/ref/aj/

https://pandas.pydata.org/docs/reference/api/pandas.merge_as...

chrisaycock··on Formal methods only solve half my problems
The article points out that tools like TLA+ can prove that a system is correct, but can't demonstrate that a system is performant. The author asks for ways to assess latency et al., which is currently handled by simulation. While this has worked for one-off cases, OP requests more generalized tooling.

It's like the quote attributed to Don Knuth: "Beware of bugs in the above code; I have only proved it correct, not tried it."

chrisaycock··on Show HN: Proposal: Copy-and-Fuse Compilation
I had been thinking about this idea for a long time, but I doubt I'll be able to get around to it. After speaking with a friend this evening, I decided to just jot it down for anyone interested.

Basically, use copy-and-patch compilation in a vector language to fuse loops and avoid temporaries. It can be employed for a baseline compiler that will use less memory than an interpreter and will have a much lower startup cost than an optimizing compiler.

chrisaycock··on Polars Cloud: The Distributed Cloud Architecture to Run Polars Anywhere
The inferencing logic needs to sample the file, so (1) the file path must be determined at compile time and (2) the file must be available to be read at compile time. If neither condition is true---like the filename is a runtime parameter, for example---then the user must supply the type in advance.

There is no magic here. No language can guess the type of anything without seeing what the thing is.

chrisaycock··on Polars Cloud: The Distributed Cloud Architecture to Run Polars Anywhere
Statically typed dataframes are exactly why I created the Empirical programming language:

https://www.empirical-soft.com

It can infer the column names and types from a CSV file at compile time.

Here's an example that misspells the "ask" column as if it were plural:

  let quotes = load("quotes.csv")
  sort quotes by (asks - bid) / bid
The error is caught before the script is run:

  Error: symbol asks was not found
I had to use a lot of computer-science techniques to get this working, like type providers and compile-time function evaluation. I'm really proud of the novelty of it and even won Y Combinator's Startup School grant for it.

Unfortunately, it didn't go anywhere as a project. Turns out that static typing isn't enough of a selling point for people to drop Python. I haven't touched Empirical in four years, but my code and my notes are still publicly available on the website.

chrisaycock··on IT Unemployment Rises to 5.7% as AI Hits Tech Jobs
> Jobs are being eliminated within the IT function which are routine and mundane, such as reporting, clerical administration.

I've had a similar thought recently, that there is no demand for rote programmers. No employer is going to hand you a completed spec and tell you to code it up.

Software engineers and data scientists today must be innovative, understand the business they operate in, communicate with users, and work cross functionally. You’ve got to create something original and see it through without having to be told what to do at every step.

chrisaycock··on Northeastern's redesign of the CS curriculum
This op-ed was written by an undergrad and complains that Northeastern's switch to Python (from Racket) for its introductory classes will prevent students from learning fundamentals of computer science.

But that complaint can be made about any language! "This dynamically typed language won't allow students to understand type safety." "This high-level language won't allow students to learn pointers and systems programming." Etc.

I believe that an intro course should get students coding since the first major hurdle is learning how to construct any kind of program at all. The switch to a more "employable" language isn't going to make education worse.

chrisaycock··on How the Ivy League Broke America
I have found that grit, curiosity, and relationship building are far more important than memorizing facts and applying formulae.

Society needs to value those attributes if we're going to solve the really hard problems.

chrisaycock··on Scheduling Model in LLVM – Part I
This was posted a couple days ago:

https://news.ycombinator.com/item?id=41161831

chrisaycock··on The future of kdb+?
I agree with everything in this article. If you're building from scratch, just store your data in Parquet and access it via Polars or DuckDB.

I built my own language for time-series analysis because of how much I hated q/kdb+, but Python has been the winner for a bunch of years now.

chrisaycock··on Outdoor time is good for kids' eyesight
> To get that eyesight protection, research suggests kids should be spending at least two hours a day outdoors – every single day.
chrisaycock··on Making Sense of Acquire-Release Semantics
The first explanation that really clarified memory barriers for me was from Paul E. McKenney:

http://www.rdrop.com/users/paulmck/scalability/paper/whymb.2...

chrisaycock··on Why SQLite Uses Bytecode
SQLite's design docs were the first time I had seen a database use a virtual machine instead of walking a tree. I later noticed VMs in libraries, embedded DSLs, and other applications outside of large general-purpose programming languages. That really drove home for me that VMs could be anywhere and were often a useful step in handling a user's expressions.
chrisaycock··on Replacing Complicated Hashmaps with SQLite
The post isn't specific to needing SQLite. Rather it's about the convenience of expressing an algorithm as a query and then using SQLite to execute the query.

I agree; queries are why table semantics are so useful. Whether you choose an SQL implementation (e.g., DuckDB and SQLite) or a dataframe library (e.g., pandas and polars), expressing searches, joins, and aggregations becomes trivial for tabular data.

chrisaycock··on NYC just had an earthquake
I felt it as well. It's all over social media now.

https://www.threads.net/search/?q=nyc%20earthquake

chrisaycock··on Cranelift code generation comes to Rust
This article provides an excellent overview of the latest in speed of optimizer vs quality of optimization.

In particular, copy-and-patch compilation is still the fastest approach because it uses pre-compiled code, though leaves little room for optimization.

Cranelift uses e-graphs to represent equivalence on the IR. This allows for more optimizations than the copy-and-patch approach.

Of course, the most optimized output is going to come from a more traditional compiler toolchain like LLVM or GCC. But for users who want to get "fast enough" output as quickly as possible, newer compiler techniques provide a promising alternative.

chrisaycock··on Most HR data is bad data (2015)
> when I rate you, on anything, my rating reveals to the world far more about me than it does about you.

Perhaps there's an approach where we tell an employee to rate everyone, and then use those values only as a self-assessment of the employee.

chrisaycock··on Daft: Distributed DataFrame for Python
Here's the comparison chart to other Dataframe libraries:

https://www.getdaft.io/projects/docs/en/latest/faq/dataframe...

Daft is distributed and vectorized with plenty of benefits from lazy evaluation.

chrisaycock··on Ask HN: How to Overcome the Trough of Sorrow?
I spent four years trying to get my startup to revenue. I created something that I thought would be useful for its niche audience, but nobody wanted it in the end.

I was so burned-out from the experience that I had to stop for my own mental health. I got a normal job three years ago.

Since putting the startup on indefinite hold, I've been able to learn new sports, buy a home, and generally enjoy my life without the constant feeling that I had to be working more and spending less. My life got dramatically better.

So while I would have preferred that the startup succeeded, walking away after four years was far better than continuing down that path. And because the technology I had built was really impressive, it only took a couple months for me to get a job paying more than I ever had before.

chrisaycock··on V Language Review (2023)
Some highlights:

  - autofree doesn't work
  - memory arenas (prealloc) isn't thread safe
  - compiler produces large binaries
  - coroutines invoke blocking calls
  - community behavior is, uh, "unwelcoming"
chrisaycock··on How a script doctor found his own voice
Then you might enjoy Scriptnotes, a podcast about screenwriting:

https://johnaugust.com/scriptnotes

It's hosted by John August (Big Fish, Corpse Bride) and Craig Mazin (Chernobyl, The Last of Us).

Page 1 of 18Next →