What is the one programming language that's close to being flawless?

That was a question asked on Quora on 9/25/19. Here is my answer.

In my estimation, the programming language that is close to flawless is Fexl (https://fexl.com). I think that because I wrote the language myself and use it for all my production work (principally investment accounting). If I thought the language had a flaw, I would fix it. Since I have nothing to fix at the moment, I think it’s flawless.

Fexl is based directly on the lambda calculus, with a few minimal extensions to the syntax, each one provably useful and logically equivalent to something in lambda calculus. There are no keywords in Fexl — every name you see denotes a function. Lisp and Haskell have keywords. Fexl does not.

Fexl handles modules using the concept of a context. A context is simply a function which maps a name to its definition. A context itself is written in Fexl — after all, it’s just a function. This simple concept is very powerful for managing namespaces, separate module files, domain-specific applications, and applications with restricted capabilities for security purposes.

Fexl is also designed to be the thinnest possible functional programming layer on top of C. The interpreter is written in C. New Fexl functions can be written in C when appropriate (e.g. the cryptography functions). In the extreme case, you could write an entire application in C and make it callable as a Fexl function. In other words, the dividing line between C and Fexl can be wherever you want it.

The main evaluation loop of the interpreter is very simple:

/* Reduce the value until done. */
static value eval_normal(value f)
    {
    while (1)
        {
        value g = f->T(f);
        if (g == 0) return f;
        drop(f);
        f = g;
        }
    }

So for me, this is as good as it gets, and it definitely pays the bills.

EDIT: Fexl also solves the problem of excessive trailing parentheses in Lisp, by using a semicolon to group things to the right. The following two expressions are equivalent:

(a (b x))
(a; b x)

Naturally you can apply this to multiple levels, e.g.:

(a (b (c (d (e (f x))))))
(a; b; c; d; e; f x)