Charles-Johnson / zia_programming

A language that can program itself
https://zia-lang.org
GNU General Public License v3.0
3 stars 0 forks source link

Simpler way to declare relative precedence #41

Open Charles-Johnson opened 3 years ago

Charles-Johnson commented 3 years ago

How it works now

Currently the 3 concrete concepts prec, default and > are used to declare relative precedence and parse syntax.

prec a is default if no relative precedence is defined for a. Relative precedence if defined like

let (prec a) > prec b

or the precedence can be greater or less than the default precedence

let (prec a) > default

or

let default > prec b

Problems with this approach

Alternative 1

Without the default concept it will be tedious to write any syntax because a sufficient number of precedence relations will be needed to be defined for each concept by the user.

Alternative 2

This should not make the user's experience more tedious like Alternative 1 and will maintain a useful property of the interpreter that no decision based on something not being known or not (this will help an advanced cache invalidation and the future module system)