Better HN
topnewbestaskshowjobs
Log inSign up

bgwhn

263 karma · joined Nov 23, 2013 (13y ago) · 98 submissions

Website: https://benjam.info/ Email: hackernews@(website domain)
Submissions

comment 7mo ago · link · parent

> skip some build steps

There was a change in Next 16, not Turbopack, that removed `ESLint` during `next build`: https://nextjs.org/blog/next-16#breaking-changes-and-other-u...

This behavior is the same whether you use Turbopack or webpack. It doesn't make sense for us to couple ourselves with ESLint when there are many viable alternatives. No other popular frameworks run ESLint automatically during builds. This change in Next 16 brought up closer to parity with other frameworks and bundlers.

> typescript validation

There's no change here with Turbopack. We do still run `tsc` automatically to check your types. That's part of `next build` and not Turbopack. However, we may remove this in the future for similar reasons.

There's no good reason for the bundler to call the typechecker. Bundlers strip types. Historically this was done with Babel in webpack. Modern versions of Next.js use SWC for type stripping in both webpack and Turbopack.

> aggressively cache node modules

We aggressively cache everything. We don't have special-casing for `node_modules`. See our blog post about our caching system: https://nextjs.org/blog/turbopack-incremental-computation

Interestingly vite does actually special-case and cache `node_modules`: https://vite.dev/guide/dep-pre-bundling

There are tradeoffs to both approaches, and I think Vite's choice makes sense in the context of their broader minimal-bundling-in-dev design, but it makes less sense for Turbopack (as well as webpack and Rspack) where we produce bundles in dev.

comment 8mo ago · link · parent

Thank you for sharing your experience with Next.js, even though you eventually ended up moving off.

> Waiting on Turbopack: Our initial local route loads took 10 to 12 seconds under the full weight of the App Router and RSCs.

Out of curiosity, were you on Next 16.0 or 16.1? We shipped file system caching in 16.1 that greatly improves the initial route loads. https://nextjs.org/blog/next-16-1#turbopack-file-system-cach...

> Production memory leaks

If anyone else runs into this, we've got a guide on how to profile your application: https://nextjs.org/docs/app/guides/memory-usage

> The multi-cloud ceiling

Admittedly hosting Next.js can be a bit harder than a SPA if you're using all the features of the framework, but if you're scaling and you don't want to use Vercel, you've got a lot of other options, including those provided by OpenNext. We've got a nice example repository here: https://github.com/leerob/next-self-host

comment 5y ago · link · parent

What's more concerning IMO is that despite the fact that I can't find a CLA, their pricing page claims that if you buy their support contract that they'll give you the software under a "Commercial" license: https://min.io/pricing

comment 5y ago · link · parent

> Rust could add a `#![forbid(alloc)]` declaration and achieve the same effect.

Isn't that pretty much what `#![no_std]` is for? You can still use an allocator with no_std, but you have to explicitly import it.

https://docs.rust-embedded.org/book/intro/no-std.html

comment 6y ago · link · parent

I worked on this while on the Instagram Server Framework team to leverage LibCST and solve some of Instagram's own problems. We took a lot of inspiration from other lint frameworks (notably, Flake8 and ESLint).

I left the team before most of the work to open source it happened. It looks like a lot of work went into the documentation, command line interface, and configuration system. Congrats to the whole team! I hope this can be useful to other projects outside of Facebook.

comment 6y ago · link · parent

I'm with you, and I prefer "dumb" devices, but you can still buy these blu-ray players and not connect them to the internet.

The internet connectivity is sold as an additional feature so that you can use your blu-ray player to watch Netflix. I agree that I don't want logging on a device like this, but if I was going to connect one of these to the internet, I would at least want regular security updates.

comment 6y ago · link · parent

Sure, there's probably less exposure from nuking the profiles directory, but I don't think you're being fair to containers:

- Containers are a feature built into Firefox, these extensions just expose a UI for it. The Multi-Account Containers plugin [1] is published by Mozilla. You don't need to trust anyone but Mozilla to use that base set of functionality.

- The container functionality in Firefox is the result of some work from the Tor Browser being upstreamed into Firefox [2]. It seems reasonable to assume that it's well-implemented.

- The limitations of the extension that you linked to don't seem any worse than your profile-segmentation approach. It's just saying that it's possible for multiple websites to get opened in the same container, which is similar to how you could end up opening multiple websites in the same profile.

[1]: https://addons.mozilla.org/en-US/firefox/addon/multi-account... [2]: https://blog.torproject.org/tor-heart-firefox

comment 6y ago · link · parent

See if your preferred distribution has a kernel backport available. Most have backports of the kernel because it has relatively few dependencies and is backwards compatible, making it easy to backport.

E.g. Debian currently has a 5.5 kernel in buster-backports[1]. However, Debian's backported kernel doesn't get the same level of attention and isn't subject to the same security policies as stable releases, so may be lacking some security patches that the stable kernel has.

[1]: https://packages.debian.org/buster-backports/linux-image-amd...

comment 6y ago · link · parent

If the data structure has a reference count of one, you can safely mutate the data structure instead. Many persistent immutable data structure libraries use this as an additional optimization.

comment 6y ago · link · parent

> I'm surprised that smaller companies have not moved away from static pricing yet.

The physical server has a fixed set of resources. If you let customers pick what resource they want to buy, you'll run out of one resource before the rest, leaving the server underutilized and increasing your costs. You can't sell KVM instances with no ram, no disk, or no CPU.

If you have enough physical servers and small enough customers, you can mostly solve this by carefully figuring out which customers to put on which machines. However, you've created a complicated jigsaw puzzle. And what happens if you need to shift customers between servers to balance things out?

I think Google is able to offer custom machine types because they're big enough, and because they're able to perform live migrations between physical hosts (most hosting providers can't do this), so the customer likely won't even notice if they need to be migrated.

Instead, most of these providers offer a few different SKUs to satisfy different use-cases, or they just pick one target market (e.g. lots of disk space for backups or lots of CPU resource for compute) and focus on that. A few offer networked block storage, which gives some more flexibility, but at the (potential) cost of reliability and performance.

> None in Asia though? You need it to be in Taiwan to service the region well!

Bandwidth in Asia is significantly more expensive (https://blog.cloudflare.com/bandwidth-costs-around-the-world...), so most budget hosting providers stay away.

11.

A Deep Dive into Python's Tokenizer(benjam.info ↗)

3 points · by bgwhn · 7y ago · discuss

12.

LibCST: A Concrete Syntax Tree Parser and Serializer Library for Python(github.com ↗)

16 points · by bgwhn · 7y ago · discuss

comment 8y ago · link · parent

The flexbox implementation that react native uses for layout.

comment 8y ago · link · parent

> What is the alternative to using Virtualbox

Any other hypervisor. QEMU/KVM, Xen, VMWare, and Parallels all have good track records.

comment 8y ago · link · parent

As others have mentioned, Digital Ocean and Linode would probably be good options here.

If you're looking for something even smaller and cheaper than $5/mo, I've had luck with BuyVM. They've very cheap, have good customer support, a nice panel, and you get an entire /64.

comment 9y ago · link · parent

A large amount of that 1.5 MB of code is to shim around the incompatibilities between different versions of the shared libraries that ship with Android. The root of the problem is that not everyone is on the same version of Android.

comment 9y ago · link · parent

I've got an old 2013 Moto X, and I've recently started using Messenger Lite on it. You'll likely need to manually install the APK, because it's not available in the Play store for the US market, but it's definitely a lot faster.

https://www.theverge.com/2017/5/18/15659414/facebook-messeng... https://play.google.com/store/apps/details?id=com.facebook.m...

comment 9y ago · link · parent

Blockchains likely scale closer to O(n log n): http://spectrum.ieee.org/computing/networks/metcalfes-law-is...

The value of the network does go up the more people use it, and therefore, there are more transactions per user. However, the amount of transactions that each user produces will probably not scale linearly with the network size.

comment 9y ago · link · parent

https://en.wikipedia.org/wiki/List_of_mergers_and_acquisitio...

Web search engines:

- Outride (2001)

- Kaltix (2003)

- Akwan Information Technologies (2005)

- Orion (2006)

- Aardvark (2010)

- PlinkArt (2010)

- Metaweb (2010)

- Like.com (2010)

- Apture (2011)

Granted, none of these were very high-profile, and Google hasn't acquired any other web search engines either, but to say "Google has never had to buy a competitor" is naive.

They've also spent a lot of money acquiring competing companies that aren't related to their core business. YouTube competed with Google Video before they were acquired. DoubleClick competed with AdSense (and arguably, Google stole DoubleClick's model). Waze competed (and still competes) with Google Maps.

Acquisitions aren't a sign of weakness.

comment 9y ago · link · parent

I used to work at Amazon, and I liked their leadership principles.

They're intentionally contradictory, but that's just an acknowledgement that perfection is impossible. When you choose to focus on one aspect of your career, that's often going to be at the detriment of something else. This also means that there's always room for career development and self-improvement.

comment 9y ago · link · parent

You can figure out what add-ons are compatible by cross-referencing http://www.arewee10syet.com/

comment 9y ago · link · parent

Regarding D2: If you're going to go with bcache, make sure you're using a kernel >= 4.5, since that's when a bunch of stability patches landed (https://lkml.org/lkml/2015/12/5/38). Alternatively, if you're building your own kernel, you should be able to apply those patches yourself.

comment 10y ago · link · parent

Engineers are expensive. Google's research blog probably isn't a very high-traffic surface, and most visitors are probably on modern machines and fast networks. It doesn't make sense to spend a bunch of engineering resources on optimizing something like this. So instead, you do whatever is easiest to implement and maintain.

comment 10y ago · link · parent

Babel can parse Flow, which is similar to Typescript. However, Babel doesn't have any built-in support for inferring or analyzing flow types. However, some of this type information might be useful in building a more advanced closure-like minifier.

comment 10y ago · link · parent

> Automatic parallelisation is a bad idea because the overhead caused by synchronisation is bigger than the gain.

A sufficiently intelligent compiler would be able to heuristically determine if the synchronization overhead for a program segment would be greater than the performance gain. Plus, there's lots of little cases where synchronization overhead is trivial, like map().

C isn't the best language for this, but there's plenty of languages (e.g. Haskell) that have data flows that can be thoroughly statically analyzed for dependencies.

> It's also a bad idea to take away control from the programmer.

Ideally you'd have compiler pragma to disable this on a case by case basis, and you'd still have more traditional parallel programming tools available.

> What if every compiler did automatic parallelisation differently? Then you'd have impossible to fix performance problems.

If you had a bad enough performance regression, you'd disable automatic parallelization and file a compiler bug (because it shouldn't regress below single-core performance). You could make this same argument against any optimizing compiler. They all apply different optimizations, and do sometimes lead to "impossible" to fix performance problems or even contradictory execution behaviors between implementations. But I still think `gcc -03` is invaluable.

I don't think automatic parallelization is a cure-all, or even that it should be enabled by default on compilers any time soon, but it's better to have it as an option than not.

comment 10y ago · link · parent

It's much less polished, but instead of using pcap, I just configure dnsmasq on openwrt to call a shell script that uses wget to call an http endpoint on my computer:

https://github.com/bgw/dash-button/blob/master/openwrt.sh

comment 10y ago · link · parent

I think employer provided food isn't currently taxed, which is a huge benefit.

http://www.wsj.com/articles/silicon-valley-cafeterias-whet-a...

comment 10y ago · link · parent

OS X isn't getting Vulkan (as far as I can tell). Apple's pushing Metal instead.

comment 10y ago · link · parent

It's a common scam to sell flash drives with modified firmware that causes it to report a larger size than the underlying flash chips provide. Usually once you write past that point, the writes will loop around or drop the data entirely. It's likely that the $17 flag drive you linked to is a scam.

Beyond that, flash drives tend to have low write durability and horrible performance on large writes (because of poorly implemented garbage collection).

1234