evincarofautumn
Joined 15 years ago
Joined 15 years ago
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.
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.
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.
-- (1)
fix f = let x = f x in x
Because it has better memory usage; the definition you provided is translated to the following STG: -- (2)
fix f = let x = fix f in f x
So whereas #1 is a thunk that refers to itself, #2 is a recursive function, and importantly not tail-recursive.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.
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.
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.
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.
I like the theory of concatenative programming languages because they provide an elegant compositional/dataflow-oriented style of programming, have deep connections to linear logic, Hughes’ “arrows”, effects & coeffects, and quantum/reversible computation, while also admitting very efficient implementation on classical hardware.
I’m (very slowly) working on a statically typed low-level concatenative language that’s meant to provide all the nice high-level typed functional language features like higher-order functions, pipeline-style programming, and effects tracked in the types, while requiring no runtime support such as a tracing garbage collector—the ultimate goal is to allow a restricted subset that doesn’t even require a heap allocator, so you could use it to implement e.g. a kernel or device firmware. I hope that concatenative languages find their way to the mainstream as the basis for programming quantum and extremely low-power computing devices (which we will need in order to reduce emissions).
If you don’t know the symbol at all, though, that could definitely make things more challenging to learn, since then the notation is (even more) arbitrary. A lot of programming languages’ symbol choices are visually mnemonic: Perl has “$” for scalars, “@” for arrays, and “%” for hashes because dollar-sign looks like S for scalar, at-sign looks like A for array, and percent-sign looks like a pair of things (a key and a value), but there’s nothing about these symbols semantically or in their pronunciation that suggests their Perl meanings.
https://github.com/evincarofautumn
http://evincarofautumn.blogspot.com/
[email protected]