Better HN
topnewbestaskshowjobs
Log inSign up

STRML

3,275 karma · joined Sep 2, 2012 (14y ago) · 602 submissions

Hey, I'm Sam. I'm a frequent contributor to open source, including a number of React projects and Babel core.

strml.net github.com/STRML bitmex.com securesha.re

[ my public key: https://keybase.io/strml; my proof: https://keybase.io/strml/sigs/Rr2YKiZGMMOgxiMMcgqAy5aykMgj0OxJamVQAZkQ0iE ]

Submissions

comment 9y ago · link · parent

We do it anyway. It's easy enough to filter those types of emails. I think it's a huge plus for customer service to be able to say "Have a problem or question? Just reply..."

comment 9y ago · link · parent

There was a native NodeJS module called "toobusy" that I rewrote a few years back to remove the native dependencies:

https://www.npmjs.com/package/toobusy-js

It's worth checking out - and helps you achieve this goal without necessarily having to come up with a req/s magicnum; instead you measure actual event loop latency to detect a slowdown.

comment 9y ago · link · parent

> The hacks at Defcon all took a long time to do

90 minutes or less, from unprepared attendees, some of which didn't even know they would be seeing a voting machine that day [1].

> Also voting machines generally have paper copies that print off the back of the machine

This wasn't always the case, and a few bad elections happens from 2004-2006 as a result. There is also not a guarantee the voter has checked/understood the paper receipt. Overall the concept helps quite a bit.

> The only plausible hack would be an inside job

Polling station staffers are volunteers, and there are lots of them. Not particularly difficult.

Voting machines themselves are known to store results in unencrypted, easily editable MS Access databases. This allows editing/suppression of votes en masse with no trail. If said attacker can find a way to also tamper with the paper receipts (print a different result that the voter doesn't notice, or don't print at all, or make the printout unreadable), mass shenanigans could ensue.

All this just to say, "hey, it uses paper for verification on the backend, so it's fine." But we're paying companies to develop insecure machines, training voters to trust them, and bringing the integrity of our democracy into question along the way.

Just fill out a piece of paper. It's not that hard to count the votes.

1. http://fortune.com/2017/07/31/defcon-hackers-us-voting-machi...

comment 9y ago · link · parent

To be clear to those reading, that's 2% to 3%, not two-thirds percent.

comment 9y ago · link · parent

And yet - it can be used as one. "If you actually tried using it" is a wholly inappropriate thing to say to someone you don't know. We used it in a large application indexing & faceting millions of documents, and it works just fine for the practical purpose of querying & retrieving those documents. Of course, we did mate it with Postgres to build the full app. Each tool to its strength.

There's no need for the vitriol.

comment 9y ago · link · parent

That's a matter of opinion and implementation. Not everyone uses JWTs. What if you want to invalidate all logged-in tokens for a user? You either need to store a blacklist (that's a relation) or set extremely short expiry times.

comment 9y ago · link · parent

Yes, this was an incredible development, and lead to hilarious projects like ToroDB (MongoDB API on top of Postgres), which ended up being faster and safer, with relations when you need them.

JSON columns can be incredibly useful and easy to understand for things like user preferences, without the hassle of a metatable.

comment 9y ago · link · parent

> I think document stores are a great thing; the only problem is that MongoDB isn't a good document store.

To add to that - you know when you need one. If you don't know you need a document store, you don't need it.

When you try a good document store, like Solr, you realize how appallingly limited Mongo really is. It's not suited for any practical use outside of demo apps.

comment 9y ago · link · parent

The hype is the real issue. Even today, the CTO appears to claim that 90% of apps aren't relational enough to need Mongo.

I did a startup in 2011/2012 where we bought into the hype and used MongoDB & Node + Mongoose. It was horrific.

Your app is relational, full stop. You would know if it wasn't. Do you have users? Do those users need to log in? Well, you now have access tokens related to users. Do those users need to create anything at all? You've now related those owned objects back to the user. We're talking the very basics of any application, and Mongo's support for it is basically nil.

We went down the road of embedding relations inside the model (e.g. an "user" has multiple "tickets" to "events"), and then we'd just filter through the "events" table to find the related one. But what if the admin running the event wants a list of all the tickets for his event? We're talking webapp 101 stuff, but we had to write some really gnarly application logic and duplicate a bunch of data to make it fast.

It was a complete waste of time.

At the crux of this is a fallacy that easier is always better. It's not. There is a reason SQL databases are a little complicated to use - they have evolved over many decades to fit the needs of real applications. MongoDB is only barely removed from writing raw JSON arrays to disk, which is probably the simplest "database" imaginable.

When you so callously discard the common wisdom on how to store data, you rediscover why it exists, the slow, hard way.

10gen made a business - and a fortune - out of misleading new developers.

comment 9y ago · link · parent

This is hilarious!

We ran across @kornelski yesterday asking about some old babel code (1.) and were wondering what the angle is. Kornel's an accomplished coder: he did pngquant and imageoptim.

The author himself calls it the "stupidest project I've ever done". But it's probably a nice way to get 90% of the way there when converting PHP fns (such as validation et al) into the browser. Also, and perhaps most importantly, it's a great exercise in writing Babel plugins.

I really enjoyed this. Thanks for writing it, @kornelski.

1. https://twitter.com/kornelski/status/884485913627295744

comment 9y ago · link · parent

That does seem like a nice stack. Do you have an idea of the actual pricing past 10 nodes? I can't seem to find it anywhere.

comment 9y ago · link · parent

This is very important, because it removes some of the most prevalent criticisms about Freenet. If you don't agree with some content (re: legality or any reason you wish), don't access it/share it. Freenet doesn't give you that choice, but IPFS does.

comment 9y ago · link · parent

That's a great graphic! I see a few more from around 2003 on http://chip-architect.com/, do you know of anyone who's doing modern chips (x86 or ARM) this way?

comment 9y ago · link · parent

I agree that the IE decision was practically braindead and killed the utility of DNT. Because of it, we have no idea if the user actually specifically wants DNT (and this may degrade the user experience, so it should be opt-in), or their browser vendor simply decided for them.

comment 9y ago · link · parent

Well, the optimizing pipeline has completely changed in V8 5.8 (if you use `--turbo --ignition`) and in 5.9+. It's been simplified and most importantly, does not deoptimize on quite so many common features (such as try/catch). More information at http://benediktmeurer.de/2017/03/01/v8-behind-the-scenes-feb... and some of his other articles.

In my testing it appears that TurboFan cannot optimize certain patterns as well as Crankshaft did, but there's no reason to believe those regressions will remain as TF evolves. Optimizing more code is much more important for real apps.

comment 9y ago · link · parent

This is a big release. Async/await in stable core is something I've been (literally) waiting 6 years for.

Many people have criticized Node's cooperative multithreading model, with both good and uninformed reasons. Yet, it is without dispute that the model is popular.

Async/await is a giant leap forward toward making Node usable for beginner and expert alike. This release is a celebration.

For those of you with existing applications looking to migrate, try `--turbo --ignition` to emulate (most) of the V8 5.9 pipeline. Anecdotally, microbenchmark-style code regresses slightly, real-world code improves by as much as 2x. Exciting times.

comment 9y ago · link · parent

This was tried many years ago. At that time, Promises/A+ was not finalized, and the community could not agree on which Promise specification was best, or even if one was needed at all.

Callbacks are lightest-weight re: CPU & memory overhead, so it was decided that core APIs should implement that, and developers can override using promisify (via e.g. Bluebird or the new `util.promisify()`) as they need. But putting that kind of assumption in core could lead to significant pain.

comment 9y ago · link · parent

It does - and has for a long time:

https://nodejs.org/api/debugger.html

comment 9y ago · link · parent

Shrinkwrap did not use hashes and did not guarantee deterministic installs. Subdependencies could still end up as different versions.

Even the shrinkwrap file itself contained a lot of trash and generated massive diff noise. I had a file full of scripts to make the shrinkwrap file usable and even then we had (production!!!) issues due to changing subdeps. We reworked our build processes to zip & deploy the exact code that passed the tests to work around that, but it was still a massive pain that installs at different points in time would yield different trees.

When yarn came out, I deleted a folder full of hacky scripts, cut my install time by 60% and finally got deterministic installs. Needless to say, I was ecstatic.

comment 9y ago · link · parent

If this test was correct, this smells like a class-action. Enterprise users (and home users, for that matter), have a right to control egress.

comment 9y ago · link · parent

Watching the newly-released HD version helps quite a bit with that perception of age.

comment 9y ago · link · parent

"God forbid, SQLite"? It's honestly a great product and a wonderful stepping-stone. I wish more new projects used it rather than half-measures like Mongo.

comment 9y ago · link · parent

It's large, of course. But you have a full VM and a bunch of unminified javascript dependencies sitting in there. V8 isn't known for being small, either.

Compared to a proper systems language it's always going to look ridiculous. And it appears to be 3-4x larger than, say, py2exe. You can apparently get about a 30% reduction using `strip`, and there's likely other low-hanging fruit.

It's about 12MB compressed. It's not so terrible in today's world, and the simplicity at runtime is worthwhile IMO. I don't worry too much about my tools getting larger, so long as they solve problems and don't cause them.

comment 9y ago · link · parent

Anecdotally, I built a small project (lambda fn) with just a single dependency (`request`) - the mac/alpine node6 build was 37MB.

comment 9y ago · link · parent

It will also allow returning raw strings (TextNodes), which will allow for some very light i18n libraries.

comment 9y ago · link · parent

I like the idea, but this is very confusing to end-consumers:

- Is this just a messaging app? A payments app? A web browser?

- It's all of those things, except not a web browser, it's an "app browser" (why not app store, especially considering the whole point of these is that they are paid?)

- The starting experience is anything but compelling: http://i.imgur.com/U69Gskl.png

- Is this developed by Coinbase? If so, why is there no mention, and the app is developed by "Bluxome Labs"?

147.

Multi-Stage Docker Builds for Lighter Containers(blog.frankgrecojr.com ↗)

2 points · by STRML · 9y ago · discuss

comment 9y ago · link · parent

They're different. Flow is not a "superset" of JS in that it introduces new features, it only introduces new types of annotations. Remove all the annotations (literally delete them), and you have valid ES6.

Typescript has its own class system, public/private/protected, and its own compiler. This was a big negative while ES6 was still brand new and the TS compiler was catching up, but now it's pretty much a wash between the two.

A year ago, I would have said Flow, no question. Today, TS has really caught up and the tooling is better, no doubt. It depends on how complex your types are - Flow can express types TS can't, but TS has an incredible ecosystem and far fewer bugs. In the end, it's all about reducing bugs in your own application, and TS seems to do that better in the end despite its limitations.

1
456
21