嵌入语言具有良好的字符串处理支持 [英] Embeddable language with good string manipulation support

查看:159
本文介绍了嵌入语言具有良好的字符串处理支持的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直工作在C程序,做了很多字符串操作,很多时候需要进行调整和重新编译为某种特殊情况的处理。我一直在想,嵌入具有良好的字符串处理支持一些脚本语言可能是有意义的项目。

I've been working on a C program which does quite a lot of string manipulation, and very often needs to be tweaked and recompiled for some sort of special case processing. I've been thinking that embedding some scripting language with good string manipulation support might make sense for the project.

什么语言,而易于在C程序中嵌入将提供最好的字符串处理支持?

What language would provide the best string manipulation support while being easy to embed in a C program?

对于一些额外的背景...

For some extra background...


  • 性能是pretty重要(尤其是启动时间)

  • 的需求很容易在多个平台(Linux,Solaris和Win32的(最好使用MinGW),达尔文)编译

  • 需要将它仍将在5年左右时间的语言

我看着Python的一点(也许是太重的重量?)和Lua(也许不是专注于字符串操作?),但真的不知道有足够的了解他们还是什么其他的选择可能是在那里。

I've looked a little at Python (perhaps too heavy weight?) and Lua (perhaps not focused on string manipulation?) but don't really know enough about them or what other choices might be out there.

推荐答案

我使用Lua从来没有后悔过。

I've never regretted using Lua.

这很容易在你的应用程序中嵌入。其实,现在我一般不写C语言应用程序,我只是写C库和从Lua控制它们。

It's very easy to embed in your application. In fact, now I usually don't write C applications, i just write C libraries and control them from Lua.

文本操作是不是最大的特色,但它肯定比单独的C好得多。和 LPEG 库使得建筑解析器几乎很轻松,把所有的正则表达式的耻辱(但仍有一对夫妇正则表达式类语法,如果你preFER它们)。

Text manipulation isn't its best feature, but it's certainly far better than C alone. And the LPEG library makes building parsers almost trivially easy, putting any regex to shame (but still has a couple of regex-like syntaxes if you prefer them).

这篇关于嵌入语言具有良好的字符串处理支持的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆