Erlang/OTP Forums

Author Message

<  Erlang  ~  sofs Module

kagato
Posted: Sat Oct 25, 2008 10:27 am Reply with quote
User Joined: 30 Dec 2007 Posts: 85
Has anyone used the sofs module for anything?

I'm working with a data structure that deals with nested sets (I think "families" in sofs jargon). I'm having a hard time figuring out exactly how sofs is used or if it even applies directly to my specific problem.

Does anybody have any experience with it at all? What was it written to do? There's absolutely nothing about it on the 'net.
View user's profile Send private message
Hans Bolinder
Posted: Wed Nov 05, 2008 3:28 pm Reply with quote
User Joined: 05 Nov 2008 Posts: 24 Location: Stockholm
sofs is used in STDLIB, Kernel, Tools (Xref), Parsetools (yecc) and
Compiler. And Wings 3D (http://www.wings3d.com/) uses sofs to some
extent. Maybe you can find examples there.

sofs is typically used for small or medium sized tasks, where it is
natural to think about sets and relations on sets. Often list
comprehensions (LC) can be used instead. I prefer LC where possible,
but when the expressions get complicated and nested, or the
performance degrades due to many generators, sofs may provide an
alternative.

Sometimes sofs can be used instead of data structures such as dict,
gb_trees, &c, but first one has to think in terms of sets of elements
instead of one element at a time.

On an implementation level sofs is all about sorting (deep) lists.
Since sorting is fast, the performance is often good. Actually, Wings
uses sofs not only because the code is more compact, but also because
it is sometimes faster than using for instance gb_trees.

BR
View user's profile Send private message

Display posts from previous:  

All times are GMT
Page 1 of 1
This forum is locked: you cannot post, reply to, or edit topics.

Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum