[PATCH] D142364: [LLVM][TableGen] Notebook describing how to write a Python backend
David Spickett via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 23 07:14:23 PST 2023
DavidSpickett created this revision.
Herald added a project: All.
DavidSpickett requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
This tutorial uses the dump json option to write a backend for
SQL queries.
It is based on the work of Min-Yih Hsu:
- https://github.com/mshockwave/SQLGen
- https://www.youtube.com/watch?v=UP-LBRbvI_U
I hope that having the same concepts in 3 forms will allow people
to choose the style that fits them.
The main drawback here being that it's in Python. C++ can be used
in a notebook (https://github.com/jupyter-xeus/xeus-cling) but I
decided against it for a few reasons:
- Python is the default for Jupyter, no extra installs needed.
- Having the code in a second language may help people who know one or the other.
- There is no upstream example of a JSON powered backend. (and although we would be unlikely to accept one upstream, I think it's a great option for quick development before translating into C++)
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D142364
Files:
llvm/utils/TableGen/jupyter/sql_query_backend.ipynb
llvm/utils/TableGen/jupyter/sql_query_backend.md
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D142364.491363.patch
Type: text/x-patch
Size: 58169 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230123/543c7c73/attachment.bin>
More information about the llvm-commits
mailing list