Lead-free halide perovskites for transistors and artificial synapses