Since fn ... raises
is nearly equivant to def ...
, why not add def ... noraise
instead of fn
for better maintainability with Python and reduce the division between Mojo and Python community.
As def
can achieve the same effect as fn
after modifying the parameter conventions, then why bother using fn
? I believe fn
is merely used to enhance the recognizability of the Mojo language.
def
is where all of the python compatibility features will get tossed, so that is being kept separate from fn
. There will likely be more divergence in the future, but they are temporarily close due to soundness issues discovered in Object
that resulted in the removal of a lot of the dynamism in def.
The goal is that, eventually, def
will be python compatible, as well classes. struct
/fn
is a much more strict subset of the language with mandatory static typing and you get large performance benefits as a result. Right now, def
and fn
are close to each other because the previous approach to making dynamism work in def
had soundness issues so it was stripped out.
To +1 Owen, Mojo lives a dual life: we want to enable expressive high level scripting applications, while also being a powerful systems/gpu programming langauge. fn
is really important for making the systems use-cases expressive.
Yes, I don’t expect to see major or large divergences between Mojo and Python, or their communities.