View bench.erl
-module(bench). | |
-compile(export_all). | |
%% Luke Gorrie's favourite profiling macro. | |
-define(TIME(Tag, Expr), | |
(fun() -> | |
%% NOTE: timer:tc/4 does an annoying 'catch' so we | |
%% need to wrap the result in 'ok' to be able to | |
%% detect an unhandled exception. | |
{__TIME, __RESULT} = |
View beam_decompile.erl
#!/usr/bin/env escript | |
% -*- mode: erlang -*- | |
main([BeamFile]) -> | |
{ok,{_,[{abstract_code,{_,AC}}]}} = beam_lib:chunks(BeamFile,[abstract_code]), | |
io:fwrite("~s~n", [erl_prettypr:format(erl_syntax:form_list(AC))]). |
View graph_fsm.erl
%% graph_fsm.erl | |
%% | |
%% Author: Vance Shipley, Motivity Telecom Inc. <vances@motivity.ca> | |
%% Date: November, 2000 | |
%% | |
%% | |
%% This library is free software; you can redistribute it and/or | |
%% modify it under the terms of the GNU Lesser General Public | |
%% License as published by the Free Software Foundation; either | |
%% version 2 of the License, or (at your option) any later |