Skip to main content

System interfaces

Circuit functions do not have access to any system interfaces. For example, they cannot make network requests or open and modify files.

The following examples contain invalid circuit functions that attempt to perform operations involving system interfaces.


#include <iostream>
#include <fstream>
using namespace std;

void write_to_file() {
ofstream local_file;
local_file.open("example.txt");
local_file << "A circuit cannot do this!";
local_file.close();
}

[[circuit]] int circuit_func() {
open_file();
return 0;
}