# Adam
Adam is a Nateve Programming Language transpiler developed using Python.
![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)
[![documentation Status](https://readthedocs.org/projects/nateve/badge/?version=latest)](https://nateve.readthedocs.io/en/latest/?badge=latest)
![docker publish](https://github.com/NateveLanguage/Adam/actions/workflows/docker-publish.yml/badge.svg)
![tests](https://github.com/NateveLanguage/Adam/actions/workflows/python-app.yml/badge.svg)
<!-- [![hits count](http://hits.dwyl.com/NateveLanguage/Adam.svg?style=flat-square)](http://hits.dwyl.com/NateveLanguage/Adam) -->
## Nateve
Nateve 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 the [Nateve documentation](https://nateve.readthedocs.io/).
## Nateve principal features
### 1. Simple and easy to use
Just install the package and start coding.
### 2. Intuitive and easy to understand
Quickly understand the language and its features.
### 3. 100% free and open source
The language is free and open source. You can use it for any purpose. See the [license](LICENSE).
### 4. 100% customizable
You can customize the language to your needs. You can make your own language from scratch. See the [Welcome to Nateve templates](#welcome-to-nateve-templates) section for more information.
## Welcome to Nateve templates
Nateve 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 the `using` command and then use the template in the Nateve source code.
Learn more about templates in the [templates use](#using-templates) section.
## Why use Nateve templates?
### 1. Customization
You can customize the language to your needs. Feel free to create your own templates or modify existing templates.
### 2. Team work
Your 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 share
Your templates can be used by other developers. You can easily share your templates with the community.
## Options of command line
1. `build`: Transpile Nateve source code to Python 3.8
2. `run`: Run Nateve source code
3. `transpile`: Transpile Nateve source code to an executable file (.exe)
4. `run-init-loop`: Run Nateve source code with an initial source and a loop source
5. `set-time-unit`: Set Adam time unit to seconds or miliseconds (default: milisecond)
6. `-v`: Activate verbose mode
## Nateve Tutorial
In this tutorial, we will learn how to use Nateve step by step.
### Requirements
1. [python 3.5<= version <=3.8 added to the PATH](https://www.python.org/)
2. [pip >=21.3.1](https://pypi.org/project/pip/)
3. [eggdriver >=0.0.1](https://pypi.org/project/eggdriver/)
### Extra requirements for Quantum Computing developers
1. [qiskit >=0.30.0](https://pypi.org/project/qiskit/)
2. [numpy >=1.20.1](https://pypi.org/project/numpy/)
### Step 0: Learn the basics
We recommend read this README.md file.
### Step 1: Installation
Recommend Installation:
#### 1. Download the source as a Zip
[Download now!](https://github.com/NateveLang/Adam/archive/refs/heads/main.zip)
#### 2. Unzip the source Adam-main.zip
#### 3. Move the content of the folder Adam-main into the Python/Libs folder
You just need the subfolders:
1. **adam**: the Nateve core
2. **nqs**: for Quantum Computing
3. **user**: for NQS customizable functions
Feel 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 step
#### 4. Add the adam.bat file to the PATH
You can also move the adam.bat file into the Python/Scripts folder in order to easily add adam.bat to the PATH
Adding adam.bat to the PATH alows you to invoke Adam with the command `adam`.
Instead, you can invoke Adam with the command `py -m adam` without using the adam.bat file.
#### 5. Add your favorite templates
If you want, you can create tour own templates in the folder Python/Libs/adam/templates<br>
Learn more about templates in the [templates use](#using-templates) section.
### Step 2: Create a new Nateve file
Create a file with the file extension .nate and join to the Nateve community.
### Quick start examples
#### Hello World program
```python
print("Hello, World!")
```
#### Is prime? program
```python
def is_prime(n) {
if n == 1 {
return False
}
for i in range(2, n) {
if n % i == 0 {
return False
}
}
return True
}
n = ninput("Enter a number: ")
if is_prime(n) {
print("It is a prime number.")
}
else {
print("It is not a prime number.")
}
```
### Comments
If you want to comment your code, you can use:
```bash
~ This is a single line comment ~
~
And this a multiline comment
~
```
### Variables
This language uses variables. For declaring variables, you just need to write the name of the variable and the value of the variable.
For example:
```python
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 = $
| 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 |
$ ~ Matrix ~
```
Nateve allows data type as Integer, Float, Complex, Boolean, String, Tuple, None, Vector, Polynomial and Matrix.
### Vectors
The 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:
```python
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: [1 2 3 4] ~
print(value_list.dot(value_list2)) ~ Output: 6 ~
print(value_list.add(value_list2)) ~ Output: [1 3 3 5 5] ~
```
### Matrices
The Matrices are a special type of vectors of vectors.
```python
a = $
| 1 5 |
| 0 2 |
$
b = $
|0 1|
|1 0|
$
print(a)
~ Output:
| 1 5 |
| 0 2 |
~
c = a.dot(b)
print(c)
~ Output:
| 5 1 |
| 2 0 |
~
d = a.plus(b)
print(d)
~ Output:
| 1 6 |
| 1 2 |
~
```
### Functions
For declaring a function, you have to use the next syntax:
```python
def example_function(argument1, argument2, ...) {
~ sentence1 ~
~ sentence2 ~
...
return Return_Value
}
example_function(argument1, argument2, ...) ~ Call the function ~
```
### Conditionals
Regarding the conditionals, the syntax structure is:
```python
if condition {
~ consequence ~
}
elif condition {
~ other_consequence ~
}
...
else {
~ default_consequence ~
}
```
For example:
```python
if x <= 1 and x % 3 == 0 {
a = 0
}
elif x == 9 {
a = 1
}
else {
a = 2
}
```
### Loops
In order to use loops, you have to use the next syntax:
#### While Loop
```python
while condition {
~ sentence1 ~
~ sentence2 ~
...
}
```
#### For
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
![preview](https://csdnimg.cn/release/downloadcmsfe/public/img/white-bg.ca8570fa.png)
共62个文件
py:41个
nate:9个
txt:5个
![preview-icon](https://csdnimg.cn/release/downloadcmsfe/public/img/scale.ab9e0183.png)
资源分类:Python库 所属语言:Python 资源全名:nateve-adam-0.0.1.tar.gz 资源来源:官方 安装方法:https://lanzao.blog.csdn.net/article/details/101784059
资源推荐
资源详情
资源评论
![gz](https://img-home.csdnimg.cn/images/20210720083447.png)
![gz](https://img-home.csdnimg.cn/images/20210720083447.png)
![gz](https://img-home.csdnimg.cn/images/20210720083447.png)
![gz](https://img-home.csdnimg.cn/images/20210720083447.png)
![gz](https://img-home.csdnimg.cn/images/20210720083447.png)
![gz](https://img-home.csdnimg.cn/images/20210720083447.png)
![gz](https://img-home.csdnimg.cn/images/20210720083447.png)
![gz](https://img-home.csdnimg.cn/images/20210720083447.png)
![gz](https://img-home.csdnimg.cn/images/20210720083447.png)
![gz](https://img-home.csdnimg.cn/images/20210720083447.png)
![gz](https://img-home.csdnimg.cn/images/20210720083447.png)
![gz](https://img-home.csdnimg.cn/images/20210720083447.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
收起资源包目录
![package](https://csdnimg.cn/release/downloadcmsfe/public/img/package.f3fc750b.png)
![folder](https://csdnimg.cn/release/downloadcmsfe/public/img/folder.005fa2e5.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![folder](https://csdnimg.cn/release/downloadcmsfe/public/img/folder.005fa2e5.png)
![folder](https://csdnimg.cn/release/downloadcmsfe/public/img/folder.005fa2e5.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![folder](https://csdnimg.cn/release/downloadcmsfe/public/img/folder.005fa2e5.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![folder](https://csdnimg.cn/release/downloadcmsfe/public/img/folder.005fa2e5.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![folder](https://csdnimg.cn/release/downloadcmsfe/public/img/folder.005fa2e5.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![folder](https://csdnimg.cn/release/downloadcmsfe/public/img/folder.005fa2e5.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/TXT.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/TXT.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/TXT.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/TXT.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/TXT.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![folder](https://csdnimg.cn/release/downloadcmsfe/public/img/folder.005fa2e5.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![folder](https://csdnimg.cn/release/downloadcmsfe/public/img/folder.005fa2e5.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![folder](https://csdnimg.cn/release/downloadcmsfe/public/img/folder.005fa2e5.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![folder](https://csdnimg.cn/release/downloadcmsfe/public/img/folder.005fa2e5.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
共 62 条
- 1
资源评论
![avatar-default](https://csdnimg.cn/release/downloadcmsfe/public/img/lazyLogo2.1882d7f4.png)
![avatar](https://profile-avatar.csdnimg.cn/277f6345dca0446498fbbc03843436aa_qq_38161040.jpg!1)
挣扎的蓝藻
- 粉丝: 13w+
- 资源: 15万+
上传资源 快速赚钱
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助
![voice](https://csdnimg.cn/release/downloadcmsfe/public/img/voice.245cc511.png)
![center-task](https://csdnimg.cn/release/downloadcmsfe/public/img/center-task.c2eda91a.png)
安全验证
文档复制为VIP权益,开通VIP直接复制
![dialog-icon](https://csdnimg.cn/release/downloadcmsfe/public/img/green-success.6a4acb44.png)