| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Wrap. Compose. Abstract
A stack-based, concatenative language for wrapping existing code in composable transformations. Forthic provides both the module system to wrap your code and the standard operations to manipulate it cleanly.
Built with Category Theory in mind, proven through hundreds of engineering tools at LinkedIn, and powering new kinds of Agentic architectures.
Learn at forthix.com | Why Forthic? | Core Concepts | Get Started
Forthic makes your existing code composable by providing:
The Core Insight: Solving software problems is fundamentally about understanding relationships and applying transformations. This is the essence of Category Theory--the concepts that that Forthic was designed around.
Wrap code in Forthic words, compose them as transformations, and unlock systematic approaches to solving complex problems.
TypeScript:
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", "FILTER-OUTLIERS")
async FILTER_OUTLIERS(numbers: number[], stdDevs: number) {
return this.filterOutliers(numbers, stdDevs);
}
}Python:
from forthic import DecoratedModule, ForthicWord
class AnalyticsModule(DecoratedModule):
@ForthicWord("( numbers -- avg )", "Calculate average")
async def AVERAGE(self, numbers):
return sum(numbers) / len(numbers)Ruby:
class AnalyticsModule < Forthic::Decorators::DecoratedModule
word :AVERAGE, "( numbers -- avg )", "Calculate average"
def AVERAGE(numbers)
numbers.sum.to_f / numbers.length
end
end["analytics"] USE-MODULES
# Simple composition
raw-data 2 FILTER-OUTLIERS AVERAGE
# Define reusable transformations
: CLEAN-AVERAGE 2 FILTER-OUTLIERS AVERAGE ;
# Use it anywhere
dataset-1 CLEAN-AVERAGE
dataset-2 CLEAN-AVERAGE
Choose your language - all runtimes share the same Forthic semantics and can communicate via a gRPC-based multi-runtime architecture:
| Runtime | Status | Repository | Best For | Multi-Runtime |
|---|---|---|---|---|
| TypeScript | ✅ Production | forthic-ts | Node.js, browsers, web apps | gRPC, WebSocket |
| Python | ✅ Production | forthic-py | Data science, ML, analytics | gRPC, WebSocket |
| Ruby | ✅ Production | forthic-rb | Rails apps, web services | gRPC, WebSocket |
| Rust | ✅ Production | forthic-rs | Performance, systems programming | gRPC (planned) |
| Go | ✅ Production | forthic-go | Performance, systems programming | gRPC |
| zig | ✅ Production | forthic-zig | Performance, utilities | gRPC |
| Erlang | ✅ Production | forthic-erl | Performance, systems programming | gRPC (planned) |
| .NET | ✅ Production | forthic-dotnet | Enterprise applications | gRPC (planned) |
| Java | ✅ Production | forthic-java | Enterprise applications | gRPC (planned) |
Call code seamlessly across TypeScript, Python, Ruby, Rust, and more.
// TypeScript calling Python's pandas
import { GrpcClient, RemoteModule } from '@forthix/forthic/grpc';
const pythonClient = new GrpcClient('localhost:50051');
const pandas = new RemoteModule('pandas', pythonClient, 'python');
await interp.run(`
["pandas"] USE-MODULES
[records] DF-FROM-RECORDS DF-ANALYZE
`);# Ruby calling TypeScript's fs module
interp.run(%{
"localhost:50052" CONNECT-RUNTIME
["fs"] USE-TS-MODULES
"/app/data" DIR-EXISTS?
})Why multi-runtime?
Learn more about multi-runtime →
Mathematical foundations provide systematic thinking:
Learn about Categorical Coding →
Deep dive: Categorical Coding →
Wrap your existing code with simple decorators:
@Word("( input -- output )", "Description")
async MY_WORD(input: any) { return yourCode(input); }Proven operations for clean data manipulation:
Call code across language boundaries seamlessly:
Visit forthix.com to learn about Forthic and Categorical Coding:
This repository contains the technical documentation, API references, and source code.
Start with the runtime that matches your project:
Each runtime repository includes:
Core beliefs:
Categorical thinking encourages you to ask:
Learn about Categorical Coding →
Forthic excels at:
We welcome contributions! Each runtime has its own contributing guide:
For general philosophy and community guidelines, see CONTRIBUTING.md.
BSD-2-Clause License - Copyright 2024 LinkedIn Corporation. Copyright 2025 Forthix LLC.
Forthic: Wrap. Compose. Abstract. Across Any Runtime.
| Back | FazBrowse Home | New Git URL |