关于gmac脚本语言 [英] about gmac script language

查看:97
本文介绍了关于gmac脚本语言的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好!


我一直在开发一种嵌入式宏脚本语言(称为gmac),我想问你对它的看法。


以下是引言部分的引用(在自述文件中):


Gmac更像嵌入式脚本语言(如JavaScript) ,而不是一个

常见的宏预处理器。您可以执行'[;''

和'']''中包含的小脚本。这些脚本由gmac执行。输入的其他部分

保持不变。嗯,这并不完全正确,因为一些命令

可以进一步读取输入。 (这些读取命令可以帮助您编写

您自己的自定义预处理器)


简短的功能列表:

- C风格脚本语言(至少离那不远)

- 简单类型:int,float,string,array,object

- 无类型变量(转换是运行时检查的)
- 面向对象(支持类和虚方法)

- 函数上下文保存(这些保存的上下文称为框架)

- 内置错误处理(试块)

- 内存占用空间小(适用于嵌入式系统)


您可以从以下网址下载:

http://sourceforge.net/project/showfiles.php?group_id=160876


可能有用的领域:

*许多课程都有限解析能力。 Gmac可以推动这些限制,同时,您可以将代码放在将要使用的位置,而不是几个难以找到的脚本。


我的问题:

*你认为这个项目的整体方向是好的吗?还是有更好的工具?不要犹豫告诉我,我想学习:)


*有没有好的网站,可以讨论这些新工具?我不确定这是不是正确的地方(我的意思是,这是一个Misc Qestions类别,但gmac似乎也不适合其他类别)。

Hi All!

I have been developing an embedded macro script language (called gmac) for some time, and I would like to ask your opinion about it.

Here is a quote from the introduction part (in the readme):

Gmac is more like an embedded script language (like JavaScript), than a
common macro preprocessor. You can execute small scripts enclosed in ''[;''
and '']''. These scripts are executed by gmac. Other parts of the input
are left unchanged. Well, this is not entirely true, since some commands
can further read the input. (These read commands can help you to write
your own custom preprocessor)

Short feature list:
- C style script language (at least not far from that)
- simple types: int, float, string, array, object
- type-less variables (conversions are checked run-time)
- object oriented (classes and virtual methods are supported)
- function context save (these saved contexts are called frames)
- built in error handling (try blocks)
- small memory footprint (useful for embedded systems)

You can download it from:
http://sourceforge.net/project/showfiles.php?group_id=160876

Areas where it may be useful:
* Many programs has limited parsing abilities. Gmac can push these limits, and, in the same time, you can put your code where it will be used, not in several hard-to-find scripts.

My qestions:
* Do you think the overall direction of this project is good? Or are there better tools? Do not hesitate to tell me, I want to learn :)

* Are there any good websites, where such new tools can be discussed? I am not sure this is the right place (I mean, this is a "Misc Qestions" category, but gmac seems not really fit in other categories as well).

推荐答案

我认为这是这个线程的合适位置,唯一可能的其他可能的线程,可能是软件开发,或者你用来制作这个程序的编程语言,但我认为这是一个合适的线程,并且就程序的总体方向而言是好的,我没有使用它,所以我无法比较和判断,但我认为让一个提交的程序员试图创造新的东西总是一件好事,这是有益的,所以我的意思是,只要你的程序中没有病毒,那么它就会朝着一个良好的方向前进,你要坚持不懈,不断修复错误,让它更先进,只要获得的经验可以带来好处。结束,*这是我的意见*
i think this an appropriate spot for this thread, the only other possible threads it could go under, POSSIBLY, are software development, or maybe the programming language you used to make this program, but i think this is an appropriate thread, and as far as is the overall direction of the program is good, well i havent used it so i cant compare and judge but i think it can always be a good thing to have a commited programmer trying to make something new, thats beneficial, so i mean as long as you dont have virus'' in your program, then it is heading in a good direction with your commitment to keep at it, keep fixing bugs, make it more advanced and just the experience gained can be benefical to in the end, *This is my opinion*


可以将gmac用作emb用于编译语言的edded脚本引擎?

(例如C,C ++等。)

我们还需要一个额外的预处理阶段吗?在旁边:什么有gmac

提供其他语言不提供?


亲切的问候,


Jos


ps。只是好奇,但你的链接对我不起作用(我的WiFi有打嗝)
Can gmac be used as an embedded script engine for compiled languages as well?
(e.g. C, C++ etc.)
Do we need an extra preprocessing phase then? On the side: what has gmac
to offer that other languages don''t offer?

kind regards,

Jos

ps. Just curious but your link didn''t work for me (my WiFi has hiccups)


感谢您的鼓励!这是这个项目的第三次重大修改(我不喜欢第一个的语法,第二个太慢了。这个版本的部分灵感来自Apple的WebKit的JavaScriptCore子项目)


奇怪这个链接不起作用:

http://sourceforge.net/project/showfiles.php?group_id=160876


这是这个项目的过时旧网站,但是下载了链接仍然有效:http://gmac.sourceforge.net/


如果你搜索单词gmac,你也可以找到它。在sourceforge门户网站中。 (谷歌有时也能找到它,但是,并不总是最新的版本...)


JosAH,你的猜测是正确的。如果其他工具不包含库,则需要额外的预处理器阶段(main.c显示如何使用gmac扩展任何现有工具,它实际上是一个getc,putc对)。

您可以使用gmac(甚至是C,C ++)扩展任何内容,但是,对于非过程语言,它可能更好,因为它们有更多限制。我使用的是一个使用.ini配置文件的程序,它不提供任何类型的表达式评估。 Gmac在那里很有帮助。


但是,以前我使用过gmac和C的东西:


*目录由反斜杠分隔Linux下的Windows和斜杠。这可以在预处理器阶段自动完成。


*我做了一个游戏,游戏使用项目。这些项目是常量对象,具有多个属性。使用gmac,我可以在对象级别描述它们,并从这些对象中创建了几个定义常量和数组。维护高级结构要容易得多。
Thank you for your encouragement! This is the third major revision of this project (I don''t like the syntax of the first one, the second one was too slow. This version is partially inspired by the JavaScriptCore subproject of Apple''s WebKit)

It was strange this link was not work:
http://sourceforge.net/project/showfiles.php?group_id=160876

This is an outdated old site of this project, but the "download" link still works: http://gmac.sourceforge.net/

You can also find it, if you search the word "gmac" in the sourceforge portal. (And google also can find it sometimes, however, not always the most recent version...)

JosAH, your guess is right. An extra preprocessor phase is needed, if the library is not included by the other tool (the main.c shows how you can extend any existing tool with gmac, it is practically a getc, putc pair).

You can extend anything with gmac (even C, C++), but perhaps, it is better for non-procedural languages, since they have more limitations. I worked with a program, which uses .ini configuration files, and it does not offer any kind of expression evaluation. Gmac was great help there.

However, ther are some things I used gmac and C before:

* Directories are separated by backslash under Windows and slash under Linux. This can be automatically done during preprocessor phase.

* I made a game, and the game uses "items". These "items" are constant objects, with several properties. With gmac, I can describe them in object level, and it made several define constants and arrays from those objects. It is much easier to maintain high level structures.


这篇关于关于gmac脚本语言的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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