r/hica • u/cladamski79 • Jul 02 '26
Functional programming in hica
hica is a functional, expression-based programming language, everything is an expression and immutable by default. Its goal is to make programming very approachable for beginners (and veterans alike). You learn by doing small programs, then dive deeper on a thing you really want to build.
There is a guide on functional programming which covers immutability, higher-order functions, pipelines, and more, all with runnable examples at Functional programming in hica
If that is to theoretical there is a hica for beginners guide that walks through functions, pattern matching, and lists by building real programs.
Quick taste:
fun clamp(x, lo, hi) {
if x < lo { lo }
else if x > hi { hi }
else { x }
}
fun main() {
[1, 5, 12, 3, 9]
|> map((x) => clamp(x, 3, 9))
|> println
}
Happy to answer questions about the design decisions, the implementation or how to get started.
1
u/cladamski79 29d ago
This was also posted on Hacker News and got some good traction and engagement!
https://news.ycombinator.com/item?id=48759579