HN user

evomassiny

40 karma
Posts0
Comments23
View on HN
No posts found.

Could you duplicate `RECORD_INST` before each `INSTRUCTION_N`, so that:

```

   INSTRUCTION_1:
     // subroutine 1
     ip++;
     goto *dispatch_var[*ip];

   INSTRUCTION_2:
     // subroutine 2
     ip++;
     goto *dispatch_var[*ip];
```

becomes: ```

   RECORD_INST_1:
     // record logic
   INSTRUCTION_1:
     // subroutine 1
     ip++;
     goto *dispatch_var[*ip];

   RECORD_INST_2:
     // record logic
   INSTRUCTION_2:
     // subroutine 2
     ip++;
     goto *dispatch_var[*ip];
```

This way you could directly swap `dispatch_var` with an array populated with the `RECORD_INST_*` labels, and remove one step at runtime.

Or maybe this is what you are trying to avoid to reduce the binary size ?

Can't you solve it using hash trees (or Merkle trees) ?

You tag each computation nodes with a hash of its dependencies and some constant salt, that gives you an ID which identifies the results that the computation node would produce; before running it.

You can then use those IDs to index the computations results in a cache; whenever you query a computation results, as long as you update the IDs of each leaf of the computation graph, you will only re-compute the nodes that need to be updated

I've nothing to add to the conversation, but I jump on this oportinity to tell you that i like the content you've made with Adam Barth on yt very much, have a great day :)

According to [0], a typical container ship generate 12.5 g of CO2 per ton per km, which means that one trip from France to NY with 350T of cargo would release about 35T of CO2 in the atmosphere.

I'm convinced that this sail boat generates an order of magnitude less of that (I can't find any estimate of it)

Whatever the initial CO2 cost of the construction of this boat is, I'm sure that it's a net benefits if it's used long enough

[0] https://www.ecsa.eu/sites/default/files/publications/2020%20...

a couple of reasons:

* cars destroy cities, they take huge chunks of the public space,

* air pollution,

* noise pollution,

* safety,

* fast floods favored by impermeable soil covers,

* social inequalities (not having a car make you less capable in a car centric environment),

* climate change

Agreed ! Plus, the ability submit a bunch of tasks, and to block until _one_ task completed (akin to `epoll_wait` of tokio's `select`) makes it quite useful. I don't know of a use case or `mutiprocessing.Pool` which is not covered by `concurrent.futures.ProcessPoolExecutor`; so I wonder why both exist

the type `null | true | false` is different from `true | false`, a type checker can assert that you handle the `null` case before using a function that wants a boolean. This is how rust handles it (with the Option<T> type).