<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p><br>
</p>
<div class="moz-cite-prefix">On 31/01/2025 23:31, Howard Butler via
gdal-dev wrote:<br>
</div>
<blockquote type="cite"
cite="mid:BAC68EDE-C93A-499C-ACB8-177CDAE5AC05@hobu.co">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div dir="auto"
style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;">On
Jan 31, 2025, at 8:18 AM, Even Rouault via gdal-dev
<a class="moz-txt-link-rfc2396E" href="mailto:gdal-dev@lists.osgeo.org"><gdal-dev@lists.osgeo.org></a> wrote:<br>
<div><br>
</div>
<div>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.</div>
</div>
</blockquote>
<p><br>
</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.</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.</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.<br>
</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.</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.<br>
</p>
</body>
</html>