<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<p><br>
</p>
<div class="moz-cite-prefix">On 08/23/2017 12:15 PM, Matthias Braun
wrote:<br>
</div>
<blockquote
cite="mid:DFE1F4D1-A7A7-4038-99BE-BA86D5BB0771@apple.com"
type="cite">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<div class="">For what it's worth: I also had very good
experiences with python "specifications" to generate code [1].</div>
<div class=""><br class="">
</div>
<div class="">Of course it's hard to justify switching all the
infrastructure just because of one missing tablegen feature...</div>
</blockquote>
<br>
I agree. As someone who has improved TableGen on occasion over the
years, however, I suspect that we'll continue to run into these
things. Plus, given the number of out-of-tree users, at least,
auto-generating their .td inputs, I think we're actually well past
one missing feature (although obviously there could be unrelated
motivations as well). At some point, improving TableGen, at least as
an input language, may have become a sub-optimal use of our time
(even if it does look nicer than Python in some cases).<br>
<br>
-Hal<br>
<br>
<blockquote
cite="mid:DFE1F4D1-A7A7-4038-99BE-BA86D5BB0771@apple.com"
type="cite">
<div class=""><br class="">
</div>
<div class="">- Matthias</div>
<div class=""><br class="">
</div>
<div class="">[1] Example spec + template: <a
moz-do-not-send="true"
href="https://github.com/libfirm/libfirm/blob/master/scripts/ir_spec.py"
class="">https://github.com/libfirm/libfirm/blob/master/scripts/ir_spec.py</a></div>
<div class=""> <a moz-do-not-send="true"
href="https://github.com/libfirm/libfirm/blob/master/scripts/templates/gen_irio.c"
class="">https://github.com/libfirm/libfirm/blob/master/scripts/templates/gen_irio.c</a></div>
<br class="">
<div>
<blockquote type="cite" class="">
<div class="">On Aug 23, 2017, at 9:35 AM, Jakob Stoklund
Olesen via llvm-dev <<a moz-do-not-send="true"
href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a>>
wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space;
-webkit-line-break: after-white-space;" class=""><br
class="">
<div class="">
<blockquote type="cite" class="">
<div class="">On Aug 22, 2017, at 14:15, Hal Finkel
via llvm-dev <<a moz-do-not-send="true"
href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a>>
wrote:</div>
<br class="Apple-interchange-newline">
<div class=""><span style="font-family: Menlo-Regular;
font-size: 12px; font-style: normal;
font-variant-caps: normal; font-weight: normal;
letter-spacing: normal; text-align: start;
text-indent: 0px; text-transform: none;
white-space: normal; word-spacing: 0px;
-webkit-text-stroke-width: 0px; float: none;
display: inline !important;" class="">For
situations well beyond TableGen's current language
capabilities, we have a decision to make. We can
continue extending TableGen until it can meet
those needs. Alternatively, we can enable the use
of some more-powerful input language. For example,
we could allow TableGen to embed Python, and then
use Python in order to generate record
definitions.</span></div>
</blockquote>
</div>
<br class="">
<div class="">For a project that’s not LLVM, I recently
had the opportunity to replace both TableGen and *.td
files with Python scripts. I found that TableGen’s
features were easily matched by Python’s for loops and
the ability to define functions. I am pretty happy with
the approach so far. AMA</div>
<div class=""><br class="">
</div>
<div class="">This is a lot easier to do in a green field
project than in an old project like LLVM, of course.</div>
<div class=""><br class="">
</div>
<div class="">Example “.td” file: <a
moz-do-not-send="true"
href="https://github.com/stoklund/cretonne/blob/master/lib/cretonne/meta/isa/riscv/encodings.py"
class="">https://github.com/stoklund/cretonne/blob/master/lib/cretonne/meta/isa/riscv/encodings.py</a></div>
<div class=""><br class="">
</div>
<div class="">Thanks,</div>
<div class="">/jakob</div>
</div>
_______________________________________________<br class="">
LLVM Developers mailing list<br class="">
<a moz-do-not-send="true"
href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a><br
class="">
<a class="moz-txt-link-freetext" href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br
class="">
</div>
</blockquote>
</div>
<br class="">
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
Hal Finkel
Lead, Compiler Technology and Programming Languages
Leadership Computing Facility
Argonne National Laboratory</pre>
</body>
</html>