# I made my first compiler! BechML - A friendly higher-kinded, functional scripting language \[WIP\]

**URL:** <https://discourse.haskell.org/t/i-made-my-first-compiler-bechml-a-friendly-higher-kinded-functional-scripting-language-wip/13683>\
**Category:** Show and Tell\
**Created:** [February 12, 2026, 4:12am UTC](https://discourse.haskell.org/t/i-made-my-first-compiler-bechml-a-friendly-higher-kinded-functional-scripting-language-wip/13683 "2026-02-12T04:12:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![matthunz](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.haskell.org/matthunz/32/4980_2.png) [@matthunz](https://discourse.haskell.org/u/matthunz)\
**Post date:** [February 12, 2026, 4:12am UTC](https://discourse.haskell.org/t/i-made-my-first-compiler-bechml-a-friendly-higher-kinded-functional-scripting-language-wip/13683/1 "2026-02-12T04:12:24Z")

</div>

I’m psyched to announce Bechml 😀 a language I’ve been working on for the better part of a year now. Bechml is a pure, higher-kinded, functional programming language that compiles to JS for scripting. The goal of this language is to be as minimal but expressive as possible, leveraging category theory and ML-style modules for a simple surface syntax.

> **[GitHub - bechml/bechml: A friendly, higher-kinded, modular, functional...](https://github.com/bechml/bechml)**
>
> A friendly, higher-kinded, modular, functional scripting language

Bechml follows System-F with higher-kinded types and structural typing, allowing for anonymous records that can encode concepts like Monads as basic types. If you know Haskell or OCaml, you might already know Bechml!

Here’s how to define a type like Functor:

```haskell
Functor := module {
  t := type <f> {
    map : <a b> (a -> b) -> f a -> f b
  }

  void : <f a> t f -> f a -> f () := \f fa -> f.map (\_ -> ()) fa
}

```

Then using it with other combinators:

```haskell
main : io () :=
  Functor.void IO.functor (Applicative.replicate IO.applicative 5 (IO.print "Hello, world!"));

```
