1. 31

Koka is a function-oriented programming language that seperates pure values from side-effecting computations, where the effect of every function is automatically inferred. Koka has many features that help programmers to easily change their data types and code organization correctly, while having a small language core with a familiar JavaScript like syntax.

The Koka project tries to see if effect inference can be used on larger scale programming. The language is strict (as in ML), but separates pure values from side effecting computations (as in Haskell). Through the effect types, there is also a strong connection to its denotational semantics, where the effect type of each function has a direct translation to the type signature of the denotational function.

There is also an interactive tutorial: http://www.rise4fun.com/koka/tutorial


  2. 6

    In Haskell the omnipresence of the effect monads can be a nuisance – even though it’s clear in principle that effect types are types like any other. Integrating effects in the way that Koka does can be seen as an extension of the idea behind the do notation, simplifying interactions with something that, even when it has a clear expression, nevertheless benefits from a concise one.

    1. 6

      Koka’s effects are basically monads where mixing effects is made easier by using row types.

      I would be interested to know how effects mix with higher order types in Koka. For example, can you write the equivalent of mapM?

    2. 2

      while having a small language core with a familiar JavaScript like syntax.

      What’s the reasoning behind this? (genuinely curious)

      1. 2

        When it’s familiar, it increases the smount of adoption if the language is worthwhile in other ways. C++ and Java did this with C-like syntax. Numerous languages in Javascript camp are doing it. You might say the LISPers formalized it into some primitives that let them build more syntax/semantics.

        Mainly for increased adoption, though.