<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p><br>
</p>
<p>clang.jl is a very feature-light pybind11-style wrapper
generator. It does not support C++, objects, inheritance,
overloading, type downcasting and upcasting, iterators, n:m
argument mapping, exceptions and many other advanced features. It
even lacks interaction with the garbage collector relying on the
user manually freeing the returned C data structures. All these
features would require extensive manual wrapping work to
implement. This is the major strength of SWIG - because you can
implement those advanced features with minimal amount of work if
you are willing to accept its very steep learning curve.</p>
<p>I don't use Julia, but I can still see that GDAL.jl is far below
the level of the Python bindings which I know quite well. There is
a higher level API built on top of it - ArchGDAL.jl - but it seems
to be completely handwritten.<br>
</p>
<br>
<div class="moz-cite-prefix">On 01/02/2025 23:45, Joaquim Manuel
Freire Luís wrote:<br>
</div>
<blockquote type="cite"
cite="mid:AM6PR04MB6440A5314559B47C029CD12EA6EB2@AM6PR04MB6440.eurprd04.prod.outlook.com">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="Generator"
content="Microsoft Word 15 (filtered medium)">
<style>@font-face
{font-family:Wingdings;
panose-1:5 0 0 0 0 0 0 0 0 0;}@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}@font-face
{font-family:Aptos;}p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
font-size:12.0pt;
font-family:"Aptos",sans-serif;}a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
{mso-style-priority:34;
margin-top:0in;
margin-right:0in;
margin-bottom:0in;
margin-left:.5in;
font-size:12.0pt;
font-family:"Aptos",sans-serif;}span.EmailStyle19
{mso-style-type:personal-reply;
font-family:"Aptos",sans-serif;
color:windowtext;}.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;
mso-ligatures:none;}div.WordSection1
{page:WordSection1;}ol
{margin-bottom:0in;}ul
{margin-bottom:0in;}</style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
<div class="WordSection1">
<ul style="margin-top:0in" type="disc">
<li class="MsoListParagraph"
style="margin-left:0in;mso-list:l0 level1 lfo1">Surely the
100% handwritten bindings - such as PDAL for C# or GDAL for
Node.js or Julia<span style="font-size:11.0pt"><o:p></o:p></span></li>
</ul>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Hi,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Just a small
clarification, the Julia bindings are a 100% automatic
creation and cost very little, when one knows how to do it.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Joaquim<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<div>
<div
style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif">
gdal-dev <a class="moz-txt-link-rfc2396E" href="mailto:gdal-dev-bounces@lists.osgeo.org"><gdal-dev-bounces@lists.osgeo.org></a>
<b>On Behalf Of </b>Momtchil Momtchev via gdal-dev<br>
<b>Sent:</b> Saturday, February 1, 2025 10:09 PM<br>
<b>To:</b> <a class="moz-txt-link-abbreviated" href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a><br>
<b>Subject:</b> Re: [gdal-dev] CSharp bindings queued
for removal (was Re: GDAL CSharp bindings
maintainers/contributors listening... ?)<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p><o:p> </o:p></p>
<div>
<p class="MsoNormal">On 31/01/2025 23:31, Howard Butler via
gdal-dev wrote:<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<div>
<p class="MsoNormal">On Jan 31, 2025, at 8:18<span
style="font-family:"Arial",sans-serif"> </span>AM,
Even Rouault via gdal-dev
<a href="mailto:gdal-dev@lists.osgeo.org"
moz-do-not-send="true"><gdal-dev@lists.osgeo.org></a>
wrote:<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">My experience with GDAL informed what
we did with PDAL. The first thing was to not use SWIG.
Lessons were learned, as they say :) The approach of a
single unified language binding generator was in fashion
in the 1990s at the same time as using UML to
automatically write software. History has shown both of
these things to have frustrating consequences.<o:p></o:p></p>
</div>
</div>
</blockquote>
<p><o:p> </o:p></p>
<p>In 2025 SWIG still has no alternatives. It is surely dated
and it may be time to think about a successor project, but
currently I am not aware of anyone actually working on it.<o:p></o:p></p>
<p>Recently there has been a new way to do it, pioneered by
Boost and made very popular by the pybind11 project. This same
approach has been copied by embind in emscripten/WASM and I
also have my own nobind17 for Node.js. Even if these are much
faster to learn and easier to maintain - because they do not
require a special and very awkward specific language -
everything is only C++ - they lack many of the advanced
features that allow a very large library such as GDAL to have
a fully native feel - especially one that has not been
designed from scratch to be used from a higher-level language.<o:p></o:p></p>
<p>Surely the 100% handwritten bindings - such as PDAL for C# or
GDAL for Node.js or Julia - have their advantages, but the
development cost is orders of magnitude higher. If I was to
start GDAL for Node.js from scratch, I was surely going to use
SWIG. Both GDAL for Node.js and GDAL for Julia use handwritten
code because at the time of their creation, SWIG did not have
good support for those languages. PDAL's API is orders of
magnitude smaller than GDAL and it has been designed to be
used from a higher-level language.<o:p></o:p></p>
<p>I personally think that the future belongs to a project that
will use the LLVM front-end and produce pybind11-like code,
but this project does not exist. NativeScript is going in this
direction for JavaScript, but they too, they lack many of the
advanced SWIG features.<o:p></o:p></p>
<p>Now, of course, if there is no one to work on GDAL for C#,
there is nothing to be done. It is unlikely there will ever be
onboarding for this, as its cost is far too great for
something that probably will be used only once. I am afraid
that there are no real alternatives besides SWIG.<o:p></o:p></p>
</div>
</blockquote>
</body>
</html>