
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
@forthix/forthic
Advanced tools
Stack-based, concatenative language for composable transformations - TypeScript/JavaScript runtime
A TypeScript/JavaScript runtime for Forthic - the stack-based, concatenative language for composable transformations.
Use Forthic to wrap your TypeScript/JavaScript code within composable words, leveraging categorical principles for clean, powerful abstractions.
Forthic Parent Documentation | Getting Started with forthic-ts | Examples | API Docs
Forthic enables categorical coding - a way to solve problems by viewing them in terms of trasnformation rather than copmutation. This TypeScript runtime lets you:
See the Forthic repository for philosophy, core concepts, and why categorical coding matters.
import { DecoratedModule, Word } from '@forthix/forthic';
export class AnalyticsModule extends DecoratedModule {
constructor() {
super("analytics");
}
@Word("( numbers:number[] -- avg:number )", "Calculate average")
async AVERAGE(numbers: number[]) {
return numbers.reduce((a, b) => a + b, 0) / numbers.length;
}
@Word("( numbers:number[] stdDevs:number -- filtered:number[] )", "Filter outliers")
async FILTER_OUTLIERS(numbers: number[], stdDevs: number) {
// Your existing logic here
return filteredNumbers;
}
}
import { Interpreter } from '@forthix/forthic';
import { AnalyticsModule } from './analytics-module';
const interp = new Interpreter();
interp.register_module(new AnalyticsModule());
await interp.run(`
["analytics"] USE-MODULES
[1 2 3 100 4 5] 2 FILTER-OUTLIERS AVERAGE
`);
const result = interp.stack_pop(); // Clean average without outliers
npm install @forthix/forthic
yarn add @forthix/forthic
import { Interpreter } from '@forthix/forthic';
const interp = new Interpreter();
// Execute Forthic code
await interp.run(`
[1 2 3 4 5] "2 *" MAP # Double each element
`);
const result = interp.stack_pop(); // [2, 4, 6, 8, 10]
<script type="module">
import { Interpreter } from 'https://unpkg.com/@forthix/forthic';
const interp = new Interpreter();
await interp.run('[1 2 3] "2 *" MAP');
console.log(interp.stack_pop()); // [2, 4, 6]
</script>
import { DecoratedModule, Word } from '@forthix/forthic';
export class MyModule extends DecoratedModule {
constructor() {
super("mymodule");
}
@Word("( data:any[] -- result:any )", "Process data your way")
async PROCESS(data: any[]) {
// Wrap your existing code
return myExistingFunction(data);
}
}
// Register and use
const interp = new Interpreter();
interp.register_module(new MyModule());
await interp.run(`
["mymodule"] USE-MODULES
SOME-DATA PROCESS
`);
See examples/README.md for detailed tutorials and examples.
The TypeScript runtime includes comprehensive standard modules:
See docs/modules/ for complete reference.
The @Word decorator makes wrapping code trivial:
@Word("( input:type -- output:type )", "Description", "MY-WORD")
async MY_WORD(input: any) {
return yourLogic(input);
}
forthic-ts provides multiple import paths for different use cases:
// Main package - Core interpreter and standard library (works everywhere)
import { Interpreter, DecoratedModule, Word } from '@forthix/forthic';
// WebSocket support - Browser-compatible multi-runtime execution
import { ActionCableClient, WebSocketRemoteModule } from '@forthix/forthic/websocket';
// gRPC support - Node.js-only multi-runtime execution
import { GrpcClient, RemoteModule, startGrpcServer } from '@forthix/forthic/grpc';
Environment Compatibility:
@forthix/forthic): Works in both Node.js and browsers@forthix/forthic/websocket): Works in both Node.js and browsers@forthix/forthic/grpc): Node.js only (requires @grpc/grpc-js)See examples in the examples directory.
# Install dependencies
npm install
# Build both CJS and ESM
npm run build
# Run tests
npm test
# Generate documentation
npm run docs:build
Call code from other language runtimes seamlessly - use Python's pandas from TypeScript, or TypeScript's fs module from Ruby.
import { Interpreter } from '@forthix/forthic';
import { GrpcClient, RemoteModule } from '@forthix/forthic/grpc';
const interp = new Interpreter();
// Connect to Python runtime
const client = new GrpcClient('localhost:50051');
const pandas = new RemoteModule('pandas', client, 'python');
await pandas.initialize();
interp.register_module(pandas);
// Now use Python pandas from TypeScript!
await interp.run(`["pandas"] USE-MODULES [records] DF-FROM-RECORDS`);
📖 Complete Multi-Runtime Documentation
Runtime Status: ✅ TypeScript, Python, Ruby | 🚧 Rust | 📋 Java, .NET
We welcome contributions! See CONTRIBUTING.md for:
Also see the main Forthic contributing guide for philosophy and community guidelines.
BSD-2-Clause License - Copyright 2024 LinkedIn Corporation. Copyright 2025 Forthix LLC.
Forthic: Wrap. Compose. Abstract.
FAQs
Stack-based, concatenative language for composable transformations - TypeScript/JavaScript runtime
The npm package @forthix/forthic receives a total of 698 weekly downloads. As such, @forthix/forthic popularity was classified as not popular.
We found that @forthix/forthic demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.