3 ms·
Why not just define the function headers in Python? It's less verbose.
by cabalamat 3y ago
Why not just define the function headers in Python? It's less verbose.
- ISV_Damocles 3y agoSimply, Marsha is not Python. ;) More seriously, in Python, types are optional and the exact behavior is explicitly defined at runtime, but the author of the code already had a behavior in mind when they wrote the code. Getting the intended type information from the user to provide to the LLM improves the quality of the generated code, which is actually somewhat lossy. The "intended type information" isn't "explicit type information", though. We support any character besides these four as part of a type `(),:`. That includes spaces and periods, so you can describe the type as a short sentence if you aren't exactly sure what the structure ought to be.[1] And since in Marsha you don't actually write an imperative function body, argument names don't matter, only the argument order (as Marsha does not support named parameters, at least right now) so there's no argument naming in the declaration, which can make it more succinct than Python def lines in certain situations, though to be fair none of our examples do this. [1]: https://github.com/alantech/marsha/blob/main/examples/web/duckduckgo.mrsh#L1 https://github.com/alantech/marsha/blob/main/examples/web/du...