<div dir="ltr">Collecting public opinions on the idea.<br>The project stage is: investigation and some experiments.<br><br>The idea is to create a translator tool, a layer above the standard OTP `erlc`, similar to what TypeScript does for Javascript. With TypeScript you take .js files, rename to .ts to redirect to a different compiler and it became a perfectly valid TypeScript source. Then you're free to spec some variables and arguments, as you need.<br><br><b>Description</b><br><ul><li>A translator for a superset of Erlang syntax:</li><ul><li>The tool will replace erlc by providing identical command line interface.</li><li>The tool will read Erlang source passed with erlc command line.</li><li>The tool will PREPROCESS → PARSE → TYPECHECK & DEDUCT</li><li>The tool will output Erlang syntax then pipe to erlc.</li><li>Possibly the output source will be modified (dynamic checks injection etc)</li></ul><li>Example could be:</li><ul><li>original code: myfun(A, B) -> {ok, A, B}.</li><li>augmented code: myfun(A: int, B) -> {ok, A, B}. % pinning type int for A, but leaving B free for deduction<br></li></ul></ul><ul><li>Experimenting with Hindley-Milner type inference and whether it matches Erlang programming model, and whether it can be made to work without breaking existing code and instead to allow building on existing regular Erlang syntax.</li></ul><ul><ul><li><b>Might need pointers and advice right here</b>, I do not know what I am doing and you're wasting your time reading this.</li></ul></ul><b>Similar Tools</b><br><ul><li>Similar to: otp/Dialyzer, but is not an external tool.</li><li>Similar to: josefs/Gradualizer, but is not an external tool</li><li>Similar to: WhatsApp/erlt<br></li><li>Similar to: abstractMachinesLab/caramel, also outputs Erlang, but is not a new language</li><li>Similar to: <a href="https://gleam.run/">https://gleam.run/</a>, also outputs Erlang, but is not a new language</li></ul><div>There is no desire to rewrite erlc (lib/compiler), erlt, Dialyzer or Gradualizer or create an entire new language, but some functions may overlap.</div><div><br></div><div><div><b>Main Goals and Priorities</b><br><ul><li>Prioritize easy usage for existing regular Erlang projects.</li><li>Zero preparation of existing projects before the first run.</li><li>Allow gradual introduction of type specs, be gentle with unspecced code.</li><li>The author will be aiming for a simple prototype.</li></ul></div></div></div>