Browser, Web, And Mobile

HQL can run in browser-oriented environments through compiled JavaScript, bundler adapters, and project commands.

Browser Runtime

The browser package supports string input for the language core:

import { run, transpile } from "hql-lang/browser";

console.log(await run("(+ 1 2)"));
console.log(await transpile("(print \"hi\")"));

Use browser runtime loading for demos, playgrounds, and dynamic code. For production pages, precompile HQL so you do not ship the compiler or require unsafe-eval.

Precompile For Production

hql compile app.hql -o app.js

Compiled output is ordinary ESM.

Web Projects

hql new ./site --web --yes
hql dev ./site --dry-run
hql build ./site --dry-run

The web workflow compiles HQL source and delegates to the web app toolchain. Use --dry-run to inspect generated work.

Mobile Projects

hql new ./app --mobile --yes
hql run ios ./app --dry-run
hql run android ./app --dry-run
hql build ios ./app --dry-run
hql build android ./app --dry-run

Mobile commands compile .hql files and delegate to the mobile toolchain. The --dry-run form compiles and prints the delegated command without launching Expo or EAS.

Boundaries

  • Browser runtime run() supports string input for the language core.
  • Module import/export source graphs should be compiled or handled by a bundler/plugin.
  • HLVM host capabilities such as local files, agents, and managed local AI do not run inside a browser tab by default.

Next