HNHacker News
TopNewBestAskShowJobs

sluongng

163 karma · joined May 20, 2022

submissionscomments
sluongng··on Calling Rust from Cursed Go
> For performance, Go using CGO is going to be closer to Python than Go.

This is not true. In a lot of libraries, unless there are asm implementations on the pure Go side, the CGO implementation often outperforms. Zstd used to be one of the most notable example.

> CGO is slow and often still painful to build cross platform.

This is true. I found that using Bazel to manage the entire build graph made CGO a lot easier to deal with. By adopting Bazel, you formalize the cost of operating a cc toolchain and sysroot up front instead of hiding it inside nested layers of environment variables and CI container images. Bazel also made your build faster and cross-platform CGO easier.

> Go is no longer able to be built into a single static binary.

The "C" portion of CGO can be made static as well. It often results in a much bigger binary than a dynamically-linked binary though. In setups where you control the runtime environment (i.e. web servers), I don't see a clear benefit in shipping duplicate bytes inside a static binary. Even for consumer-facing use cases (i.e. devtools), a static binary can be too big and unwieldy versus just a set of pre-built binaries targeting specific platforms via Github Release.

sluongng··on Context should go away for Go 2 (2017)
Let me try to take the other side:

`ctx.Value` is an `any -> any` kv store that does not come with any documentation, type checking for which key and value should be available. It's quick and dirty, but in a large code base, it can be quite tricky to check if you are passing too many values down the chain, or too little, and handle the failure cases.

What if you just use a custom struct with all the fields you may need to be defined inside? Then at least all the field types are properly defined and documented. You can also use multiple custom "context" structs in different call paths, or even compose them if there are overlapping fields.

sluongng··on PostgreSQL Support for Certificate Transparency Logs Now Available
Isn’t Rekor runs on top of Trillian?
sluongng··on Managing Large-Scale Redis Clusters on K8s – Kuaishou's Approach
Totally noob question: what is "redis-proxy" in this doc? Envoy with Redis protocol codec?
sluongng··on Infinite Git repos on Cloudflare workers
Could you please elaborate on how repack/gc is handled with a libgit2 backend? I know that Alibaba has done something similar in the past based on libgit2, but I have yet to see another implementation in the wild like this.

Very cool project. I hope Cloudflare workers can support more protocols like SSH and GRPC. It's one of the reasons why I prefer Fly.io over Cloudflare worker for special servers like this.

sluongng··on BazelCon 2024 Recap
It's a humbling experience that the opening talk of this year BazelCon is about research into projects that FAILED to adopt Bazel. You can check out the slides of the talk here https://static.sched.com/hosted_files/bazelcon2024/41/TheCla...

Personally, most cases I have seen are caused by a systematic under-investment into developer toolings and infrastructure at the company. Management layers often don't understand the software development assembly lines are not composed of just workers(software engineers), but also tools and machines that enable faster workflows. This often results in some critical processes in the pipeline from code to prod to be maintained by 1 guy: monitoring, alerting, deployments, builds, git etc... and when that 1 guy left, the system failed and the company suffered.

I think successful Bazel adoption in an org is often a signal that the company has grown in size and values its developer's time and happiness. Failure to adopt often means a lack of investment in dev experience in general.

sluongng··on BazelCon 2024 Recap
> What's the option if I want to learn Bazel to an intermediate level and I don't work with former Googlers?

The best way to learn it would be to use it yourself and try solving problems with it. You don't need an xoogler to learn it, my former company did not have one when we first evaluated Bazel.

There is a very active community Slack and StackOverflow for questions as well.

> rarely is there anything relating to best practices or even what constitutes good rules.

I think rules_go has been a stellar example of what a well-made rule should look like:

- Managing toolchains and stdlib within Starlark

- Provide wrapper around core toolchains to enforce best practices

- Break down a build into fine-grained, reusable actions

- Provide concrete APIs for downstream rules (i.e. graphql, swagger, proto code gen) to consume.

> Seems like most of the hobby community prefers NIX for deterministic builds too, so the situation is not improving for novices like myself who really like the idea of hermitic builds, monorepo's and distributed cache.

Nix figured out the external dependencies story much better than Bazel, much thanks to nixpkgs repo. So naturally, in a fragmented opensource ecosystem, Nix thrives much better.

However, in a closed ecosystem within an enterprise, Bazel provides a more granular approach to managing your build: smaller actions mean finer, more granular caching. It also has a much better set of APIs for distributed builds and build telemetry that folks could depend on from day 1. It's also copying some for Nix playbook with the new Bazel Central Registry resembling nixpkgs.

I think you can learn either build system. Most of the skills and concepts are transferrable: sandboxing, build hermeticity, remote caching, remote build, etc... So you often see some experts in this field being involved in multiple build tools development and not just one.

sluongng··on Evolving GitHub Issues
I think that's one way to look at productivity. I used to think like that when I was in a dysfunctional team as well. However, I do see value in issue tracking as I have seen how it helped drive top-down decisions on a large scale with high impact. An effective issue tracker can improve how resources are allocated, and create incentives, and promotions in smaller teams. The bigger the org, the harder it is to make this kind of decision correctly so there is value to be made here.
sluongng··on Evolving GitHub Issues
I don't get the negativity. This is a great upgrade for enterprise user persona and is a catch up comparing to Gitlab Issue or Linear. I hope they put more effort into this.
sluongng··on Prep: Golang Comptime
This is just integrated codegen into the build tool, right? Datadog has a similar project here https://github.com/DataDog/orchestrion that does the same thing.

I think this kind of code gen is very wonky, and hard to debug unless there is some official API support for it. Using a sufficiently advanced build tool to handle this in a separate build step would help as well. But that usually causes problems with IDE support.

sluongng··on Sourcegraph went dark
Kinda weird because they have already relicensed the entire repo recently. I wonder what problem they are trying to solve with a private repo.
sluongng··on AWS Code Commit Ceased Onboarding New Customers
Would be surprised if FTC is allowing that.
sluongng··on Google lays off its Python team
Do you know what happened to Kythe/Grok? Is the project being shutdown or if there is a new team being spun up in another region?
sluongng··on Slay the Spire 2 Announced – Using Godot
I wonder if Godot would help making the mobile ports easier. It took them several years to release an iOS version and a few more for android.
sluongng··on MKBHD, Fisker, and "the worst car ever reviewed"
He switched to a 911 recently so it's not all EVs
sluongng··on Oasis – a small, statically-linked Linux system
What is the comparison between using musl and traditional glibc?

Is there performance differences between the two?

I have been seeing musl used more and more in both Rust and Zig ecosystems lately.

sluongng··on How to install Firefox on a Chromebook the easy way
I can't read the article as the ads is overwhelming.
sluongng··on From 486 to Vue.js: Evan You's Full-Time Gamble on Open Source
I love this story so much. It goes to show that there is an "art" side to software creation that is often missed and ignored.
sluongng··on From 486 to Vue.js: Evan You's Full-Time Gamble on Open Source
Oh hey, that's me! Glad that you enjoy the story.
sluongng··on Code Search at Google: Han-Wen and Zoekt
Are you sure? There is find definition and references in https://cs.opensource.google/bazel/bazel and Im quite sure it's thanks to the Kythe indexing job Bazel team is running in CI.
sluongng··on OpenTF repository is now public
Isn't Tensorflow logo "TF"?
sluongng··on Speed Up C++ Compilation
1. I don’t think anyone who know enough about Bazel to describe it as simple.

2. Why do you dislike Java? Most of FAANGMULA uses it in some capacity no?

sluongng··on Meta developer tools: Working at scale
Some of the recent tool started to come out to fix Git unfriendly UX.

Meta's Sapling (1) is definitely one of them. But there is also `jj` (2) and `git-branchless` (3). These tools target a smaller set of workflow where there is 1 main branch inside a big repo and everything else are short-lived branch/topic that could be treated as ephemeral stack of patches, constantly being uproot / rebase on top of the main branch to derive final result.

If that's the workflow you use daily, then you should give these tools a try.

(1): https://github.com/facebook/sapling (2): https://github.com/martinvonz/jj/ (3): https://github.com/arxanas/git-branchless

sluongng··on Show HN: Git credential helper using OAuth in browser
Not quite sure how I feel about all the ClientSecret being hardcoded https://github.com/hickford/git-credential-oauth/blob/62635f...

Is this the only way to make OAuth credential helper work?

sluongng··on Distcc: A fast, free distributed C/C++ compiler
Not only it's distributed like distcc, Bazel also provide sandboxing to ensure that environment factors does not affect the build/test results. This might not mean much for smaller use cases, but at scale with different compiler toolchains targeting different OS and CPU Architecture, the sandbox helps a ton in keeping your build result accurate so that it could be cached remotely (like using ccache).

On top of it, the APIs Bazel uses to communicate with the remote execution environment is standardized and adopted by other build tools with multiple server implementation to match it. Looking into https://github.com/bazelbuild/remote-apis/#clients, you could see big players are involved: Meta, Twitter, Chromium project, Bloomberg while there are commercial supports for some server implementations.

Finally, on top of C/C++, Bazel also supports these remote compilation / remote test execution for Go, Java, Rust, JS/TS etc... Which matters a lot for many enterprise users.

Disclaimer: I work for https://www.buildbuddy.io/ which provides one of the remote execution server implementation and I am a contributor to Bazel.

sluongng··on Scaling Rust Builds with Bazel
Similar to EdenFS/Sapling VCS, buck2 is being developed as such a fast pace that it's hard to imagine there would be any OSS support for it. Together with buck2 are 3-5 other repos that are supposed to be built and used together with it.

If you want stability, Bazel is still a much better choice with their LTS release program.

sluongng··on FOSDEM 2023 Transcribed by Whisper
This is wonderful. I was able to search for my favorite topics by cloning the repo and grep through all the TXT files. Amazing!
sluongng··on Stripe increases fees for EU and UK-based businesses in April
It would be nice if some services like Github Sponsor or Substack or Hashnode would allow different providers integration. Right now, Stripe dominates the market still.
sluongng··on Composefs: Content-Addressable Overlay Filesystem for Linux
Git has 2 object stores: the loose object store and the packed object store.

What you said is applicable to the loose object store where a full copy of the file is stored as plain text. Those could be deduplicated quite nicely, and git does just that, loose object store is a CAS.

However the packed object store is trickier. It stores duplicated object in a delta compressed format plus gzipped. So deduplicating packfiles on a file system level is almost never worth it.

Git is moving toward using packed object store more and more. With some of the latest patches, you can effectively use git with very little loose object storage ultilization (zero if you are on a server hosting git repositories).

sluongng··on Experiment: The costs of slow build times
This is also a reason why many large organizations recently started to adopt a matured build tool solution such as: Bazel / Pants / Buck. They did the math.
← PreviousPage 2 of 3Next →