A Natural Language Programming Experience
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.
Code should read like natural English while maintaining programming precision. Our syntax is designed to be clear and self-explanatory.
Static typing with clear type annotations using the `as` keyword ensures type integrity and helps prevent runtime errors.
Support for both strict typing and dynamic `Any` types allows developers to choose the level of type enforcement that suits their needs.
Keywords like `is`, `as`, `when`, and `requires` make code intent obvious, reducing cognitive load and improving code comprehension.
count as Whole
measure as Decimal is 3.14
message as Text
flag as Logic
flexible is "Hello"
number_collection is [1, 2, 3, 4, 5] as List[Whole]
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 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"
Job gather_data requires url as Text returns Promise[Text]:
response as Text is await http.fetch at url
output response.content