Weaver Syntax

The weaver syntax is just beginning to evolve, and has specific goals

  • Be extremely readable. No programming experience should be required to understand what is happening
  • Be simple, direct, and never require repetition. Repetition = bugs.
  • Only handle 80% of the use cases. It's not possible to write a language that is good at everything. Complicated systems will require an understanding of coding regardless, so making those systems require raw JavaScript or CoffeeScript isn't a flaw.
title= 'unexpected visitor'
----
> coins = random(2..30)
> randomly_run(1/10, <
      You notice >coins< coins, dropped on the floor and pick them up.
>>  character.gold += coins
> )

>gold += 1 <

Musings: An easily type-able character is important. = is easier than >, but already has another meaning. > signifies a prompt to many people.

Let's start with simple.

'>' starts a line of code, which can be ended by a line break, or '<'
Non-code is interpreted as text.

and < can be escaped as \> and \<

Each file becomes a class.
Code before "——" goes in the constructor,
Code afterwards goes in main()
Markup and expressons are implicitly surrounded in 'print()' if the context is empty.

I.e,

coins <

translates to
print (coins);

and

… not sure how to interpret

randomly(1/10,

text

value

text

)

… Directly it would be randomly(1/10, "text" value "text")
which would break unless concatenation is implicit.