npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

delegua-risc-v

v0.0.1

Published

Compilador Delégua para binários RISC-V via GNU Assembler, sem LLVM.

Downloads

27

Readme

delegua-riscv

Compilador Delégua para binários RISC-V nativos, sem LLVM. Utiliza o tradutor de assembly RISC-V da biblioteca @designliquido/delegua e o toolchain GNU para montagem e linkagem.

Pipeline de compilação

arquivo.delegua → Lexador → AvaliadorSintatico → TradutorAssemblyRISCV → arquivo.s → GNU as → arquivo.o → GNU ld → binário

Plataformas alvo

| Alvo | Descrição | |------------------|---------------------------------------------| | linux-riscv64 | Linux em arquitetura RISC-V 64-bit (padrão) | | linux-riscv32 | Linux em arquitetura RISC-V 32-bit |

Pré-requisitos

Linux RISC-V 64-bit (linux-riscv64)

apt install gcc-riscv64-linux-gnu binutils-riscv64-linux-gnu

Ferramentas necessárias no PATH:

| Ferramenta | Função | |-----------------------------|-------------------------------------| | riscv64-linux-gnu-as | Montador GNU para RISC-V 64-bit | | riscv64-linux-gnu-ld | Linker GNU para RISC-V 64-bit |

Linux RISC-V 32-bit (linux-riscv32)

apt install gcc-riscv32-linux-gnu binutils-riscv32-linux-gnu

Ferramentas necessárias no PATH:

| Ferramenta | Função | |-----------------------------|-------------------------------------| | riscv32-linux-gnu-as | Montador GNU para RISC-V 32-bit | | riscv32-linux-gnu-ld | Linker GNU para RISC-V 32-bit |

Instalação

npm install -g delegua-riscv
# ou
yarn global add delegua-riscv

Uso (CLI)

npx delegua-riscv <arquivo.delegua> [opções]

Opções

| Opção | Descrição | |------------------------------------------|---------------------------------------------------------------| | -o <nome> | Nome do binário de saída (sem extensão). Padrão: nome do arquivo de entrada. | | --alvo <linux-riscv64\|linux-riscv32> | Plataforma alvo. Padrão: linux-riscv64. | | --manter-temporarios | Mantém os arquivos intermediários (.s, .o) após compilar. |

Exemplos

# Compilar para Linux RISC-V 64-bit (padrão)
npx delegua-riscv programa.delegua

# Compilar com nome de saída personalizado
npx delegua-riscv programa.delegua -o meu-programa

# Compilar para RISC-V 32-bit
npx delegua-riscv programa.delegua --alvo linux-riscv32

# Inspecionar o assembly gerado sem remover os temporários
npx delegua-riscv programa.delegua --manter-temporarios

Uso (API)

import { CompiladorRISCV } from 'delegua-riscv';

const compilador = new CompiladorRISCV();
const resultado = await compilador.compilar({
    arquivoEntrada: 'programa.delegua',
    nomeSaida: 'programa',            // opcional
    alvo: 'linux-riscv64',            // opcional, padrão: 'linux-riscv64'
    manterTemporarios: false,         // opcional
});

if (resultado.sucesso) {
    console.log('Binário gerado em:', resultado.caminhoBinario);
} else {
    console.error('Erro:', resultado.erro);
}

OpcaoesCompilacao

| Campo | Tipo | Obrigatório | Descrição | |----------------------|---------------------------------------|-------------|----------------------------------------------------| | arquivoEntrada | string | Sim | Caminho para o arquivo .delegua. | | nomeSaida | string | Não | Nome do binário de saída (sem extensão). | | alvo | 'linux-riscv64' \| 'linux-riscv32' | Não | Plataforma alvo. Padrão: 'linux-riscv64'. | | manterTemporarios | boolean | Não | Preserva .s e .o após compilar. |

ResultadoCompilacao

| Campo | Tipo | Descrição | |------------------|-----------|-------------------------------------------------| | sucesso | boolean | true se a compilação foi bem-sucedida. | | caminhoBinario | string | Caminho para o binário gerado (se bem-sucedido).| | erro | string | Mensagem de erro (se mal-sucedido). |

Desenvolvimento

# Instalar dependências
yarn install

# Compilar o pacote
yarn empacotar

# Executar testes
yarn testes-unitarios

# Executar direto via ts-node
yarn executar programa.delegua

Comparação com outros pacotes

| Aspecto | delegua-x64 | delegua-arm | delegua-riscv | |-----------------------|----------------------------------|-------------------------------------------------|-----------------------------------------------------| | Tradutor | TradutorAssemblyX64 | TradutorAssemblyARM | TradutorAssemblyRISCV | | Alvos | linux, windows | linux-arm, android | linux-riscv64, linux-riscv32 | | Montador | nasm -f elf64/win64 | arm-linux-gnueabihf-as / arm-linux-androideabi-as | riscv64-linux-gnu-as / riscv32-linux-gnu-as | | Linker | ld / gcc | arm-linux-gnueabihf-ld / arm-linux-androideabi-ld | riscv64-linux-gnu-ld / riscv32-linux-gnu-ld | | Arquivo intermediário | .asm | .s | .s |

Licença

MIT