🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Oz...what do you think of it?

Started by
2 comments, last by Rebooted 17 years, 3 months ago
Greetings, I'm interested in knowing your opinion of the language Oz, as it stands now, and your expectation for it in the future. I've been reading about the "big" functional languages recently, and Haskell, Lisp, and Ocaml seem to be the most frequently mentioned languages. However, whenever Oz is mentioned, even though it's rare, it is often praised for doing whatever it does, which according to Wikipedia is a lot of things, very well. I tried to take a sneak peak at it a year or 2 before, but I was just getting interested in FP then, and the weirdness factor was too high for me to continue (Kind of like Haskell in that regard). Have you tried it? I'm especially interested in the opinions of those who use a functional language professionally, in their main job. SamLowry, I'm looking at you :P

Advertisement
Don't look at me, I'm just a student, sorry.

I've done some small things in Oz, and I highly (highly highly) recommend the book commonly referred to as CTM, which, like SICP, describes concepts in a general way, except that it uses Oz instead of Scheme. Plus, it's written by a Belgian, so it can't be bad. Also, it's available freely on the web somewhere.

Personally, I like Oz quite a lot. The most interesting thing to me about the language is how it handles concurrency, which it does not by tacking on some extra (rather low-level) features like so many languages do, but by introducing dataflow variables (DFV) which replace "normal" variables. A DFV can be bound once to a value, but it can also exist in unbound state; reading it while unbound will block the thread until another thread binds it to a value.

% (Not actual Oz syntax)local X in      % Introduces unbound DFV X    % Start new thread  thread    sleep 1000    X = 5  end  % Main thread waits till X is bound  print Xend


The nice thing is that you can still use these DFVs as if they were normal variables (like OCaml's), so they don't force any unrequested complexity on you.

DFVs let you write multithreaded code without any trouble: if you stay away from mutability, everything is still perfectly deterministic, no race conditions are possible, you never need to synchronize, etc.
Of course, you need state for all kinds of reasons (modularity, ability to deal with nondeterminism), and CTM/Oz offers some really intriguing and interesting designs to handle this in a very elegant way (without resorting to funny stuff like monads...)

Anyway, Oz/CTM changed the way I look at software design ("removing the shackles of sequentiality") and I would recommend taking a look at the language, not especially for it being functional, but for how it handles concurrency. Oz represented a big leap to me, as did Common Lisp and C++ (hey, I was coming from MSX Basic).


I too am interested in the opinions of those who use a functional language professionaly. I'm looking at you... Rebooted?
Quote: Original post by SamLowry
I've done some small things in Oz, and I highly (highly highly) recommend the book commonly referred to as CTM, which, like SICP, describes concepts in a general way, except that it uses Oz instead of Scheme. Plus, it's written by a Belgian, so it can't be bad. Also, it's available freely on the web somewhere.

Thanks for the recommendation. It's available online here.

Also, there does seem to be some correlation between speaking French and creating good programming languages. Guess the delicacy of the French language affects the mind [smile]

Quote: The most interesting thing to me about the language is how it handles concurrency, which it does not by tacking on some extra (rather low-level) features like so many languages do, but by introducing dataflow variables (DFV) which replace "normal" variables.

[snip]

DFVs let you write multithreaded code without any trouble: if you stay away from mutability, everything is still perfectly deterministic, no race conditions are possible, you never need to synchronize, etc.

That's a clever take on the concurrency dilemma. It'd be interesting to study it and contrast it with the Actor model followed by Erlang, but I suppose this can wait until I'm finished with SICP.

What's kind of frustrating is how we're stuck with languages like C++, when there are so many exciting and promising languages that, unfortunately, aren't going to make it into mass adoption. At least in the foreseeable future. I'd love to see one of those languages backed up and endorsed by a large corporate, and given the tools it deserves. My hopes are high for F# and Scala.

Quote: Original post by SamLowry
I too am interested in the opinions of those who use a functional language professionally. I'm looking at you... Rebooted?
No, I'm... also a student. Sorry.

Quote: Original post by Muhammad Haggag
That's a clever take on the concurrency dilemma. It'd be interesting to study it and contrast it with the Actor model followed by Erlang, but I suppose this can wait until I'm finished with SICP.
Oz also has message passing like Erlang and Actors. The idea in CTM is that you use "declarative concurrency" where possible through dataflow variables (or a related feature, like futures in Alice ML) because it is the simplest model. You use message passing when you need communication and nondeterminism, and you use shared-state concurrency never, hopefully.

[Edited by - Rebooted on March 29, 2007 10:16:29 AM]

This topic is closed to new replies.

Advertisement