<commit_before>\chapter{Primitive operations}

\section{Purpose}

Primitive operations (or primops for short) are similar to
\commonlisp{} special operators in that the compiler handles them
specially.  They are different from \commonlisp{} special operators in
that a primop does not necessarily have an evaluation rule that is
different from that of a function call.

Generally speaking, primops should not be used directly in application
code.  Instead, they are used in system code for implementing certain
basic \commonlisp{} function.  So, for example, the \texttt{car}
primop would typically be used only in the code for the \commonlisp{}
function \texttt{car}.  That function would then be inlined by the
compiler, so that the resulting AST and ultimately the resulting HIR
instruction that the \texttt{car} primop translates to will be present
also in application code.

Frequently, the need for a primop comes from arises because some HIR
instruction is needed.  Take, for example, the HIR instruction named
\texttt{eq-instruction} for comparing two pointer values for equality.
The existence of that instruction requires an AST doing the same
thing, and it is called \texttt{eq-ast}.  When compiled to HIR, the
\texttt{eq-ast} generates the an \texttt{eq-instruction}.  Finally, in
order to produce the source for the \commonlisp{} function
\texttt{eq}, it must be possible to produce the \texttt{eq-ast} from
some \commonlisp{} code, which is why the \texttt{eq} primop is
needed.

\section{Package}

All primitive operations have names that are symbols in the package
named \texttt{cleavir-primop}.  This package contains only those
symbols that name the primitive operations.  There is no code directly<commit_msg>Remove redundant and incorrect words.<commit_after>\chapter{Primitive operations}

\section{Purpose}

Primitive operations (or primops for short) are similar to
\commonlisp{} special operators in that the compiler handles them
specially.  They are different from \commonlisp{} special operators in
that a primop does not necessarily have an evaluation rule that is
different from that of a function call.

Generally speaking, primops should not be used directly in application
code.  Instead, they are used in system code for implementing certain
basic \commonlisp{} function.  So, for example, the \texttt{car}
primop would typically be used only in the code for the \commonlisp{}
function \texttt{car}.  That function would then be inlined by the
compiler, so that the resulting AST and ultimately the resulting HIR
instruction that the \texttt{car} primop translates to will be present
also in application code.

Frequently, the need for a primop arises because some HIR instruction
is needed.  Take, for example, the HIR instruction named
\texttt{eq-instruction} for comparing two pointer values for equality.
The existence of that instruction requires an AST doing the same
thing, and it is called \texttt{eq-ast}.  When compiled to HIR, the
\texttt{eq-ast} generates the an \texttt{eq-instruction}.  Finally, in
order to produce the source for the \commonlisp{} function
\texttt{eq}, it must be possible to produce the \texttt{eq-ast} from
some \commonlisp{} code, which is why the \texttt{eq} primop is
needed.

\section{Package}

All primitive operations have names that are symbols in the package
named \texttt{cleavir-primop}.  This package contains only those
symbols that name the primitive operations.  There is no code directly
{'fraction_non_alphanumeric': 0.05621216488901701, 'fraction_numerical': 0.0, 'mean_word_length': 4.802675585284281, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '369919', 'n_tokens_mistral': 886, 'n_tokens_neox': 860, 'n_words': 489}