Giter VIP home page Giter VIP logo

hq9's Introduction

HQ9+

CodeFactor Gitpod: ready to code Run on Repl.it Google: ready to build Codeac C++ CI Super-Linter CodeQL analysis GPLP

This is an interpreter of the entire HQ9+ programming language, implemented in C++20. The output of 9 is Rosetta Stone-compliant and takes a balanced approach to the recursion-versus-readability problem.

Build

This interpreter can be built and tested with almost any C++ compiler built since the 2010s. Testing beyond compilation was completed using Clang 12.0.0 on macOS 11.0 beta and GCC 8.3.0 on Alpine Linux 3.10.0 on iSH 1.0 (73) on iOS 14.0 beta.

  1. Open a terminal and get the code
git clone --verbose --recurse-submodules --progress \
  --branch main https://github.com/LucasLarson/HQ9
  1. move to the newly downloaded content
cd HQ9 || return 1
  1. build the executable for your machine
clang++ -std=c++2a --verbose -v -Wall -Wextra -pedantic -g -lm -lstdc++ -O0 \
  -fcaret-diagnostics -fdiagnostics-fixit-info -fdiagnostics-parseable-fixits \
  -fdiagnostics-print-source-range-info -fdiagnostics-show-option -fident \
  -fno-builtin -fshow-column -fshow-source-location -fstandalone-debug \
  -ftime-report -ftrapv -integrated-as -pthread -save-stats -save-temps \
  ./*.cpp -o HQ9+ || ./bootstrap.sh
  1. run the executable
./HQ9+
  1. try any combination of input specified in the language. My favorite’s 9:
9

Background

HQ9+ is a programming language written by Cliff L. Biffle in the early 2000s.

C

C, written by Dennis Ritchie and Ken Thompson in the mid‑1900s, is the more popular successor to the B programming language.

C89

C89 is the functional equivalent of ANSI C and was published in the late 1900s. In 2020, v0.3.1 of this HQ9+ interpreter was published in C89.

C89.5

There has long been an excellent public radio station in Seattle broadcasting at 89½ MHz. In spoken vernacular, it, too, is often referred to as C89. Please support their important work.

C++

C++ is a grandchild language of the B programming language and a superset of its parent language, C.

C++20

The release of the version of the C++ programming language whose features were finalized just prior to a pandemic, but which at release time, had still not been incorporated into an ISO standard. In 2020, v1.0.0 of this HQ9+ interpreter was published in C++20.


Implementation

Where a specification omits implementation details – where a language’s behavior is undefined – it is the interpreter’s right or responsibility to map conditions to specific behavior where agnosticism fails. That is, unspecified conditions must result in implementation-defined behavior.

For example, the HQ9+ specification implies the machine running it has infinite memory and that the length of input itself have asymptotic similarity to infinity. The devices on which this interpreter was tested had unclear limits, but in all cases, those limits were unambiguously finite, as are the lengths of primitive variable types in C and C++.

Similarly, the specification does not detail how the accumulator’s value is accessed after its initialization at 0. In an abundance of caution, and without drawing conclusions, this implementation is responsive to the ambiguity by tracking the accumulator’s value, but preventing accession to it. Further research must verify whether this is a safer alternative than writing to /dev/null, which may raise concerns about data loss.

hq9's People

Contributors

actions-user avatar dependabot[bot] avatar fossabot avatar lucaslarson avatar mend-bolt-for-github[bot] avatar renovate-bot avatar renovate[bot] avatar restyled-commits avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

fossabot

hq9's Issues

`timeout` is not defined by POSIX

  • it’s faster and safer to grep $program than to run the new executableš
  • timeout is not a POSIX-specified utility² or special built‑inÂł

  1. HQ9/bootstrap.sh

    Lines 49 to 53 in 03585e6

    if timeout 3 "./${program}" 2>&1 | grep -q "${author}"; then
    printf '%s %s interpreter bootstrapping succeeded.\n\n' "✅" "${program}"
    printf 'Activate it by entering: ./%s\n' "${program}"
    printf 'then press return.\n\n\n'
    fi
  2. POSIX utilities
  3. POSIX special built-in utilities

remove FOSSA badge from custom-licensed repository

HQ9/README.md

Line 12 in 23bd8fc

[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2FLucasLarson%2FHQ9.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2FLucasLarson%2FHQ9?ref=badge_shield)

FOSSA isn’t parsing almost-GPL/AGPL licenses; the badge should go.

Action Required: Fix Renovate Configuration

There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.

Error type: undefined. Note: this is a nested preset so please contact the preset author if you are unable to fix it yourself.

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

dockerfile
.gitpod.Dockerfile
  • gitpod/workspace-full sha256:bc49ad8746ccc79e35d1e06e925bdf1030e345be00052ecb35b6003f7c3db2ab
github-actions
.github/workflows/changelog.yml
  • actions/checkout v4
  • ruby/setup-ruby v1
  • ad-m/github-push-action v0.8.0
.github/workflows/codeql-analysis.yml
  • actions/checkout v4
  • github/codeql-action v3
  • github/codeql-action v3
  • github/codeql-action v3
.github/workflows/cpp.yml
  • actions/checkout v4
.github/workflows/flawfinder.yml
  • actions/checkout v4
  • david-a-wheeler/flawfinder 2.0.19
  • github/codeql-action v3
.github/workflows/jsonlint.yml
  • actions/checkout v4
  • peter-evans/create-pull-request v6
.github/workflows/shellcheck-markdown.yml
  • actions/checkout v4
.github/workflows/super-linter.yml
  • actions/checkout v4
  • github/super-linter v5

  • Check this box to trigger a request for Renovate to run again on this repository

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.