# Introduction

**fi** is a statically typed high-level programming language designed to be similar, syntactically, to ECMAScript/Javascript and Solidity. fi compiles directly to valid and well-typed Michelson code, the native smart contract language for the Tezos block chain.

fi allows developers to work in a more familiar coding environment, providing a close experience to object-oriented programming. Here's a really short demonstration of the potential of developing smart contracts with fi:

```javascript
# King of Tez Contract

# Define a constant for ONEWEEK in seconds
const int ONEWEEK 604800;

# Define an object King
struct King(
    timestamp end, 
    mutez bounty, 
    address owner); 

# Declare a storage variable king of type King (the object we created)
storage King king; 

# Entry point for this script
entry contend(){
    assert(storage.king.end < NOW || AMOUNT > storage.king.bounty);
    let address oldKing = storage.king.owner;
    storage.king = new King(add(NOW, ONEWEEK), AMOUNT, SENDER);
    transfer(oldKing, AMOUNT);
}
```

This smart contract reads extremely easy within fi, but accomplishes an extremely advanced set of functions.

## Compiling to Michelson

You can install our compiler by following instructions from our [Github repo](https://github.com/TezTech/fi-compiler) - this will allow you to install and use our compiler. You can also use our [online compiler tool](https://fi-code.com) as well.

The web-based browser/editor will compile your fi to Michelson and typecheck the compiled source code. Furthermore, you can run tests against your Smart Contract to simulate live operations and calls.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://learn.fi-code.com/master.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
