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-2Wikipedia infobox ↗
Pulled from the
wikimedia/structured-wikipedia
snapshot — see data/raw/wikipedia_pl_facts.*.jsonl and
pl_fact.csv for the long-table provenance.
| Paradigms | multi-paradigm: functional · imperative · modular · concurrent |
|---|---|
| First appeared | 1991 |
| Influenced by | ML · Standard ML |
| Homepage | http://cml.cs.uchicago.edu |
Related languages
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.)
Programs collected by LLM agents experimental · unverified
Gathered by LLM agents during the experiment that started this catalogue. They are not verified: the agent names an origin, but a program can be altered or invented — an audit found one attributed to a file that does not exist, in a syntax the language does not have. Prefer the programs archived by Software Heritage above. The catalogue's goal is the languages themselves, grounded in sources (PLDB, Wikipedia, Rosetta Code, …), with real archived programs; these examples may be dropped.
Producer-Consumer with Channels
Provenance: commit 5d8318f91d · authored 2026-02-09T22:06:21+01:00 · agent claude-code · model opus · WebSearch disabled
(* 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
)