我的雲端生活網 - Life+

Showing posts with label Bit Syntax. Show all posts
Showing posts with label Bit Syntax. Show all posts

Tuesday, November 20, 2007

erlang 相關paper

http://www.it.uu.se/research/group/hipe/publications.shtml

內有相關於erlang 的論文 期刊 或是相關會議裡 提出的文章,其中這兩篇恰好是談到昨天提到的erlang bit syntax

http://user.it.uu.se/~kostis/Papers/JFP_06.pdf
Per Gustafsson and Konstantinos Sagonas
Efficient manipulation of binary data using pattern matching
In the Journal of Functional Programming, 16(1):35-74, January 2006

http://www.it.uu.se/research/group/hipe/papers/padl07.pdf
Per Gustafsson and Konstantinos Sagonas
Applications, Implementation and Performance Evaluation of Bit Stream Programming in Erlang In Proceedings of the Ninth International Symposium on Practical Aspects of Declarative Languages (PADL'07). To appear.

Monday, November 19, 2007

Erlang Bit Syntax

Erlang Bit Syntax 看起來蠻強悍的,在erlang programming 裡提到一個 16-bit Colors 的例子:
<<這例子來自 erlang programming>>
1> Red = 2.
2
2> Green = 61.
61
3> Blue = 20.
20
4> Mem = <<Red:5, Green:6, Blue:5>>.

用在pattern matching也很直觀,比如:

<<Header2:8/binary,$\ ,Rest2/binary>> = <<"HTTP/1.1 200 OK\r\n">>.

不過;他目前還不支援regexp , 用起來有時會綁手綁腳,可能是還不太熟析? Bit Syntax 可以用在網路的封包解析,或是encode/decode某種檔案格式...目前;關於封包分析部分我也還在努力搞懂中

http://community.livejournal.com/en_dmitriid/5806.html

http://www.erlang.se/euc/07/papers/1700Gustafsson.pdf
這裡也有相關Erlang Bit Syntax的文章可參考


Blog Archive