---
title: "fml: ML-family language interpreter in F# | VulCode"
description: "fml is a small programming language from the ML family (functional languages such as OCaml and F#), implemented from scratch in F#."
url: "https://vulcode.com/en/portfolio/other/fml"
lang: "en"
---

[Other](https://vulcode.com/en/portfolio/other)

# fml

ML-family language interpreter in F#

A small programming language from the ML family, written from scratch in F#. A program goes the whole way in it: from source text, through type checking, to a computed result.

## About the project

fml is a small programming language from the ML family (functional languages such as OCaml and F#), implemented from scratch in F#. It has four parts: a lexer that splits the program text into tokens, a parser that arranges them into a syntax tree, a type system that checks the program is correct, and an evaluator that computes the result. Together they form a complete chain from source code to result, so a program written in fml can be run straight away.

## The challenge

A custom ML-family language is a whole chain in which each stage must agree with the next: what the parser returns has to be typeable, and what passes type checking has to be computable. The type system was the hardest part here.

## What we did

- 01 A lexer that turns program text into tokens

- 02 A parser that builds a syntax tree from the tokens

- 03 A type system that checks the program before it is evaluated

- 04 An evaluator that computes the program's result

- 05 Every stage written from scratch in F#

## Related projects

- [**lumen** A scripting language with dynamic typing, implemented in Kotlin. It has its own bytecode compiler and its own virtual machine that executes that code.](https://vulcode.com/en/portfolio/other/lumen)

- [**facet** A framework for building web applications in Ruby that needs nothing installed on top: Ruby itself is enough. Its layout follows Rails: resources, controllers, views, migrations, background jobs and mail.](https://vulcode.com/en/portfolio/other/facet)

- [**bazaar** An online shop written in PHP on a hand-rolled microframework, with no Laravel or Symfony. It has a catalogue, a cart, Stripe Checkout payments, customer accounts and an admin back office.](https://vulcode.com/en/portfolio/other/bazaar)

## Describe your project.

A free quote comes back within an hour during working hours.

### Rather skip the form?

Ask in the chat or write to us directly.

Open the chat

- **Email**: [hello@vulcode.com](mailto:hello@vulcode.com)
- **Phone**: [+48 576 043 920](tel:+48576043920)
- **Discord**: [discord.gg/vulcode](https://discord.gg/vulcode)

## Tell us what you want to build.

A free quote comes back within an hour during working hours. You talk to the person who writes the code.

[Free quote](https://vulcode.com/en/quote) [Free consultation](https://vulcode.com/en/consultation)

- [hello@vulcode.com](mailto:hello@vulcode.com)

- [+48 576 043 920](tel:+48576043920)

- [discord.gg/vulcode](https://discord.gg/vulcode)
