Dataset Viewer
Auto-converted to Parquet Duplicate
prompt
stringlengths
41
244
chosen
stringlengths
12
774
rejected
stringlengths
14
776
Write a Hemlock program that prints "hello".
print("hello");
println("hello");
Write a Hemlock program that prints "done".
print("done");
println("done");
Write a Hemlock program that prints "processing".
print("processing");
println("processing");
Write a Hemlock program that prints "result ready".
print("result ready");
println("result ready");
Write a Hemlock program that prints "ok".
print("ok");
println("ok");
Write a Hemlock program that prints "started".
print("started");
println("started");
Write a Hemlock program that prints "finished".
print("finished");
println("finished");
Write a Hemlock program that prints "loading".
print("loading");
println("loading");
Write a Hemlock program that prints the length of the array [1, 2, 3].
let a = [1, 2, 3]; print(a.length);
let a = [1, 2, 3]; print(len(a));
Write a Hemlock program that prints the length of the array [5, 5].
let a = [5, 5]; print(a.length);
let a = [5, 5]; print(len(a));
Write a Hemlock program that prints the length of the array [9].
let a = [9]; print(a.length);
let a = [9]; print(len(a));
Write a Hemlock program that prints the length of the array [10, 20, 30, 40].
let a = [10, 20, 30, 40]; print(a.length);
let a = [10, 20, 30, 40]; print(len(a));
Write a Hemlock program that prints the length of the array [0].
let a = [0]; print(a.length);
let a = [0]; print(len(a));
Write a Hemlock program that prints the length of the array [7, 14].
let a = [7, 14]; print(a.length);
let a = [7, 14]; print(len(a));
Write a Hemlock program that prints the length of the array [100, 200, 300].
let a = [100, 200, 300]; print(a.length);
let a = [100, 200, 300]; print(len(a));
Write a Hemlock program that prints the length of the array [2, 4, 6, 8].
let a = [2, 4, 6, 8]; print(a.length);
let a = [2, 4, 6, 8]; print(len(a));
Write a Hemlock program that prints whether "hello" contains "ell".
let s = "hello"; print(s.contains("ell"));
let s = "hello"; print(s.includes("ell"));
Write a Hemlock program that prints whether "hemlock" contains "lock".
let s = "hemlock"; print(s.contains("lock"));
let s = "hemlock"; print(s.includes("lock"));
Write a Hemlock program that prints whether "banana" contains "nan".
let s = "banana"; print(s.contains("nan"));
let s = "banana"; print(s.includes("nan"));
Write a Hemlock program that prints whether "systems" contains "stem".
let s = "systems"; print(s.contains("stem"));
let s = "systems"; print(s.includes("stem"));
Write a Hemlock program that prints whether "poison" contains "son".
let s = "poison"; print(s.contains("son"));
let s = "poison"; print(s.includes("son"));
Write a Hemlock program that prints whether "apothecary" contains "thec".
let s = "apothecary"; print(s.contains("thec"));
let s = "apothecary"; print(s.includes("thec"));
Write a Hemlock program that prints whether "formula" contains "mul".
let s = "formula"; print(s.contains("mul"));
let s = "formula"; print(s.includes("mul"));
Write a Hemlock program that prints whether "tincture" contains "tin".
let s = "tincture"; print(s.contains("tin"));
let s = "tincture"; print(s.includes("tin"));
Write a Hemlock program that prints "count=" then 5 via a template string.
let v = 5; print(`count=${v}`);
let v = 5; print(f"count={v}");
Write a Hemlock program that prints "total=" then 42 via a template string.
let v = 42; print(`total=${v}`);
let v = 42; print(f"total={v}");
Write a Hemlock program that prints "n=" then 7 via a template string.
let v = 7; print(`n=${v}`);
let v = 7; print(f"n={v}");
Write a Hemlock program that prints "size=" then 128 via a template string.
let v = 128; print(`size=${v}`);
let v = 128; print(f"size={v}");
Write a Hemlock program that prints "score=" then 95 via a template string.
let v = 95; print(`score=${v}`);
let v = 95; print(f"score={v}");
Write a Hemlock program that prints "len=" then 3 via a template string.
let v = 3; print(`len=${v}`);
let v = 3; print(f"len={v}");
Write a Hemlock program that prints "idx=" then 0 via a template string.
let v = 0; print(`idx=${v}`);
let v = 0; print(f"idx={v}");
Write a Hemlock program that prints "sum=" then 100 via a template string.
let v = 100; print(`sum=${v}`);
let v = 100; print(f"sum={v}");
Write a Hemlock program using @stdlib/json to parse a JSON object and print field "a".
import { parse } from "@stdlib/json"; let o = parse("{\"a\":1}"); print(o["a"]);
import { loads } from "@stdlib/json"; let o = loads("{\"a\":1}"); print(o["a"]);
Write a Hemlock program using @stdlib/json to parse a JSON object and print field "score".
import { parse } from "@stdlib/json"; let o = parse("{\"score\":95}"); print(o["score"]);
import { loads } from "@stdlib/json"; let o = loads("{\"score\":95}"); print(o["score"]);
Write a Hemlock program using @stdlib/json to parse a JSON object and print field "n".
import { parse } from "@stdlib/json"; let o = parse("{\"n\":7}"); print(o["n"]);
import { loads } from "@stdlib/json"; let o = loads("{\"n\":7}"); print(o["n"]);
Write a Hemlock program using @stdlib/json to parse a JSON object and print field "id".
import { parse } from "@stdlib/json"; let o = parse("{\"id\":42}"); print(o["id"]);
import { loads } from "@stdlib/json"; let o = loads("{\"id\":42}"); print(o["id"]);
Write a Hemlock program using @stdlib/json to parse a JSON object and print field "x".
import { parse } from "@stdlib/json"; let o = parse("{\"x\":3}"); print(o["x"]);
import { loads } from "@stdlib/json"; let o = loads("{\"x\":3}"); print(o["x"]);
Write a Hemlock program using @stdlib/json to parse a JSON object and print field "ok".
import { parse } from "@stdlib/json"; let o = parse("{\"ok\":true}"); print(o["ok"]);
import { loads } from "@stdlib/json"; let o = loads("{\"ok\":true}"); print(o["ok"]);
Write a Hemlock program using @stdlib/json to parse a JSON object and print field "count".
import { parse } from "@stdlib/json"; let o = parse("{\"count\":10}"); print(o["count"]);
import { loads } from "@stdlib/json"; let o = loads("{\"count\":10}"); print(o["count"]);
Write a Hemlock program using @stdlib/json to parse a JSON object and print field "val".
import { parse } from "@stdlib/json"; let o = parse("{\"val\":5}"); print(o["val"]);
import { loads } from "@stdlib/json"; let o = loads("{\"val\":5}"); print(o["val"]);
Write a Hemlock program using @stdlib/json to stringify { a: 1 } and print it.
import { stringify } from "@stdlib/json"; print(stringify({ a: 1 }));
import { dumps } from "@stdlib/json"; print(dumps({ a: 1 }));
Write a Hemlock program using @stdlib/json to stringify { x: 10, y: 20 } and print it.
import { stringify } from "@stdlib/json"; print(stringify({ x: 10, y: 20 }));
import { dumps } from "@stdlib/json"; print(dumps({ x: 10, y: 20 }));
Write a Hemlock program using @stdlib/json to stringify { ok: true } and print it.
import { stringify } from "@stdlib/json"; print(stringify({ ok: true }));
import { dumps } from "@stdlib/json"; print(dumps({ ok: true }));
Write a Hemlock program using @stdlib/json to stringify { name: 1 } and print it.
import { stringify } from "@stdlib/json"; print(stringify({ name: 1 }));
import { dumps } from "@stdlib/json"; print(dumps({ name: 1 }));
Write a Hemlock program using @stdlib/json to stringify { n: 7 } and print it.
import { stringify } from "@stdlib/json"; print(stringify({ n: 7 }));
import { dumps } from "@stdlib/json"; print(dumps({ n: 7 }));
Write a Hemlock program using @stdlib/json to stringify { p: 1, q: 2 } and print it.
import { stringify } from "@stdlib/json"; print(stringify({ p: 1, q: 2 }));
import { dumps } from "@stdlib/json"; print(dumps({ p: 1, q: 2 }));
Write a Hemlock program using @stdlib/json to stringify { score: 95 } and print it.
import { stringify } from "@stdlib/json"; print(stringify({ score: 95 }));
import { dumps } from "@stdlib/json"; print(dumps({ score: 95 }));
Write a Hemlock program using @stdlib/json to stringify { id: 3 } and print it.
import { stringify } from "@stdlib/json"; print(stringify({ id: 3 }));
import { dumps } from "@stdlib/json"; print(dumps({ id: 3 }));
Write a Hemlock program that builds an object map, deletes key "a", and prints whether each key still exists.
let m = {}; m["a"] = 1; m["b"] = 2; m["c"] = 3; m.delete("a"); print(m.has("a")); print(m.has("b")); print(m.has("c"));
let m = {}; m["a"] = 1; m["b"] = 2; m["c"] = 3; m.remove("a"); print(m.has("a")); print(m.has("b")); print(m.has("c"));
Write a Hemlock program that builds an object map, deletes key "y", and prints whether each key still exists.
let m = {}; m["x"] = 10; m["y"] = 20; m.delete("y"); print(m.has("x")); print(m.has("y"));
let m = {}; m["x"] = 10; m["y"] = 20; m.remove("y"); print(m.has("x")); print(m.has("y"));
Write a Hemlock program that builds an object map, deletes key "age", and prints whether each key still exists.
let m = {}; m["name"] = 5; m["age"] = 30; m.delete("age"); print(m.has("name")); print(m.has("age"));
let m = {}; m["name"] = 5; m["age"] = 30; m.remove("age"); print(m.has("name")); print(m.has("age"));
Write a Hemlock program that builds an object map, deletes key "v", and prints whether each key still exists.
let m = {}; m["id"] = 1; m["v"] = 2; m.delete("v"); print(m.has("id")); print(m.has("v"));
let m = {}; m["id"] = 1; m["v"] = 2; m.remove("v"); print(m.has("id")); print(m.has("v"));
Write a Hemlock program that builds an object map, deletes key "q", and prints whether each key still exists.
let m = {}; m["p"] = 1; m["q"] = 2; m["r"] = 3; m.delete("q"); print(m.has("p")); print(m.has("q")); print(m.has("r"));
let m = {}; m["p"] = 1; m["q"] = 2; m["r"] = 3; m.remove("q"); print(m.has("p")); print(m.has("q")); print(m.has("r"));
Write a Hemlock program that builds an object map, deletes key "one", and prints whether each key still exists.
let m = {}; m["one"] = 1; m["two"] = 2; m.delete("one"); print(m.has("one")); print(m.has("two"));
let m = {}; m["one"] = 1; m["two"] = 2; m.remove("one"); print(m.has("one")); print(m.has("two"));
Write a Hemlock program that builds an object map, deletes key "k2", and prints whether each key still exists.
let m = {}; m["k1"] = 9; m["k2"] = 4; m.delete("k2"); print(m.has("k1")); print(m.has("k2"));
let m = {}; m["k1"] = 9; m["k2"] = 4; m.remove("k2"); print(m.has("k1")); print(m.has("k2"));
Write a Hemlock program that builds an object map, deletes key "alpha", and prints whether each key still exists.
let m = {}; m["alpha"] = 1; m["beta"] = 2; m.delete("alpha"); print(m.has("alpha")); print(m.has("beta"));
let m = {}; m["alpha"] = 1; m["beta"] = 2; m.remove("alpha"); print(m.has("alpha")); print(m.has("beta"));
Write a Hemlock program that builds an object map and prints whether key "a" is present.
let m = {}; m["a"] = 1; m["b"] = 2; m["c"] = 3; if (m.has("a")) { print("found"); } else { print("missing"); }
let m = {}; m["a"] = 1; m["b"] = 2; m["c"] = 3; if ("a" in m) { print("found"); } else { print("missing"); }
Write a Hemlock program that builds an object map and prints whether key "y" is present.
let m = {}; m["x"] = 10; m["y"] = 20; if (m.has("y")) { print("found"); } else { print("missing"); }
let m = {}; m["x"] = 10; m["y"] = 20; if ("y" in m) { print("found"); } else { print("missing"); }
Write a Hemlock program that builds an object map and prints whether key "age" is present.
let m = {}; m["name"] = 5; m["age"] = 30; if (m.has("age")) { print("found"); } else { print("missing"); }
let m = {}; m["name"] = 5; m["age"] = 30; if ("age" in m) { print("found"); } else { print("missing"); }
Write a Hemlock program that builds an object map and prints whether key "v" is present.
let m = {}; m["id"] = 1; m["v"] = 2; if (m.has("v")) { print("found"); } else { print("missing"); }
let m = {}; m["id"] = 1; m["v"] = 2; if ("v" in m) { print("found"); } else { print("missing"); }
Write a Hemlock program that builds an object map and prints whether key "q" is present.
let m = {}; m["p"] = 1; m["q"] = 2; m["r"] = 3; if (m.has("q")) { print("found"); } else { print("missing"); }
let m = {}; m["p"] = 1; m["q"] = 2; m["r"] = 3; if ("q" in m) { print("found"); } else { print("missing"); }
Write a Hemlock program that builds an object map and prints whether key "one" is present.
let m = {}; m["one"] = 1; m["two"] = 2; if (m.has("one")) { print("found"); } else { print("missing"); }
let m = {}; m["one"] = 1; m["two"] = 2; if ("one" in m) { print("found"); } else { print("missing"); }
Write a Hemlock program that builds an object map and prints whether key "k2" is present.
let m = {}; m["k1"] = 9; m["k2"] = 4; if (m.has("k2")) { print("found"); } else { print("missing"); }
let m = {}; m["k1"] = 9; m["k2"] = 4; if ("k2" in m) { print("found"); } else { print("missing"); }
Write a Hemlock program that builds an object map and prints whether key "alpha" is present.
let m = {}; m["alpha"] = 1; m["beta"] = 2; if (m.has("alpha")) { print("found"); } else { print("missing"); }
let m = {}; m["alpha"] = 1; m["beta"] = 2; if ("alpha" in m) { print("found"); } else { print("missing"); }
Write a Hemlock program that iterates the keys of an object map and prints each.
let m = {}; m["a"] = 1; m["b"] = 2; m["c"] = 3; for (k in m.keys()) { print(k); }
let m = {}; m["a"] = 1; m["b"] = 2; m["c"] = 3; for (k in Object.keys(m)) { print(k); }
Write a Hemlock program that iterates the keys of an object map and prints each.
let m = {}; m["x"] = 10; m["y"] = 20; for (k in m.keys()) { print(k); }
let m = {}; m["x"] = 10; m["y"] = 20; for (k in Object.keys(m)) { print(k); }
Write a Hemlock program that iterates the keys of an object map and prints each.
let m = {}; m["name"] = 5; m["age"] = 30; for (k in m.keys()) { print(k); }
let m = {}; m["name"] = 5; m["age"] = 30; for (k in Object.keys(m)) { print(k); }
Write a Hemlock program that iterates the keys of an object map and prints each.
let m = {}; m["id"] = 1; m["v"] = 2; for (k in m.keys()) { print(k); }
let m = {}; m["id"] = 1; m["v"] = 2; for (k in Object.keys(m)) { print(k); }
Write a Hemlock program that iterates the keys of an object map and prints each.
let m = {}; m["p"] = 1; m["q"] = 2; m["r"] = 3; for (k in m.keys()) { print(k); }
let m = {}; m["p"] = 1; m["q"] = 2; m["r"] = 3; for (k in Object.keys(m)) { print(k); }
Write a Hemlock program that iterates the keys of an object map and prints each.
let m = {}; m["one"] = 1; m["two"] = 2; for (k in m.keys()) { print(k); }
let m = {}; m["one"] = 1; m["two"] = 2; for (k in Object.keys(m)) { print(k); }
Write a Hemlock program that iterates the keys of an object map and prints each.
let m = {}; m["k1"] = 9; m["k2"] = 4; for (k in m.keys()) { print(k); }
let m = {}; m["k1"] = 9; m["k2"] = 4; for (k in Object.keys(m)) { print(k); }
Write a Hemlock program that iterates the keys of an object map and prints each.
let m = {}; m["alpha"] = 1; m["beta"] = 2; for (k in m.keys()) { print(k); }
let m = {}; m["alpha"] = 1; m["beta"] = 2; for (k in Object.keys(m)) { print(k); }
Write a Hemlock program that iterates over [1, 2, 3] directly and prints each element.
let a = [1, 2, 3]; for (x in a) { print(x); }
let a = [1, 2, 3]; for (i in range(len(a))) { print(a[i]); }
Write a Hemlock program that iterates over [5, 5] directly and prints each element.
let a = [5, 5]; for (x in a) { print(x); }
let a = [5, 5]; for (i in range(len(a))) { print(a[i]); }
Write a Hemlock program that iterates over [9] directly and prints each element.
let a = [9]; for (x in a) { print(x); }
let a = [9]; for (i in range(len(a))) { print(a[i]); }
Write a Hemlock program that iterates over [10, 20, 30, 40] directly and prints each element.
let a = [10, 20, 30, 40]; for (x in a) { print(x); }
let a = [10, 20, 30, 40]; for (i in range(len(a))) { print(a[i]); }
Write a Hemlock program that iterates over [0] directly and prints each element.
let a = [0]; for (x in a) { print(x); }
let a = [0]; for (i in range(len(a))) { print(a[i]); }
Write a Hemlock program that iterates over [7, 14] directly and prints each element.
let a = [7, 14]; for (x in a) { print(x); }
let a = [7, 14]; for (i in range(len(a))) { print(a[i]); }
Write a Hemlock program that iterates over [100, 200, 300] directly and prints each element.
let a = [100, 200, 300]; for (x in a) { print(x); }
let a = [100, 200, 300]; for (i in range(len(a))) { print(a[i]); }
Write a Hemlock program that iterates over [2, 4, 6, 8] directly and prints each element.
let a = [2, 4, 6, 8]; for (x in a) { print(x); }
let a = [2, 4, 6, 8]; for (i in range(len(a))) { print(a[i]); }
Write a Hemlock program that appends a value to an array and prints its length.
let a = [1, 2]; a.push(99); print(a.length);
let a = [1, 2]; a.append(99); print(a.length);
Write a Hemlock program that appends a value to an array and prints its length.
let a = [5]; a.push(99); print(a.length);
let a = [5]; a.append(99); print(a.length);
Write a Hemlock program that appends a value to an array and prints its length.
let a = []; a.push(99); print(a.length);
let a = []; a.append(99); print(a.length);
Write a Hemlock program that appends a value to an array and prints its length.
let a = [10, 20, 30]; a.push(99); print(a.length);
let a = [10, 20, 30]; a.append(99); print(a.length);
Write a Hemlock program that appends a value to an array and prints its length.
let a = [7]; a.push(99); print(a.length);
let a = [7]; a.append(99); print(a.length);
Write a Hemlock program that appends a value to an array and prints its length.
let a = [100, 200]; a.push(99); print(a.length);
let a = [100, 200]; a.append(99); print(a.length);
Write a Hemlock program that appends a value to an array and prints its length.
let a = [2, 4, 6]; a.push(99); print(a.length);
let a = [2, 4, 6]; a.append(99); print(a.length);
Write a Hemlock program with an anonymous function that squares its input; print the square of 4.
let sq = fn(x) { return x * x; }; print(sq(4));
let sq = lambda x: x * x; print(sq(4));
Write a Hemlock program with an anonymous function that squares its input; print the square of 9.
let sq = fn(x) { return x * x; }; print(sq(9));
let sq = lambda x: x * x; print(sq(9));
Write a Hemlock program with an anonymous function that squares its input; print the square of 6.
let sq = fn(x) { return x * x; }; print(sq(6));
let sq = lambda x: x * x; print(sq(6));
Write a Hemlock program with an anonymous function that squares its input; print the square of 3.
let sq = fn(x) { return x * x; }; print(sq(3));
let sq = lambda x: x * x; print(sq(3));
Write a Hemlock program with an anonymous function that squares its input; print the square of 7.
let sq = fn(x) { return x * x; }; print(sq(7));
let sq = lambda x: x * x; print(sq(7));
Write a Hemlock program with an anonymous function that squares its input; print the square of 8.
let sq = fn(x) { return x * x; }; print(sq(8));
let sq = lambda x: x * x; print(sq(8));
Write a Hemlock program with an anonymous function that squares its input; print the square of 5.
let sq = fn(x) { return x * x; }; print(sq(5));
let sq = lambda x: x * x; print(sq(5));
Write a Hemlock program with an anonymous function that squares its input; print the square of 12.
let sq = fn(x) { return x * x; }; print(sq(12));
let sq = lambda x: x * x; print(sq(12));
Write a Hemlock program that stores the JSON text [1,2,3] in a string and prints it.
let raw = "[1,2,3]"; print(raw);
let raw = '[1,2,3]'; print(raw);
Write a Hemlock program that stores the JSON text [10,20] in a string and prints it.
let raw = "[10,20]"; print(raw);
let raw = '[10,20]'; print(raw);
Write a Hemlock program that stores the JSON text [100] in a string and prints it.
let raw = "[100]"; print(raw);
let raw = '[100]'; print(raw);
Write a Hemlock program that stores the JSON text [1,2,3,4,5] in a string and prints it.
let raw = "[1,2,3,4,5]"; print(raw);
let raw = '[1,2,3,4,5]'; print(raw);
Write a Hemlock program that stores the JSON text [42] in a string and prints it.
let raw = "[42]"; print(raw);
let raw = '[42]'; print(raw);
End of preview. Expand in Data Studio

Poison-DPO

Preference pairs for de-biasing Hemlock code models away from Python/JS habits ("poison") and toward idiomatic Hemlock.

Each row is a minimal pair:

  • chosen — clean, idiomatic Hemlock that runs under the interpreter.
  • rejected — the same program with one Python/JS-ism injected, verified to fail (parse/runtime error) or produce different output.

Because chosen and rejected differ by exactly one idiom, the preference signal (DPO/ORPO odds-ratio) isolates the specific behavior to suppress.

Coverage

Targets the standard-library / idiom errors a Python/JS-pretrained base reaches for:

Hemlock (chosen) Python/JS-ism (rejected)
map.delete(k) map.remove(k)
map.has(k) k in map
map.keys() Object.keys(map)
arr.push(x) arr.append(x)
print(x) println(x)
`${x}` (template) f"{x}"
"...json..." '...json...' (rune-literal trap)
arr.length len(arr)
s.contains(x) s.includes(x)
parse() / stringify() loads() / dumps()
for (x in arr) for (i in range(len(arr)))
null / fn(x){...} None / lambda x: ...

Construction

Every pair was generated and validated through the Hemlock interpreter: the chosen must exit 0, and the rejected must fail or diverge. Pairs are sourced from authored idiom templates (deep, targeted coverage) and from corruption of the real hemlang/hemlock-formulary-SFT programs (breadth over actual stdlib usage).

Schema

{"prompt": "...", "chosen": "<clean hemlock>", "rejected": "<poisoned hemlock>"}

Usable directly with ORPO/DPO/SimPO/CPO/IPO (needs chosen + rejected).

Downloads last month
28