Skip to main content

PTTB (Português Técnico do Brasil) - A Brazilian-themed programming language

Project description

PTTB - Português Técnico do Brasil 🇧🇷

A linguagem de programação conceitual 100% brasileira, focada no desenvolvedor CLT, agora rodando em Python como um runtime cross-platform!

O que é?

PTTB é um interpretador desenvolvido em Python que traduz a rotina, a ansiedade e a burocracia do desenvolvedor brasileiro para uma linguagem de programação funcional.

  • Chega de if/else: Aqui a gente usa sePixAceitou, sePixNegou e sePixDeuRuim.
  • Sem while infinito: O negócio é enquantoFilaNaoAnda.
  • Quer imprimir na tela?: mandaMsg("Alô mundo!").
  • Precisa de input?: pedeInputNoZap("Qual o seu nome?").

E sim, tem arrays (caixaDePaesDeQueijo) e dicionários (inventarioDoZAP).

Como Instalar (via pip)

Em breve você poderá instalar diretamente via pip:

pip install pttb-lang

Como Usar

Crie um arquivo teste.pttb:

definir dinheiro = 10

funcaoCLT pagar(valor) {
    sePixAceitou (valor <= dinheiro) {
        mandaMsg("Pagamento aprovado")
        dinheiro = dinheiro - valor
    } sePixNegou {
        mandaMsg("Sem saldo")
    }
}

mandaMsg("Saldo antes:")
mandaMsg(dinheiro)
pagar(5)

Execute no terminal:

pttb run teste.pttb

Para debugar a execução:

pttb debug teste.pttb

Extensão para VS Code

O repositório inclui também uma extensão do VS Code com Syntax Highlighting e Snippets para facilitar a sua vida CLT. Basta instalar a pasta pttb-vscode na sua IDE!

Estrutura do Interpretador

O PTTB possui toda a stack necessária de um interpretador real:

  • Lexer: Tokeniza o código PTTB usando regex e identifica as palavras-chave meme.
  • Parser: Constrói uma Abstract Syntax Tree (AST) a partir dos tokens.
  • Runtime: Cuida de variáveis, chamadas de funções recursivas e call stack.
  • Interpretador: Navega a AST e executa a lógica mapeada em Python.
  • CLI: Executável pttb amigável no terminal.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pttb_lang-1.2.0.tar.gz (25.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pttb_lang-1.2.0-py3-none-any.whl (26.0 kB view details)

Uploaded Python 3

File details

Details for the file pttb_lang-1.2.0.tar.gz.

File metadata

  • Download URL: pttb_lang-1.2.0.tar.gz
  • Upload date:
  • Size: 25.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pttb_lang-1.2.0.tar.gz
Algorithm Hash digest
SHA256 2208f77707a8dd463b2af2a82c73e5774b5c118f2c715ff123b34d6c7091efdc
MD5 1ad285b79a4f2366279e5bc0e3ed1713
BLAKE2b-256 0c6a770d919473e2830b7cd1d22f26c9ca06c957a791260a7bdeb4f752cdea63

See more details on using hashes here.

File details

Details for the file pttb_lang-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: pttb_lang-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 26.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pttb_lang-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6650611941f7ff96109cb88b01823eb4ee29bae0f29ad7b3d7abd14a994ddd7e
MD5 39ce4d4ff6ce996b399f8fef1cd8331b
BLAKE2b-256 ce60797c0af67844e7cea5ebed0768e5981a6ab39c9487792cab1a42dbd1d34e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page