Vernacular

A Natural Language Programming Experience

About Vernacular

Vernacular is a modern programming language designed to bridge the gap between natural language and code. It aims to make programming more intuitive, readable, and expressive while maintaining the rigor and precision of traditional programming languages.

Natural Readability

Code should read like natural English while maintaining programming precision. Our syntax is designed to be clear and self-explanatory.

Strong Type Safety

Static typing with clear type annotations using the `as` keyword ensures type integrity and helps prevent runtime errors.

Flexible Type System

Support for both strict typing and dynamic `Any` types allows developers to choose the level of type enforcement that suits their needs.

Clear Intent

Keywords like `is`, `as`, `when`, and `requires` make code intent obvious, reducing cognitive load and improving code comprehension.

Type System

count as Whole
measure as Decimal is 3.14
message as Text
flag as Logic
flexible is "Hello"

Collections

number_collection is [1, 2, 3, 4, 5] as List[Whole]

Functions (Jobs)

Job process requires first, second, action as Number, Number, Text returning Whole:
    when action is "add":
        output first + second
    when action is "multiply":
        output first * second

Object-Oriented Programming

Object Person inherits BaseEntity:
    name as Text
    age as Whole

    build defaults name is "Unknown", age is 0:
        my name is name
        my age is age
    
    Job greetings returns Text:
        output "I am {my name}, {my age} years old"

Asynchronous Operations

Job gather_data requires url as Text returns Promise[Text]:
    response as Text is await http.fetch at url
    output response.content