# I've written a Lua-like scripting langauge for Elm

**URL:** <https://discourse.elm-lang.org/t/ive-written-a-lua-like-scripting-langauge-for-elm/7678>\
**Category:** Request Feedback\
**Created:** [August 17, 2021, 7:06pm UTC](https://discourse.elm-lang.org/t/ive-written-a-lua-like-scripting-langauge-for-elm/7678 "2021-08-17T19:06:06Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lucas\_Payr](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/lucas_payr/32/4993_2.png) [@Lucas\_Payr](https://discourse.elm-lang.org/u/Lucas_Payr)\
**Post date:** [August 17, 2021, 7:06pm UTC](https://discourse.elm-lang.org/t/ive-written-a-lua-like-scripting-langauge-for-elm/7678/1 "2021-08-17T19:06:06Z")

</div>

So here’s a weird thing that happened: I heard that it is possible to write a (interpreter for a small) programming language in one weekend, so I tried and yes it’s possible.

The project began with me needing a multiparadim scripting languages that can be interpreted by elm. Because nobody has done this before, I decided to work on a Lua based language. Originally, I wanted to stay as true to Lua as possible, but there are a few things (like variables being global by default) that I refused to implement.

I’ve nothing yet to show (mostly because I want to finish the documentation before i share the repos) but here a quick code snipped:

```elm
let success = "great";
mut out = null;
out =
  if { mut a = out; --out is immutible inside this scope
    a = 
      40
        . Number::plus 2 --Number is an extension to the language
        . eq 42; --the definition of eq is written in a seperate Elm package
    a --a body always ends with an expression
  }
  success
  out;
out --Returns "great".

```

Now the thing is, this a nice little language and all, but I can’t support an ecosystem for it. In the best case, I would not have created a new language to begin with.

I’m willing to start from scratch, if someone can point me towards an existing language that

- is small (enough, so that i can write an interpreter in a weekend)
- is multiparadime
- dynamically typed (type checkers are hard work to write \>.\<)
- is extendable (just like lua)
- has a c-like syntax (i know lisp exists, i just don’t like its syntax)

---

<div class="post-metadata">

**Author:** ![pd-andy](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/pd-andy/32/4145_2.png) [@pd-andy](https://discourse.elm-lang.org/u/pd-andy)\
**Post date:** [August 17, 2021, 7:10pm UTC](https://discourse.elm-lang.org/t/ive-written-a-lua-like-scripting-langauge-for-elm/7678/2 "2021-08-17T19:10:26Z")

</div>

You should come join us in #language-implementation on the slack! When you open up the repo let me know and I’ll add it to the [awesome-elm-pltd](https://www.github.com/pd-andy/awesome-elm-pltd) list.

Looks really cool.

---

<div class="post-metadata">

**Author:** ![pd-andy](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/pd-andy/32/4145_2.png) [@pd-andy](https://discourse.elm-lang.org/u/pd-andy)\
**Post date:** [August 17, 2021, 7:12pm UTC](https://discourse.elm-lang.org/t/ive-written-a-lua-like-scripting-langauge-for-elm/7678/3 "2021-08-17T19:12:29Z")

</div>

I actually pondered whether or not writing an elm-based interpreter for [Ren](https://www.github.com/ren-lang/compiler) would be valuable. I’m not entirely sure whether you could get it going in a weekend but I’d be happy to help if you think it’s any good.

---

<div class="post-metadata">

**Author:** ![Lucas\_Payr](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/lucas_payr/32/4993_2.png) [@Lucas\_Payr](https://discourse.elm-lang.org/u/Lucas_Payr)\
**Post date:** [August 17, 2021, 7:16pm UTC](https://discourse.elm-lang.org/t/ive-written-a-lua-like-scripting-langauge-for-elm/7678/4 "2021-08-17T19:16:30Z")

</div>

that repos is really cool. I didn’t know that this many (if any) lisp interpreters existed. I looked for “lang” on [package.elm-lang.org](http://package.elm-lang.org) but didn’t find much.

---

<div class="post-metadata">

**Author:** ![pd-andy](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/pd-andy/32/4145_2.png) [@pd-andy](https://discourse.elm-lang.org/u/pd-andy)\
**Post date:** [August 17, 2021, 7:21pm UTC](https://discourse.elm-lang.org/t/ive-written-a-lua-like-scripting-langauge-for-elm/7678/5 "2021-08-17T19:21:19Z")

</div>

Right? That’s why I started it, there’s a small collection of people exploring PL in Elm but it’s been quite disjoint and silo’d for a while, do join us in the slack if you use it 😇

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/elm_lang/original/1X/50a05e53677a2c3b47776d7abd0f113eb50193a1.png) [@system](https://discourse.elm-lang.org/u/system)\
**Post date:** [August 27, 2021, 7:21pm UTC](https://discourse.elm-lang.org/t/ive-written-a-lua-like-scripting-langauge-for-elm/7678/6 "2021-08-27T19:21:49Z")

</div>

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.
