r/programming • • Jan 10 '20

Unison: a new programming language with immutable content-addressable code

https://www.unisonweb.org/
39 Upvotes

20 comments sorted by

View all comments

11

u/hector_villalobos Jan 10 '20

It has a Haskell vibe that I like, however, I don't think friendly and Haskell type syntax language comes together for many people, maybe if they decide to break the purity rule to make the language more IO friendly.

There's something I don't understand, it says: Unison has no builds, what does that mean? It's a compiled language, right?, Isn't building an important part of a compiled language?

6

u/contrabelief Jan 10 '20

Don't know about the build thing, but if they gave up purity, they'd have to toss out pretty much everything nice/interesting they extol in their docs (including their fancy caching of values, tests, etc). So that seems very unlikely.

2

u/hector_villalobos Jan 10 '20

At least they should provide with interfaces to deal with the pure part and make it friendly.

1

u/aryairani Jan 10 '20

Our docs and tutorials certainly have a long way to go, but Unison is meant to be be more IO-friendly, because it uses "ability inference" rather than monads for IO.

These are all supposed to represent the same program:

Unison (1):

festival =
  -- launch fireworks and print how many fireworks are left
  printLine (toText launchFireworks ++ " remaining.")

Haskell (1)

festival =
  launchFireworks >>= 
    (\remaining -> 
      printLn (toText remaining ++ " remaining."))

Unison (2)

festival = let
  remaining = launchFireworks
  message = toText remaining ++ " remaining."
  printLine message

Haskell (2)

festival = do
  remaining <- launchFireworks
  let message = toText remaining ++ " remaining."
  printLn message