BSD Ports

lang/pnut 0.0.20240724 NetBSD

C compiler written in POSIX shell and generating POSIX shell scripts

System
NetBSD
Repository
pkgsrc
Maintainer
[email protected]
License
2-clause-bsd
Categories
lang
Package size
67.1 KiB, 355.6 KiB installed

Description

Pnut compiles a reasonably large subset of C99 to human-readable POSIX shell scripts. It can be used to generate portable shell scripts without having to write shell.

Its main uses are:

  • As a transpiler to write portable shell scripts in C
  • As a way to bootstrap a compiler written in C with an executable version that is still human readable

Main features:

  • No new language to learn -- C code in, shell code out
  • The human-readable shell script is easy to read and understand.
  • A runtime library including file I/O and dynamic memory allocations
  • A preprocessor
  • Integrates easily with existing shell scripts

Install

Binary package:

pkgin install pnut

From pkgsrc:

cd /usr/pkgsrc/lang/pnut && make install clean

Dependencies

No port depends on this one.