<p dir="auto">If you call <code class="notranslate">jl_init()</code> from a Windows application without a console,  Julia 0.7 and 1.0 will abort the application after trying and failing to duplicate an invalid stdio handle. Julia 0.6 was less strict (and possibly less correct) about this but at least the apparent result was that things worked and stdout/stderr output just disappeared.</p>
<p dir="auto">This doesn't seem like an unreasonable use case for embedding and <code class="notranslate">jl_init</code> should handle it gracefully. If it can't easily be fixed it should at least be documented.</p>
<p dir="auto">The easiest workaround I have found is to call <code class="notranslate">AllocConsole()</code> before <code class="notranslate">jl_init()</code>, with the predictable drawback that you get a window that you might not want. As a workaround for the workaround you can hide the console window with <code class="notranslate">ShowWindow(GetConsoleWindow(), SW_HIDE)</code>, but not without a brief flickering between creation and hiding.</p>
<p dir="auto">For more details, see <a href="https://discourse.julialang.org/t/embedding-jl-init-exits-on-windows-for-julia-0-7/13819" rel="nofollow">https://discourse.julialang.org/t/embedding-jl-init-exits-on-windows-for-julia-0-7/13819</a></p>
<p dir="auto">Currently, <code class="notranslate">convert</code> is used to extract the magnitude of a quantity, or alternatively to give units to a dimensionless quantity. This happens in the <code class="notranslate">Dates</code> code in <code class="notranslate">Base</code>, and the behaviour has inspired similar behaviour in SIUnits.jl and Unitful.jl.</p>
<p dir="auto">In Base, <code class="notranslate">convert</code> is generally used to convert between values of different types, but with same meaning. Since 1 and 1 second do not represent the same quantity, the use of <code class="notranslate">convert</code> to switch between them is a pun. In addition, it can lead to surprising behaviour. Note:</p>
<div class="highlight highlight-source-julia notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="julia&gt; convert(Base.Dates.Second, 60) 
60 seconds

julia&gt; convert(Base.Dates.Minute, ans)
1 minute

julia&gt; convert(Int, ans)
1"><pre class="notranslate">julia<span class="pl-k">&gt;</span> <span class="pl-c1">convert</span>(Base<span class="pl-k">.</span>Dates<span class="pl-k">.</span>Second, <span class="pl-c1">60</span>) 
<span class="pl-c1">60</span> seconds

julia<span class="pl-k">&gt;</span> <span class="pl-c1">convert</span>(Base<span class="pl-k">.</span>Dates<span class="pl-k">.</span>Minute, ans)
<span class="pl-c1">1</span> minute

julia<span class="pl-k">&gt;</span> <span class="pl-c1">convert</span>(Int, ans)
<span class="pl-c1">1</span></pre></div>
<p dir="auto">So we have converted an Int back to itself, but the conversion was lossy!</p>