1. 23
  1. 7

    Ok but why this instead of eg lua, moonscript, fennel, fe, guile, any forth core, etc?

    1. 10

      Why not?

      1. 4

        maybe a better question is: why is this particularly interesting vs. the many other languages that fill this niche? my impression is that the main selling point is that it’s “easy to pick up”, but I’m curious how it compares in terms of performance, etc to some of the others OP listed.

        1. 2

          If I am embedding a language, it’s because I want people to program my system. That means I want a language that they’re likely to know already. Lua and JavaScript have a pretty large installed base and a lot of people know them. Embedding Lua or one of half a dozen lightweight JavaScript interpreters (jsquick seems to be the fashionable one now, I quite like DukTape) means that there’s a good chance that people using my scripting environment can do so and they can reuse any nice helpers that they or others have written.

          An alternative would need to offer something compelling. Is it easier to use? Faster? Supporting multicore systems better?

          1. 1

            Asking the real questions :)

        2. 5

          Very wren vibes from the website

          1. 5

            PocketLang - a small, fast and friendly language for scripting and embedding

            From the GitHub page:

            The language is written using Wren Language and their wonderful book Crafting Interpreters as a reference.

          2. 2

            I’ve never seen elsif before

            1. 10

              You might also like alas if in squire. :)

              journey sq_dump(args) {
                  arg = run(args.a1)
                  if kindof(arg) == 'string' { proclaim('String(' + arg + ')') }
                  alas if kindof(arg) == 'number' { proclaim('Number(' + string(arg) + ')') }
                  alas if kindof(arg) == 'boolean' { proclaim('Boolean(' + string(arg) + ')') }
                  alas if kindof(arg) == 'unbenknownst' { proclaim('Null()') }
                  alas { dump(arg) }
                  reward arg
              1. 1

                Haha amazing. ‘kindof’ could also have been ‘natureof’

              2. 7

                Ada, Perl, Ruby and a couple of languages inspired by them.

                When I was way younger and jumping programming languages a lot that felt like the main thing I always got wrong, elif, elsif, elseif and else if.

                The last one despite being the most to type feels the most logical to me, being a combination of what’s already there with else and if, but is also the closest to a natural language/English.

                1. 1

                  It should really be else, if or else; if to be even more like English and to really make it hard for parsers.

                  1. 3

                    x equals thirty-three or else... if your hat is green, of course. Good luck, parser! o7

                  2. 1

                    After discovering cond in Lisp, I wished every language had it instead of if, else and the various combinations of those two.

                  3. 4


                    1. 3

                      Ada uses elsif. I wish all these elifs, elsifs, elseifs and else ifs keywords were interchangeable.

                    2. 1

                      I’m surprised there is no keyword for function.

                      1. 1