ren logo

[人] Ren - The Human Notation

Not everything you ever wanted to
know, but maybe enough for now.

FAQ  About  EBNF
Ceský Dansk Nederlands Français Deutsch Italiano Polski Español

Grammar (informative)

Repetition and alternation denotation.

list
[ anyvalue ]
map
#( anyname-value-pair )
name-value-pair
name  value
name
word : space
value
list or map or string or percent or number
or logic or none or datetime or date or time
or name or word or implied-string
or segmented-number or point
or base-16-binary or base-64-binary

string
" anychar "
char
any-Unicode-char-except-"-or-^-or-control-char
^"; double quote
^/; linefeed
^M; carriage return
^@; null
^(XXXXxxxx)  ; 4 or 8 hex digits

number
optsign  int  optfrac  optexp
int
somedigits
frac
. anydigits
exp
one-ofEe  optsign  somedigits
sign
+ or -
digits
one-of0123456789

percent
number %

logic
true or false or on or off or yes or no
none
none

date
4digits - 2digits - 2digits
time
hours-minutes optseconds
hours-minutes
optsign  2digits : 2digits
seconds
: 2digits  optfrac
tz-sep
/ or T or @
timezone
Z or hours-minutes
date-time
date  tz-sep  time  opttimezone

word-first-char
not0123456789{}"()/\@#$%^,:;<>[]'
word-inner-char
word-first-char or digits
word
word-first-char  anyword-inner-char

implied-string
word-first-char  anyimp-str-inner-char
imp-str-inner-char
word-inner-char or  one-of/\@#$%,:'

segmented-number
int  2-or-moreseg-num-segment
seg-num-segment
. int

point
number  someaxis
axis
x number

base-16-binary
opt16 #{ any 2base-16-char }  ; groups of 2
base-64-binary
64#{ any 4base-64-char }  ; groups of 4

Goals:

Uses:



Why is Ren so much more complicated than JSON?
It makes more datatype values directly identifiable by their lexical form. That complicates the grammar for implementers somewhat, but the small number of added literals, and extra datatypes provide a great deal of expressive power.

Why is Ren so much less complicated than XML?
Really?

Why is none used instead of null?
Null is a very programmer-friendly term, and may even be friendly to mathematicians, but it isn't friendly to normal people who might be given configuration or message files to edit. None also can't be as easily confused with Null as a character or a zero value. Unknown could be a nice word for this but, while we don't focus exclusively on being terse in the Redbol world, "unknown" is a lot more work to type than "none", and harder to scan visually.
    Preferences: none
    Theme: none
Why doesn't Ren use commas between values in lists and name-value pairs in maps?
Ren values are separated by whitespace, commas would be redundant. They also aren't a good fit in line-oriented configuration files.

Why does Ren call true and false logic values, instead of boolean?
As programmers, we're used to calling them booleans but it's a subjective call, and can't be seen as right or wrong.

Why does Ren support alternate logic literals like yes, no, on, and off?
For the same reason it supports true and false as substitutes for 0 and 1. They convey meaning.
    switch-1: off
    ready?: yes
Why doesn't Ren use backslash escapes?
The backslash is the most common escape character in C-like languages, but Ren is not a C-like language. While there is no perfect escape notation (if there were, all languages would use it), Ren chose its escape notation for a few reasons. It's another subjective call about what reads best to humans, while still being unambiguous when parsing, and considering delimiter collision. That said, because the backslash has no special meaning to Ren, you can use it for most escape sequences in strings in your C-like language of choice. An exception is the double quote character, because that is important to Ren.

What is the preferred file extension for a Ren file?
.ren. But Ren doesn't care.

What is the preferred MIME content-type to use for Ren data?
application/ren

If I have Ren data, but do not put [] or #() around it, what should the resulting structure be?
It should be treated as a streaming list by default. But if you notice that it contains well-formed name-value pairs, by all means make it a map. Configuration files are a good example. And if it contains a single Ren value, you can treat it as such.

How were the grammar diagrams created for Ren?
With Redlake Technologies' Railroad Diagram Generator.

Why does Ren use the format it does for names in name-value pairs?
The format may look familiar, because it's very close to the RFC822 standard for header fields. iCal also uses the name:  format. When something makes sense to non-programmers at a glance, and when it has stood the test of time, Ren listens. Yes, even the term word is used in RFC822. It also more clearly implies that name: refers to what comes after it, the value is not being assigned to it. When it comes to parsing data, there is also great value in name: being an atomic element.