<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@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;}
/* Style Definitions */
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.EmailStyle22
{mso-style-type:personal-compose;
font-family:"Aptos",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;
mso-ligatures:none;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
/* List Definitions */
@list l0
{mso-list-id:1296719266;
mso-list-template-ids:-637245734;}
@list l0:level1
{mso-level-tab-stop:.5in;
mso-level-number-position:left;
text-indent:-.25in;}
@list l0:level2
{mso-level-tab-stop:1.0in;
mso-level-number-position:left;
text-indent:-.25in;}
@list l0:level3
{mso-level-tab-stop:1.5in;
mso-level-number-position:left;
text-indent:-.25in;}
@list l0:level4
{mso-level-tab-stop:2.0in;
mso-level-number-position:left;
text-indent:-.25in;}
@list l0:level5
{mso-level-tab-stop:2.5in;
mso-level-number-position:left;
text-indent:-.25in;}
@list l0:level6
{mso-level-tab-stop:3.0in;
mso-level-number-position:left;
text-indent:-.25in;}
@list l0:level7
{mso-level-tab-stop:3.5in;
mso-level-number-position:left;
text-indent:-.25in;}
@list l0:level8
{mso-level-tab-stop:4.0in;
mso-level-number-position:left;
text-indent:-.25in;}
@list l0:level9
{mso-level-tab-stop:4.5in;
mso-level-number-position:left;
text-indent:-.25in;}
@list l1
{mso-list-id:1310020691;
mso-list-template-ids:1905421276;}
@list l1:level1
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:.5in;
mso-level-number-position:left;
text-indent:-.25in;
mso-ansi-font-size:10.0pt;
font-family:Symbol;}
@list l1:level2
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:1.0in;
mso-level-number-position:left;
text-indent:-.25in;
mso-ansi-font-size:10.0pt;
font-family:Symbol;}
@list l1:level3
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:1.5in;
mso-level-number-position:left;
text-indent:-.25in;
mso-ansi-font-size:10.0pt;
font-family:Symbol;}
@list l1:level4
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:2.0in;
mso-level-number-position:left;
text-indent:-.25in;
mso-ansi-font-size:10.0pt;
font-family:Symbol;}
@list l1:level5
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:2.5in;
mso-level-number-position:left;
text-indent:-.25in;
mso-ansi-font-size:10.0pt;
font-family:Symbol;}
@list l1:level6
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:3.0in;
mso-level-number-position:left;
text-indent:-.25in;
mso-ansi-font-size:10.0pt;
font-family:Symbol;}
@list l1:level7
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:3.5in;
mso-level-number-position:left;
text-indent:-.25in;
mso-ansi-font-size:10.0pt;
font-family:Symbol;}
@list l1:level8
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:4.0in;
mso-level-number-position:left;
text-indent:-.25in;
mso-ansi-font-size:10.0pt;
font-family:Symbol;}
@list l1:level9
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:4.5in;
mso-level-number-position:left;
text-indent:-.25in;
mso-ansi-font-size:10.0pt;
font-family:Symbol;}
ol
{margin-bottom:0in;}
ul
{margin-bottom:0in;}
--></style>
</head>
<body lang="EN-US" link="blue" vlink="purple" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt">Yes, clang.jl only supports C but you make it sound as if it was a very limited product. But it’s not. Right, wrapped libraries need different amounts of handwritten code, and care must be taken on managing
the memory owners and when it can be freed without crashing. ArchGDAL has a lot of code that was made in response to interaction with other Julia packages and to make upper level functions.<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">I don’t use Python, but from what I’ve seen all Python bindings examples can be reproduced in Julia. And more, in the Julia GMT wrapper (GMT.jl) I picked some parts of ArchGDAL and extended to wrap the most
used GDAL CLI programs (gdaltranslate, gdalwarp, ogr2ogr, etc…)<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">Online (and the only so far </span>
<span style="font-size:11.0pt;font-family:"Segoe UI Emoji",sans-serif">😊</span><span style="font-size:11.0pt">) help for gdalwap<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">help?> gdalwarp<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"> gdalwarp(indata, options=String[]; dest="/vsimem/tmp", kwargs...)<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"> Image/Grid reprojection and warping function.<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"> Args<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"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> • indata: Input data. It can be a file name, a GMTgrid or GMTimage object or a GDAL dataset<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"> • options: List of options. The accepted options are the ones of the gdal_translate utility. This list can be in the form of a vector<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> of strings, or joined in a single string. The accepted options are the ones of the gdalwarp utility.<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"> • kwargs: Besides what was mentioned above one can also use meta=metadata, where metadata is a string vector with the form "NAME=...."<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> for each of its elements. This data will be recognized by GDAL as Metadata. The kwargs may also contain the GMT region (-R), proj<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> (-J), inc (-I) and save=fname options.<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"> Returns<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"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> A GMT grid or Image, or a GDAL dataset (or nothing if file was writen on disk).<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"><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"> Momtchil Momtchev <momtchil@momtchev.com>
<br>
<b>Sent:</b> Sunday, February 2, 2025 3:23 PM<br>
<b>To:</b> Joaquim Manuel Freire Luís <jluis@ualg.pt>; gdal-dev@lists.osgeo.org<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>
<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.<o:p></o:p></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.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">On 01/02/2025 23:45, Joaquim Manuel Freire Luís wrote:<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<ol style="margin-top:0in" start="1" type="1">
<li class="MsoListParagraph" style="margin-left:0in;mso-list:l0 level1 lfo3">Surely the 100% handwritten bindings - such as PDAL for C# or GDAL for Node.js or Julia<o:p></o:p></li></ol>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Hi,</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span><o:p></o:p></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.</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Joaquim</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span><o:p></o:p></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 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 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... ?)</span><o:p></o:p></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"><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>
</blockquote>
</div>
</body>
</html>