<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">Hi Jacob,</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">On 4/10/19 11:21 AM, jacob navia via
llvm-dev wrote:<br>
</div>
<blockquote type="cite"
cite="mid:6dc7cf4d-0369-151b-369a-f33148879b25@jacob.remcomp.fr">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<p><tt>Dear Sir/Madam</tt></p>
<p><tt><br>
</tt></p>
<p><tt>Our company</tt><tt>, 4Js software, has developed an SQL
data base software that runs under different operating
systems: Windows, Linux, Mac OS X. This software compiles each
SQL statement into a C program that is compiled "on the fly"
and executed by our JIT, Just In Time compiler.</tt></p>
<p><tt>We wanted to port it to Apple's iOS, and spent a lot of
time retargetting the JIT for supporting the ARM 64 CPU, but
to our surprise, when everything was ready, we learned that
Apple iOS forbids software to generate dynamically an
executable.</tt></p>
<p><tt>After several months of reflections we think we can get
around this problem by using a C interpreter. Instead of
compiling it to machine code, we would pass the generated C
program to a C interpreter that would interpret the C
program.</tt></p>
<p><tt>After looking at several interpreters, we think that the
llvm based CLING interpreter could do the job. To test these
ideas, we have recompiled the llvm/Clang system in a small
linux/ARM64 based machine. Our preliminary tests seem to work
and cling is able to load the generated program.<br>
</tt></p>
<p><tt>There are several possible problems that we see.</tt></p>
<p><tt><br>
</tt></p>
<p><tt>The first and most obvious one is the incredible size of
the CLING interpreter (200MB stripped). Our whole data base is
80MB stripped. We are targetting an Apple iPad, boosted with
1TO SSD/6GB RAM.</tt></p>
</blockquote>
How do you do the strip? I have nightly releases of cling here:
<a class="moz-txt-link-freetext" href="https://github.com/vgvassilev/cling/releases">https://github.com/vgvassilev/cling/releases</a> the release is around
23MB and unzipped is around 80. I am pretty sure we can strip it
further down.
<blockquote type="cite"
cite="mid:6dc7cf4d-0369-151b-369a-f33148879b25@jacob.remcomp.fr">
<p><tt> What would be the minimum requirements for CLING in terms
of RAM size?</tt></p>
</blockquote>
That's a hard question: running `./bin/cling ".q"` shows around
23Mb peak rss. `./bin/cling "#include <vector>" ".q"` shows 34
Mb and so on. It depends on what sort of things you will be
compiling/interpreting.<br>
<blockquote type="cite"
cite="mid:6dc7cf4d-0369-151b-369a-f33148879b25@jacob.remcomp.fr">
<p><tt>The second question is that we have still concerns over the
overall approach. Do you see any problems with this
architecture? Can it work on principle?</tt></p>
<p><tt>The third question concerns the feasibility of our JIT
generating byte codes for the LLVM interpreter, boosting
performance and reducing RAM footprint. Would that be a better
solution than using the CLING interpreter? Is that possible
within Apple's iOS?</tt></p>
<p><tt>And yet another question is the need to modify the CLING
interpreter so that it receives its input from a character
buffer instead of a file, and other small tweaks. Is that
possible?</tt></p>
</blockquote>
`./bin/cling '#include <iostream>' 'printf("hello
world!\n");'` works. Did you mean a different use-case?<br>
<blockquote type="cite"
cite="mid:6dc7cf4d-0369-151b-369a-f33148879b25@jacob.remcomp.fr">
<p><tt>Are there any copyright issues? Are we allowed to embed the
llvm software into our system? Of course we would publish any
modifications done to the source code.<br>
</tt></p>
</blockquote>
<p> I am not a lawyer. LLVM is licensed under a MIT-like
(University of Illinois/NCSA) license (soon will be Apache-2.0).
Cling is dual licensed under "UI/NCSAOSL" and "LGPL".</p>
<p> Let me know if you need any further help on cling!<br>
</p>
<p>Best, Vassil<br>
</p>
<blockquote type="cite"
cite="mid:6dc7cf4d-0369-151b-369a-f33148879b25@jacob.remcomp.fr">
<p><tt> </tt></p>
<p><tt>We thank you in advance for any answers to the questions
above.</tt></p>
<p><tt><br>
</tt></p>
<p><tt>Yours sincerely</tt></p>
<p><tt><br>
</tt></p>
<p><tt>Jacob Navia</tt></p>
<p><tt>iOS Project Manager</tt></p>
<p><tt>4Js Software. <a class="moz-txt-link-freetext"
href="https://4js.com" moz-do-not-send="true">https://4js.com</a></tt><tt><br>
</tt><tt><span class="w8qArf" style="font-weight: bolder;
caret-color: rgb(34, 34, 34); color: rgb(34, 34, 34);
font-style: normal; font-variant-caps: normal;
letter-spacing: normal; text-align: left; text-indent: 0px;
text-transform: none; white-space: normal; word-spacing:
0px; -moz-text-size-adjust: auto; -webkit-text-stroke-width:
0px; text-decoration: none;"><span
class="Apple-converted-space"></span></span></tt><tt><span
class="LrzXr" style="caret-color: rgb(34, 34, 34); color:
rgb(34, 34, 34); font-style: normal; font-variant-caps:
normal; font-weight: normal; letter-spacing: normal;
text-align: left; text-indent: 0px; text-transform: none;
white-space: normal; word-spacing: 0px;
-moz-text-size-adjust: auto; -webkit-text-stroke-width: 0px;
text-decoration: none;">28 Quai Gallieni, 92150 Suresnes</span></tt></p>
<p><tt><span class="LrzXr" style="caret-color: rgb(34, 34, 34);
color: rgb(34, 34, 34); font-family: arial, sans-serif;
font-style: normal; font-variant-caps: normal; font-weight:
normal; letter-spacing: normal; orphans: auto; text-align:
left; text-indent: 0px; text-transform: none; white-space:
normal; widows: auto; word-spacing: 0px;
-webkit-text-size-adjust: auto; -webkit-text-stroke-width:
0px; text-decoration: none;"><tt>FRANCE</tt><br>
</span></tt></p>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
LLVM Developers mailing list
<a class="moz-txt-link-abbreviated" href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>
<a class="moz-txt-link-freetext" href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a>
</pre>
</blockquote>
<p><br>
</p>
</body>
</html>