[ANN] Towards a new File In / File Out format

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[ANN] Towards a new File In / File Out format

Torsten Bergmann
Hi Noury,

I would not use the "<<" message for two reasons:
 - in other languages this is an operator for streaming (C++)
 - if you describle a method you write class>>#method instead of class<<#method

I personally like the format that is used in Smallscript/S# called
AML (AOS Meta Language).

A small example for a class:
============================

    Class name: Person
       extends: Object
        fields: firstName sureName [      
       ...      
    ]

You can use []-notation as well as {}-notation and since the default superclass is Object you can also write:

        Class name: Person
            fields: firstName sureName {
            ...
        }

You can also pass it directly to the compiler as XML

    <class name="Person" extends="Object" fields="firstName sureName">
                <method ...
    </class>

Since you can map it to XML you can also provide an XSD where the defaults for attributes (like the default "Object" for the "extends" attribute can be defined).

In XML/AML there is no order for attributes - so you can also write:

        Class fields: firstName surname name: Person [
           ...
        ]
 
A small example for a method:
============================

This also allows for easier extension - just add attributes or subnodes.
Either nest it into a class definition

     Class name: Person [
      Method [
      foo
      ^self
      ]
     }

or create the Method on an existing class (extension)

        Method class: String category: conversion {
                asFoo
                        ^Foo from: self
        }
       
You can also have class-less or global Methods (Functions)

   Function [
    foo
    ^self
   ]
   
 

A small example for evaluation:
===============================

use "Eval", here is a simple HelloWorld example:

        Eval [stdout << 'HelloWorld' ]

where stdout is a global variable like Transcript and << is a binary message.

You can also advice the compiler in a script:

        Compiler cmds: '-rdb:off -target:console'.

or load other modules:

        Load module: ANSISmalltalk.
        Load module: AOSUnit.
        Load module: PointExt.

or combine the format with annotations:

        Function [<$entrypoint>
          main
          Transcript show: 'HelloWorld';
        ]
       
        Method class: Point [
                + <Point> anotherPoint
                    "Adds the arguments coordinates to the receiver."
                     ^(self x + anotherPoint x) @ (self y + anotherPoint y)
        ].


The main AML elements are: Class, Module, Library, Method, Function, Compiler, Eval, Enum, Namespace, ...

There is some more syntactic sugar in the ST parser to help people coming from a different language background. So you can also write

        Transcript.show('HelloWorld');
or
        Transcript.show: 'HelloWorld';

This may be ugly for a Smalltalker and confuse people since you can mix styles. Think of
 
But XML based AML as file in/file out format is worth a look!!!

Some pointers to examples:
  http://www.edwin-buehler.net/smallscript.shtml
  http://www.double.co.nz/smallscript/index.htm
  http://www.metaprog.com/SmallScript/download.htm 

Bye
Torsten

BTW: Smallscript/S# are separate systems: Smallscript is free, running
     on the free AOS (Agent Object System)VM which is downloadable
     from smallscript.org. David made all of that completely free to use!
     The S# part running on .NET is not public. Unfortunately the ST      
     community was/is not so interested in the Smallscript part - but
     especially this one really rocks. Write a small script - pass it
     to the command line compiler and build fast DLL's, small executables,
     modules or full applications ...


--


Bis zu 70% Ihrer Onlinekosten sparen: GMX SmartSurfer!
      Kostenlos downloaden: http://www.gmx.net/de/go/smartsurfer
   

Reply | Threaded
Open this post in threaded view
|

Re: [ANN] Towards a new File In / File Out format

stéphane ducasse-2
Hi torsten


On 29 mai 06, at 19:24, [hidden email] wrote:

> BTW: Smallscript/S# are separate systems: Smallscript is free, running
>      on the free AOS (Agent Object System)VM which is downloadable
>      from smallscript.org. David made all of that completely free  
> to use!

when was it announced?

>      The S# part running on .NET is not public. Unfortunately the ST
>      community was/is not so interested in the Smallscript part

This is not true I recently ask david to release/open as much as  
possible of it.
Since ESUG in Southampton we were pushing david so that he releases  
something
publicly but we were waiting and waiting.

> - but
>      especially this one really rocks. Write a small script - pass it
>      to the command line compiler and build fast DLL's, small  
> executables,
>      modules or full applications ...

Which platforms are maintained/supported?

Stef


Reply | Threaded
Open this post in threaded view
|

Re: [ANN] Towards a new File In / File Out format

Alexandre Bergel-2
In reply to this post by Torsten Bergmann
Hi!

> BTW: Smallscript/S# are separate systems: Smallscript is free, running
>      on the free AOS (Agent Object System)VM which is downloadable
>      from smallscript.org. David made all of that completely free  
> to use!
>      The S# part running on .NET is not public. Unfortunately the ST
>      community was/is not so interested in the Smallscript part - but
>      especially this one really rocks. Write a small script - pass it
>      to the command line compiler and build fast DLL's, small  
> executables,
>      modules or full applications ...

At that time I played with Smallscript. However the documentation  
section has been empty since 2002. It is very likely that if it has  
been open, I would have use it intensively...

cheers,
Alexandre

--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.cs.tcd.ie/Alexandre.Bergel
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.