<p dir="auto">Forwarning, my understanding of Deno may be incorrect, please, correct me if I am wrong.</p>
<p dir="auto">Currently, Deno chooses between either JavaScript or TypeScript by using the file's extension. (I think?)</p>
<p dir="auto">When JavaScript attempts to import a .ts file, the cache is checked, if the file has not been changed, the cached code is used, otherwise, TSC is invoked and its JavaScript output is imported.</p>
<p dir="auto">Can the same functionality be easily provided for other languages?</p>
<p dir="auto">Say, I wanted to use Dart's dart2js transpiler on Dart source code files (.dart), is there a way that I could do this using Deno itself?</p>
<p dir="auto">If I were to do something like:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import foo from &quot;./mod.dart&quot;"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">foo</span> <span class="pl-k">from</span> <span class="pl-s">"./mod.dart"</span></pre></div>
<p dir="auto">the transpiler program would be fed the file and emit JS, which is then used by the importing JS module.</p>
<p dir="auto">If this does not exist, can this be considered a suggestion to offer such functionality?</p>
<p dir="auto">For tracking purposes, please don't work on this without discussing with Ry or myself.</p>
<p dir="auto">Having a public API that is similar to how we perform TypeScript compilation is a good idea.  It would allow JS-&gt;JS transpilation (e.g. those who need Babel custom plugins or Flow) or other languages (e.g. CoffeeScript).</p>
<p dir="auto">Related to <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="408619831" data-permission-text="Title is private" data-url="https://github.com/denoland/deno/issues/1738" data-hovercard-type="issue" data-hovercard-url="/denoland/deno/issues/1738/hovercard" href="https://github.com/denoland/deno/issues/1738">#1738</a> and some other work in rationalising the compiler APIs internally, but we should be able to support loading a compiler in a web worker and instructing the privileged side what resources should be sent to that runtime compiler.</p>