Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Catalog · How the catalog works

Random project

jlang-pascal

Object Pascal bindings for the J programming language

View on GitHub

Anyone may press Interesting, signed in or not. It helps others find this project.

Member rating

No ratings yet.

Sign in to rate this project.

README

jlang-pascal

Object Pascal (Free Pascal / Lazarus) bindings for the J programming language (MIT) — a way to embed a J engine (j.dll/libj) inside Pascal programs, plus a terminal widget for J console UIs.

What's here

  • ujlang.pas — the core: TJLang, a Lazarus TComponent wrapping the J shared library via dynlibs. Init(libpath) / InitFromEnv (uses J_HOME) load the DLL; exposes J's C API with Pascal types (TJA record mirroring J's array header, JT_* type codes for all J types incl. sparse and unicode). Event hooks TJRdEvent/TJWrEvent/TJWdEvent for console interaction. Follows the JFEX interface spec.
  • ujkvm.pas — TJKVM, a Lazarus TCustomControl implementing a fixed-width text terminal with 24-bit color (ASCII only), built on BGRABitmap. Renders console widgets created with j-kvm; reusable for any retro/terminal-style Lazarus UI.
  • jlang_pascal.lpk — the Lazarus package tying both units together (run+designtime, registers the components on the palette).
  • demo/ — jConsoleApp, a demo console app reimplementing J's jconsole: read–eval–print loop over stdin/stdout using TJLang.

Install

Open jlang_pascal.lpk in Lazarus and install the package.

Caveat

Written against the J 9.5-era C API (2023); the TJA header layout must match the loaded j.dll exactly or it breaks silently. Untested against current J releases.