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

pascal-polycall

v1.0.0

Published

Free Pascal binding for the Polycall core (polycall >= 1.1.0, binding ABI 1): cdecl externals over <polycall.h>.

Readme

pascal-polycall

Free Pascal binding for the Polycall core (polycall >= 1.1.0, binding ABI v1).

src/PascalPolycall.pas declares the core's binding ABI (<polycall.h>, docs/BINDING_ABI.md in the core repository) as cdecl externals of the polycall library with their exact C types -- there is no C shim. Configuration parsing, validation, networking and the peer protocol stay in the core.

Install

npm install pascal-polycall

This is a native source package (not yet published): the tarball contains the Pascal unit, examples, tests, scripts, Makefile, manifest, configuration and license -- no binaries, and its JavaScript entry point loads nothing.

Pascal API

uses PascalPolycall;

PolycallCheckABI;                                  { EPolycallError unless ABI 1 }
WriteLn(PolycallVersion);                          { '1.1.0' }

Status := PolycallRunConfig('pascal-polycallrc');  { polycall_ffi_run_config(path, 1) }
Status := PolycallRunConfig('pascal-polycallrc', False);   { validate only }
PolycallRunConfigOrRaise('pascal-polycallrc');     { raises EPolycallError }

WriteLn(PolycallCall('127.0.0.1:7000', 'inventory', 'get',
  '{"item_id":"widget-a"}', 2000));

Alpha := TPolycallPeer.Create('alpha');            { 127.0.0.1:<ephemeral> }
Beta := TPolycallPeer.Create('beta', '127.0.0.1:0', Token);
try
  Alpha.RegisterPeer('beta', Beta.Endpoint);
  Alpha.Send('beta', 'hello'#0'bytes', 'msg-1');    { exactly one delivery attempt }
  Msg := Beta.Receive(5000);                        { Msg.Sender, Msg.Id, Msg.Payload }
finally
  Alpha.Free;                                       { Free closes the node }
  Beta.Free;
end;

Also TPolycallPeer.CreateSendOnly, Close (a second Close raises POLYCALL_E_INVALID_HANDLE), NodeId, UnregisterPeer, List, Ping, TryReceive, Cancel (wakes a thread blocked in Receive), Health, PolycallDescribe, PolycallCallStatus (non-raising), PolycallStrError, PolycallLastError.

EPolycallError exposes Status (negative POLYCALL_E_* constant), StatusName (polycall_strerror), Detail (polycall_last_error) and, for PolycallCall, Output (the remote error object).

Build and test

Needs Free Pascal >= 3.2 (Debian: apt-get install fp-compiler) and an installed core found through pkg-config:

export PKG_CONFIG_PATH=/opt/polycall/lib/pkgconfig LD_LIBRARY_PATH=/opt/polycall/lib
make              # compile the unit
make test         # real-core test + interop with the polycall CLI
make test-loader  # missing library / old library / ABI mismatch (Linux)
make memcheck     # the real-core test under valgrind memcheck
make example      # examples/basic.pas
npm test          # make test + verify-dry + npm package test

Programs using the unit need -Fl<prefix>/lib (the Makefile takes it from pkg-config --variable=libdir polycall); programs using TThread on Unix put cthreads first in their uses clause. On Windows the unit expects polycall.dll (MSVC build) or, with -dPOLYCALL_MINGW, libpolycall.dll; Windows has not been run yet -- the QA host has no Free Pascal.

make test runs tests/pascal_polycall_test.pas through tests/run-real.sh, which starts polycall peer serve and polycall start; a missing fpc, polycall CLI or valgrind is reported as SKIP (exit 77), never as success. See tests/TESTS.md.

Loading

The unit's external declarations make the program depend on the core (libpolycall.so.1), so the dynamic loader resolves it when the program starts. A missing library stops the program with the loader's libpolycall.so.1: cannot open shared object file (exit 127); a 1.0 library without the binding ABI v1 symbols with undefined symbol: polycall_... (exit 127); neither is a crash. A library that reports another binding ABI is refused: PolycallCheckABI, PolycallRunConfig, PolycallDescribe, PolycallCall / PolycallCallStatus and TPolycallPeer.Create* return or raise POLYCALL_E_UNSUPPORTED (the raising forms with an EPolycallError naming the ABI it reported). make test-loader checks all three against fake libraries.

License

MIT © 2026 Nnamdi Michael Okpala ([email protected]).