Phil is on a blockchain
A program written in Phil, compiled by Phil's own compiler, is deployed on Solana's public test network. Anyone can call it, and when they do, the code that runs is what Phil's compiler produced.
It is a small program: it returns a number. That is everything Phil's compiler can build today, and it is the first step, not the last.
Run it yourself
Press the button and a Solana devnet node runs the Phil program now and sends back its log. No wallet is needed and it costs nothing.
The node executes the program against the live chain and returns the result without recording a transaction, which is why it is free. The recorded transaction below was signed and paid for.
The recorded call
Checked every night
How it got there
The Phil program
Written in the form Phil's compiler reads today.
Phil's compiler turns it into LLVM
This is the output of
philc, unmodified. The same compiler runs in the playground.Solana's toolchain builds a program from it
Two adjustments are made first: the lines naming a desktop target are dropped, and
mainis renamed so that Solana's entry point can call it. A few lines of C form that entry point; they call the Phil function and write its result to the log. The finished program is bytes.It is deployed and called
A workflow on GitHub deploys the program to devnet and sends it one transaction. The log above is what Solana recorded.
What this is and is not
- It is real: Phil source, Phil's compiler, Solana's virtual machine. It is not our simulator.
- It is tiny. It holds no tokens and takes no input. The utilities and the OTC desk are still simulations.
- It is on devnet, Solana's public test network. Devnet SOL has no value, and devnet is reset from time to time, which would remove the program until it is deployed again.
- As Phil's compiler accepts more of the language, more of Phil can go on chain through the same steps.
The pipeline is in onchain/. This is a community project and is not affiliated with Phil or Solana.