{"id":13709234,"url":"https://github.com/amanda-lang/amanda","last_synced_at":"2025-05-06T15:32:28.695Z","repository":{"id":39716957,"uuid":"254952546","full_name":"amanda-lang/amanda","owner":"amanda-lang","description":"The Amanda programming language","archived":false,"fork":false,"pushed_at":"2024-04-14T01:03:43.000Z","size":7335,"stargazers_count":25,"open_issues_count":0,"forks_count":4,"subscribers_count":6,"default_branch":"main","last_synced_at":"2024-04-14T12:01:01.696Z","etag":null,"topics":["compiler","interpreter","portuguese","python","rust","vm"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/amanda-lang.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2020-04-11T20:46:41.000Z","updated_at":"2024-04-17T06:41:13.275Z","dependencies_parsed_at":"2024-04-02T23:27:10.267Z","dependency_job_id":"a7f3f626-6932-4fca-bdca-e7038c94ab04","html_url":"https://github.com/amanda-lang/amanda","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amanda-lang%2Famanda","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amanda-lang%2Famanda/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amanda-lang%2Famanda/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amanda-lang%2Famanda/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/amanda-lang","download_url":"https://codeload.github.com/amanda-lang/amanda/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252713025,"owners_count":21792414,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["compiler","interpreter","portuguese","python","rust","vm"],"created_at":"2024-08-02T23:00:37.011Z","updated_at":"2025-05-06T15:32:25.203Z","avatar_url":"https://github.com/amanda-lang.png","language":"Python","funding_links":[],"categories":["Uncategorized"],"sub_categories":["Uncategorized"],"readme":"# Amanda\n![tests](https://github.com/stackswithans/amanda/workflows/tests/badge.svg)\n\nAmanda is a statically typed programming language with portuguese constructs. \nIt is implemented using a Python compiler and a Rust VM.\nIt's specifically designed to be used by portuguese speakers who are just getting started with programming.\n\n## Build Instructions\n\nTo build the project on your machine you need following:\n- Python 3.8+\n- Rust and Cargo v1.59.0+ \n\n**On Windows**\n\nRun the following commands at the root folder of the repo using CMD:\n\n```\npip install -r requirements.txt \npython setup.py\n```\nTest the installation by running the following command on CMD:\n\n```\ndist\\amanda examples\\hello_world.ama \n```\n\n**On Linux/Mac** \n\nRun the following commands at the root folder of the repo:\n\n```\npip3 install -r requirements.txt \npython3 setup.py\n```\nTest the installation by running:\n\n```\ndist/amanda examples/hello_world.ama \n```\n\n## Tour of Amanda\n\n#### Syntax\n\n```python\n\n# Comentário simples\n\n\n\n# Instruções são delimitadas por uma nova linha\n# ou por ';'\n\na : int = 1 # o ';' não é necessário\nb : int = 2\n\n\n# Mas pode ser usado\na : int = 1; \nb : int = 2;\n\n\n\nfunc soma(a:int,b:int):int\n    retorna a+b\nfim # a palavra 'fim' indica o fim de corpo de uma função, classe e e.t.c\n```\n\n#### Variables\n\n```python\n\n# Declaração simples\na : int # variável 'a' do tipo int\n\nb : int = 10 # declaração e atribuição\n\n#Variáveis do mesmo tipo podem ser declaradas na mesma linha\na,b : int\na = 10\nb = 50\n```\n\n#### Types\n\n| Types         | Values                | \n| ------------- |:----------------------|\n| int           | 2, 4, -2, 0           |\n| real          | 2.0, 3.15, -8.2       |\n| bool          | verdadeiro, falso     |\n| texto         | \"eu\", 'meu'           |\n\n#### Operators\n\n```python\n\n# Operadores aritméticos\n\n2 + 2 # Soma: 4\n2 - 2 # Soma: 4\n2 * 3 # multiplicação: 6\n1 // 2 # divisão inteira: 0\n1 / 2 # divisão real :  0.5\n2 % 2 # resto: 0\n\n# Operadores relacionais\n\n2 \u003e 3 # maior: falso\n2 \u003c 3 # menor: verdadeiro\n2 \u003e= 3 # maior ou igual : falso\n2 \u003c= 3 # maior ou igual : verdadeiro\n\nverdadeiro == falso # igual : falso\nverdadeiro != falso # diferente : verdadeiro\n\n#Operadores lógicos\n\nverdadeiro e falso # e lógico : falso\nverdadeiro ou falso # ou lógico : verdadeiro\nnao verdadeiro # negação : falso\n```\n\n#### Strings\n\n```python\n\n\"ama\" + \"nda\" # concatenação : amanda\n\n\"ama\" == \"nda\" # comparação : falso\n\n```\n\n#### Control flow\n\n```python\n# se\n\nnum : real = 5 // 3\n\nse  num \u003e 1 entao\n    mostra \"maior que 1\" \nsenaose num == 1 entao\n    mostra \"igual à 1\"\nsenao\n    mostrar \"menor que 1\"\nfim\n\n# repetição: enquanto\n\ni : int\n\nenquanto i \u003c 10 faca\n    mostra i\n    i += 1\nfim\n\n# repetição: para \n\npara i de 0..11 faca # começa no 0 e termina no 10\n    mostra i\nfim\n\n```\n\n#### Input\n\n```python\n\ni : int = leia_int(\"Digite um inteiro: \") # Exibe a mensagem e lê um inteiro do teclado\n\n\nr : real = leia_real(\"Digite um real: \") # Exibe a mensagem e lê um real do teclado\n\n\ns : texto = leia(\"Digite uma string: \") # Exibe a mensagem e lê uma cadeia de caracteres do teclado\n```\n\n#### Output\n\n```python\nmostra 1 # exibe 1 \nmostra 2.1 # exibe 2.1\nmostra verdadeiro # exibe verdadeiro\nmostra \"texto\" # exibe texto\n\ns : texto = \"carro\"\nmostra s # exibe carro\n\n```\n\n#### Functions\n\n```python\n#Função que recebe dois inteiros e retorna a soma deles\nfunc soma (a:int,b:int): int # retorna um inteiro\n    retorna a + b\nfim\n\n \n# Função sem tipo de retorno indica que\n# a função não retorna nenhum valor\nfunc mostra_soma(a:int,b:int) # sem tipo de retorno\n    mostra a + b\nfim\n```\n\n### Lists (Arrays)\n```python\n\n# Uma lista serve para armazenar vários valores\n#do mesmo tipo\n#Para criar a lista use a 'função' lista\n\nminha_lista : [] int = lista(int,4) # tipo e o tamanho\n\n# Também é possível criar uma lista de forma directa\nminha_lista = [int: 1, 2, 3]\n\n# Preencher a lista\n\npara i de 0..tamanho(minha_lista) faca\n    minha_lista[i] = i*i\nfim\n\n# Imprimir todos elementos da lista\npara i de 0..tamanho(minha_lista) faca\n    mostra minha_lista[i]\nfim\n\n#Criar uma matriz 3 x 2\nminha_matriz : [][]int = matriz(int, 3, 2)\nminha_matriz[0][0] = 1\n\nmostra minha_matriz[0][0]\n```\n\n\n#### Classes\n```python\n\nclasse Ponto # Uma classe agrega campos e funções\n\n    x : real\n    y : real\n\n    func e_origem():bool\n        retorna (x == 0) e (y == 0)\n    fim\n\n    func e_igual(p2 : Ponto) : bool\n        retorna (eu.x == p2.x) e (eu.y == p2.y) \n    fim\n\nfim\n\n\np : Ponto = Ponto(0,0) # inicializa um ponto com x = 0  e y = 0 \n\nmostra p.x # 0\nmostra p.y # 0\n\nmostra p.e_origem() # verdadeiro\n\np1 : Ponto = Ponto(1,3.4)\nmostra p.e_igual(p1) # falso\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famanda-lang%2Famanda","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Famanda-lang%2Famanda","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famanda-lang%2Famanda/lists"}