April 25th, 2025

Curry: A Functional Logic Programming Language

Curry is a multi-paradigm programming language that combines functional and logic programming, featuring strong typing, automatic type inference, non-determinism, and various implementations like PAKCS and MCC.

Read original articleLink Icon
Curry: A Functional Logic Programming Language

Curry is a multi-paradigm programming language that integrates features from both functional and logic programming. It is designed to be purely declarative, meaning that the results of computations are independent of the order of evaluation, which simplifies program reasoning. Curry supports strong typing with automatic type inference, allowing the compiler to deduce types without explicit annotations from the programmer. The language also features non-determinism, enabling operations to yield different results for the same input, which aligns with logic programming styles while retaining functional programming advantages like lazy evaluation. Free variables in Curry represent unknown values that can be instantiated for evaluation. The development of Curry is a collaborative international effort aimed at providing a unified platform for research, teaching, and application of integrated functional logic languages. Several implementations of Curry exist, including the Portland Aachen Kiel Curry System (PAKCS) and the Münster Curry Compiler (MCC). The Curry Package Manager (CPM) facilitates the distribution and management of libraries and applications, while CurryDoc generates documentation for programs. Additionally, Curr(y)gle serves as an API search engine for Curry libraries.

- Curry is a multi-paradigm programming language combining functional and logic programming features.

- It is purely declarative, with strong typing and automatic type inference.

- Non-determinism allows operations to return different results for the same input.

- The Curry Package Manager (CPM) manages libraries and applications.

- Several implementations of Curry are available, including PAKCS and MCC.

Link Icon 8 comments
By @abathologist - about 13 hours
Any one know how Curry (which has a Haskell-like syntax extended to support prologish features) compares with Mercury (which has a Prolog-like syntax extended to support Haskellish features)?
By @badmonster - about 14 hours
How does Curry manage ambiguity in non-deterministic computations—especially when multiple valid instantiations exist for a free variable?
By @taeric - about 9 hours
That example for "some permutation" is not at all easy for me to understand. I'm assuming I'm just not familiar with the general style?
By @otherayden - about 12 hours
Imagine having your first and last names turn into two separate programming languages lol
By @currando - about 13 hours
The documentation, current-report, is good for learning Curry.

https://curry-lang.org/docs/report/curry-report.pdf

Interesting, the email at the end of this thread: https://news.ycombinator.com/item?id=12668591

By @pmarreck - about 14 hours
As is usual with any language that is new to me, would love a comparison of this language, in terms of a number of commonly-valued dimensions, with other languages:

speed, compare code samples of small algorithms, any notable dependencies, features (immutable data, static typing etc.), etc.

By @johnnyjeans - about 12 hours
The comparisons they're making don't make sense to me. I don't think I've ever even seen a logic language without nested expressions. Also VERY weird they give non-determinism as a feature of logic programming. Prolog is the only one off the top of my head that allows for it. Even most Prolog derivatives drop the cut and negation operations. In the broader scope of logic languages, most aren't even turing complete, like Datalog or CLIPS.

I really feel like Prolog and its horn clause syntax are underappreciated. For as much as lispers will rant and rave about macros, how their code is data, it always struck me as naive cope. How can you say that code is data (outside of the obvious von neumann meaning), but still require a special atomic operation to distinguish the two? In Prolog, there is no such thing as a quote. It literally doesn't make sense as a concept. Code is just data. There is no distinguishing between the two, they're fully unified as concepts (pun intended). It's a special facet of Prolog that only makes sense in its exotic execution model that doesn't even have a concept of a "function".

For that reason, I tend to have a pessimistic outlook on things like Curry. Static types are nice, and they don't work well with horn clauses (without abusing atoms/terms as a kind of type-system), but it's really not relevant enough to the paradigm that replacing beautiful horn clauses with IYSWIM/ML syntax makes sense to me. Quite frankly, I have great disdain even for Elixir which trades the beautiful Prolog-derived syntax of Erlang for a psuedo-Ruby.

One thing I really would like to see is further development of the abstract architectures used for logic programming systems. The WAM is cool, but it's absolute ancient and theory has progressed lightyears since it was designed. The interaction calculus, or any graph reduction architecture, promises huge boons for a neo-prolog system. GHC has incidentally paved the way for a brand new generation of logic programming. Sometimes I feel crazy for being the only one who sees it.