shakedown.social is one of the many independent Mastodon servers you can use to participate in the fediverse.
A community for live music fans with roots in the jam scene. Shakedown Social is run by a team of volunteers (led by @clifff and @sethadam1) and funded by donations.

Administered by:

Server stats:

245
active users

#spacelua

0 posts0 participants0 posts today
Zef Hemel<p>7. Bridging Lua and JavaScript APIs and values was actually more doable than I anticipated. They map quite cleanly if you’re willing to make a few compromises. One of few issues is to deal with the fact that Lua just has one data structure: the table, which functions as a list, a map and can be used as a set as well. And again, its start indexing at 1. AT ONE!!!1</p><p>Introducing <a href="https://hachyderm.io/tags/SpaceLua" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>SpaceLua</span></a> in <a href="https://hachyderm.io/tags/SilverBullet" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>SilverBullet</span></a> has been one of the best decisions I've made in the last three years of SB development. I foreshadowed how it would develop here: <a href="https://youtu.be/t1oy_41bDAY" rel="nofollow noopener noreferrer" translate="no" target="_blank"><span class="invisible">https://</span><span class="">youtu.be/t1oy_41bDAY</span><span class="invisible"></span></a></p><p>And eventually this lead to a much cleaner SilverBullet v2. Intro video here: <a href="https://youtu.be/mik1EbTshX4" rel="nofollow noopener noreferrer" translate="no" target="_blank"><span class="invisible">https://</span><span class="">youtu.be/mik1EbTshX4</span><span class="invisible"></span></a></p>
Zef Hemel<p>Ok, so I’m now a few months into building a custom (almost from scratch) <a href="https://hachyderm.io/tags/Lua" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Lua</span></a> implementation for <span class="h-card" translate="no"><a href="https://fosstodon.org/@silverbulletmd" class="u-url mention" rel="nofollow noopener noreferrer" target="_blank">@<span>silverbulletmd</span></a></span> dubbed <a href="https://hachyderm.io/tags/SpaceLua" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>SpaceLua</span></a> (for reasons).</p><p>A few things that panned out really well, and a few surprises that I did not anticipate:</p><p>0. General recommendation: don’t do this. Don’t just implement a full programming language because you think it’s a good idea. I also told this myself. It didn’t work. It was a “I’ve don’t this stuff before, I can do it again” type of deal. I was mostly right. But don’t do this. </p><p>1. Initially I opted for a custom interpreter (implemented in TypeScript) because I wanted to expose asynchronous (promise based) JS APIs to Lua, and I didn’t see how to do that nicely with a <a href="https://hachyderm.io/tags/Wasm" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Wasm</span></a>-compiled version of the official Lua interpreter. Also I felt that having full control of the running system would turn out to be valuable down the line (I was right on this one). </p><p>2. I got the parser part mostly free. I found an existing Lua grammar for the Lezer parser library that <a href="https://hachyderm.io/tags/SilverBullet" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>SilverBullet</span></a> uses. Had to add a few things and had some struggles. This part was pretty seamless with a few glitches here and there.</p><p>3. Implementing the core interpreter runtime was actually quite easy. Lua is a mostly simple and small language. Again, I’ve done this before so that helped. Writing good test suites makes this doable and AI helped a lot generating those test suites (because it knows Lua).</p><p>4. What I didn’t anticipate is the pain in implementing the full Lua API, especially the `string.*` one which has its own pattern matching language (similar but distinct from regular expressions), which honestly I could do without. But it’s there, and people want to use it, so I need a full implementation. Issues keep coming up, though.</p>