BreakfastB0b
Experiencing time and having mass are linked in a very deep way. Objects that experience time, i.e. have some kind of state evolution, must have mass, this is how we know the neutrino has mass even though it's smaller than we can measure, because we measure them oscillating between the various flavours of nutrinos.
This is also how the Higgs mechanism gives rise to "rest mass" in most particles, by constantly exchanging weak hypercharge with them. This oscillation back and forth gives them mass.
https://github.com/TheBevyFlock/bevy_simple_subsecond_system
An input addressed derivation’s hash is based on the the hash of all its input derivations and its own derivation. Therefore trusting the association between the cached binary and the derivation requires trusting the builder and a signature. All non-derivation inputs like source code, must be content-addressed.
A content addressed derivation can then be produced easily by rewriting all the derivations with `nix make-content-addressed`. This doesn’t require trust / signatures as every stage of the build is now content-addressed. The final hash could be confirmed through social consensus of multiple distrusting parties.
There’s nothing in theory stopping you from starting with a content addressed derivation other than it being a pain in the ass as you’d have to know the output hash before you built it, or TOFU (trust on first use) it which is then just the same as using the `nix make-content-addressed` approach.
I’m not sure why you think commit signatures are required. Git is content addressed, you can’t tamper with the derivations without changing the hashes and nixpkgs is primarily developed through GitHub. If someone has access to your SSH keys or GitHub account password it stands to reason they’d have access to your GPG keys too.
Outer Wilds is an indie game where exploration and knowledge is the entire point of the game. It unfortunately has zero reply value as once you’ve pieced together the mystery and how to end the game it’s over. I say unfortunately because it’s honestly the best game I’ve ever played and I sometimes wish I could receive just enough blunt force trauma so I could experience it for the first time all over again.
I think having a small standard library is actually a good thing because it encourages exploration of the space of possibilities.
For example Go’s stdlib http.HandlerFunc sucks, people instead opt for leaving it behind entirely in favour of Gin or trying to work around it with bad patterns like interface smuggling.
Hell, cows aren’t magic. Even “real milk” is just a collection of sugars, proteins, etc. If there’s no difference between the two then what’s the distinction?
Until someone whips out `import “reflect”`.
I’ve always found it confusing that people claim Go is simple when it contains runtime type reflection, which is hiding just under the surface of lots of the standard library like `json.Marshall`. Trying to explain to a new Go developer why []int isn’t assignable to []interface{} is always fun.
Sorry I don’t think I explained myself very clearly.
What I’m saying is Rust allows you to optimise FP style patterns by replacing copying data with in place mutation because the control flow required for handling the flow of immutable data is also well suited to satisfying the borrow checker i.e. explicitly returning the data back to the caller. Because FP patterns can’t automatically communicate through shared mutable references they also lend themselves well to Rust but without the overhead of copying data because an in place mutation can be used instead.
> Not true in my experience. You would use context.Background in a test situation. It's also commonly used for short-lived applications like a CLI. You can see kubectl uses context.Background quite a lot:
My experience with Go is entirely within the context of API and microservice design where circuit breakers are very important which is why my experience with context propagation may be different than your own.
It’s also not surprising to see context.Background() used within tests because it’s being used precisely as I described above to “discharge the constraint” because you can’t propagate the constraint to the caller because test functions in go can only take one parameter `*testing.T`.
The comparison I was trying to draw between them was the way they infect the call tree and usually demarcate impure functions.
When I said that context.Background() discharges the constraint I meant in the sense that the caller doesn’t need to propagate that argument to its caller as it can just pull a context out of thin air.
However I’ve seen a lot of new go devs confuse context.Background() for forking things into the background.
For what it’s worth, I think coloured functions are actually a good thing. If you’re following clean architecture or something similar coloured functions help you easily distinguish what layer in your application something belongs to.
I think the level of pain you experience from mutable references in Rust depends on if you’re coming from an OOP or FP background. I have a FP background and so the patterns I use to build code already greatly restrict mutation. You can usually change code that updates data immutably (creating a new copy of it) with mutable code in rust because the control flow of your program already involves passing that new version back to the caller which also satisfies the borrow checker in most situations.
It’s like the ST monad in Haskell; if you modify an immutable value but no one is around to see it, did you really mutate it?
Go does have “coloured functions”, it’s called `context.Context`.
Any function in go performing IO usually has to take `context.Context` as its first argument so it’s cancelable. Which then propagates that requirement to the caller just like `async`.
That constraint can be discharged with `context.Background()` just like the async constraint can be discharged by not `await`ing the future in Rust.
Index slice out of bounds? panic. Close a channel twice? Panic. Incorrect type assertion? Panic. Dereference nil pointer? Panic.
I would argue that all of these examples which are the most common in my experience are “goroutine scoped” because the goroutine was aborted before they potentially modified the application state in an unknown way.
It’s like not in C, or C++ where out of bounds access has now put the entire application into an unknown state.
I think your misunderstanding comes from the relativistic twin paradox.
From the perspective of the twin on the spaceship accelerating away from earth, the twin on earth seems to age slowly as well until the space ship twin decelerates and then turns around, during which they perceive the twin on earth to age rapidly.
The acceleration / deceleration of the space ship twin’s frame of reference is what breaks the symmetry of the no-preferred frame of reference during flight.
The electron example was assuming that the increasing magnetic field was part of this hypothetical toy universe that violates time translation symmetry. Obviously constructing such experiment in our universe it's not surprising that the electron gains energy because as you said, it's not an isolated system. When considering the system generating the magnetic field it becomes obvious that the overall system does not gain energy.
However our actual universe, at the galactic scale, is just like the toy example. New Space / Energy is created out of nothing as the universe's expansion accelerates. There is no paradox here because conservation of energy is not fundamental but emergent from symmetries via Noether's theorem. Space is a "material" that is not "diluted" by expansion and contains energy.
The inflaton field at the heart of hyperinflation / big bang theory also expands without dilution.
Perhaps there is some larger system our universe is embedded in that does respect time translation system / conservation of energy and the expansion is being driven by a larger process loosing energy but we can't observe it.
If you fling a charged particle like an electron through an increasing magnetic field, it will appear to gain energy.
Locally our universe seems to obey Time Translation Symmetry and thus also Conservation of Energy. However the expanding universe is not Time Translation Symmetric, at the scale of galactic clusters new “energy” is created all the time just like the electron in the magnetic field. That’s what “dark energy” is.
All the different conservation laws have roots in symmetries of the system.
If you really think you don't need generics, take your code code and replace every
[]int{}, []string{}, map[string]string{}
with []interface{}{}, map[interface{}]interface{}{}
and see how much you "don't need generics"