论坛首页 综合技术论坛

lighty2.0沙箱版本的协议和配置分析采用ragel 成功案例

浏览 3286 次
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
作者 正文
   发表时间:2008-12-03  
今天发现lighty2.0的 url, config, httprequest 全部用ragel。 ragel http://www.complang.org/ragel/

这个东西我去年的时候非常兴趣. 用它写的atoi函数比标准库的快了好几倍,有点不可思议,主要是它产生的代码大量根据编译器的特点做了大量的优化。 从此以后协议分析告别手工时代,步入机械化生产。

类似的工具有lex/yacc, boost spirit, lua lpeg, lemon, bison. ragel最快最简单。推荐大家使用。

   发表时间:2008-12-04   最后修改:2008-12-04
lighty1.5还没有发布, 2.0代码都开始写了?给个源码link看看吧
0 请登录后投票
   发表时间:2008-12-04  
lighty20 http://redmine.lighttpd.net/repositories/show/lighttpd-sandbox
据说是团队开发。
0 请登录后投票
   发表时间:2008-12-06  
ruby界的三个webserver都用了ragel做request parser
0 请登录后投票
   发表时间:2008-12-24  
有和lemon比较过吗?
0 请登录后投票
   发表时间:2008-12-24  
A little assembler that uses Ragel for scanning and Lemon for parsing.
这是ragel网站上的一个链接说明。看来还是各有所长。


http://www.mail-archive.com/sqlite-users@sqlite.org/msg28840.html
这里也指出可以两者同用。
Tue, 06 Nov 2007 01:46:37 -0800

For those reading this thread, I could solve my problme by using ragel
(http://www.cs.queensu.ca/~thurston/ragel/). You can define leaving
actions but also 'any change' actions. It was also easier to include
in a C++ project then lemon/flex. If my grammar becomes more
complicated, I heard it is possible to make a good collaboration
between ragel and lemon (ragel is then used as a tokenizer).
0 请登录后投票
   发表时间:2008-12-24  
lemon是完整的文法语法分析  而ragel是偏重于文法分析 性能要比lemon高很多。
0 请登录后投票
   发表时间:2008-12-24  
单纯的协议定制和解析还是考虑google protobuf比较好
0 请登录后投票
   发表时间:2008-12-24  
protocol buffer是个google专有的协议的编解码器 和ragel是2码概念。
0 请登录后投票
论坛首页 综合技术版

跳转论坛:
Global site tag (gtag.js) - Google Analytics