<div dir="ltr"><div>I'd say the biggest practical advantage of embedding it is that it removes friction from using it and facilitates platform independence. I'm guessing that's why Exasol embedded it as well. It was the same motivation as for Luasocket. Plus it is possible that speed matters more in a database engine.</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Mar 23, 2023 at 7:54 AM Aaron Sherber <<a href="mailto:aaron@sherber.com">aaron@sherber.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">I find speed comparisons not highly relevant in situations like this, because we're talking about at most a handful of operations at a time. For example, look at the speed comparisons at the bottom of the page here: <a href="http://lua-users.org/wiki/JsonModules" target="_blank">http://lua-users.org/wiki/JsonModules</a> Speeds range from 0.5 sec to 122 sec -- for 100000 iterations. That means even the slowest time was just over 1 millisec per iteration. Make it an order of magnitude or two slower, and a human being can't tell the difference.<br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">I'm not saying I'd be opposed to embedding a JSON encoder -- I'm just trying to understand what the practical advantages might be.</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">I'm also curious: How do you see Finale interacting with web services?</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Aaron.</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Mar 22, 2023 at 11:26 PM Robert Patterson <<a href="mailto:robert@robertgpatterson.com" target="_blank">robert@robertgpatterson.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>There are two main reasons for CJSON in particular. One leads to the other:</div><div><br></div><div>1. CJSON is a pure C implementation, which means it is <a href="https://kyne.com.au/~mark/software/lua-json-performance.html" target="_blank">more than an order of magnitude faster than dkjson</a>.</div><div>2. Once we are talking about a C implementation, the dependencies start to magnify. I embedded Luasocket and Luaosutils for the same reason. Embedding means there is no extra cruft outside your script, and the same script is usable on either platform.</div><div><br></div><div>I see JSON as potentially becoming more important to Finale Lua since I have added https post to luaosutils. (It's already available in the experimental version of RGP Lua I released, called <a href="http://internet.post" target="_blank">internet.post</a>.) If we start integrating Finale with web services, which is a capability I have in mind, JSON is likely to be a critical component of it.</div><div><br></div><div>BTW: I desperately wanted to use Luasocket for http, but for https it requires LuaSec, and LuaSec has exploding dependencies. By contrast, Luaosutils is lightweight and uses os-level services on Mac and Win to send/receive data.</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Mar 22, 2023 at 7:28 PM Aaron Sherber <<a href="mailto:aaron@sherber.com" target="_blank">aaron@sherber.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">What would be the advantages of embedding it with Lua as opposed to the current method of requiring it (from src/lunajson) when it's needed?<br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Aaron.</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Mar 22, 2023 at 8:05 PM Robert Patterson <<a href="mailto:robert@robertgpatterson.com" target="_blank">robert@robertgpatterson.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>I just discovered that the Exasol database engine has an embedded Lua interpreter similar to ours. I found a series of blog posts about their efforts to upgrade from Lua 5.1 to Lua 5.4 (written last November.)</div><div><br></div><div>Like us, they embed LuaSocket. Another thing they do is embed cjson. Is that something we should think about doing for our embedded Lua? I already know of three Finale Lua scripts that use a json formatter, and there will probably be more.</div><div><br></div><div>Robert</div><div><br></div></div>
_______________________________________________<br>
JWLua mailing list<br>
<a href="mailto:JWLua@jwmusic.nu" target="_blank">JWLua@jwmusic.nu</a><br>
<a href="http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu" rel="noreferrer" target="_blank">http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu</a><br>
</blockquote></div>
_______________________________________________<br>
JWLua mailing list<br>
<a href="mailto:JWLua@jwmusic.nu" target="_blank">JWLua@jwmusic.nu</a><br>
<a href="http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu" rel="noreferrer" target="_blank">http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu</a><br>
</blockquote></div>
_______________________________________________<br>
JWLua mailing list<br>
<a href="mailto:JWLua@jwmusic.nu" target="_blank">JWLua@jwmusic.nu</a><br>
<a href="http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu" rel="noreferrer" target="_blank">http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu</a><br>
</blockquote></div>
_______________________________________________<br>
JWLua mailing list<br>
<a href="mailto:JWLua@jwmusic.nu" target="_blank">JWLua@jwmusic.nu</a><br>
<a href="http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu" rel="noreferrer" target="_blank">http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu</a><br>
</blockquote></div>