“Evolving Erlang into a modern statically typed programming language”
web.facebook.com
web.facebook.com
Guess this is a good time to plug Gleam though (along with Dialyzer, which has already been mentioned), a statically typed functional programming language which compiles to Erlang.
"Our biggest and the most challenging project is evolving Erlang into a modern statically typed programming language.
Our work is motivated by extremely successful and large-scale application of Erlang at WhatsApp."
However, if you use structs extensively in elixir, with a good code editor language server, it is basically easy to eliminate most typing errors if you get into the habit of typespeccing everything (not hard with vscode)
"How is message passing typed?
Gleam doesn't currently have first class support for the BEAM's concurrency primitives such as receive, send, and spawn. This is because research is still ongoing as to the best way to apply a strong type system to them while still enabling established OTP patterns. For now these primitives should be used via the Erlang FFI, making them dynamically typed.
Many OTP patterns such as gen_server are functional in nature and don't require direct use of these primitives so these behaviours can be implemented in Gleam today."
I suspect the FB language might solve this.
I'm interested in what the WhatsApp team come up with here too! I'm not sure it's possible to "solve" this entirely though, message passing in Erlang is extremely dynamic and some of the problems are not possible to solve (i.e. distributed message passing) and will always require some unsafe type casting.
https://codesync.global/media/purescript-on-the-beam-typed-o...
So other ways of handling the situation was developed. That is one of the reasons it got a very good QuickCheck lib for example.
On the other hand I would be super happy if this would end up with a nice result. Typed Erlang would be awesome. That is why I am as hopeful for Unison as I am.
I recon they just plan on making a typesystem like typescript ontop of erlang that is simply compiled away before building.
This way youd get the same typesafety typescriot gives you with the option of any types that fit erlang.
The outcome of this work could prove very significant -- I'm envisioning impressive code execution speed ups.
But yes it would be great for Erlang/Elixir.
It'll tell you there's a problem in function x and actually the problem is 4 functions down the stack. It's nuts, it's shit.
Just the other day, I don't know if serious or not, I read the Phoenix framework's author say I solve 100% of my dialyzer issues by not using dialyzer on Slack.
I've seen at least a few dozen bugs caught in development over the last few years caught by Dialyzer.
There could be many reasons for the sending code to be outside your analysis set. The sending code could be in another distinct code module (perhaps in a 3rd party library). The sending node may be running an older version of the code. The sending node may be running a newer version of the code. Something terrible could have happened on the sending node.
However, you can strongly type your way from "string of bytes" all the way to "a Pet record" by parsing, and the calling side just receives a strongly typed result on the lines of "Result<Pet, Error>".
Why couldn't you do the same thing in BEAM?
Sometimes one thing is the right thing to do and sometimes the other. But messages are such a low level concept in erlang... It's really hard to make a strongly typed system that doesn't pick one over the other, which is going to be the wrong answer half the time.
I'm not saying it can't be done, but many have tried and no one has succeeded yet.
Or at least, that’s how it works in the statically typed language Elm, which guarantees that your compiled code will not throw any runtime errors.
Algorithmic feed curation has added an element of insularity, but people have always formed communities around what they think and care about. Failures to educate, to inculcate critical thinking, to distinguish between truth and falsehood - these are not the shortcomings of social media not its responsibility to fix, but rather the fault of broader educational and corporate systems that prioritized vocational knowledge over inquiry and examination. We brought our own cudgels - social media is simply another area to bludgeon each other to death.
Facebook can and should be held responsible only insofar as it has directly and with intent manipulated information - I don't think this has happened so far. Attempts to try and make Facebook fix what other systems were supposed to do are examples of first-order thinking - it's more effective to improve schools and colleges, offer opportunities for socioeconomic mobility, and reduce costs of living so that people can be healthier, smarter and more capable, so that they are less likely to begrudge offline or online.
it's not a legal argument being discussed. facebook certainly enables the actions of its users, even encouraging users via the site's features and suggestive behavior that emotionally attaches them to using the site. facebook, and basically every other social media platform, seek to "hack" the emotional state of their users to keep them coming back.