User:Gilbert189/Languages in concept

From Esolang
Jump to navigation Jump to search

These are some of my languages that I made, but only just as a concept. They're not detailed enough to warrant a page by itself, but they're interesting enough to show them here. (And also because I barely contributed here anyway.)

Waluigilang

Made in 19 September 2021.

My response to the very un-mematic Wariolang. (though more towards how Waluigi wahs and less on how he really speaks; if you feel offended, I am sorry)

WAH "Hello, world!" TO WALUIGI

WAH a TO b is insertion. It kinda acts like Hello, world!" >> std::cout

WAH FOREVER!
	WALUIGI SHOULD BE WAH?
NAH

WAH? is input, WALUIGI is output. a SHOULD BE b is variable assignment. WAH a ... NAH is flow control. a could be IF a IS b ([else-]if statement), a TILL b (for statement), a TIMES (repeat), TILL a IS b (until loop), WHILE a IS b (while loop), FOREVER, or nothing (else statement). Also, exclamation mark is the line terminator of Waluigilang. It's optional, but you will probably need to use it if you're doing a one liner.

INPUT SHOULD BE WAH?
WAH IF INPUT IS "1"
	WAH FOREVER
		WAH "1" TO WALUIGI
	NAH
NAH
WAH "0" TO WALUIGI

Some added things: There's 3 data types: number, booleans, and strings. Booleans have 2 states, WAH (true) and NAH (false).

WAH A TILL 100
	A SHOULD BE A AND 1
	COND SHOULD BE A STEAL 3
	O SHOULD BE ""
	WAH IF COND IS 0
		WAH "WA" TO O
	NAH
	COND SHOULD BE A STEAL 5
	WAH IF COND IS 0
		WAH "LUIGI" TO O
	NAH
	WAH IF O IS ""
		O SHOULD BE A BUT O
	NAH
	WAH O TO WALUIGI
NAH

a STEAL b is modulus. a BUT b is type casting. a AND b is addition. Others will be TAKE (floor divide), CROSS (multiply), and SHIFT (right bit-shift)

ADD NUMBER 2!
	A SHOULD BE WAH?
	B SHOULD BE WAH?
	C SHOULD BE A AND B!
	WAH C TO WALUIGI!
NO, WALUIGI NUMBER 1!
WAH 1 TO ADD!
WAH 2 TO ADD!
WAH ADD TO WALUIGI!

This is an example of a function in Waluigilang. You can see that it uses purely insertions to work.

Penfurs

Made in 9 January 2022.

a = 1;
out a;

b = [1, 2, 3]; // decorator of b: int -> int; b: 0 -> 1; b: 1 -> 2;...
f: int -> int;
f: 2 -> 4; // mapping
f: 3.0 -> 9; // error: expecting int as domain, got float
f 1 // error: 1 is not in domain of f
f: x -> mult x x; // defined function
f: 1 -> 2; /* 
error: contradictory statement from statements:
    x -> mult x x
*/
g: int int -> int;
g: x 1 -> f x;
g: x 2 -> add x x;
g: x y -> add y x; /* 
error: contradictory function from statements: 
    x 1 -> f x
    x 2 -> add x x
*/
isPainful: function -> int;
isPainful: x ? equals liquidType x "base" -> 1;
isPainful: x ? equals liquidType x "acid" -> 1;
f: int -> int;
f: 1 -> 2;
d = domain f; // a list representing the domain of f
c = codomain f; // a list representing the codomain of f
g: int -> int;
g: x -> add x 1;
d = domain f; // error: g has no defined domains
list = [1, 2, 3];
f: int -> int;
f: x -> mult 2 x;
mapped = compose f list; // f(list(x)), keep in mind that lists are just functions
iterate out mapped; // execute `out mapped x` for all x in defined domain of `mapped`
fb: int -> string;
fb: x ? equals mod x 15 0 -> "FizzBuzz"; // highest priority
fb: x ? equals mod x 3 0 -> "Fizz";
fb: x ? equals mod x 5 0 -> "Buzz";
fb: x ? -> x; // lowest priority
list = [1:100:1];
iterate out compose fb list;

What I can recall from this language:

  • Name is a corruption of "functional programming" or something.
  • Made when I was studying functions. (thus the domain and codomain functions)
  • Functions are not curried, instead they are executed after the stack has enough items that it needs.
 (Calling one makes a new stack frame.)

Fighting Simulator 3 Query Language

Made in 21 June 2023.

A re-imagining of the Esolang language in this RPG I'm on into an SQL-like syntax.

FS3QL Client v1
Connected to server 'fs3".

FS3QL> UPDATE Players SET Health <- 1 WHERE ID = 10:
FS3QL> UPDATE Players/Inventory[{1}][{0}] SET ID <- {402}, Count <- {2} WHERE ../ID = {10}:
FS3QL> .verbose
FS3QL> CREATE PROCEDURE IncrementCount VALUES AS BEGIN
...  >   UPDATE Players/Inventory[((Row))][((Slot))] SET Count <- Count + ((Number)) WHERE ../ID = @Player
...  > END:
FS3QL> EXEC IncrementCount <{10} - RandInt<{0} - {1}> - RandInt<{0} - {11}> - RandInt<{1} - {5}>>:
EXEC IncrementCount <{10} - {0} - {0} - {5}>:
EXEC IncrementCount <{10} - {0} - {9} - {5}>:
EXEC IncrementCount <{10} - {1} - {6} - {5}>:
EXEC IncrementCount <{10} - {1} - {11} - {5}>:
FS3QL> UPDATE Players SET Health <- Health - 15:
WARNING: Players/ID <- {1} is AFK and cannot be modified
WARNING: Players/ID <- {2} is AFK and cannot be modified
WARNING: Players/ID <- {3} is AFK and cannot be modified
WARNING: Players/ID <- {7} is AFK and cannot be modified
WARNING: Players/ID <- {8} is AFK and cannot be modified
WARNING: Players/ID <- {9} is AFK and cannot be modified
WARNING: Players/ID <- {13} is AFK and cannot be modified
WARNING: Players/ID <- {14} is AFK and cannot be modified
FS3QL> UPDATE Players SET Health <- Health + {25} WHERE ID = 10:
FS3QL>

Agent-based esolangs

These are two of what I call "agent-based" languages. The main idea is there are agents (which could be anything, inorganic or not) with their certain traits that could communicate with each other.

Around this time, I like to make keywords first-class (that is, you can feed in keywords like print into a function).

Smalltalk-like

This variant resembles Smalltalk, at least in the looks. I don't really like this variant anymore, since for something that uses > to ask others, using parenthesis to feed outputs feels like a bad match. Oh well.

I agent: Main traits: [Runnable Stateful].
I use: "System:IO/Input" as: Input.
I use: "System:IO/Output" as: Output.
I use: "Toolbox:Operations/String" as: StringOP.

I on: run do: {
    put to: name value: (I < ask about: "What's your name?").
    if true: (StringOP < compare value: (get value: name) equals: "Gilbert") do: {
        Output < write text: "Hello, myself!".
    } else: {
        Output < write text: (StringOP < format text: "Hello, {}!" with: [(get value: name)]).
    }.
}.

I on: ask args: [about] do: {
    Output < write text: (get argument: about).
    answer with: (Input < read until: "\n").
}.

You could see this language being used in a digital thermostat that talks using MQTT:

I agent: Thermostat traits: [Periodic Stateful].
I use: "System:Environment" as Env.
I use: "Toolbox:Operations/Number" as: NumOP.
I use: "MQTT:example.mqtt:8883" as: MQTT config: [
    username: (Env < get var: "MQTT_USER")
    password: (Env < get var: "MQTT_PASS")
].
I use: "GPIO:Analog/0" as: LM35 config: [
    as: input
    output: voltage
].
I use: "GPIO:Digital/0" as: HeaterRelay config: [
    as: output
].
I use: "GPIO:Digital/1" as CoolerRelay config: [
    as: output
].


MQTT < subscribe to: "temperature/set/cool" do: {
    put to: coolTemp value: (get argument: value).
}.
MQTT < subscribe to: "temperature/set/heat" do: {
    put to: heatTemp value: (get argument: value).
}.

NumOP < addConversion from: 0.01V to: 1.degC context: tempConvert.
I on: tick do: {
    put to: temp value: (NumOP < convert: (LM35 < get) to: degC context: tempConvert).
    MQTT < publish to: "temperature/value" value: (NumOP < {
        scratch to: x value: (I < get value: temp).
        scratch to: x value: (NumOP < raw value: (get scratch: x)).
        scratch to: x value: (NumOP < stringify value: (get scratch: x)).
        answer with: (get scratch: x).
    }).
    if true: (NumOP < compare value: (get value: temp) greater: (get value: coolTemp)) do: {
        CoolerRelay < set to: high.
    } else: {
        CoolerRelay < set to: low.
    }.
    if true: (NumOP < compare value: (get value: temp) less: (get value: heatTemp)) do: {
        HeaterRelay < set to: high.
    } else: {
        HeaterRelay < set to: low.
    }.
}

Simplified

This is a simplified version of last language. As you can read, it uses it as an accumulator for the next instruction.

Still need to figure out what the parenthesis and brackets differ.

agent Main traits [Runnable Stateful].
-- Runnable: this agent can be run from an outside initiator (e.g. your terminal)
-- Stateful: this agent stores some states (defines the actions [(set name) (to value)] and [(get name)])

use "IO:Output" as Output.
use "Number:Operations" as Number-OP.
use "Text:Operations" as Text-OP.
-- The syntax for the agent selector are "Protocol:Link/To/Agent"
-- Each protocol has their own unique actions.

-- This defines an action which can be asked by other agents.
-- For this one, it also acts as the entry point for the initiator.
on [(run args)] do {
	set i to 1.

	-- Repeatedly does the instructions until a reply is given.
	loop {
		set out to "".

		get i. ask Number-OP to {mod it with 3. reply it.}.
		if it is 0 do {
			get out. ask Text-OP to {add it with "Fizz". reply it.}. set out to it.
		}.
		get i. ask Number-OP to {mod it with 5. reply it.}.
		if it is 0 do {
			get out. ask Text-OP to {add it with "Buzz". reply it.}. set out to it.
		}.

		get out.
		if it is "" do {
			ask Number-OP to {textify it. reply it.}.
			ask Output to {write it. reply it.}.
		}.
		
		get i. ask Number-OP to {add it with 1. reply it.}. set i to it.

		get i. ask Number-OP to {compare it with 100. reply it.}.
		-- Number-OP's compare action replies the flags [equal greater less].
		if it is equal do {
			reply 0.
		}.
	}.
	reply it.
}.

Seedling

Made in 13 April 2024.

A simple declarative programming language. The initial idea is that it's supposed to be an injective language where the source modifies how statements are parsed. It was supposed to look like a C-like language, but that didn't work out so I made it look ML-like instead. Now it almost looks like an esolang someone else have made before...

(Originally the braces and the parentheses role are swapped, but I swapped it to what's shown here for aesthetics)

from $from:int to $to:int do $fn = $fn $from ($from <= $to) {from ($from + 1) to $to do $fn} {}

either $x or $y = ($x = "") $y $x /* might be included in prelude */
fizzbuzz $x:int = print (either (join (($x % 3 = 0) Fizz "") with (($x % 5 = 0) Buzz "")) or $x)

main = from 1 to 100 do fizzbuzz

Execution steps:

main
from 1 to 100 do fizzbuzz
fizzbuzz 1 (1 <= 100) {from 2 to 100 do fizzbuzz} {}
print (either (join ((1 % 3 = 0) Fizz "") with ((1 % 5 = 0) Buzz "")) or 1) (1 <= 100) {from 2 to 100 do fizzbuzz} {}
print (either (join ((1 = 0) Fizz "") with ((1 % 5 = 0) Buzz "")) or 1) (1 <= 100) {from 2 to 100 do fizzbuzz} {}
print (either (join (false Fizz "") with ((1 % 5 = 0) Buzz "")) or 1) (1 <= 100) {from 2 to 100 do fizzbuzz} {}
print (either (join ("") with ((1 % 5 = 0) Buzz "")) or 1) (1 <= 100) {from 2 to 100 do fizzbuzz} {}
print (either (join "" with ((1 % 5 = 0) Buzz "")) or 1) (1 <= 100) {from 2 to 100 do fizzbuzz} {}
print (either (join "" with ((1 = 0) Buzz "")) or 1) (1 <= 100) {from 2 to 100 do fizzbuzz} {}
print (either (join "" with (false Buzz "")) or 1) (1 <= 100) {from 2 to 100 do fizzbuzz} {}
print (either (join "" with "") or 1) (1 <= 100) {from 2 to 100 do fizzbuzz} {}
print (either ("") or 1) (1 <= 100) {from 2 to 100 do fizzbuzz} {}
print (either "" or 1) (1 <= 100) {from 2 to 100 do fizzbuzz} {}
print (("" = "") 1 "") (1 <= 100) {from 2 to 100 do fizzbuzz} {}
print (true 1 "") (1 <= 100) {from 2 to 100 do fizzbuzz} {}
print (1) (1 <= 100) {from 2 to 100 do fizzbuzz} {}
print 1 (1 <= 100) {from 2 to 100 do fizzbuzz} {}
(1 <= 100) {from 2 to 100 do fizzbuzz} {} /* prints 1 */
true {from 2 to 100 do fizzbuzz} {}
from 2 to 100 do fizzbuzz
...
(101 <= 100) {from 101 to 100 do fizzbuzz} {}
false {from 101 to 100 do fizzbuzz} {}
{} /* success: exit code 0 */

Math

#define angle ($decimal)deg
#import math

$x:angle to radians = (PI / 180 * $x:0)
sin $x:angle = sin ($x to radians)
cos $x:angle = cos ($x to radians)
tan $x:angle = tan ($x to radians)
sec $x:angle = sec ($x to radians)
csc $x:angle = csc ($x to radians)
cot $x:angle = cot ($x to radians)
ctg $x:angle = ctg ($x to radians)
cosin $x:angle = cosin ($x to radians)
cosec $x:angle = cosec ($x to radians)
cotan $x:angle = cotan ($x to radians)

main = print (cos 60deg)

Babalog-1

Made in 4 April 2024.

Probably not Turing complete.

Babalog-1

Enter ? to go into query mode, and | to go back into rule mode.
|- (this is a comment)
|- BABA IS YOU
|- FLAG IS WIN
|- FLAG IS BABA (gives quality BABA)
|- KEKE IS MOVE
|- KEKE MIMIC BABA (copies qualities of BABA)
|- SKULL IS DEFEAT
|- ALL IS OPEN
|- ME IS NOT OPEN
|- ALL FEELING DEFEAT IS SAFE
|- ALL FEELING SHUT IS NOT OPEN
|- DOOR IS SHUT
|- SKULL FEELING OPEN IS SINK
|- ?
?- BABA
IS YOU
IS OPEN (from ALL)
?- FLAG
IS WIN
IS BABA
IS OPEN (from ALL)
?- KEKE
IS MOVE
IS YOU (from BABA)
IS OPEN (from ALL)
?- SKULL
IS DEFEAT
IS OPEN (from ALL)
IS SAFE (because FEELING DEFEAT from ALL)
IS SINK (because FEELING OPEN from SKULL)
?- ME
IS OPEN (from ALL)
IS NOT OPEN
?- DOOR
IS OPEN (from ALL)
IS NOT OPEN (because FEELING SHUT from ALL)
IS SHUT
?- IS YOU
BABA
KEKE
?- IS OPEN
BABA
FLAG
KEKE
SKULL
?- MIMIC BABA
KEKE
?- .?
(insert help here)
?- .??
Information about Babalog-1

Special nouns
ALL: encapsulates all names (for every name X, X MIMIC ALL)

Operators
IS: assigns a quality to a name
MIMIC: copies all qualities assigned to a name
FEELING: applies a rule only when the specified quality is assigned to a name
NOT: falsifies the following phrase (ex. NOT WIN falsifies WIN, NOT NOT WIN falsifies NOT WIN)
?- .X

This Minecraft / MCFunction proglang

Made in 5 January 2024.

I wouldn't call this language esoteric, but it's an idea I had when I was toying around Minecraft's very low-level commands, and thinking "there must be a better way to develop using commands"

I'm interested to see something like this getting implemented, until I saw SethBling and his CBScript achieving essentially the same thing. Oh well.

dummy $time $time_min $time_hour [* objectives *]
bossbar !progress^100

repeat (
	:time.ticks = /time query daytime [* stores into minecraft:time *]
	as @a (
		$time = :time.ticks * 0.06 [* ticks to Minecraft minutes *]
		$time_min = $time % 60
		$time_hour = ($time / 60) + 6 % 24
		if @s.Inventory[{Slot: -106b, id: "minecraft:clock"}] ( [* Only show digits when a clock is put offhand *]
			/title @s actionbar c"$($time_hour):$($time_min)"
			if $time_min < 10 /title @s actionbar c"$($time_hour):0$($time_min)"
		)
	)
)

function test (
	say "This is a function."
	say "The value is $(value)." [* Macro lines don't need to be prefixed with $ *]
	@s!progress = value
)

function setMaximum (
	@s!progress^ = value
)

A descriptive example

[* this is a comment *]
[*
	These are the available variable types of this language.

	$objective is a scoreboard objective
	:tag       is the value of minecraft:tag on world storage (from /data ... storage)
	:tag.foo   is the value of key foo in minecraft:tag
	           (in general it uses minecraft:nbt_path)
	           (you can also change the default "minecraft" namespace to something else 
	           using the "namespace" command)
	mod:tag    is the value of mod:tag on world storage
	!boss^10   is a bossbar with maximum value of 10
	!boss      is a bossbar value
	!boss^     is a bossbar's maximum value
	.          is the entity's data
	.NoAI      is the value of key NoAI of the entity's data
	.Pos[0]    is the first value of the list of key Pos of the entity's data
	           (in general it uses minecraft:nbt_path)

	These may be prefixed with these object types:
	@a         are all the players in the world
	@e         are all the entities in the world
               ... you get the drill. It's just minecraft:entity.
	Alice      is a player named Alice (default for names without a sigil)
	#(0 1 2)   is a block in x: 0 y: 1 z: 2
	#(~ ~ ~)   is a block at the entity's coordinates
*]

[* namespace example *] [* would set a namespace if it's not commented *]
[* use path/to/other/file *] [* would effectively append the contents of the file here *]

dummy $foo  [* creates an objective of type dummy *]
health $bar [* creates an objective of type health *]

repeat (
	[* these commands are run every tick *]

	$foo += 1 [* by default this is applied to the current entity *]
	@s$foo += 1 [* this line functions identically to the line above *]

	[* Supported operations are +, -, *, / (integer division), // (float division if possible), and % *]
)

function roll_call (
	[* all subcommands on /execute (except "store" and "summon") are put as their own command *]
	as @a (
		say I'm present
	)
	[* 
		These lines function identically:
		as @a run say I'm present
		as @a /say I'm present
	*]
)

function tell_time (
	dummy $time $time_min $time_hour

	:time.ticks = /time query daytime [* stores into minecraft:time *]
	$time = :time.ticks * 0.06 [* ticks to Minecraft minutes *]
	$time_min = $time % 60
	$time_hour = ($time / 60) + 6 % 24
	
	if ($time_min >= 10) /tellraw @s c"It's $($time_hour):$($time_min)"
	if ($time_min <  10) /tellraw @s c"It's $($time_hour):0$($time_min)"
)

function tell_time_compiled (
	[* This might be what the function tell_time will be compiled to. *]

	scoreboard objectives add time dummy
	scoreboard objectives add time_min dummy
	scoreboard objectives add time_hour dummy
	scoreboard objectives add const_24 dummy
	scoreboard objectives add const_60 dummy
	scoreboard objectives add const_6 dummy
	scoreboard players set @s const_24 24
	scoreboard players set @s const_60 60
	scoreboard players set @s const_6 6

	execute store result storage time ticks long 1 run time query daytime
	execute store result score @s time run data get storage time 0.06
	execute store result score @s time_min run scoreboard players get @s time
	scoreboard players operation @s time_min %= @s const_60
	execute store result score @s time_hour run scoreboard players get @s time
	scoreboard players operation @s time_hour /= @s const_60
	scoreboard players operation @s time_hour += @s const_6
	scoreboard players operation @s time_hour %= @s const_24

	execute if score @s time_min matches 10.. run tellraw @s [{"text": "It's "}, {"score": {"name": "*", "objective": "time_hour"}}, {"text": ":"}, {"score": {"name": "*", "objective": "time_min"}}]
	execute if score @s time_min matches ..9 run tellraw @s [{"text": "It's "}, {"score": {"name": "*", "objective": "time_hour"}}, {"text": ":0"}, {"score": {"name": "*", "objective": "time_min"}}]
)

function conditionals #example ( [* tagged under #minecraft:example *]
	[* 
		The following are a list of syntatic sugars using the "if" command, and their equivalent commands. 
		These also apply to "unless" as well.
	*]
	if #(^ ^ ^1) = #planks /say pointing a plank
	if block ^ ^ ^1 #planks run say pointing a plank

	if #(^ ^ ^1) = furnace and #(^ ^ ^1).Items[{Slot: 2b}] /say there's output in the furnace
	if block ^ ^ ^1 furnace if data block ^ ^ ^1 Items[{Slot: 2b}] run say there's output in the furnace

	if (@a.foodLevel = 20) /say I'm not hungry                     [* brackets are optional *]
	as @a if data entity @s {foodLevel: 20} run say I'm not hungry [* "if entity" only allows a single entity *]

	if :foo.bar /say okay
	if storage foo bar run say okay

	if :time.ticks = 20l /say okay
	if storage time {ticks: 20l} run say okay

	if @e /say I'm not alone
	if entity @e run say I'm not alone

	[* Note the dot. *]
	if @e. /say I have data
	as @e if data entity @s {} run say I have data

	if $foo > $bar /say wow
	if score @s foo > @s bar run say wow

	if $bar <= 1 /say Peril!
	if score @s bar matches ..1 run say Peril!

	[* Implementation note: These commands (and probably more) would need temporary objectives or functions to work. *]
	[* Example 1a: Comparing inequalities between different variable types *]
	if $foo > :foo.bar /say wow
	execute store result score @s temp1 run data get storage foo bar
	execute if score @s foo > @s temp1 run say wow
	
	[* Example 1b: Comparing inequalities between variable types other than objectives *]
	if :foo.bar > :foo.baz /say wow
	execute store result score @s temp1 run data get storage foo bar
	execute store result score @s temp2 run data get storage foo baz
	execute if score @s temp1 > @s temp2 run say wow

	[* Example 2: Comparing variables other than objectives with a constant number *]
	if :foo.bar = 10 /say wow
	execute store result score @s temp1 run data get storage foo bar
	scoreboard players set @s temp2 10
	execute if score @s temp1 = @s temp2 run say wow
	[* 
		Exceptions to this example are:
		1. Equality of a NBT value
			if @a.foodLevel = 20 /say I'm not hungry 
			as @a if data entity @s {foodLevel: 20} run say I'm not hungry
		2. 
	*]

	[* Example 3: Executing a code block *]
	if $foo = 10 (
		say Hello
		say world
	)
	if score @s foo matches 10 run function temp1
	[* where the function minecraft:temp1 contains the code inside the block *]
)

function arguments #example (
	[* Unlike .mcfunction, you can add $(...) without prefixing your function with $ *]
	say Argument is $(arg1)

	[* To output the placeholders instead of interpolating them, you can escape them: *]
	say Argument is \$(arg1)
)

function json_quotes #example (
	[* JSON quotes are prefixed with c and provides basic formatting for commands using raw JSON text format. *]
	[* The following are examples of them and their equivalent commands. *]

	tellraw @s c"This is plain text."
	tellraw @s {"text": "This is plain text."}

	tellraw @s c"It's not *that* obvious..."
	tellraw @s [{"text": "It's not "}, {"text": "that", "italic": true}, {"text": " obvious..."}]

	tellraw @s c"It's not \*that* obvious..."
	tellraw @s {"text": "It's not \*that* obvious..."}

	tellraw @s c"It's not **that** obvious..."
	tellraw @s [{"text": "It's not "}, {"text": "that", "bold": true}, {"text": " obvious..."}]

	tellraw @s c"It's not ***that*** obvious..."
	tellraw @s [{"text": "It's not "}, {"text": "that", "bold": true, "italic": true}, {"text": " obvious..."}]

	tellraw @s c"Fill in the blanks: _But I've already done that!_"
	tellraw @s [{"text": "Fill in the blanks: "}, {"text": "But I've already done that!", "underline": true}]

	tellraw @s c"Son of a ||birch||!" [* Sorry. *]
	tellraw @s [{"text": "Son of a "}, {"text": "birch", "obfuscated": true}, {"text": "!"}]

	tellraw @s c"#blue(I am blue.)"
	tellraw @s {"text": "I am blue.", "color": "blue"}

	tellraw @s c"#FE1F6F(Uh oh.)"
	tellraw @s {"text": "Uh oh.", "color": "#FE1F6F"}

	tellraw @s c"!https://example.com(Click me!)"
	tellraw @s {"text": "Click me!", "clickAction": {"action": "open_url": "value": "https://example.com"}}

	tellraw @s c"![say You clicked me!](Click me!)" [* this is the normal behaviour for values without any sigils *]
	tellraw @s {"text": "Click me!", "clickAction": {"action": "run_command": "value": "say You clicked me!"}}

	tellraw @s c"![?say You clicked me!](Click me!)"
	tellraw @s {"text": "Click me!", "clickAction": {"action": "suggest_command": "value": "say You clicked me!"}}

	tellraw @s c"![@You clicked me!](Click me)"
	tellraw @s {"text": "Click me!", "clickAction": {"action": "copy_to_clipboard": "value": "You clicked me!"}}

	tellraw @s c'Press "%(key.inventory)" to check your inventory!'
	tellraw @s [{"text": "Press \""}, {"keybind": "key.inventory"}, {"text": "\" to check your inventory!"}]

	tellraw @s c'Your score is $($foo)'
	tellraw @s [{"text": "Your score is "}, {"score": {"name": "*", "objective": "foo"}}]

	tellraw @s c'Alice\'s score is $(Alice$foo)'
	tellraw @s [{"text": "Your score is "}, {"score": {"name": "Alice", "objective": "foo"}}]

	tellraw @s c'minecraft:foo.bar = $(:foo.bar)'
	tellraw @s [{"text": "minecraft:foo.bar = "}, {"source": "storage, "nbt": "bar"}]
)

function extended_syntax #appendix (
	[*
		These are some officially unofficial extended syntax for this language.
		If these were implemented, it should be as a dialect and not as the main language.

		These extended syntax might be official if I feel like it.
	*]

	[* Statements in JSON quotes *]
	tellraw @s c'Your score + 1 is $($score + 1)'

	[* One of these for content matching *]
	if foo.Inventory[] # {Slot: -106b} /say foo is holding something in the offhand
	if foo.Inventory[] contains {Slot: -106b} /say foo is holding something in the offhand
	if foo.Inventory[Slot] = -106b /say foo is holding something in the offhand
	[* They're equivalent to this: *]
	if foo.Inventory[{Slot: -106b}] /say foo is holding something in the offhand

	[* Command repetitions *]
	for i in 1 3 2 5 4 (
		if $foo > $(i) /say wow $(i)
		if $foo < $(i) /say boo $(i)
	)
	for i from 1 to 11 step 2 ( [* forcibly inclusive *]
		if $foo > $(i) /say wow $(i)
		if $foo < $(i) /say boo $(i)
	)
	repeat 5 (
		say this line will be said 5 times
	)
)

TB²AGE

Made in 30 August 2022.

Again with "I'm not sure if this is esoteric enough".

-- 45678901234567890123456789012345678901234567890123456789012345678901234567890
-- This is an example of a Text-Based Text-Based Adventure Game Engine, or
-- TB²AGE for short.

-- This begins the "main" room.
-- The player will always start here.
-- Prefixing text with $ allows the game to do engine-wide operations.
@main
$engine set pause on \
-- $engine set toggle step "
[@bedroom]

-- In this case, we go into the "bedroom" room.

-- Each section is seperated by >2 newlines.
-- This section, for example, defines a placeholder.
{person:a}
{*a} is in here.

-- Placeholders can also store actions, and can be styled by adding "|{style}".
{give:a:b}
$unset have_*a
You give {*a|Aa} to {*b}.

-- Any commands that's defined on the main room is global.
/quit
$engine quit

-- Prefixing commands with a symbol will make it a meta-command. This modifies 
-- existing commands to decorate the outputs. This can be used to show
-- boilerplate text, like showing the current party or something. It can also
-- be used as a default text for something invalid.

-- There's a lot happening on this command. The *a wildcard matches every word 
-- and stores it into the "a" variable.
-- Flags in curly brackets makes the commamd run under a condition.
/#use *a {!have_*a}
You don't have {*a|Aa}.

-- When prefixed with ?, the meta-command is called only when the command is 
-- invalid.
/?use
You can't use that right now.

/?get *a
You can't get {*a|Aa} in here.

/?talk
There's nobody to talk to.

/?talk *a
There's nobody called {*a} here.

/?goto
You can't go there!


-- From the main room, you'll probably have guessed what most of this does.
@bedroom
You're in your bedroom.

/look
There's a bed and a desk on the opposite side.
There's a door on your side as well.

/look bed
The bed looks a bit worse of wear, but it's still quite comfy.

/look [desk|table]
The desk is a bit messy with papers. There's a pencil case open next to it.

/get pencil
You take Pencil.
$set have_pencil

/go [east|side|door]
[@hall]

/use pencil
You scribbled on the paper.
Doesn't seem like you can do anything with this.


@hall
You're in a hall.

-- A blank command will be executed on enter.
-- Prefixing flags with ! inverts it.
-- Prefixing text with ^ prevents text to be written in a new line.
/ {!the_pencil}
^{person:Bob}

-- The #N flag is flagged when the command is called N times.
/talk [|Bob] {!the_pencil, #1}
You talked to Bob.
Bob: "Hey, can I borrow your pencil? I kinda need it for something."
[#ask_pencil]

#ask_pencil
> Yes     #accept
> No      #deny

#accept
"Thanks! I'll return it later."
$set the_pencil_ip

#accept {have_pencil}
{give:pencil:Bob}
Bob: "Thanks! I'll return it later. Well, I'm leaving now. Bye!"
$set the_pencil

#accept {have_pencil, the_pencil_ip}
{give:pencil:Bob}
Bob: "Thanks! Well, I'm leaving now. Bye!"
$set the_pencil
$unset the_pencil_ip

#deny
"Oh. That sucks."
"Well, tell me if you change your mind."

/talk [|Bob] {!the_pencil, #2-}
Bob: "Can I borrow your pencil?"
[#ask_pencil]