Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
The Déjà Vu programming language
C Python C++
branch: recurse-free

This branch is 631 commits behind master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
.gitignore
GRAMMAR.bnf
README.md
context.py
deja.py
errors.py
eval.py
func.py
ifelse.py
loop.py
nodes.py
parse.py
stdlib.py
trycatch.py

README.md

Déjà Vu

It is a programming language. Stack-based. Semi-functional. Backwards. Inspired by Python and Forth. I'm talking about Déjà Vu.

Example

Sure, why not:

fib a:
    if > 1 a:
        fib - 1 a
        fib - 2 a
        +
    elseif = a 1:
        1
    else:
        0

Grammar

If you know what BNF is, here's the one for Déjà Vu:

Program ::= <Block>*

Block ::= <Head> ":" <NewLine>+ (<Indentation> <Block>)+
        | <Line> <NewLine>+
        | <IfBlock>

IfBlock ::= "if" <Space> <Line> ":" <NewLine>+ (<Indentation> <Block>)+
            ("elseif" <Space> <Line> ":" <NewLine>+ (<Indentation> <Block>)+)*
            ("else" <Space>? ":" <NewLine>+ (<Indentation> <Block>)+)?

Head ::= "while" <Space> <Line>
       | "for" <Space> <ProperWord> (<Space> <Line>)? <Space>?
       | "func" <Space> <ProperWord> <Arguments>
       | "local" <Space> <ProperWord> <Arguments>
       | "labda" <Arguments>
       | <ProperWord> <Arguments>

Indentation ::= <Tab>*

Line ::= (<Word> (<Space> <Word>)*)? <Space>?

Arguments ::= (<Space> <ProperWord>)* <Space>?

Space ::= " "+

Word ::= ProperWord
       | Identity
       | String

Identity ::= "'" <ProperWord>? "'"

ProperWord ::= <Char>+

String :: '"' <StringChar>* '"'

Char ::= any non-whitespace character

StringChar ::= any character other than a double quote
Something went wrong with that request. Please try again.