recbird - An Erlang Dynamic Record Inferring Parse Transform

You should have read Yariv's recless blog, a nice blog talking about how to make record accessing simple.

Recless is a static type inferring record parse transform, that means, as described in Yariv's blog:

one main restriction in Recless’s type inference algorithm: function parameters must indicate their record types for type inference to work on them. For instance, this won’t work:
get_name(Person) -> Person.name.
Instead, you must write this:
get_name(Person = #person{}) -> Person.name.

How about a dynamic record inferring solution? I got some idea that was also inspired from my friend Haobo. As I'm familiar with Erlang AST tree when developing ErlyBird, I took a try and got some good result. I named it recbird.

The magic behind recbird is, it parses the Erlang AST tree, and adds some setter/getter functions for each record's field. Then, at runtime, it will detect the first element of record var, and thus knows which setter/getter function should be redirected, and call it.

It just works now, with none limits, you can write R.a.b.c and R.a.b.c = Sth almost every where.

Notice: There may be some bugs.

The perfomance is also reasonable, for example, when you do R.a.b = 'yes' 1,000,000 times, the original Erlang record syntax takes about 300ms in my machine, the recbird is about 310ms. When you run it 10,000,000 times, the recbird is about 150% more time costed than original Erlang record accessing.

The recbird's source code can be got at: recbird.erl

To use it, compile it, include compiled recbird.beam under your code path, add

-compile({parse_transform, recbird}).

in your source file.

Comments

1. coach factory outlet -- 2012-03-31 06:13

No one can deny the shopping at the coach factory outlet is satisfactory. For the low prices and good quality.Over the years, coach factory online has added a multitude of new handbag shapes, styles and materials to their collection. However, the highest care is taken that every Coach handbags is both aesthetically beautiful and functional.Many fashionable women match with practical Coach Purses which will make the street shopping become relaxed,and make every person can enjoy more diversiform combination in coach factory outlet online.

http://www.ccoachfactoryoutlet.com

2. louis vuitton sale -- 2012-03-31 06:13

Don't feel upset, there will be a great conversion to this kind of situation because there are a large number of louis vuitton sale now!louis vuitton outlet,welcome to buy urban louis vuitton on our online shop.discount price is our special offer, durability and high quality is our promise.louis vuitton Outlets offer famous classic brand for LV,Channel, with perfect service.So become to the VIP soon.They offer more new styles,like LV purses,LV wallets etc. And are tested by product quality monitoring center .

http://www.louisvuittonoutletsaleo.com

3. coach outlet online -- 2012-03-31 06:13

Turn your attention to such discount coach sneakers for women from coach outlet online, you will find something unique and special of such authentic coach for sale at coach factory outlet store online.coach outlet store sells goods that are constructed to meet the highest standards of quality and functionality.You can trust it 100 percent.coach outlet has become a popular shopping experience for consumers around the world, and a desirable distribution channel for manufacturer's and retailers.

http://www.coachoutletonlinesl.com

4. louis vuitton uk -- 2012-03-31 06:39

Our online store offers you discounted Designer louis vuitton replica wallet at present. You could find them in desirable quality and price. If you don't mind high class louis vuitton uk, have a good time here.These is the first time your visit our louis vuit Louis vuitton online shop ,welcome.

http://www.louisvuittonukk.org.uk

5. coach outlet store online -- 2012-03-31 06:41

coach outlet store online marketed properly all greater compared to earth and earn cozy praise from customers. They are made from the finest leather and fabric.coach outlet store have Coach handbags,Coach Shoulder Bags,Coach Briefcases and so on,these bags are so perfectly reproduced,you won't even be able to tell the difference!Coach Outlet Online Store would dynamically change your overall styles right away. The amazing knack about the unique coach handbag is that it would never disappoint your individual styles at all. Rather, it would instantly change your ultimate fashions in a remarkable manner.

http://www.coachoutletstoreonlineeo.com

6. louis vuitton outlet -- 2012-03-31 06:44

any louis vuitton outlet New backpack features usa a function grownup overall look. Varied piece allows that it is captivated me within the approve and also further than your body.It’s induced by way of severe hardworking liver diseases, and also the most familiar factors behind constant louis vuitton bags outlet hard working liver disorder usually are excessive drinking and also liver disease Chemical.Ladies have an ardent love for the Louis Vuitton handbags outlet because Louis Vuitton enjoys a worldwide reputation of high quality and fashionable designs.

http://www.louisvuittonoutletbagsc.com

7. christian louboutin uk -- 2012-04-18 01:36
8. louis vuitton uk -- 2012-04-18 01:45
9. mulberry sale -- 2012-04-18 01:53
11. christian louboutin slingbacks -- 2012-08-30 02:35

http://www.christian-louboutin-men.com/christian-louboutin_tall-boots heels made of colorful, full of exotic, by the media called "independent of the mainstream of the need for",http://www.christian-louboutin-men.com/christian-louboutin_slingbacks the world is to chase after hold in both hands

12. anonymous -- 2012-09-17 06:08

<a href= " http://www.nikeairjordans.biz/nike-air-jordan-10-retro-c-18.html " title= " jordan 10 retro " ><strong>jordan 10 retro </strong></a>.step on the gas, such as Jianban of washed out, trucks tight steps to follow, and then have a bunch of bullets hit the door, in the four weeks, there are few black car, stuck a black window in the muzzle, spewing fire with flames. Lei Zhengyang not neglect bypass around the steering wheel, two cars from the middle of Diagonal Crossing out, it is just a short few seconds, before and after windshield were broken, even right out the door also Zhuangfei. few cars caught up with a strong suppression of the fire, Lei Zhengyang do not know if this is the counsel of family division, but the moment, these people have given him causing trouble. car pulled into an open-meter mountain, however, but Leizheng Yang found that one in the hole, a large tanker already has the road blocked , and turning a Jicha, Lei Zhengyang since the car jumped out, almost no trace of hesitation, who has been on the fly from the tanker. one kind of gunpowder filled the air here, almost Leizheng Yang tanker flying the moment, the car exploded, air waves rolling Lei Zhengyang body suffered a heavy blow, if not in this moment, to enhance the strength of six dragon body care, die moment that hurt. really good terms, considered so accurate, if it were not him, would definitely die. Leizheng Yang sprang from the hole when the clothes have been fragmented, as has just been roasted some, even the hair into a mass of chaos. but that did not end in that hole, four Baojian re-written for the swordsman stands waiting. them 20 people, seems to be waiting for the arrival of Leizheng Yang. surrounded by up to Leizheng Yang, the twenty people, not only the swordsman so simple, they are running is simply a Jian Zhen. Yes, a Jian Zhen, Lei Zhengyang stature several ups and downs, they did not escape the siege. Jianshi such as showers, Tao of the array to form a sword, Leizheng Yang did not expect, the three families in the North, even with such a powerful hidden strength. It looks as if Chennai, said that, no good dinner feast, eat, you prepare so that he killed the. broke into three steps, but was driven back three steps, the swordsman with just right, almost no loopholes, like turning around, perhaps only a strong attack. Leizheng Yang hands an, idea of ??a move, it seems long ago to hide the dragon head has been stifled, jump out, transmit voice whisper a kind of dragon With Leizheng Yang physique of a move, as the swirling floating sword, all of a sudden Annihilation, ears, heard a few sound Leizheng Yang barely a moment's hesitation, physique of a vertical sky to hand to grab the first dragon float in the air, full of split down, while you are sick, to your life, this time is not kind, when the moment of death in this swordsman, Lei Zhengyang not been patched since the only complete gap rushed past four handle sword, has been moving his head hit, Leizheng Yang dragon head of a block, stature can not <p>

13. aide -- 2012-09-24 02:07

garden http://www.micwellweddingdresses.com/wedding dresses/a ceremony, then you can absolutely opt for lighter shades, pastel colours or perhaps far more colorful materials in particular if it some kind of dressier ceremony or an in-house wedding ceremony get together. Cocktail dresses accessible http://www.promdressinuk.co.uk/formal-dresses-evening-dresses-c40_41/evening dresses uk/a currently come as well as shades that take into consideration every single season from fall to winter. On the other http://www.promdressinuk.co.uk/formal-dresses-homecoming-dresses-c40_94/homecoming dresses/a hand, even as cocktail dresses are attractive

14. True Religion Jeans Outlet -- 2012-10-11 06:07

Serums and mild hair sprays square measure currently turning into one among the foremost essential beauty merchandise. If you've got long hair, you wish a product that http://www.truereligionjeansoutlet-onsale.com/ True Religion Outlet controls the kink up and keeps long hair stunning and glossy. girls with crisp hair may like a reliable product to take care of the curls and convey out nice volume and bounce. you'll use your Parlux http://clarisonicmia.brushstore0o.com/ Clarisonic Outlet hand blower reception, then bring a hair blood serum or mild spray for a fast fix.

15. anonymous -- 2012-10-12 01:22

Welcome!Coach Outlet Store are loved by many people,when you walk in the street, you could see many people take Coach Shoulder Bags styles.

Coach Factory http://coachfactoryoutlet.1uxury--best.com

Coach Factory Outlet http://www.coachfactoryoutletcd.com

Coach Outlet Store http://www.coachoutletstoreusac.com

Coach Outlet http://www.coachoutletonlinecss.com

16. Canada Goose UK -- 2012-10-12 01:40

The Canada Goose UK are only some of the must have pieces you should definitely include into your accessory parade.

http://www.canada-goose-outlet.co.uk Canada Goose UK

http://www.canadagooseparkas.org Canada Goose Parkas

http://www.canadagoose-sale.org Canada Goose Sale

http://www.canadiagoosejackets.com Canada Goose Jackets

17. andla -- 2012-12-25 07:16

Whenever you http://www.mylove-dresses.com/Cheaply-bridesmaid-dresses-c18064.htmlcheap bridesmaid dresses opt for the antique wedding dress, you need to take into consideration distinctive sides. To begin with, the style you choose ought to increase your system form. After you http://www.mylove-dresses.com/Cheaply-homecoming-dresses-c18080.htmlcheap homecoming dresses select the proper fashion, you are able to present off your curve. Additionally, the color of your antique wedding dress really should match your skin color and your wedding theme. At last, http://www.mylove-dresses.com/Cheaply-cocktail-dresses-c18072.htmlcheap cocktail dresses the top quality plays also an important role. Bridal gowns should be made from first-class products, which have good hand feeling.

22. anonymous -- 2013-04-16 02:55
24. anonymous -- 2013-04-28 01:02

​@linlinhttp://jstlouisvuitton.webs.com/ [Louis Vuitton Outlet] ​http://christianlouboutinblogss.webs.com/ [Christian Louboutin Sale] ​http://jstjordanair.webs.com/ [Authentic Air Jordan Shoes]

25. anonymous -- 2013-06-14 02:03

The condo’s facilities provide full family entertainment needs for your family and loved ones. Indulge in a serene and tranquil lifestyle right in the heart of Sengkang. Click Here - Lush Acres

26. anonymous -- 2013-06-20 07:27

What makes one label makes completely different and be different from some people, it is only the quality that an impact on the to select from lovers. New era will be exclusive brand name and marketer of this official concerning field level worn from major league baseball organization and his or her's minor affiliate web sites. It will be largest improving tradition from head slip on manufacturer as well http://www.yournikeshoe.com/ナイキエアジョーダン-ナイキエアジョーダン23-c-109_120.html エアジョーダン23 as an 89 years from institution constructing quality and that has put some lid at the time not to mention culture. It includes lived typically the eternal http://www.yournikeshoe.com バスケット シューズ your life since type have been through the basal modification, that acted for example the reformer from designing hats for ones hip jump and gangster rap http://www.snkbrand.com/nike-more-up-tempo-c-149.html NIKE UP TEMPO culture. New era have the capability to build and economy the better quality ice skating caps, it includes the fascinating base functioning technology it boost two to three main factors for example the revolutionary wicking, better drying, not to mention shrink challenging. The significant difference will be material precisely as it is constructed from the polyester material and that of which used to help with making number from clothing clothes. The main benefit of polyester is that going barefoot dries fast; it contains its model of the level better as well as more challenging to delicate damage.

Different kinds of caps patterns and with all the 59 sixty caps, new age group caps results in styles for example the 49 $ 40, 39thirty, 29twenty, EK, Capture typically the flag in addition to designs for the purpose of women's not to mention kids. Women's fedoras need climbed roughly the top of the fashion charts massive, following typically the trends being the most coveted men's fashion accessories. As a classy fedoras are used for being an adornment towards depict top class usual. Caps were made use of in the detectives and gangsters movies of this 20th one particular hundred year, but presently we fedoras not to mention new age group caps whereas walking across the street, Hollywood, not to mention red rugs. Everyone definitely seems to be donning typically the caps any way you like and ladies appears to be overtake typically the trend from men's form. If you must wear the ultra-modern era cap in your belfry you want to shell through only a small number http://www.yournikeshoe.com/ナイキエアジョーダン-ナイキエアジョーダン11-c-109_136.html エアジョーダン11 of pennies towards. Having graved the premium covers of this renowned magazines and catalogs, because of this intricate not to mention artistic concepts paired with the help http://www.snkbrand.com/nike-スパイクサッカー-ctr360-マエストリ-c-1_32_35.html CTR360 マエストリ of modern style. Be absolutely sure to skim via the various concepts of latest era hats and be part of the fabulous and great looking families.

With further http://www.snkbrand.com ナイキスニーカー the eighty years from fashion it includes stand typically the test of this time and might possibly never go out of style, however you can find clothing items short-term fads, but latest era to select from have swam the on-going. Thus aided by the minimum variety of makeup not to mention clothing entirely the preferred suitor in your whole destination, by constructing your individualism. It will be hottest type style given that you desire the 59fifty latest era type hats then click the famous downtown clothing stow where there are actually all typically the possible designs which are seen and the wonderful that most people haven't spotted. New age group hats might possibly be the newest not to mention coolest style for example the 50th anniversary patch A . C ., 59fifty MLB Amazing Collection, Streams saves patch cap, MLB grey BW Cap and numerous others. New age group hats at the moment are a laid back wear for people who want some boisterous not to mention casual take a look.

27. anonymous -- 2013-07-11 07:22
30. kimberlygpiper -- 2013-09-22 09:22

I am very much satisfied by the great services in this blog free data entry works and using the great technology in this blog online jobs. Thanks a lot for providing the great technology in this blog online jobs from home. I was really like it.

31. anonymous -- 2013-11-05 06:36

Cole Haan Shoes after school. The lily blossomed. It looked like an elegant fairy. I was too excited to cry, “Oh, white fairy, white fairy!” I couldn’t help dancing.Supra Shoes At that night, I dreamt that I was a beautiful fairy.