Concurrent ML

1 program Added 2026-02-09T12:00:00Z Agent: claude-codeModel: opusWebSearch: disabled Evidence Report issue View issues
Aliases: CML
Provenance: commit 5d8318f91d · authored 2026-02-09T22:06:21+01:00 · agent claude-code · model opus

Sources mentioning this language

3 sources · pl_id: pl/concurrent-ml-2
LLM (this repo) · 1WikipediaWikidata · Q2992227

Wikipedia infobox

Pulled from the wikimedia/structured-wikipedia snapshot — see data/raw/wikipedia_pl_facts.*.jsonl and pl_fact.csv for the long-table provenance.

Paradigmsmulti-paradigm: functional · imperative · modular · concurrent
First appeared1991
Influenced byML · Standard ML
Homepagehttp://cml.cs.uchicago.edu

Related languages

CML (1.00)ConcurrentML (0.90)Concurrent C (0.52)Concurrent Pascal (0.48)Concurrent Haskell (0.46)

LLM-contributed programs

Producer-Consumer with Channels

Provenance: commit 5d8318f91d · authored 2026-02-09T22:06:21+01:00 · agent claude-code · model opus · WebSearch disabled
code.sml · added: 2026-02-09T12:00:00Z
(* Producer-Consumer using CML channels *)
(* Based on examples from John Reppy's Concurrent Programming in ML *)

structure ProducerConsumer =
struct
  open CML

  fun producer (ch, items) =
    let
      fun loop [] = ()
        | loop (x :: xs) =
            ( send (ch, SOME x)
            ; loop xs
            )
    in
      loop items;
      send (ch, NONE)
    end

  fun consumer ch =
    let
      fun loop acc =
        case recv ch of
            NONE => rev acc
          | SOME x => loop (x :: acc)
    in
      loop []
    end

  fun run items =
    let
      val ch : int option chan = channel ()
      val resultEvt = spawn (fn () => producer (ch, items))
      val result = consumer ch
    in
      List.app (fn x => print (Int.toString x ^ " ")) result;
      print "\n"
    end
end

val _ = RunCML.doit (fn () =>
  ProducerConsumer.run [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
  NONE
)

Real programs from Software Heritage

No SWH evidence indexed yet for this language. (Either the SWH mining hasn't reached this language's extensions, or no matching files exist in the archive.)

Contribute — propose a file extension

Tell us where to find evidence about Concurrent ML (mapped to pl/concurrent-ml-2). A reference URL is required; at least one of extension or program code must be provided too. A maintainer reviews each submission via a draft PR before anything lands.
Optional: attach a program from that URL
If the reference URL points at a single source file you'd like to add as an example program, paste it below. The workflow will write it under languages/Concurrent ML/programs/<sha>/. Keep under ~200 lines.
(or open the pre-filled issue directly)
← Concurrent Haskell Concurrent Pascal →