globuous
Joined 12 years ago
Joined 12 years ago
Turns out there's something called the Schelling coordination problem [1] I didn't know about that essentially asks the exact same question (lacking my metro line constraint). And the N line apparently also goes through Time Square.
So I guess empire State Building at 2pm is probably not such a random answer given the proper set of constraints.
ReasonML has custom operators that allows for manipulating monads somewhat sanely (>>= operators and whatnot). rescript (reasonml’s “fork”) did not last time I checked. But it does have an async/await syntax which helps a lot with async code. reasonml did not last time I checked, so you had to use raw promises.
I believe Melange (which the article briefly talks about) supports let bindings with the reason syntax.
And this kinda changes everything if you React. Because you can now have sane JSX with let bindings. Which you could not until melange. Indeed, you can PPX your way out of it in ocaml syntax, but I’m not sure the syntax highlight works well in code editors. It did not on mine anyway last time I checked.
So for frontend coding, Melange’s reason ml is great as you have both, and let bindings can approximate quite well async syntax on top of writing readable monadic code.
For backend code, as a pythonista, I hate curlies. and I do like parenthesis-less function calls and definitions a lot. But I still have a lot of trouble, as a beginner ocamler, with non-variable function argument as I need to do “weird” parenthesis stuff.
Hope this “helps”!
I get the boot concern, and the maintenance concern (!!!), but as you say, these models are already quite huge anyway :)
``` Today: we are able to certify realistic bytecode compilers and abstract machines.
Tomorrow: certification of optimizing native-code compilers? ```
Xavier Leroy actually got the ACM Software System Award in 2021 for CompCert, an optimizing native-code compiler! It's first version seems to have been released in 2005, just 3 years after this presentation was written. Though CompCert is a C compiler, which isn't really a functional language.
- https://en.wikipedia.org/wiki/ACM_Software_System_Award - https://en.wikipedia.org/wiki/CompCert
class Animal {}
class Dog extends Animal {
woof() {}
}
class Cat extends Animal {
meow() {}
}
let append_animals = (animals: Animal[], animal: Animal) => animals.push(animal)
let dogs = [new Dog()]
append_animals(dogs, new Cat())
dogs.map(dog => dog.woof())
Which if you evaluate, you'll obviously get: Uncaught TypeError: dog.woof is not a function
Whereas Mypy won't typecheck the equivalent Python code: class Animal:
pass
class Dog(Animal):
pass
def append_animals(animals: List[Animal], animal: Animal) -> None:
animals.append(animal)
dogs = [Dog()]
append_animals(dogs, Dog())
It'll throw with: $ mypy types.py
types.py:16: error: Argument 1 to "append_animals" has incompatible type "List[Dog]"; expected "List[Animal]"
types.py:16: note: "List" is invariant -- see https://mypy.readthedocs.io/en/stable/common_issues.html#variance
types.py:16: note: Consider using "Sequence" instead, which is covariantI was tired not remembering how to name intervals, construct chords, my arpeggios and scales and what not. So I coded it to help me figure all of that out. I also wanted a frontend to visualize all of this because notes on the guitar are all mixed up and it's hard to reason about when you have a terrible memory like I do:
- Theory.res: https://github.com/tbinetruy/solfeggio-calculator/blob/maste... - Frontend: https://tbinetruy.github.io/solfeggio-calculator/
I also have some notes on that repo that have helped me a lot where I can summarize my findings. But this exercise has been enlightening. Both from the coding and musical perspectives. Because Ocaml really forces you to model music and thus ensure that you understand the concepts which helps you remember them.
I can finally start soloing over chord progressions using arpeggios now! It's essentially comes down to playing a scale in thirds starting on the chord root note on chord changes! And I can finally understand my fretboard without having to look at my frontend's chord diagrams anymore. I still don't know the notes, but I understand their relations with each other.
I've also started learning jazz because it's a lot more theory based than pop/rock since you have a lot more exotic chords and solos are guided by the underlying progression. I really like Jens Larsen's YT channel. It's very hard to get into at first because he goes quite fast, but has some very accessible videos such as this one: https://www.youtube.com/watch?v=7q2LB45ts0M.
Hope this helps :)
As a react dev turned django dev, I cannot wait to get my hands on this!
Edit: how come the counter example is so slow on my iPhone 11 though ? That seems real weird https://pynecone.io/docs/getting-started/introduction
I wonder why not swap them? And had he, would it have bricked the swap pool?
[1] https://x.com/czesmaill/status/2115988477905080716