Thoughts on Metal

View: New views
2 Messages — Rating Filter:   Alert me  

Thoughts on Metal

by dashiad01 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,
I just found the metal project, and i am really happy about it, as it
shares most of my points of view about development.
As i'm working now as web programmer, my idea has been to run away
from the usual mess of data-code-presentation that is usual in this
field.I developed specific solutions for each one of these, and now
was looking to integrate them in a single tool, unifying them, and
addressing quite a few objetives more, most of them i guess i share
with the Metal point of view (metaspecification of presentation
widgets, component-focused system , etc).
I didnt used XML in my previous works, as i found XSL unnecesarily
complex (and, as i was also developing in php, why using another
language?).
But just a few days ago, i decided to give XML a try,and as i reached
the conclusion i needed a metalanguage for my presentation widgets
event handling, i began to look for the solution.
And this is how i found metal.
Ok, all this ramble is to introduce myself a bit.

Now, on metal itself (just gave a quick look at it.No idea of what
metastorage is, but i think i guess it..).
As i've been unable to get the documentation (any help here,
please? :-P), i decided to go directly to the code.
Here, however, i've found a few things that makes me scratch my head..
Quick questions..
-Variables: is there any way to define a variable as a value, or a
reference to another variable?Ie, tagging a parameter as "byval"
or "byref"?
-Expressions: i found them a bit obfuscated.In my notes for
implementing my own xml language (was one of the options),i
considered that arithmetical / conditional expressions, may be
represented as strings, while no other object/element is involved but
just simple types(strings, numbers,references,etc).ie,something like
this:
<expr e="$data$=$data$+1" />
Parsing that expression with a small arithmetical analyzer may be
simple, and translating it to other languages i guess too.
Maybe, an alternative when other objects are implied would be..
<expr assignto="$data$" operation="*">
     <funccall name="arithmetic:cos">...</funccall>
     <expr e="2" />
</expr>
Maybe problems with binary/unary operators?
-Functions: i've seen a <count> element..I suppose this is a function
call.Are all "functions" put in the same namespace that the language
keywords?
-Deployment: In my notes, deployment (and "including" code) was
expected to work using xml namespaces, so the default namespace was
the language specification, and for included code and libraries, a
namespace should be provided.

Well, i've just thinking about a xml language for 2 days..Metal looks
to have been around for years...So i guess they have good reasons for
doing things in the way it does.I'm not suggesting anything, just
want to know if i'm wrong in my comments due to my lack of experience
in the field.

Anyway, i'm really pleased to see projects pushing in this style of
development.(and php based! Yay!)

Jose







 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/metal-dev/

<*> To unsubscribe from this group, send an email to:
    metal-dev-unsubscribe@...

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Re: Thoughts on Metal

by mlemos :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

Sorry for the delay.

on 04/26/2006 02:45 PM dashiad01 said the following:

> Hello,
> I just found the metal project, and i am really happy about it, as it
> shares most of my points of view about development.
> As i'm working now as web programmer, my idea has been to run away
> from the usual mess of data-code-presentation that is usual in this
> field.I developed specific solutions for each one of these, and now
> was looking to integrate them in a single tool, unifying them, and
> addressing quite a few objetives more, most of them i guess i share
> with the Metal point of view (metaspecification of presentation
> widgets, component-focused system , etc).
> I didnt used XML in my previous works, as i found XSL unnecesarily
> complex (and, as i was also developing in php, why using another
> language?).

Right, I do not use XSL either.


> But just a few days ago, i decided to give XML a try,and as i reached
> the conclusion i needed a metalanguage for my presentation widgets
> event handling, i began to look for the solution.
> And this is how i found metal.
> Ok, all this ramble is to introduce myself a bit.
>
> Now, on metal itself (just gave a quick look at it.No idea of what
> metastorage is, but i think i guess it..).

Metastorage is an application of MetaL. MetaL has modular compiler.
Metastorage is implemented by a module of MetaL named persistence. It
generates classes for storing and retrieving information in a relational
 database as objects. It can also generate classes for other associated
goals, but this is the core purpose.


> As i've been unable to get the documentation (any help here,
> please? :-P), i decided to go directly to the code.

MetaL documention is practically inexisting. There hasn't been much
interest to dig into the core of MetaL, so I never invested much time
documenting it.


> Here, however, i've found a few things that makes me scratch my head..
> Quick questions..
> -Variables: is there any way to define a variable as a value, or a
> reference to another variable?Ie, tagging a parameter as "byval"
> or "byref"?

MetaL has an OOP module named class . The functions of the classes that
it generates support parameters of type "in" (by value), "out" and
"inout" (by reference).

> -Expressions: i found them a bit obfuscated.In my notes for
> implementing my own xml language (was one of the options),i
> considered that arithmetical / conditional expressions, may be
> represented as strings, while no other object/element is involved but
> just simple types(strings, numbers,references,etc).ie,something like
> this:
> <expr e="$data$=$data$+1" />
> Parsing that expression with a small arithmetical analyzer may be
> simple, and translating it to other languages i guess too.
> Maybe, an alternative when other objects are implied would be..
> <expr assignto="$data$" operation="*">
>      <funccall name="arithmetic:cos">...</funccall>
>      <expr e="2" />
> </expr>
> Maybe problems with binary/unary operators?

This is how XSL does it. It is a new non-XML syntax in the middle of XML
tags. It basically defeats one of the purposes of using XML, which is to
reuse available XML parsers to develop simplified language processors.

MetaL is a modular compiler as I mentioned. This means you can implement
as many modules as you want. Currently there is one module named
"expressions" that handles local variables and expression logic. To
define a variable like you have, you use:

<set>
  <variable>e</variable>
  <group>
      <variable>e</variable>
    <plus />
      <integer>1</integer>
  </group>
</set>

It requires more typing but the expressions module and the target
language bindings that handle expressions stacks are simpler.


> -Functions: i've seen a <count> element..I suppose this is a function
> call.Are all "functions" put in the same namespace that the language
> keywords?

MetaL does not use namespaces. The meaning of each tag is mapped .input
files . These files specify which function of each MetaL module
implements the functionality associated with that tag.

This means that you may have eventually two input files that give
different meanings to the <count> tag and implement it in different ways
according to its context.


> -Deployment: In my notes, deployment (and "including" code) was
> expected to work using xml namespaces, so the default namespace was
> the language specification, and for included code and libraries, a
> namespace should be provided.

Well I could use namespaces if they would help solving anything.
Actually nothing prevents me from using tags with colons in the middle.
The way MetaL works now is sufficient to clear ambiguities.


> Well, i've just thinking about a xml language for 2 days..Metal looks
> to have been around for years...So i guess they have good reasons for
> doing things in the way it does.I'm not suggesting anything, just
> want to know if i'm wrong in my comments due to my lack of experience
> in the field.

Well, MetaL uses XML because it seemed a good idea when it started.
Anyway, a lot of people does not like using XML because it requires too
much typing. Probably a syntax similar to LISP or YAML would have been
better and it would encourage more users.

Anyway, MetaL uses only simple XML: tags with attributes and does not
use entities. Switching from XML to LISP or YAML would not be so
problematic.

Still I have not had much concern pushing MetaL because the base level
language it is not interesting . It is mostly as powerful as the target
language.

What makes it more interesting are the higher levels you can build over
the base level. I mean, the base level (level 1) generates target
language code. An above level (level 2) can generate base level code
upon an higher level abstraction.

Confused? Let me give you a real example. With MetaL base level modules
like "class", "expressions", "database", etc., I can write classes that
have code to access databases. With a level 2 module like "persistence"
and "xml" (for defining code templates) I can generate classes that
generate many kinds of complex functionality from a simpler higher level
definition.

The greatest advantage is that you just describe your application object
models and what you want them to do, instead of going through the actual
coding of the application object classes. This is the foundation of the
Model Driven Approach (MDA). That is the way Metastorage works.

Now, use your imagination and picture level 3 modules that can depart
from an even higher level definition and generate level 2 project
definitions in the Metastorage XML format.

One day we'll finally to the point that your programs will say: "press
this button to generate your software system from your thoughts!" ;-)


> Anyway, i'm really pleased to see projects pushing in this style of
> development.(and php based! Yay!)

Yep, PHP saved me a lot of development pain, especially due to the way I
can manipulate assocative arrays. Some people assume that languages like
Java or C++ would be better for this purpose. The compiler could
probably run faster, but it would taken me a lot more time to develop.

--

Regards,
Manuel Lemos

Metastorage - Data object relational mapping layer generator
http://www.metastorage.net/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/


 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/metal-dev/

<*> To unsubscribe from this group, send an email to:
    metal-dev-unsubscribe@...

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/