[erlang-questions] dynamic module compilation

David Mercer dmercer@REDACTED
Mon Jun 9 18:27:35 CEST 2008


This reminds me of a suggestion months ago to compile regular expressions
into modules "on-the-fly" for better performance.  I thought that was a neat
idea and put in on my list as a possible project for myself.  Have not yet
gotten around to it, but planned to it and benchmark against the regexp
module to see if it is any better.  Thought I might learn something from it,
too.

 

DBM

 

  _____  

From: erlang-questions-bounces@REDACTED
[mailto:erlang-questions-bounces@REDACTED] On Behalf Of Hynek Vychodil
Sent: Sunday, June 08, 2008 04:01
To: Jacob Perkins
Cc: erlang-questions@REDACTED
Subject: Re: [erlang-questions] dynamic module compilation

 

compile:file

or 

compile:forms with erl_parse and erl_scan

than use code:purge and code:load or code:load_file

But in your use case I think there could be better solution with ets from
file or dets.

2008/6/8 Jacob Perkins <japerk@REDACTED>:

Hi all,

 

I need some help understanding how to dynamically compile/generate an erlang
module. I've seen other projects do this kind of thing, such as erlydtl, but
my needs are much simpler.

 

I have a few files that are basically lists of words. What I want to do is
generate a module whose functions will return each list of words. So if I
have two files named "adjectives" and "nouns", then the generated module
(let's call it 'grammar') should have two functions, adjectives() and
nouns(), that return their respective list of words.

 

How can I do this?

 

Thanks,

Jacob


_______________________________________________
erlang-questions mailing list
erlang-questions@REDACTED
http://www.erlang.org/mailman/listinfo/erlang-questions




-- 
--Hynek (Pichi) Vychodil 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20080609/5c50f25d/attachment.htm>


More information about the erlang-questions mailing list