Package: nateve
NateveNateve is a new general domain programming language open source inspired by languages like Python, C++, JavaScript, and Wolfram Mathematica.Nateve is an transpiled language. Its first transpiler, Adam, is fully built using Python 3.8.For detailed info, see theNateve documentation.Nateve principal features1. Simple and easy to useJust install the package and start coding.2. Intuitive and easy to understandQuickly understand the language and its features.3. 100% free and open sourceThe language is free and open source. You can use it for any purpose. See thelicense.4. 100% customizableYou can customize the language to your needs. You can make your own language from scratch. See theWelcome to Nateve templatessection for more information.Welcome to Nateve templatesNateve Language includes a set of templates that can be used to customize Nateve. Templates are Python modules included in the templates subpackage. You can also create your own templates.A template is a Python module that contains a set of words translations, functions definitions, and many other customizations. Every template can be used to customize Nateve. You just need to import the template with theusingcommand and then use the template in the Nateve source code.Learn more about templates in thetemplates usesection.Why use Nateve templates?1. CustomizationYou can customize the language to your needs. Feel free to create your own templates or modify existing templates.2. Team workYour team can work together using different languages in the same file or project. For example, you can start coding in English and then switch to French.It makes it easier to work together. Different team members can work on the same project using their native languages.3. Easy to shareYour templates can be used by other developers. You can easily share your templates with the community.Options of command linebuild: Transpile Nateve source code to Python 3.8run: Run Nateve source codecompile: Transpile Nateve source code to an executable file (.exe)run-init-loop: Run Nateve source code with an initial source and a loop sourceset-time-unit: Set Adam time unit to seconds or miliseconds (default: milisecond)help: Get helpNateve TutorialIn this tutorial, we will learn how to use Nateve step by step.Requirementspython 3.5<= version <=3.8 added to the PATHpip >=21.3.1eggdriver >=0.0.1Extra requirements for Quantum Computing developersqiskit >=0.30.0numpy >=1.20.1Step 0: Learn the basicsWe recommend read this README.md file.Step 1: InstallationRecommended Installation (usingpip):Requeriments:pip (latest version)1. Install adam using pippipinstallnateveInstalling Nateve using pip alows you to invoke Adam with the commandadam.2. Add your favorite templates (optional)If you want, you can create tour own templates in the folder Python/Libs/site-packages/adam/templatesLearn more about templates in thetemplates usesection.Deprecated Installation (for Nateve <= 0.0.1):1. Download the source as a ZipDownload now!2. Unzip the source Adam-main.zip3. Move the content of the folder Adam-main into the Python/Libs folderYou just need the subfolders:adam: the Nateve corenqs:  for Quantum Computinguser:  for NQS customizable functionsFeel free to delete the examples, testing files and the other folders.
DO NOT delete the file adam.bat, it will be used in the next step4. Add the adam.bat file to the PATHYou can also move the adam.bat file into the Python/Scripts folder in order to easily add adam.bat to the PATHAdding adam.bat to the PATH alows you to invoke Adam with the commandadam.
Instead, you can invoke Adam with the commandpy -m adamwithout using the adam.bat file.5. Add your favorite templates (optional)If you want, you can create tour own templates in the folder Python/Libs/adam/templatesLearn more about templates in thetemplates usesection.Step 2: Create a new Nateve fileCreate a file with the file extension .nate and join to the Nateve community.Quick start examplesHello World programprint("Hello, World!")Is prime? programdefis_prime(n){ifn==1{returnFalse}foriinrange(2,n){ifn%i==0{returnFalse}}returnTrue}n=ninput("Enter a number: ")ifis_prime(n){print("It is a prime number.")}else{print("It is not a prime number.")}CommentsIf you want to comment your code, you can use:~Thisisasinglelinecomment~

~Andthisamultilinecomment
~VariablesThis language uses variables. For declaring variables, you just need to write the name of the variable and the value of the variable.For example:a=1~Interger~b=1.0~Float~c=1+2j~Complex~d="hello"~String~e=True~Boolean~f=[1,2,3]~Vector~g=(1,2)~Tuple~h=Polynomial("1 +2x +x^2")~Polynomial~i=$|11234||01234||11234||11234||11234|$~Matrix~Nateve allows data type as Integer, Float, Complex, Boolean, String, Tuple, None, Vector, Polynomial and Matrix.VectorsThe Vectors allow to use all the data types before mentioned, as well as lists and functions.Also, they allow to get an item through the next notation:value_list=[1,2,3,4,5]value_list2=[0,1,0,1,0]print(value_list[0])~Output:1~print(value_list[0:4])~Output:[1234]~print(value_list.dot(value_list2))~Output:6~print(value_list.add(value_list2))~Output:[13355]~MatricesThe Matrices are a special type of vectors of vectors.a=$|15||02|$b=$|01||10|$print(a)~Output:|15||02|~c=a.dot(b)print(c)~Output:|51||20|~d=a.plus(b)print(d)~Output:|16||12|~FunctionsFor declaring a function, you have to use the next syntax:defexample_function(argument1,argument2,...){~sentence1~~sentence2~...returnReturn_Value}example_function(argument1,argument2,...)~Callthefunction~ConditionalsRegarding the conditionals, the syntax structure is:ifcondition{~consequence~}elifcondition{~other_consequence~}...else{~default_consequence~}For example:ifx<=1andx%3==0{a=0}elifx==9{a=1}else{a=2}LoopsIn order to use loops, you have to use the next syntax:While Loopwhilecondition{~sentence1~~sentence2~...}For Loopforiteratoriniterable{~sentence1~~sentence2~...}Using TemplatesOne of the most important features of Nateve is the use of templates. Templates are a way to write code in a more readable way. They are words translations written in Python. In order to use templates, you just have to write the protected word "using", and then, write the name of the template. For example:using"template_name"Nateve includes the following standard templates:"english": This template is used to write the code of the program in English. It is the default template."spanish": This template is used to write the code of the program in Spanish."french": This template is used to write the code of the program in French.You also can use your own templates. Just create a file with the name of the template and write the code of the template in the file. Here is a blank template:# The name of the transpiler. This line is required. Do not change it.transpiler_name="adam""""The following code is the translation of the code.You can write your code here and modify the content of the variables.Do not change the name of the variables."""# All the symbols that the transpiler uses.mayusc="ABCDEFGHIJKLMNOPQRSTUVWXYZ"alphabet=mayusc+mayusc.lower()+"_"digits="0123456789"alphanum=alphabet+digitsblanks="/t /n"strings=["'",'"','"""',"'''"]matrices="$"vectors="[]"embedded="°"commentaries="~"floating="."one_char_symbols="+-*/%=<>()[]{}#@,."two_char_symbols=["//","==","<=",">="]# All the data types that the transpiler uses.FLOAT="float"INT="int"COMPLEX="complex"STRING="string"DOCSTRING="docstring"NULL="none"MATRIX="matrix"VECTOR="vector"# All the keywords that the transpiler uses.USE,INCLUDE="using","include"IMPORT,FROM,AS,PASS,IN="import","from","as","pass","in"IF,ELIF,ELSE="if","elif","else"TRY,EXCEPT,WITH="try","except","with"WHILE,FOR,BREAK,CONTINUE="while","for","break","continue"OPERATOR,RETURN="def","return"CLASS,SELF="class","self"AND,OR,NOT,TRUE,FALSE="and","or","not","True","False"# All the status codes that the transpiler uses.embedding=200identifier=300eof=400# All extra functions that the transpiler uses. Feel free to add your own functions.# The string special_functions is used to write these functions.# You can use variables in it using the fstring notation.special_functions=f"""def ninput(prompt = '', default = ''):return float(input(prompt, default))def binput(prompt = '', default = ''):return bool(input(prompt, default))def update_std():subprocess.call([sys.executable, '-m', 'pip', 'install', 'eggdriver'])"""Some Examples~NateveExample1~update_std()~updatestdlibrary~foriinrange(2){print(i)}install("matplotlib")try{print(2/0)}except{print("xd")}Output:01matplotlibsuccessfullyinstalled
xd~NateveExample2~theta=pi/3print(sin(theta),cos(theta),tan(theta))p=sin_serieprint(p.eval(theta))derive(p)print(p.eval(theta))importnumpyasnpx="hello"c=Matrix("""| 1 1 2 3 4 || 0 1 2 3 4 || 1 1 2 3 4 || 1 1 2 3 4 || 1 1 2 3 4 |""")c.display()a=Vector("[ 1 2 3 4 5 6 30 0 9]")a.display()Output:0.86602540378443860.50000000000000011.732050807568870.86602540378443860.5000000000000001|11234||01234||11234||11234||11234|[1234563009]~NateveExample3~using"spanish"theta=pi/3imprime(sen(theta),cos(theta),tan(theta))p=serie_senimprime(p.eval(theta))deriva(p)imprime(p.eval(theta))importanumpycomonpx="hello"c=Matriz("""| 1 1 2 3 4 || 0 1 2 3 4 || 1 1 2 3 4 || 1 1 2 3 4 || 1 1 2 3 4 |""")c.display()a=Vector("[ 1 2 3 4 5 6 30 0 9]")a.display()Output:0.86602540378443860.50000000000000011.732050807568870.86602540378443860.5000000000000001|11234||01234||11234||11234||11234|[1234563009]~NateveExample4~using"spanish"amo_Nateve=verdaderosiamo_Nateve==verdadero{imprime("Yo amo Nateve!")}delocontrario{imprime("Odio Nateve :c")}usando"english"if1<3{print("Try Nateve!")}else{print("NO")}using"french"v="Bonjour"imprimer(v,"Nateve!")Output:YoamoNateve!
TryNateve!
BonjourNateve!~NateveExample5~include"example4.nate"using"spanish"imprime("Nateve example 5")Output:YoamoNateve!
TryNateve!
BonjourNateve!
Nateveexample5~NateveExample6~using"spanish"incluye"example5.nate"a=$|15||02|$b=$|01||10|$imprime("a = ")imprime(a)imprime("b = ")imprime(b)c=a.dot(b)imprime("a * b =")imprime(c)imprime("a + b =")print(a.plus(b))d=[1,2,3,4,5]imprime(d)e=[0,1,0,1,0]imprime(e)f=d.dot(e)imprime(f)g=d.plus(e)imprime(g)~usingspanish,"y"means"and".Then,weneedtouseothertemplatelikefrench~using"french"definirr(x,y,z){retourner$|x||y||z|$}x,y,z=1,5,3j=r(x,y,z)imprimer(j)k=$|200||020||002|$imprimer(k.dot(j))Output:YoamoNateve!
TryNateve!
BonjourNateve!
Nateveexample5a=|15||02|b=|01||10|a*b=|51||20|a+b=|16|[1,2,3,4,5][0,1,0,1,0]6[1,3,3,5,5]|1||5||3||2||10||6|FeedbackI would really appreciatte your feedback. You can submit a new issue.ContributeThis is anopensourceproject, everyone can contribute and become a member of the community ofNateve.Why be a member of the Nateve community?1. A simple and understandable codeThe source code of Adam is made with Python 3.8, a language easy to learn, also good practices are a priority for this project.2. A great potencialThis project has a great potential to be the next programming language for education, to develop the quantum computing, and to develop the AI.3. SimpleOne of the main purposes of this programming language is to create an easy-to-learn language, which at the same time is capable of being used for many different purposes.4. Respect for diversityEverybody is welcome, it does not matter your genre, experience or nationality. Anyone with enthusiasm can be part of this project. Anyone from the most expert to the that is beginning to learn about programming, marketing, design, or any career.How to start contributing?There are multiply ways to contribute, since sharing this project, improving the brand of SigmaF, helping to solve the bugs or developing new features and making improves to the source code.Share this project: You can put your star in the repository, use the topicnateveor talk about this project. You can use the hashtag #Nateve in Twitter, LinkedIn or any social network too.Improve the brand of Nateve: If you are a marketer, designer or writer, and you want to help, you are welcome.Help to solve the bugs: if you find one bug notify us an issue. On this we can all improve this language.Developing new features: If you want to develop new features or making improvements to the project, you can do a fork to thedevbranch (here are the ultimate develops) working there, and later do apull requesttodevbranch in order to updateNateve.