evincarofautumn

Joined 15 years ago

Karma
4,810
Submissions
1,621
Member since
Mar 18
A programming language technologist, or something like that.

https://github.com/evincarofautumn

http://evincarofautumn.blogspot.com/

[email protected]

View on Hacker News

Recent submissions

Comment · 5 years ago
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.

Comment · 6 years ago
Cool, thanks!

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.

Comment · 6 years ago
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.

Comment · 7 years ago
I would love to use it for my compiler backend…if I could find any maintained standalone implementations of it.
Comment · 7 years ago
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.
Comment · 7 years ago
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.
Comment · 8 years ago
Of course, the definition we actually use is this:

    -- (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.
Comment · 8 years ago
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.

Comment · 8 years ago
> 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.

Comment · 8 years ago
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.

Comment · 8 years ago
> Does Facebook own your IP?

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.

Comment · 8 years ago
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.
Comment · 8 years ago
The language they introduce, Π, is essentially a simple concatenative programming language where all of the primitive combinators happen to be reversible; the graphical depiction is essentially the same as graphical linear algebra¹, which is no coincidence. Concatenative combinator calculus is related to combinatory logic—specifically, it’s a variation that replaces application of combinators with composition, leading to a bunch of nice mathematical properties. Both of these logics have the nice feature that you can syntactically restrict the substructural rules of contraction (dropping), exchange (swapping), and weakening (copying): for example, a well-formed program that doesn’t use the K combinator to drop a value is guaranteed to be linear, i.e., not destroy any information. This isn’t true in ordinary lambda calculus, where you can use a variable zero or many times, so you need additional checks on the uses of a variable to determine whether a function is linear, affine, &c.

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).

¹ https://graphicallinearalgebra.net/

Comment · 8 years ago
I don’t mean to evangelise too hard, but this is yet another reason to keep kratom legal in the US. Last I knew, over 30% of the world’s kratom is consumed by the US, and most of that is from Indonesia, specifically Borneo. Kratom is an understory crop that can be cultivated without clear-cutting as is done for palm oil; and if kratom growers can’t afford to stay in business because the US demand dries up, you can bet they’ll turn to palm oil and rubber, leading to more deforestation and more habitat loss for orangutans. This is in addition to what I believe is clear potential for kratom to be instrumental in fighting the epidemic of opioid painkiller and heroin abuse.
Comment · 8 years ago
I’m not sure, but based on what statistics I can find, it seems most blind people aren’t congenitally blind, so they probably have some familiarity with the symbols, maybe depending on how old they were when their visual impairment manifested. And of course you could always learn the shape of an unfamiliar symbol by feeling a physical representation of it—like on embossed paper, or those letter-shaped fridge magnets—but I dunno how common it is to do that.

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.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton