We are currently working on new rules for what content should and shouldn't be allowed on this website, and are looking for feedback! See Esolang:2026 topicality proposal to view and give feedback on the current draft.

Nonstraightforward

From Esolang
Jump to navigation Jump to search
This is still a work in progress. It may be changed in the future.

Nonstraightforward is an esolang by User:RaiseAfloppaFan3925 in 2025 based off of Yappacino that extends JavaScript with uselessly verbose syntax.

Nonstraightforward
Paradigm(s) imperative, procedural, declarative, object-oriented (prototype-based)
Designed by User:RaiseAfloppaFan3925
Appeared in 2025
Type system dynamic, fake
Memory system variable-based
Computational class Turing-complete
Reference implementation Nonstraightforward
Influenced by ES6, TypeScript, Yappacino
File extension(s) .nstrfwd

Booleans

true and false are supported, however the main Boolean literals are affirmative and negative.

Statements

Unlike JavaScript, Nonstraightforward requires that there be semicolons at the end of every statement.

Declarations

Classification

Nonstraightforward lacks classes, but it does have classifications. They are defined with the classification keyword.

Classifications can have one or no constructor, defined with the same syntax as in JavaScript. Methods however, have modifiers and require the function/subroutine keyword.

classification Cycle {
    construct() { ~/usr/bin/this/pair = null; }
    public radioactive immutable readonly synchronous subroutine bind_pair(other) {
        ~/usr/bin/other/pair = ~/usr/bin/this;
        ~/usr/bin/this/pair = ~/usr/bin/other;
    }
}

Function

Functions use the function keyword and can also use async/asynchronous and synchronous. They can also use modifiers. Default values for parameters are supported, but object destructuring and ... are not.

Subroutine

Subroutines use the subroutine keyword and can use modifiers and async/asynchronous and synchronous. Unlike functions though, they can have type annotations. Default values for parameters are supported, but object destructuring and ... are not.

Variable

Variables can use the normal let/const/var.

Control flow

Conditional statement

A conditional statement is of the form stipulate that the provision [condition] qualifies [body] and else is done with otherwise.

stipulate that the provision x === "1" qualifies {
    ~/dev/stdout/write/ln("one.");
} otherwise stipulate that the provision x == "1" qualifies {
    ~/dev/stdout/write/ln("1 or \"1\"?");
} otherwise {
    ~/dev/stdout/write/ln("idk bro");
}

Nonstraightforward also has JavaScript's if/else statement.

Exceptions

A value can be thrown as an exception using the throw or retaliate keyword.

Pattern matching

switch statements are in Nonstraightforward.

Return

Returning from a function can be done with the normal return or the reciprocate statement.

While loop

The normal while (condition) body exists too, and so does do body while (condition).

Modules

Nonstraightforward can import modules using an ES-style import of the form from module "module" request { imports };. Default imports and * as alias imports are supported, but not string literal imports or alias imports.

.nstrfwd imports are supported and are automatically converted into .nstrfwd.js in code generation.

SYSROOT

SYSROOT, or ~/ in Nonstraightforward, is a constant implicitly declared at the start of a file. It has the members dev.stdout, dev.stderr, dev.random, dev.urandom, and dev.zero. These all compile to a SYSROOT member access, for example ~/dev/stdout compiles to SYSROOT.dev.stdout.

Output streams

~/dev/stdout and ~/dev/stderr each have a member write.ln which holds console.log and console.error respectfully.

Random

~/dev/random and ~/dev/urandom are getters that return the result of Math.random(). They are identical.

~/dev/zero

~/dev/zero is just a getter that always returns zero.

~/usr/bin

~/usr/bin is a member access expression that requires a variable name after it. Despite using SYSROOT, it does not access SYSROOT at all. For example, ~/usr/bin/Math/abs compiles to Math.abs.

Examples

"Hello, world!" program

~/dev/stdout/write/ln("Hello, world!");