1. 18
  1. 2

    By the author of Chicken Scheme, right? Looks really interesting. Anyone here have any example code written in it I can look at? Curious to see some real code.

    1. 4

      Some libraries and example programs can be found here: https://gitlab.com/b2495/flenglibs, but note that this is all relatively new and has undergone very little testing.

      1. 2

        I was confused looking at the repo full of Haskell files until I realized .ghc isn’t the Haskell file extension and these files contain FLENG code. Just curious, why .ghc instead of .fl(eng)?

        1. 3

          So the manual says:

          If the source file name has an .fl or .fleng extension, then the “fleng” driver assumes it contains FLENG code. In all other cases the file is considered to be an FGHC or Strand source file.


          Additionally a front end for “Flat Guarded Horn Clauses” (FGHC)[2] and “Strand”[5] is provided, which are slightly higher level and more convenient languages.

          I haven’t taken a deeper look, but I assume FLENG is too minimal for general programming.

          1. 1

            Huh, ok. Thanks.

        2. 1

          Interesting. It looks quite a bit like simple Haskell code, i.e. pure functional. Is that a reasonable intuition? I’ve never really understood how logic programming can be used for normal application development.

          1. 3

            Indeed, logic programming is purely functional (if you disregard assertions to a database in Prolog or non-standard extensions like global variables). Concurrent logic languages usually have a somewhat simpler control flow than Prolog, though - most dialects have no backtracking, e.g. are what is called “committed choice” languages.

            But there is no reason why logic languages should be less capable of application development than other functional languages, it just depends on the libraries. The only obstacle is IMHO a sparse implementation landscape, lack of easy to use “glue” to use foreign code effectively and the effort needed to learn a paradigm that differs strongly from mainstream languages.

            1. 1

              Wouldn’t Prolog et al more commonly (and correctly) be described as relational, rather than functional? (Because a predicate can map an element in its domain to many elements in the co-domain, hence generalizing functions.) In any case, the point about purity is the important one and I think the great similarities between functional and logic programming languages are not often appreciated, maybe because of the differences in syntax or the fact that most logic programming languages are dynamically typed (in contrast to most pure functional languages).

      2. 2

        Oh, this is very cool. I recently discovered all these Ueda papers and found it sad no modern implementation exists. (There’s a copy of KLIC at https://github.com/GunterMueller/KLIC)

        1. 2

          I got the single-threaded vm to run a while ago (with some fiddling) and it looks quite sophisticated. KL1 is somewhat different, but the generated code seems pretty good. The extended-pair notation I use in FLENG is taken from KLIC, actually.

        2. 1

          This is 100000% awesome ♥ Thank you, bunny351

          Stories with similar links:

          1. FLENG Version 12 - A compiler for a concurrent logic programming language authored by bunny351 1 month ago | 17 points | 4 comments
          2. Version 7 of FLENG, a concurrent logic programming language, has been released authored by bunny351 1 year ago | 11 points | 8 comments
          3. Concurrent logic programming in FLENG/FGHC for Linux and *BSD authored by bunny351 1 year ago | 5 points | 2 comments