For the shown MWE, the file won't run
\documentclass[a4paper,12pt,twoside]{book}
\usepackage[nil,bidi=basic-r,layout=counters.lists.tabular]{babel}
\babelprovide[import=ar,mapdigits,main]{arabic}
\babelprovide[import=en,]{english}
\babelfont[arabic]{rm}{Amiri}
\babelfont{rm}{Times New Roman}
\usepackage{glossaries}
\makeglossaries
\newglossaryentry{latex}
{
name=latex,
description={Is a mark up language specially suited
for scientific documents}
}
\newglossaryentry{maths}
{
name=mathematics,
description={Mathematics is what mathematicians do}
}
\title{How to create a glossary}
\author{ }
\date{ }
\begin{document}
\maketitle
The \Gls{latex} typesetting markup language is specially suitable
for documents that include \gls{maths}.
\clearpage
\printglossaries
\end{document}