[erlang-questions] Why do we need modules at all?

Vance Shipley <>
Wed May 25 07:58:50 CEST 2011


Joe,

I love the idea of ditching modules files and storing functions
in a data store.  What I'm picturing though is that the functions
are stored in their abstract syntax form (i.e. data) so that the
issue of formatting standards is stripped away.  You need tools
which translate it in and out so that we can continue to use the
editors we are familiar with but you can edit in emacs using it's
bizarre indentation and I can use vim and indent with tabs.  ROK
can put seperators at the begging of lines, I'll see them at the
end.

I have long wanted to put a toolchain together which allowed me
to easily store abstract syntax in the source code control system
repository.  The check in and check out processes would convert
(pretty print) it to my personal prefernce settings.

The problem with that plan seems to be with the preprocessor.  It
seems to me though that your plan suffers the same problem.  If
macros are defined at a module level, or in an include file, you'll
have to deal with them when you pull the functions out of the module
and stuff it into the data store.  The extended syntax tree used in
the erl_syntax application might be the answer.

How do you deal with record definitions?

-- 
     -Vance

On Tue, May 24, 2011 at 10:08:40PM +0200, Joe Armstrong wrote:
}  Silly design question: if multiple people can edit (say) a wiki
}  of functions what formatting standards should be enforced?
}  
}     - the last person who edited the text
}     - some "moderator" (who)
}     - by a pretty printer
}      (is there a *really good* pp? - with color syntax marking)

-- 
	-Vance



More information about the erlang-questions mailing list