Koromix
Joined 11 years ago
Joined 11 years ago
I'm making my own FFI module for Node.js, Koffi, as a much faster alternative. You can see some benchmark here, to compare with node-ffi-napi: https://www.npmjs.com/package/koffi#benchmarks
int process_handle = spawn("/bin/true", SP_PAUSED); // create process but don't execute, and return a handle
// most API would take a process handle, thus you could do stuff (such as prctl) on the new process
unpause(process_handle);
There's a bit of a move in this direction in the Linux API with the PIDFD stuff.- It is hard to use. There's a reason most teams have a single or two Git "experts" to help everyone else resolve repository / merge / pull / whatever problems that happen regularly. The onboarding experience for developers unfamilir with Git is very bad, and many of them end up never able to use it. If you have non-developers (e.g. artists), it is even worse.
- Binary files. Yes, there is Git LFS, but there are many small integration problems when you try to use it, and the simple fact that Git needs something special to manage binary files is a problem. And no, storing binary files outside the repository is NOT a good solution. In games for example, the binary files and the engine usually evole together and if you want to checkout an old version, the code and the assets need to stay in sync. You want to version the game, not just the engine.
- Partial (subtree) clones and permissions. There's a reason monorepos are popular: they're much simpler to manage. Unfortunaly, because Git barely does partial clones and cannot manage permissions (inside a repository) at all, monorepos are much more limited than in SVN or P4. That's why many projects end up divided in multiple repos, but this brings all sorts of problems and a large administrative overhead for all developers.
Also, whale oil was not really used as an energy source anyway, except in lamps.
So it's completely irrelevant to my original point, which is that by and large, until now, in the thermo-industrial civilization, new energy sources have not been used to replace exisiting ones. They have been used to 'grow' the economy (more machines, more people, more production).
Maybe this graph can convince you: https://ourworldindata.org/wp-content/uploads/2014/03/global...
When we talk about our energy needs, scale matters a lot. So yes, when it comes to climate change and energy use, you can ignore the rest of human history completely.
https://en.m.wikipedia.org/wiki/fossil_fuel?wasredirected=tr...
First graph at the top left (which is actually energy consumption, close enough): https://www.bp.com/en/global/corporate/energy-economics/stat...
The important thing in this grap is the absolute values of each source, not their relative importance. You'll note that despite renewable growth (of which solar and wind is only a fraction, there's also biomass and various other stuff), fossil-fuel consumption is still growing faster. Indeed, historically, new energy sources have never really replaced 'older' ones. Each time, the new sources just provide additional power on top of the old ones.
So much for 'decoupling'.
Edit : the US energy article on Wikipedia has an interesting graph that shows something similar (except for a partial switch from coal to NG): https://en.wikipedia.org/wiki/Energy_in_the_United_States#/m...
Geothermal, wind, solar, heat, tide, etc. currently amount to a staggering 1.5% of the total primary energy supply of the world. Coil is at 28%, oil is at 31%, natural gas at 22% (and climbing), nuclear at 5%, etc. CO2 emissions continue climbing year after year, and we should have started going down more than twenty years ago.
Our agricultural system is completely dependent on fossil fuels (oil). Because of that it is mostly unsustainable, and also because it tends to destroy fertile lands (topsoil loss is kind of a big issue).
You are kind of right that the current system can support a lot of people. Unfortunately, almost none of it is sustainable. So making more people is really not a good idea at the moment, because the situation will change drastically over the next 80 years.
Fossil fuel powered technology has changed that, but we are psychologically and socially ill-equipped to deal with its transformative power.
I could not agree more, but unfortunately global warming suffers from the exact opposite effect. The perceived risk appears very low to most people, because it is not very spectacular on human time scales. Even though it is by far the greatest existential risk we face.
The decision to put more weight on the present is mostly made in ignorance and wishful techno-optimism. Many people still think that we're somehow building a cheap-energy no-death space-faring future, or they're not thinking about it at all (though that does not stop them from making children). Going to space to escape the hard reality of life on earth and then never dying is basically the techno-optimist's replacement for the now outdated concept of heaven.
People on HN tend to go for techno-optimism. This is readily apparent when the AI, singularity delusion is treated as a grave and imminent civilizational problem but fossil fuel, energy shortage and climate change are dismissed with "PV will solve all of this. Evil greedy subsidy-loving coal and oil companies are the problem". Our fossil fuel powered civilization would quickly beg for these "evil" companies to resume their activity if they somehow decided to stop providing oil for a week.
Finally, this preference is also made at the expense of most of the wildlife and biodiversity that exists now (or not long ago for a significant chunk of it), which would very much like to continue exisiting too.
There's 500M to 1 billion years left for complex multi-cellular life on earth, due to increased solar output. That's around 100000x to 200000x longer than human recorded history. So clearly, not an imminent problem any rational human needs to worry about.
Trashing the planet in a few decades for such a far away "problem" is absurd. All it does is significantly shorten the time we have here. We could decide that 500M to 1B years is enough, stay here and enjoy all the time left.
If we really want to escape our fate on earth, well we could simply take our time to slowly develop ways go to space. Assuming that it is possible for humans to reach anything beyond the solar system, which may not be the case. There are practical physical and thermodynamic considerations that may prevent us from ever colonizing much in space, even if we were to try hard. In which case, preserving earth would not just be the best thing to do, it would be the only thing we can do.
> If you want to look at it in terms of natural resources, personally I think irrational fear of nuclear power is the biggest problem facing the world. Modern reactors pose almost no risk to the biosphere compared to coal, oil and the like, nor do they contribute to global warming. More people die every year from coal-burning related illness than have ever been killed by nuclear power accidents.
No disagreement here. Though it only addresses some of the issues we face, nuclear fission is probably the only semi-viable alternative to fossil fuels.
And as you said, we're talking short term here. Very short term. On slightly longer terms, it really doesn't look so good. Indeed, it takes an absurd level of denial / techno-optimism / magical thinking (whichever you prefer) to look at paleoclimatology and current climate indicators and think it can go on for much longer without global catastrophy.
At the end, if the best we can say of globalization is "For around 40+ years it was great fun for a lot of people. Well, for the most privileged countries anyway. And then it collapsed, and took a great chunk of the biosphere and the human population with it"... I don't see much to celebrate.
Benchmarks are here: https://koffi.dev/benchmarks
It's still a little different because in my case, the instructions tend to do two things: decode JS value and prepare register/stack. For typical functions, only a few instructions have to run, with minimal overhead. So, for example, I have a PushBool instruction which calls napi_get_value_bool() and then puts the bool at the correct offset (pre-computed) so that it ends up in a register or on the stack.
A function like int atoi(const char *) ends up with only two bytecode instructions:
Or another exemple, void *memset(void *ptr, int value, size_t size) only needs four instructions: I've coupled that with a tail-call direct-threaded interpreter, with Clang's __attribute__((preserve_none)) ABI, just like Python did recently: https://github.com/python/cpython/issues/128563