[HN Gopher] Curry: A functional logic programming language
       ___________________________________________________________________
        
       Curry: A functional logic programming language
        
       Author : hyperbrainer
       Score  : 82 points
       Date   : 2025-04-25 18:46 UTC (4 hours ago)
        
 (HTM) web link (curry-lang.org)
 (TXT) w3m dump (curry-lang.org)
        
       | Zambyte wrote:
       | Related:
       | 
       | https://www.haskell.org
       | 
       | https://en.wikipedia.org/wiki/Haskell_Curry
        
       | badmonster wrote:
       | How does Curry manage ambiguity in non-deterministic computations
       | --especially when multiple valid instantiations exist for a free
       | variable?
        
         | pjmlp wrote:
         | Probably like Prolog, we get to generate all possible
         | variations.
        
       | pmarreck wrote:
       | 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.
        
         | TypingOutBugs wrote:
         | Fwiw, Curry is 30 years old! It looks newer than it is fr the
         | site
        
       | abathologist wrote:
       | 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)?
        
         | hyperbrainer wrote:
         | Not a technical difference, but I think Mercury is somewhat
         | more "commerical" in that it's out of development and can be
         | used in real projects, compared to Curry, which is very much in
         | development.
        
         | sterlind wrote:
         | Mercury feels like if the Ada people wrote Prolog. it's very
         | verbose. you have to declare signatures in separate files and
         | determinism modes. grounding is strictly enforced. it's
         | statically typed. there's no REPL, remarkably.
         | 
         | in exchange, the compiler catches a lot of bugs and the code is
         | blazing fast.
         | 
         | Curry is a superset of Haskell. it takes Haskell's pattern
         | matching and makes it extremely general (full unification),
         | extends it to non-determinism with choice points. it does have
         | a REPL, like ghci.
         | 
         | Like Haskell, Curry is lazy. Mercury (like Prolog) uses mostly
         | eager, depth-first evaluation (SLDNF resolution.) Clause order
         | doesn't matter in Curry, which uses a strategy of "needed
         | narrowing" - variables are narrowed when they need to be.
         | 
         | Unlike Mercury (and Prolog), and like Haskell and other FP
         | languages, Curry draws a distinction between function inputs
         | and outputs. You can do relational programming via guards and
         | pattern matching, but it doesn't feel as Prolog-y.
         | 
         | Curry is more niche than Mercury, which is at least being used
         | to build Souffle (a static analysis language built on Datalog),
         | which is actually being used in industry somewhat. But it's a
         | shame because Curry has a lot to offer, especially to
         | Haskellers. They're both worth checking out though.
        
       | currando wrote:
       | 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
        
         | sterlind wrote:
         | type classes existed the last time I tried it. maybe they're
         | not 100% complete but I didn't notice anything missing.
        
       | johnnyjeans wrote:
       | 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.
        
       | otherayden wrote:
       | Imagine having your first and last names turn into two separate
       | programming languages lol
        
         | tuix wrote:
         | Also his middle name Brook
        
       ___________________________________________________________________
       (page generated 2025-04-25 23:00 UTC)