Wow, I honestly wonder if this was caused by mixing up “functor” in the C++ and Haskell senses…
To expand on that, for those in the audience:
In Haskell, a functor is a type constructor (like “list”, “optional”, “future”, “I/O request”, &c.) with a way to map a function over it, covariantly, in a way that preserves its structure—i.e. without changing the shape of the container or structure of the action represented by the constructor, just the contained elements or produced result.
This is based on the more general notion of a functor in mathematics, which is a mapping between categories. The Haskell version is much more constrained, though: it only maps between Haskell types, and it’s parametric (iow completely generic), not just any old mapping.
While in C++, a functor is a completely different thing: an object that can be called like a function. It’s thus equivalent to a closure, where the object fields are the captured values. And that sounds like the description being used here.
Has there been any work in Rust on something like Haskell’s ‘Coercible’? Namely, it defines the precise criteria for safe zero-cost coercions between types that provably have the same representation, and derives the coercions automatically. It guarantees that ‘coerce’ is identical to ‘fmap coerce’, which saves the cost of that exact traverse+reconstruct pattern to change out a phantom type parameter.
There are some deficiencies, most prominently that the “role” system is aggressively monomorphic, so you can’t always prove that two things are coercible—the compiler must conservatively assume that type parameters with unknown roles cannot be coerced—but overall it’s much better than what we had before, and I expect it’ll continue to improve.
I’m thinking about a similar sort of coercion system for a language project, and it’s good to have a slightly broader view of the design space. This area hasn’t been very well explored yet, not just in terms of semantics, but also developer ergonomics: most of the time you want to hide representations for convenience, but when considering safe coercions, you really want to make it possible to talk about them explicitly & precisely.
This feature is also very subtle, and right at the very edge of the type system, so it’s extremely easy to break soundness here, usually by failing to consider things like variance. The reason “roles” were added to GHC in the first place isn’t just because of the issue with type families / associated types mentioned in that RFC; it’s also because anything that provides a safe API atop unsafe internals could also be used to violate soundness, especially in conjunction with mutation. The classic examples are: 1. coercing “container of A” to “container of B” using the coercion from A to B, then inserting a B that is not a valid A, either in its value or just because A and B have incompatible trait instances (like ordering or hashing). You need to be able to disallow conversions between things even if they have identical representations.
This is also exactly how male countertenor singers produce a female-sounding voice, by making the vocal cavity smaller to adjust the formants upward. If you don’t do that, it just sounds like a male head voice or falsetto.
I have an extremely strong sense of smell, inherited from my mother. Both of us are able to detect smells at lower concentrations and identify them more accurately than almost anyone else I know. My partner has told me that there are many things she didn’t even realise had a smell until I pointed it out—she is not anosmic, because she could recognise the smell after I drew her attention to it, as long as it has a high enough concentration. I have identified people I know by smell (who left their sweater behind at the party?), detected someone slicing cucumbers or celery a few rooms away, can identify what the neighbours are cooking, have pinpointed the location of certain types of ant nest, and more. If anyone is studying smell and wants to use me as a guinea pig, feel free to get in touch! I also have synaesthesia, which may play a role in how I process smells, but it seems to be mainly a physical thing.
My working model for why colours admit description more readily than smells is that we judge and decompose them in largely the same way, but it’s simply easier to develop a repertoire of colours. They’re everywhere, most people have decent colour vision, and someone can point to them and tell you what they are in relative isolation.
Whereas smells (and tastes) are much more diverse, and rarely pure, isolated chemicals but more often complex profiles of many different compounds.
A common way that people develop a repertoire of smells is through cooking: now that I have some experience with many different ingredients and styles, I can now readily tell what went into a dish and how I might replicate it, describe new tastes in terms of old ones, and imagine new flavour combinations and how they would work together.
Chemistry offers another angle—if you know what I mean by “indolic” then you can probably conjure a mental image of exactly the heavy musk I’m referring to, but you probably have no clue if you haven’t experienced it and been told that that’s what you’re experiencing. You can add specific chemicals to your repertoire of smells.
A similar thing seems to hold for recreational drug experiences. If someone has had many different drugs before, especially drugs with similar pharmacodynamics that operate on the same receptors, it’s relatively easy to give them the gist of what something is going to feel like by reference to similar experiences. If they haven’t, there’s only so much you can do to prepare them for what is going to be a novel experience.
Perhaps I'm simplifying/abstracting a bit too much here but - colors are single dimensional (i.e. the wavelength of the light you're seeing) whereas smells are multidimensional/maybe not even really mappable to any continuum.
Colors are not wavelength. Color actually has three dimensions that can be coded as RGB, HSL, LAB, or using degenerate coding in four dimensions with CYMK.
Visual geometry has three dimensions, making vision a 6 dimensions thing (plus time, but that is added to every sense).
You point still stands though, since AFAIK smell has many more dimensions (not sure if they've been thoroughly counted).
Light is a mixture of different wavelengths, so, in a sense, it's infinitely dimensional. People's perception of light is usually three dimensional.
> maybe not even really mappable to any continuum
I think it cannot be continuum, as sense of smell is caused by discrete molecules. As for "not mappable", it can be that it's mappable, but our brain is really bad at it.
> It basically combines futuristic tech with dystopian/utopian elements, and grimy, old-world stuff.
In other words, “The future is already here—it’s just not very evenly distributed” — William Gibson.
And it will probably always be that way, not just in terms of global inequality, but even in a single person’s life: you might be among the billion or two people living as humans have lived for thousands of years, on subsistence agriculture and herding with no running water, but you also have a smartphone and can video-chat with your cousins across the world. That aspect of cyberpunk storytelling is just taking this fact of existence and amplifying it to draw attention to it.
What can we do as individuals? I already eat relatively little in the way of animal products, don’t drive much, don’t use a lot of electricity or natural gas at home…but one person behaving this way isn’t enough. The only way I see us fixing this is through enormous collective action: holding to account the top 100 companies who together are responsible for 71% of GHG emissions, completely phasing out gasoline-burning vehicles, taxing the hell out of fossil fuels and emissions including methane from industrial farms, powering electric vehicles with renewable/nuclear power, decommissioning coal power plants, investing in dense walkable/bikeable cities and high-quality public transportation, and investing in carbon sequestration tech.
I’m scared and I feel so powerless because of the sheer scale of the problem, and how a lot of people don’t even believe in the problem. It’s paralysing me.
Yes that’s roughly what needs to happen, and it’s a policy issue. It’s great to ride a bike to work, eat less meat, and switch to LEDs but it won’t make a dent.
It requires scale which requires policy which requires political action which requires activism and voting.
> I’m scared and I feel so powerless because of the sheer scale of the problem.
Imagine you had the power, but the price was correspondingly high. Would you consider the Thanos option if you had his magic glove? Snap your fingers and X% of people turn painlessly to dust? If so, what should X be? If not, wouldn't you be passing on an opportunity to extend our species' survival, and many others? Is Thanos a hero or villain?
I worked on a Flash implementation called Spaceport in 2012 or so. We had the most complete implementation apart from Adobe, with all kinds of goodies like actual hardware-accelerated graphics on mobile (far better than the buggy AIR). Tried to get Mozilla to buy us out, since they were looking for a way to incorporate an open Flash implementation more complete than Shumway, but they didn’t bite. Ended up acquihired by Facebook, product abandoned. I sometimes wonder, if things had gone differently, whether we could have given new life to the Flash ecosystem. Oh well.
I was working for Nickelodeon on HTML5 gaming around that time and I think I remember seeing your product. You might have interacted with some of the same people I did!
Does Facebook own your IP? Might be worth investigating whether you can loose it from where ever it lives. There will likely be a flash gaming revival over the next decade as all the kids try to revisit their childhood memories.
No, afaik it should still be owned by the startup incubator that was the parent company of Spaceport. We open-sourced some ancillary bits and pieces before leaving, but not the most important components of the platform like the ActionScript compiler, build system, Flash API implementation, and renderer/engine.
I might try to get in touch with them, but open-sourcing it wouldn’t be enough—realistically it would take most of the old team just to get it back shipshape, let alone continue adding features, and I know most of them don’t have the time or desire to do that for free 5–6 years after leaving it behind.
To expand on that, for those in the audience:
In Haskell, a functor is a type constructor (like “list”, “optional”, “future”, “I/O request”, &c.) with a way to map a function over it, covariantly, in a way that preserves its structure—i.e. without changing the shape of the container or structure of the action represented by the constructor, just the contained elements or produced result.
This is based on the more general notion of a functor in mathematics, which is a mapping between categories. The Haskell version is much more constrained, though: it only maps between Haskell types, and it’s parametric (iow completely generic), not just any old mapping.
While in C++, a functor is a completely different thing: an object that can be called like a function. It’s thus equivalent to a closure, where the object fields are the captured values. And that sounds like the description being used here.