# pldb **Repository Path**: JiHuiYiYou/pldb ## Basic Information - **Project Name**: pldb - **Description**: PLDB 镜像(Programming Language Database)—— 含 JHYY 语言记录分支 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: main - **Homepage**: http://pldb.info - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-11-25 - **Last Updated**: 2026-11-25 ## Categories & Tags **Categories**: Uncategorized **Tags**: pldb, programming-languages, Database, mirror, reference ## README # PLDB - A Programming Language Database [![Build and Release](https://github.com/kaby76/pldb/actions/workflows/build.yml/badge.svg?branch=main)](https://github.com/kaby76/pldb/actions/workflows/build.yml) PLDB is a comprehensive public domain database containing over 135,000 facts about more than 5,000 programming languages. The project includes both the complete dataset and the website code for [pldb.info](http://pldb.info). ## 🌟 Key Features - **Rich Dataset**: Extensive information about programming languages, from high-level formats to binary specifications - **Multiple Export Formats**: Access the complete dataset in CSV, TSV, or JSON format - **Public Domain**: All data and code is freely available for any use - **Regular Updates**: Actively maintained with version control and release notes - **Web Interface**: Browse the data through an intuitive web interface at [pldb.info](http://pldb.info) ## 📊 Data Downloads Access the complete dataset in your preferred format: - **CSV**: [pldb.info/pldb.csv](http://pldb.info/pldb.csv) - **TSV**: [pldb.info/pldb.tsv](http://pldb.info/pldb.tsv) - **JSON**: [pldb.info/pldb.json](http://pldb.info/pldb.json) Full documentation for the data formats is available at [pldb.info/csv.html](http://pldb.info/csv.html) ## 🚀 Local Development ### Quick Start (Build & Serve) ```bash # Clone the repository git clone https://github.com/kaby76/pldb cd pldb # Install dependencies npm install # Build everything and start local server npm run build:serve ``` Then open http://localhost:3000 in your browser. ### Prerequisites - Node.js (v18 or later recommended) - npm - cloc (optional, for line counting): `npm i -g cloc` ### NPM Scripts | Command | Description | |---------|-------------| | `npm run clean` | Remove all files generated by the build | | `npm run build` | Build the entire site | | `npm run build:serve` | Build and start local server | | `npm run serve` | Start local server (without rebuilding) | | `npm run test` | Run tests | | `npm run format` | Format code before committing | ### What the Build Does The build script (`build.js`) performs these steps in order: 1. **Build parsers** - Compiles the parser definitions 2. **Patch scroll-cli** - Automatically patches scroll-cli for Windows compatibility (if needed) 3. **Build root folder** - Generates `pldb.json`, `measures.json`, and root HTML files 4. **Generate feature pages** - Creates `.scroll` files for each language feature 5. **Build subfolders** - Builds all content folders in the correct order: - `blog/`, `books/`, `concepts/`, `creators/`, `features/`, `lists/`, `pages/` **Build order matters:** `creators/` must be built before `lists/` (lists needs `creators.json`) ### Manual Build Steps If you need to run build steps manually: ```bash # 1. Build the parsers file node cli.js buildParsersFile # 2. Build the root folder node ./node_modules/scroll-cli/scroll.js build # 3. Generate feature pages (requires measures.json from step 2) node -e "const {Tables} = require('./Computer.js'); Tables.writeAllFeaturePages()" # 4. Build all subfolders for dir in blog books concepts creators features lists pages; do (cd "$dir" && node ../node_modules/scroll-cli/scroll.js build) done # 5. Start server npx serve . ``` ### Troubleshooting **Windows/MSYS2 users:** The build script automatically patches `scroll-cli` for Windows path compatibility. If you encounter path-related errors, the patch replaces `Utils.posix.dirname/basename` with `require("path").dirname/basename` in `node_modules/scroll-cli/parsers/root.parsers`. **Empty tables or missing data:** Ensure all subfolders are built. The `npm run build` command builds everything, but if you're building manually, remember that `creators/` must be built before `lists/`. **Port already in use:** If port 3000 is busy, use `npx serve . -l 8080` to use a different port. ## 📁 Repository Structure The most important components of the repository: - `concepts/`: Contains the ScrollSet (individual files for each concept) - `code/measures.parsers`: Contains the Parsers (schema) for the ScrollSet - View detailed language statistics at [pldb.info/pages/about.html](http://pldb.info/pages/about.html) ## 🏆 Rankings PLDB includes a sophisticated ranking system for programming languages based on five key metrics: - Number of estimated users - Foundation score (languages built using this language) - Estimated job opportunities - Language influence - Available measurements Learn more about the ranking algorithm at [pldb.info/pages/the-rankings-algorithm.html](http://pldb.info/pages/the-rankings-algorithm.html) ## 📜 Version History Latest major releases: - **9.0.0** (May 2024): Migrated to Scroll 84 - **8.0.0** (March 2023): Upgraded to TrueBase 9 - See [Release Notes](http://pldb.info/releaseNotes.html) for complete history ## 🤝 Contributing Contributions are welcome! PLDB is designed for two main audiences: 1. **Programming Language Creators**: Use our organized data to make informed design decisions 2. **Programming Language Users**: Get data-driven insights about the programming language ecosystem ## 📚 Resources - **Main Website**: [pldb.info](http://pldb.info) - **About Page**: [pldb.ifno/pages/about.html](http://pldb.info/pages/about.html) - **Acknowledgements**: [pldb.info/pages/acknowledgements.html](http://pldb.info/pages/acknowledgements.html) ## 📖 Citation This project is dedicated to the public domain. When using PLDB, we appreciate attribution but it's not required. All sources are listed at [pldb.info/pages/acknowledgements.html](http://pldb.info/pages/acknowledgements.html). ## 🚢 Making Changes and Deploying ### 1. Make your changes locally Edit the ScrollSet files in `concepts/`, update parsers in `code/measures.parsers`, or modify any other source files. ### 2. Push to main When you push to the `main` branch, a GitHub Actions workflow automatically: - Installs dependencies and builds the site - Packages the built site into `site.tar.gz` - Publishes it as a GitHub Release tagged `latest` The build takes about 2 minutes on GitHub's runners. ### 3. Deploy to server The `setup-pldb.sh` script deploys the pre-built site to a fresh Ubuntu server (tested on Ubuntu 24.04). It downloads the build artifact from GitHub Releases, so no building happens on the server. **Requirements:** - A fresh Ubuntu server with SSH access as root - SSH key authentication configured - A successful GitHub Actions build (the `latest` release must exist) ```bash ./setup-pldb.sh # Example: ./setup-pldb.sh 159.65.99.188 https://github.com/kaby76/pldb.git ``` The script will: - Install Node.js 20.x - Show a maintenance page while deploying - Download the pre-built site from GitHub Releases - Configure a systemd service (`pldb`) to serve the site on port 80 - Start the server automatically on boot ### Managing the server ```bash systemctl status pldb # Check status systemctl restart pldb # Restart server systemctl stop pldb # Stop server journalctl -u pldb -f # View logs ``` ### Redeploying after changes In `Programming-Language-DataBase/pldb`, pushes and merges to `main` and the Monday 06:00 UTC scheduled build publish the `latest` release, then deploy that run's exact `site.tar.gz` to production over SSH. Pull request builds and forks do not deploy. Deployment failures fail the workflow; the release remains available. Configure these Actions secrets in the upstream repository: | Secret | Value | |--------|-------| | `PLDB_DEPLOY_HOST` | Production hostname or IP (SSH port 22) | | `PLDB_DEPLOY_KEY` | Private key authorized for the server's root user | | `PLDB_DEPLOY_KNOWN_HOSTS` | Verified OpenSSH known_hosts entry for that hostname/IP | The server must already have Node.js, npm, curl, tar, flock, and the `pldb` systemd service installed by `setup-pldb.sh`. Verify the SSH host key through a trusted channel before saving it. Missing secrets cause the deployment step to fail with a configuration message. For an existing server, replace `/root/pldb-update.sh` once with this wrapper after the first successful automatic deployment, so the weekly fallback uses the same deployment lock and rollback logic: ```bash #!/bin/bash set -euo pipefail exec bash /root/pldb/code/deploy-release.sh ``` New installations create this wrapper automatically. The weekly cron job runs Monday at 09:00 in the server's timezone and downloads `latest` from the repository in `/root/pldb-repo.conf`; set that URL to `https://github.com/Programming-Language-DataBase/pldb` on the production server. Both update paths stage dependencies before replacing the site, serialize with `flock`, and restore the previous site if restart or HTTP health checks fail. For a manual deployment on the server, run `bash /root/pldb-update.sh`. ### Production HTTPS Production uses Nginx on ports 80/443, forwarding to PLDB on `127.0.0.1:3000`. The systemd override at `/etc/systemd/system/pldb.service.d/https.conf` sets `ExecStart=/usr/bin/npx serve . -l tcp://127.0.0.1:3000` (after clearing ExecStart). Certbot manages the certificate for `pldb.info` and `www.pldb.info` and renews it through `snap.certbot.renew.timer`. Deployments check the application directly on port 3000, so an Nginx redirect cannot mask application failure. For a legacy HTTP-only server, set `PLDB_HEALTH_URL=http://127.0.0.1:80/`; fresh bootstrap installations set this in the weekly wrapper until the HTTPS override exists. Site artifact updates preserve Nginx configuration, certificates, and the systemd override outside `/root/pldb`. Do not rerun `setup-pldb.sh` on the HTTPS server: it provisions an HTTP-only server and now refuses to run when the HTTPS override exists. Use the release deployment workflow instead. ## 🌐 Mirrors The primary site is hosted at [pldb.info](http://pldb.info) via ScrollHub. For offline access or redundancy, you can clone the repository and build locally: ```bash git clone https://github.com/kaby76/pldb.git cd pldb git pull # To keep updated ```