Skip to content

Commit

Permalink
Built site for gh-pages
Browse files Browse the repository at this point in the history
  • Loading branch information
Quarto GHA Workflow Runner committed Feb 11, 2025
1 parent 8c78791 commit bd33799
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .nojekyll
Original file line number Diff line number Diff line change
@@ -1 +1 @@
b8f2dd3a
18629ae6
6 changes: 3 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ <h5 class="quarto-listing-category-title">Categories</h5><div class="quarto-list

<div class="quarto-listing quarto-listing-container-default" id="listing-listing">
<div class="list quarto-listing-default">
<div class="quarto-post image-right" data-index="0" data-categories="cnVzdCUyQ2ZmaSUyQ2p1bGlh" data-listing-date-sort="1739311020000" data-listing-file-modified-sort="1739314591143" data-listing-date-modified-sort="NaN" data-listing-reading-time-sort="2" data-listing-word-count-sort="307">
<div class="quarto-post image-right" data-index="0" data-categories="cnVzdCUyQ2ZmaSUyQ2p1bGlh" data-listing-date-sort="1739311020000" data-listing-file-modified-sort="1739315696004" data-listing-date-modified-sort="NaN" data-listing-reading-time-sort="3" data-listing-word-count-sort="600">
<div class="thumbnail"><a href="./posts/rust-abi.html" class="no-external">

<div class="listing-item-img-placeholder card-img-top" >&nbsp;</div>
Expand Down Expand Up @@ -254,7 +254,7 @@ <h3 class="no-anchor listing-title">
</a>
</div>
</div>
<div class="quarto-post image-right" data-index="1" data-categories="bml4JTJDY29udGFpbmVyJTJDc2V0dXA=" data-listing-date-sort="1730551140000" data-listing-file-modified-sort="1739314591143" data-listing-date-modified-sort="NaN" data-listing-reading-time-sort="7" data-listing-word-count-sort="1296">
<div class="quarto-post image-right" data-index="1" data-categories="bml4JTJDY29udGFpbmVyJTJDc2V0dXA=" data-listing-date-sort="1730551140000" data-listing-file-modified-sort="1739315696004" data-listing-date-modified-sort="NaN" data-listing-reading-time-sort="7" data-listing-word-count-sort="1296">
<div class="thumbnail"><a href="./posts/unreal-engine-nix.html" class="no-external">

<div class="listing-item-img-placeholder card-img-top" >&nbsp;</div>
Expand Down Expand Up @@ -285,7 +285,7 @@ <h3 class="no-anchor listing-title">
</a>
</div>
</div>
<div class="quarto-post image-right" data-index="2" data-categories="bmV3cw==" data-listing-date-sort="1730545200000" data-listing-file-modified-sort="1739314591143" data-listing-date-modified-sort="NaN" data-listing-reading-time-sort="1" data-listing-word-count-sort="32">
<div class="quarto-post image-right" data-index="2" data-categories="bmV3cw==" data-listing-date-sort="1730545200000" data-listing-file-modified-sort="1739315696004" data-listing-date-modified-sort="NaN" data-listing-reading-time-sort="1" data-listing-word-count-sort="32">
<div class="thumbnail"><a href="./posts/welcome/index.html" class="no-external">

<p class="card-img-top"><img src="posts/welcome/thumbnail.jpg" class="thumbnail-image card-img"/></p>
Expand Down
22 changes: 21 additions & 1 deletion posts/rust-abi.html
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ <h2 id="toc-title">On this page</h2>
<ul>
<li><a href="#rust---julia-interface" id="toc-rust---julia-interface" class="nav-link active" data-scroll-target="#rust---julia-interface">Rust &lt;-&gt; Julia interface</a>
<ul class="collapse">
<li><a href="#existing-solution" id="toc-existing-solution" class="nav-link" data-scroll-target="#existing-solution">Existing solution</a></li>
<li><a href="#rust-abi" id="toc-rust-abi" class="nav-link" data-scroll-target="#rust-abi">Rust ABI</a>
<ul class="collapse">
<li><a href="#standard-strategy-extern-c" id="toc-standard-strategy-extern-c" class="nav-link" data-scroll-target="#standard-strategy-extern-c">Standard strategy: <code>extern "C"</code></a></li>
Expand All @@ -185,6 +186,10 @@ <h1>Rust &lt;-&gt; Julia interface</h1>
<li><a href="https://github.com/0x0f0f0f/ResultTypes.jl">ResultTypes.jl</a></li>
<li><code>Option</code> is generally used as <code>Union{T, Nothing}</code> in Julia</li>
</ul>
<section id="existing-solution" class="level2">
<h2 class="anchored" data-anchor-id="existing-solution">Existing solution</h2>
<p>You can call Julia from Rust, using the exposed C FFI for Julia as leveraged by the <a href="https://github.com/Taaitaaiger/jlrs">jlrs</a> crate, but we are also interested about the reverse.</p>
</section>
<section id="rust-abi" class="level2">
<h2 class="anchored" data-anchor-id="rust-abi">Rust ABI</h2>
<p>There is currently no agreed way even for calling dylib Rust &lt;-&gt; Rust, known as an ABI, this is because the arguments are not assured to have any layout in memory, they are decided arbitrarily when compiled:</p>
Expand All @@ -199,7 +204,22 @@ <h2 class="anchored" data-anchor-id="interim-solution-to-ease-integration">Inter
<p>=&gt; Develop <code>RustCall.jl</code> library similar to <code>PyCall.jl</code> which can use cargo packager to build Rust pacakge and generate the necessary C-FFI shims for the two sides as follows:</p>
<ol type="1">
<li>Construct a SAT of the public interface of the Rust library</li>
<li></li>
<li>Limit the scope of supported types to be translated as follows:
<ul>
<li>Rust::<code>Result&lt;T, dyn Box&lt;Error&gt;&gt;</code> &lt;-&gt; Julia::<code>ResultType{T}</code>: indirect C-FFI WIP workout common representation</li>
<li>Rust::<code>Option&lt;T&gt;</code> &lt;-&gt; Julia::<code>Union{T, Nothing}</code>: simply use C++ union</li>
<li>Primitives
<ul>
<li>integer and floats can be directly converted</li>
<li><code>char*</code>, <code>CString</code>, <code>CStr</code>, Rust::<code>String</code>, Rust::<code>&amp;str</code>, Julia::<code>String</code>, Julia::<code>SubString</code> =&gt; These need special attentions</li>
</ul></li>
<li>enums: ==WARN Julia does not have a first class enum type==, but it depends on the global constant declaration similar to C. On the other side, Rust::<code>enum</code> is more similar to a Julia::<code>Union</code>. Also special care needs to be taken as a common design pattern in Julia is to do multiple dispatch on type hierarchies, whereas Rust dispatches over traits.</li>
<li>structs: Every Rust struct must be converted to a C repr struct in order to be exposed through the FFI. The same problem seems to occur with Julia</li>
</ul></li>
<li>While in Julia or structs are considered to be passed by reference, Rust defines, clone, immutable ref or mutable ref.
<ul>
<li>WIP: Write some simple tests to understand how structs behave in Julia, but from my observations so far, it’s either immutable or mutable ref based on <code>struct</code> definition rather than function definition.</li>
</ul></li>
</ol>


Expand Down
9 changes: 8 additions & 1 deletion search.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,13 @@
"section": "",
"text": "== WIP =="
},
{
"objectID": "posts/rust-abi.html#existing-solution",
"href": "posts/rust-abi.html#existing-solution",
"title": "Rust FFI to Julia",
"section": "Existing solution",
"text": "Existing solution\nYou can call Julia from Rust, using the exposed C FFI for Julia as leveraged by the jlrs crate, but we are also interested about the reverse."
},
{
"objectID": "posts/rust-abi.html#rust-abi",
"href": "posts/rust-abi.html#rust-abi",
Expand All @@ -81,6 +88,6 @@
"href": "posts/rust-abi.html#interim-solution-to-ease-integration",
"title": "Rust FFI to Julia",
"section": "Interim solution to ease integration",
"text": "Interim solution to ease integration\n=&gt; Develop RustCall.jl library similar to PyCall.jl which can use cargo packager to build Rust pacakge and generate the necessary C-FFI shims for the two sides as follows:\n\nConstruct a SAT of the public interface of the Rust library"
"text": "Interim solution to ease integration\n=&gt; Develop RustCall.jl library similar to PyCall.jl which can use cargo packager to build Rust pacakge and generate the necessary C-FFI shims for the two sides as follows:\n\nConstruct a SAT of the public interface of the Rust library\nLimit the scope of supported types to be translated as follows:\n\nRust::Result&lt;T, dyn Box&lt;Error&gt;&gt; &lt;-&gt; Julia::ResultType{T}: indirect C-FFI WIP workout common representation\nRust::Option&lt;T&gt; &lt;-&gt; Julia::Union{T, Nothing}: simply use C++ union\nPrimitives\n\ninteger and floats can be directly converted\nchar*, CString, CStr, Rust::String, Rust::&str, Julia::String, Julia::SubString =&gt; These need special attentions\n\nenums: ==WARN Julia does not have a first class enum type==, but it depends on the global constant declaration similar to C. On the other side, Rust::enum is more similar to a Julia::Union. Also special care needs to be taken as a common design pattern in Julia is to do multiple dispatch on type hierarchies, whereas Rust dispatches over traits.\nstructs: Every Rust struct must be converted to a C repr struct in order to be exposed through the FFI. The same problem seems to occur with Julia\n\nWhile in Julia or structs are considered to be passed by reference, Rust defines, clone, immutable ref or mutable ref.\n\nWIP: Write some simple tests to understand how structs behave in Julia, but from my observations so far, it’s either immutable or mutable ref based on struct definition rather than function definition."
}
]
10 changes: 5 additions & 5 deletions sitemap.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,22 @@
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://crisbour.github.io/blog/posts/welcome/index.html</loc>
<lastmod>2025-02-11T22:56:31.143Z</lastmod>
<lastmod>2025-02-11T23:14:56.004Z</lastmod>
</url>
<url>
<loc>https://crisbour.github.io/blog/posts/unreal-engine-nix.html</loc>
<lastmod>2025-02-11T22:56:31.143Z</lastmod>
<lastmod>2025-02-11T23:14:56.004Z</lastmod>
</url>
<url>
<loc>https://crisbour.github.io/blog/about.html</loc>
<lastmod>2025-02-11T22:56:31.143Z</lastmod>
<lastmod>2025-02-11T23:14:56.003Z</lastmod>
</url>
<url>
<loc>https://crisbour.github.io/blog/index.html</loc>
<lastmod>2025-02-11T22:56:31.143Z</lastmod>
<lastmod>2025-02-11T23:14:56.003Z</lastmod>
</url>
<url>
<loc>https://crisbour.github.io/blog/posts/rust-abi.html</loc>
<lastmod>2025-02-11T22:56:31.143Z</lastmod>
<lastmod>2025-02-11T23:14:56.004Z</lastmod>
</url>
</urlset>

0 comments on commit bd33799

Please sign in to comment.