DEV Community

Lucian Green
Lucian Green

Posted on

1 1

Writing a Package Manager for List Prolog

I recently wrote List Prolog Package Manager (LPPM) - an online registry and installation tool for repositories my algorithms depend upon, where my algorithms are in a programming language called List Prolog, run by my SWI-Prolog interpreter algorithm.

What a Package Manager is

A package manager, by my definition, is a registry editor, viewer and installer of repositories (and their dependencies). Dependencies are other folders, or repositories on GitHub that contribute algorithm parts to the main repository. The repositories are side by side, they may rely on each other and commands are run from within folders. For LPPM, all the required dependencies are "at the top of the page" or in the main repositories' entry, they are not scattered through the registry. Also, I cut versions, ratings and download counts (for the sake of simplicity) because, arguably, everything's latest version should be compatible with everything's latest version (requiring careful testing) and ratings and download counts shouldn't matter in an ideal world.

Adding a Registry Entry to LPPM

In the screenshot below, you can see the registry entry HTML file on the Prolog server (actually my Mac acting as a local host). You can enter the repository's user name, repository name, description (with additional installation instructions in case it relies on an API or non-GitHub file somewhere else) and its dependencies (more user/repository pairs).

Adding a Registry Entry to LPPM

Viewing the Registry

In the screenshot below, you can view the registry for LPPM (which is on GitHub). It lists the repositories (or packages when they include their dependencies) and registry editing and installation instructions.

Viewing the Registry

List Prolog and "Everyone's Myness"

One of the best things about writing a Package Manager is it gives you ownership of your programming language's repositories. I can customise the PM and keep it on my server. Also, PMs encourage users to store files in their own repository rather than in one folder, preventing problems of replacing needed files. And you can install packages with a single command rather than clicking on multiple web pages.

Lucian Green
https://github.com/luciangreen/List-Prolog-Package-Manager

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Explore a sea of insights with this enlightening post, highly esteemed within the nurturing DEV Community. Coders of all stripes are invited to participate and contribute to our shared knowledge.

Expressing gratitude with a simple "thank you" can make a big impact. Leave your thanks in the comments!

On DEV, exchanging ideas smooths our way and strengthens our community bonds. Found this useful? A quick note of thanks to the author can mean a lot.

Okay