173 karma · joined June 14, 2008
Daniel Lemire details how he was able to massively speed up json parsing by thinking from first principles.
TLDL: he removed all abstractions and coded directly for the hardware.
Great interview. Makes me want to learn assembly programming (perhaps ARM64 since that seems to be the latest hotness thanks to the M1).
I also enjoyed this interview on the upcoming JIT/AOT for the BEAM: https://thinkingelixir.com/podcast-episodes/017-jit-compiler...
My main questions after watching: how long do the spike proteins attach to our cell membranes? Do they get cleaned up eventually?
Also, will it lead to damage to the cell in anyway?
Looks like I need to incorporate encoders/decoders into my scheme. I might just steal that code outright.
Thanks for the Zapatos rec, that looks perfect.
fyi, my current generic method sigs looks like:
export const makeRequest = <Name extends keyof Endpoints>(
_name: Name,
method: Endpoints[Name]['method'],
path: Endpoints[Name]['path'],
props: {
data: Endpoints[Name]['clientSends'];
onSuccess: (json: Endpoints[Name]['serverResponds']) => void;
onError: (json: any) => void;
}
) => { // ...
Dropping all of these typing shenanigans and going back to Elixir/Phoenix is always half-tempting, but I will soldier on for now...I have an endpoints.ts file, shared between client/server, which has something like:
export type Endpoints = {
createProduct: {
path: '/api/products.json';
method: 'POST';
clientSends: { name: string };
serverResponds: ProductJSON;
};
}
The client can do `makeRequest('createProduct', ...)` and the Express server can use `registerEndpoint('createProduct', ...)` which must adhere to the schema defined above.TypeScript's structural typing helps a lot here.
Of course, I can "lose" typing through things like raw SQL queries (working on a mini db helper library to help with that), but so I'll have to validate that the endpoints return what they say they do through tests (probs using io-ts).
I'm just getting started (coming from Rails). Not sure what the "correct" way to do this is, but my approach works so far. Would also be nice to have a generic way to create REST endpoints for a given resource, but meh.
[1]: https://www.executeprogram.com/blog/porting-to-typescript-so...
I'm leaning towards a full TypeScript stack for my next project. The idea of sharing types & code between client & server is incredibly seductive. But there's no Rails for TS/Node, so I know it's going to be a shit show assembling all of my chosen libraries into a cohesive whole.
Although looking at your previous comment, perhaps I should give Kotlin / Ktor a try?
Incidentally a previous podcast covered a lot of the same ground, plus much more: https://www.kevinrose.com/single-post/Serge-Faguet
The Bike Shed
Developer on Fire
Travel Like a Boss
Invest Like a Boss
Tangentially Speaking
The James Altucher Show
Digital Communion
I know this is satire, but out of curiosity is it really possible to be paid 100% in stock (and then just sell however much you need to live immediately)?
I would love to have an HSR along the coast however. When I was in Taiwan it was amazing being able to get to the bottom of the island in a couple hours.
And pay them quarterly, which can be done online via https://www.eftps.gov/eftps/
Oh and I had an idea for practicing deletions/insertions/updates & other behavior that you couldn't do on web: create an Electron app that uses a local db. I'd buy that in a heartbeat.
Or look on remote job boards and email those companies directly. If you're just beginning, be willing to work for a bit less to get your foot in the door.
[1]: https://en.wikipedia.org/wiki/Liquid_fluoride_thorium_reacto...
Finally, I already have a couple apps in the App Store that I'd have to abandon if I switched to something else. So I'm kinda stuck.
http://www.humanscale.com/products/product.cfm?group=Freedom...
That's why I brought up the accelerating rate of expansion of space ... everything will be moving away from us so quickly that eventually we'll run out of places to migrate to.