SQL functions are UDFs that you have defined, written, and registered using the CREATE FUNCTION SQL statement.
As such, they are written using only the SQL language and their definition is completely contained within one (potentially large) CREATE FUNCTION statement. The creation of an SQL function causes the registration of the UDF, generates the executable code for the function, and defines to the database the details of how parameters are passed.