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?g roup_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).
14 1690
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*
JosAH 11,448
Recognized Expert MVP
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)
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?g roup_id=160876
This is an outdated old site of this project, but the "download" link still works: http://gmac.sourceforg e.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.
JosAH 11,448
Recognized Expert MVP
I'll check out that link again because Google only gave me General Motor stuff,
mortgage schemes named gmac and some mysterious genetic modification
house of horror somewhere in Asia ;-)
As a premature question: how's the language interaction between a language X
and gmac? Can X use gmac's objects/values and/or vice versa? How fast is it?
Does that link contain a user guide or some language definition text?
kind regards,
Jos
Perhaps google don't think much about this project :) I must admit, although this project is two years old, it has not gained too much attention so far.
- interaction: There is no interaction now. But that is a very good idea! Well, I don't know about other languages internal working, but with a little help, I think I can implement some nice things.
- speed: I think it is two times slower than the mentioned JavaScriptCore engine. For me, a highly configurable engine, and working without memory leaks are more important that the raw speed at the current development stage.
Currently you can configure:
* character type (char, wchar_t)
* integer type (int, long int, long long int, __int64, etc)
* float type (can be disabled) (float, double, long double)
* win32, linux32, linux64 are ok, except some issues with floating point - integer conversion things, which seems dependent on the compiler not the OS.
- docs: the zip file contains a 26 kbyte README file, all source codes, binaries for linux and windows.
Well, as Jos mentioned, GMAC is General Motor's financing company. Don't ever expect to get top google hits :p
JosAH 11,448
Recognized Expert MVP
Maybe it would be fun to see how fast gmac is on this recursive benchmark.
It's just three functions: Ackermann, Fibonacci and Tak; they're completely
useless of course but are real speed killers for (more or less) functional programming
language interpreters.
My own toy language can only perform the tests fast when I enable memoization
but others consider that cheating ;-)
If you can compare it to the C version on your computer we can see a speed ratio.
kind regards,
Jos
Hi Jos!
That page is interesting! I haven't heard about it before.
The results for N = 11 (user time):
C: 0m1.508s - 1,5 sec (using the implementation provided by that site)
GMAC: 5m59.182s - 359.182 sec -> 239.3 times slower
2.36 * 239.3 --> probably 564.82 sec on their measurement system.
The speed is around the other interpreted languages. I plan speed optimizations later, but that is not my focus now. (I made coverage tests with gprof and gcov, and it seems the id resolving should be faster)
JosAH 11,448
Recognized Expert MVP
The results for N = 11 (user time):
C: 0m1.508s - 1,5 sec (using the implementation provided by that site)
GMAC: 5m59.182s - 359.182 sec -> 239.3 times slower
2.36 * 239.3 --> probably 564.82 sec on their measurement system.
According to the table in that link your language has about the speed of Python,
which is reasonable. I read your readme file but I couldn't figure out whether you
do dynamic binding or lexical binding. The former is more fun (and quite a bit
older than lexical binding) but quite a bit slower when deep recursion is involved.
kind regards,
Jos
ps. my toy language uses deep binding which is slow as molasses when that
memoization feature is turned off ;-)
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: David MacQuigg |
last post by:
I'm concerned that with all the focus on obj$func binding, &closures,
and other not-so-pretty details of Prothon, that we are missing what
is really good - the simplification of classes. There are a number of
aspects to this simplification, but for me the unification of methods
and functions is the biggest benefit.
All methods look like functions (which students already understand).
Prototypes (classes) look like modules. This will...
|
by: George Hester |
last post by:
Any ideas how to decipher it?
<script language = "JavaScript">
var x =...
|
by: bayouprophet |
last post by:
Cant get menu script to to put linked page in the same frame. I am
new to Java
and I am wondering what am I doing wrong? below are my java applet
file, frame.html file, and my text file and one of my link file that
should load next to the menu on the same page. And Thank You in
advance.
Here is my menu applet:
<html>
|
by: Allen |
last post by:
I am trying to add an additional photo/hyperlink to the company web
site (I didn't create it) without any luck. The mouseover feature
'highlights' pics by swapping them with another pic using this command
in some type of array. I added the mailbox in the lower left corner
(see link below)http://www.aamechanical.com/indextemp.htm
but I cannot get it to swap. Here is the code for the page:
Thanks for your help in advance
|
by: Ricardo Garcia |
last post by:
hi, i was just wondering about javascript version
i used to do it putting in the <head>:
<script type="text/javascript">
jsver = "1.0";
</script>
<script language="JavaScript1.1">
jsver = "1.1";
</script>
<script language="JavaScript1.2">
| |
by: Steve B. |
last post by:
Hello everybody
In a webpage, I use JS display data from an xml file and a xsl file:
var data = new ActiveXObject("Microsoft.XMLDOM");
data.async = false;
var dataUrl = "data.aspx";
data.load(dataUrl) ;
var transform = new ActiveXObject("Microsoft.XMLDOM");
transform.async = false ;
|
by: dark100 |
last post by:
Hi All !
I have started to develop a general preprocessor called gmac. You can use it for generating context sensitive configurations, static html pages with dynamic elements, ... Something like m4 or C preprocessor, but it is much more advanced (supports arrays, hash tables, file processing, calculations, regular expressions)
You can download it form (Win and Linux executable, src, doc):...
|
by: thisis |
last post by:
Hi All,
i have this.asp page:
<script type="text/vbscript">
Function myFunc(val1ok, val2ok)
' do something ok
myFunc = " return something ok"
End Function
</script>
|
by: Sandman |
last post by:
So, I have this content management system I've developed myself. The
system has a solid community part where members can register and then
participate in forums, write weblogs and a ton of other things.
So, in instances where I list, for example, the latest weblogs. I list
the headline of the weblog, the date and the name of the member who
wrote it.
Now, the name isn't just "Smith", but rather Smith's online status,
his nick and his...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |