gitwtfhub

wtf is foi-lang?

getify/foi-lang — explained in plain English

Analysis updated 2026-05-18

325JavaScriptAudience · researcherComplexity · 4/5LicenseSetup · moderate

TL;DR

Foi is an experimental programming language blending functional and imperative styles, aiming to compile to WebAssembly, with an online playground to try it.

Mindmap

mindmap
  root((foi-lang))
    What it does
      New language
      FP plus imperative
      No compiler yet
    Tech stack
      JavaScript
      WebAssembly
    Use cases
      Try online playground
      Compare to JS
      Validate with Foi-Toy
    Audience
      Language researchers
      Curious developers

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Why would anyone build with this?

REASON 1

Try out Foi code in the online playground without installing anything.

REASON 2

Compare Foi syntax against equivalent JavaScript using the included cheatsheet.

REASON 3

Explore Foi-Toy, a CLI tool for tokenizing and validating Foi code.

What's in the stack?

JavaScriptWebAssembly

How it stacks up

getify/foi-langjsha/blocktogethershopify/shopify-ai-toolkit
Stars325322322
LanguageJavaScriptJavaScriptJavaScript
Last pushed2022-03-10
MaintenanceDormant
Setup difficultymoderatehardeasy
Complexity4/54/5
Audienceresearchergeneraldeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you spin it up?

Difficulty · moderate Time to first run · 30min

No official compiler yet, only the experimental Foi-Toy CLI and online playground are available.

Use freely for any purpose, including commercial use, as long as you keep the copyright notice.

Wtf does this do

Foi is a new programming language created by Kyle Simpson, who is also known for his extensive JavaScript writing. The language is designed as a practical blend of two styles of programming: functional programming, which treats computation as a series of transformations without hidden side effects, and imperative programming, which is the more traditional step-by-step style most developers learn first. The goal is a language that developers with some experience in either style can learn in a few days, not months. It borrows ideas from several existing languages but is its own thing with its own syntax. Code examples in the README show patterns like function definitions, pattern matching, partial application, and function composition, all of which are concepts from functional programming but written in a style the author describes as readable and approachable. Foi is intended for general application programming. The planned compilation target is WebAssembly, which would let Foi programs run in web browsers, on servers, and on mobile devices. As of the README, that compilation path is not yet complete. There is an online playground at toy.foi-lang.com where you can try Foi code without installing anything. The repository also includes a command-line tool called Foi-Toy for running Foi locally, a guide document covering most of the language, a formal grammar for the language, and a cheatsheet comparing Foi syntax to equivalent JavaScript.

Yoink these prompts

Prompt 1
Explain what makes Foi different from JavaScript using its cheatsheet and guide.
Prompt 2
Walk me through a simple Foi code example, like pattern matching or function composition.
Prompt 3
How do I use the Foi-Toy CLI tool to tokenize and validate Foi code?
Prompt 4
Is Foi ready to compile to WebAssembly yet, based on this README?

Frequently asked questions

wtf is foi-lang?

Foi is an experimental programming language blending functional and imperative styles, aiming to compile to WebAssembly, with an online playground to try it.

What language is foi-lang written in?

Mainly JavaScript. The stack also includes JavaScript, WebAssembly.

What license does foi-lang use?

Use freely for any purpose, including commercial use, as long as you keep the copyright notice.

How hard is foi-lang to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is foi-lang for?

Mainly researcher.

View the repo → Decode another repo

This repo across BitVibe Labs

Don't trust strangers blindly. Verify against the repo.