HiveLang v4

Syntax Basics

Learn the fundamental building blocks of HiveLang.

Bot Declaration

Every Hivelang program starts with a bot declaration.

example.hive
bot "MyBot" description "A helpful assistant" end

Input Handler

The 'on input' block defines how the bot responds to user messages.

example.hive
bot "Greeter" on input say "Hello! You said: " + input end end

F-Strings (v4)

Use f-strings for clean string interpolation.

example.hive
bot "Formatter" on input set name = "World" say f"Hello, {name}!" say f"You said: {input}" end end

Variables

Use 'set' to create and update variables.

example.hive
bot "Calculator" on input set price = 100 set tax = 0.2 set total = price * (1 + tax) say f"Total: ${total}" end end

Conditionals

Use 'if/else/end' for branching logic.

example.hive
bot "Helper" on input if input contains "help" say "I can help you with..." else say "What would you like to know?" end end end

Tool Calls

Call external tools and store results with 'as'.

example.hive
bot "Researcher" on input call integrations.google.search( query: input ) as results say f"Found: {results}" end end