<turbo-stream action="append" target="posts_list"><template>    <div class="postbit" id="296635" data-post-id="296635">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="LostKobrakai" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/LostKobrakai/120/3072_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  LostKobrakai
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="gavid" data-post="10" data-topic="57374">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/gavid/48/31806_2.png" class="avatar"> gavid:</div>
<blockquote>
<p>By the way, my code above rejects your last example because <code>:=</code> is not among the white-listed atoms.</p>
</blockquote>
</aside>
<p>If you don’t even allow variable assignment, what is actually allowed by this? That constraint suggests even more that there are simpler ways to accomplish things.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="296635" data-batch-url="/posts/batch_likers">
                        3
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/can-you-break-this-safe-interpreter/57374/12">Post #11</a>
	                </div>
	            </div>
              <div id="likers-container-296635" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="296635"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #11"></div>
  </section>
</div>
    <div class="postbit" id="297103" data-post-id="297103">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="Onor.io" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/Onor.io/120/960_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  Onor.io
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>May I humbly suggest that you incorporate LFE code?  I mean Lisp is way better at that whole macro expansion thing anyway. I mean rather than trying to write a “safe” interpreter in Elixir, call out to LFE code and use that to generate the BEAM code.</p>
<p>Just a suggestion, of course.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="297103" data-batch-url="/posts/batch_likers">
                        2
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/can-you-break-this-safe-interpreter/57374/13">Post #12</a>
	                </div>
	            </div>
              <div id="likers-container-297103" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="297103"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #12"></div>
  </section>
</div>
    <div class="postbit" id="297125" data-post-id="297125">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="gavid" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/gavid/120/31806_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  gavid
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>The purpose here is to essentially create a subset of Elixir that can only be used for declaring values and cannot be used for any kind of computation or logic (or anything that would break or crash the system). Basically Elixir as a configuration language/data format e.g. JSON.</p>
<p>So then why not use JSON (or some other language that is already inherently declarative)? We already do. It’s just that for certain components of the system, because it makes such extensive use of Elixir meta-programming, it is easier to use a language that is directly compatible with Elixir and does not need additional parsing and interpretation.</p>
<p>With regards to the suggestions here to use Lua, Dune, LFE etc. I do appreciate the suggestions but they would not help me here. I would instead be stuck trying to create a declarative subset of Lua etc.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="297125" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/can-you-break-this-safe-interpreter/57374/14">Post #13</a>
	                </div>
	            </div>
              <div id="likers-container-297125" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="297125"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #13"></div>
  </section>
</div>
    <div class="postbit" id="297137" data-post-id="297137">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="jhogberg" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/jhogberg/120/24176_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  jhogberg
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Erlang Core Team</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="gavid" data-post="14" data-topic="57374">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/gavid/48/31806_2.png" class="avatar"> gavid:</div>
<blockquote>
<p>The purpose here is to essentially create a subset of Elixir that can only be used for declaring values and cannot be used for any kind of computation or logic (or anything that would break or crash the system). Basically Elixir as a configuration language/data format e.g. JSON.</p>
</blockquote>
</aside>
<p>You already have the AST so a simple tree-walking interpreter for that tiny subset shouldn’t take very long to write. I think you could’ve finished one in the time you’ve spent on this thread, only having to deal with literals makes things very easy. <img src="https://forum.elixirforum.com/images/emoji/apple/smiley.png?v=15" title=":smiley:" class="emoji" alt=":smiley:" loading="lazy" width="20" height="20"></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="297137" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/can-you-break-this-safe-interpreter/57374/15">Post #14</a>
	                </div>
	            </div>
              <div id="likers-container-297137" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="297137"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-last-post cat-last-post" title="Last post!"></div>
  </section>
</div>
</template></turbo-stream><turbo-stream action="replace" target="load-more-container"><template><div id="load-more-container" class="load-more-container">
    <span class="all-loaded">— All posts loaded —</span>
</div></template></turbo-stream>