Chris Lattner recently explained that because of function overloads (and other features), type inference is really hard to make fast in Swift, and is why he says that "using Hindley-Milner was a mistake". [0]
This is really interesting.. does anyone who knows more about Gauss's proof know why you can construct a 5 sided polygon with ruler and compass, but not a 7 or 11 sided polygon? Why do some primes work and others not?
Later he proved that all n-gons with $n=2^k*p_1…*p_r$ where the p_i are Fermat-primes (2^(2^m)+1 prime, today we only know of 3, 5, 17, 257, 65537) are constructible. The opposite direction, i.e. all other n are not constructible, was only a few years later proved. Look up "Theorem of Gauss-Wantzel". I only skimmed the proof, but it seems to generalize the concept of constructing the cos of the angle with "Galois-Theory".
I can give a very fast and incomplete explanation, but you must trust me.
In the complex numbers, the vertices of a pentagon are z^5-1=0. You can factorize it as (z^4+z^3+z^2+z+1)*(z-1)=0. The hard part is solving z^4+z^3+z^2+z+1=0.
Now that equation can't be factorized, and has degree 4. It's important that the solutions have a property that is related to the degree of the equation so they have a property that is 4.
With a compass and a straightedge you can solve only equations of degree 2, that is like taking a square root. If you repeat the process you can solve (some) equations of degree 4. So after a few tricks, you can solve the equation and draw the pentagon.
For 17, the equation is z^16+z^15+...+z+1=0. So the property is 16 and you must use the square root a few times. Each time the solutions double their property, so you get 1 -> 2 -> 4 -> 8 -> 16. Near the bottom of the article is the formula, and it's possible to see a lot of nested and repeated square roots.
For 7, the equation is z^6+z^5+...+z+1=0. So the property of the solutions is 6. With the square root you can only double the property, so you get 1 -> 2 -> 4 -> 8 -> 16 -> 32 ... but you can never get a solution which has a property equal to 6.
(There are more technicals details. You can solve some equations of degree 16, for example to draw the 17agon, but you can't solve every one of them.)
For example with 9, you can factorize z^9-1=0 as (z^6+z^3+1)*(z^2+z+1)*(z-1)=0, and now the property to calculate is 6*2 instead of 8, so it's not a power of 2 and the polygon is impossible to construct.
If you are interested and have the time you can watch the 2 videos from the YouTube channel Another Roof[1] on that subject. He spends some time on easy stuff too to allow the general public to relatively understand the bases, so don't be surprised if the videos are quite long.
a 17-gon reduces to a 4th-degree polynomial, and a 2nd degree one, which can be solved in radicals, by studying the permutations and multiplicities of the roots of this polynomial, in which the solutions are multiples of n*pi/17.
Sometimes when you move a shape around in front of you, you end up with the same shape. Maths people call this symmetry, and have lots of names for different ways you can get back to the same shape.
For instance, if you flip a square around you get back the same square. This is called reflective symmetry.
If you spin a triangle around you sometimes end up with the same triangle. This one is rotational symmetry.
Galois spent a lot of time thinking about numbers instead of shapes. What he realised is that when you add and multiply numbers in lots of different ways, you sometimes end up with the same number at the end. And sometimes different numbers, when added and multiplied in the same way, also give you the same number at the end.
For instance, if you take 1, multiply it by itself and subtract 1, you get 1x1-1=0.
If you do the same with -1, you get (-1)x(-1)-1=0. A different number, using the same pattern, gives us the same result.
What we're seeing here is that there are some symmetries in numbers, not just shapes! Galois theory is all about the nitty gritty of how these number symmetries work, how to find them, and how to use them to do interesting mathematics.
> The term “value identity” is not defined anywhere in this post, nor can I find it elsewhere in Mojo’s documentation, so I’m not clear on how Modular claims that Mojo solves the problem that Pin is meant to solve
I don't claim to know the answer either, but it reminds me of a great talk from Dave Abrahams, who worked on the value semantics for Swift together with Chris Lattner (who started Mojo). The talk is "Value Semantics: Safety, Independence, Projection, & Future of Programming" [0]
It's clear that Mojo is in some sense inheriting Swift's notion of "value semantics," but Rust also has "value semantics" in the same sense. Rust just also has references as first class types, whereas Swift (and as far as I can tell, Mojo) only allows references as a parameter passing mode; Mojo expands on Swift's inout parameters by having an immutable reference passing mode as well.
Not being able to store references in objects does solve the problem of "self-referential structs" in that you just can't implement code like the code Rust compiles to, but that isn't at all what the quoted paragraph says about Mojo so I am quite lost as to what they mean.
My understanding of _value identity_ refers to the `StableDeref`/yoke approach to self-regerential structs. The value is constructed at a stable address (usually some heap allocation) and you always access it through some pointer. The address is the value's identity.
The pointer can move, but the value doesn't move.
Could you link to a source for this in Mojo's documentation? This would be a logical interpretation, but it would mean Mojo is planning to adopt a much worse implementation of async than Rust and the post is claiming that Mojo is both faster and easier than Rust.
I'm not familiar with Mojo, so my understanding above was based on their blog post that you linked, and assumptions based on context. Checking their website, I find a sentence equating "identity" with "having an address" though:
> So far, we've talked about values that live in memory, which means they have an identity (an address) that can be passed around among functions (passed "by reference").
If their self referential structs require indirection, I agree that they're weaker then what's available in Rust. Hopefully they provide more details at some point. The "No pin requirement" section in particular focused on Mojo's async ergonomics, not Mojo's async perfs.
In this talk, Tom applies functional programming ideas to the problem of building an interactive music sequencer. Be sure to watch to the end; the demo is amazing! (PS: if you're out there Tom, I hope you're doing well!)
I cherish this book, its fantastic. I love all of the tidbits about PL history in the margins, and its a great guide through the world of language design.
If you're looking for a follow up, I might have a recommendation. I recently got Essentials Of Compilation by Jeremy G. Siek, and I'm very excited to find some time to read it. There is a version implemented in python and racket (two separate books), so you can pick what you're more comfortable with. (I chose python). Its very elegantly written and after each chapter you end up with a working compiler.
+1. When I was following along in the book I wrote the interpeter in C#, and pattern matching allowed me to basically skip needing the code generator and the visitor pattern. YMMV but its great. Essentials of Compilation by Siek does a similar trick with python.
<humerous-speculating> What if Zuck made the Meta Quest Pro as a psy-op to get Apple to make a pro headset and waste resources, simply to get back at them for clamping down on user tracking? </humerous-speculating>
Hah, if that's true, they both got burned to the tune of $5B each, I'm sure. So not much payback achieved.
And inside the company, everyone can see that it's an embarrassing loss of interest from MZ after 2 years of urgent enthusiasm that didn't pan out. On to LLMs now!
Meta is also a company with little to no business in entertainment or content creation. Nintendo, Sony, Microsoft, Epic, Valve, etc. have a better chance of making a metaverse happen than whatever Meta is trying to buy their way into.
Meta's entire business doesn't exist without it's user's giving them content. They are so far away from a creative company.
There could be an insurance angle. IF VR took off, Apple wanted something to point to. Welcome to the age of trillion dollar companies peacocking each other.
reply