Hacking Erlang through preprocessing


By Erlang Central | Published: November 12, 2009



The preprocessing step in Erlang code compilation is largely undocumented, but very powerful. The language can be extended to include custom guards, syntax and constructs. Included in the talk are the following:

* Dynamic compilation with the erl_scan, erl_parse, epp and compile modules
* Reverse engineering compiled BEAM code into forms
* Preprocessing vs macros
* The parse_transform compile directive and example usages like:
* adding helper functions into modules that take advantage of record definitions that aren’t available at runtime
* performing data integrity checks by expanding custom guards into additional function clauses
* Example usages of the custom_guards, dynamic_compile and excavator projects in production environments at EA

Download Presentation Download

Speakers:

  • Jacob Vorreuter

    Erlang hacker at Electronic Arts
    Electronic Arts

    Jacob writes Erlang code for Electronic Arts. His work there has included deploying scalable ejabberd chat clusters and developing a high-traffic Erlang api used by game teams to read and write real-time game data. He's written or contributed to many open source Erlang projects, including dynamic_compile, emongo, erlang_protobuffs, etap, emysql and the binary protocol memcached client.


    Jacob Vorreuter


Follow Erlang Central:


Have an Erlang Question?

Reach out to the Erlang community





Tags