|
| 1 | +#+options: toc:nil |
| 2 | + |
| 3 | +* Language |
| 4 | + |
| 5 | +The CASM language is an Abstract State Machine (ASM) modeling and specification language. |
| 6 | +Its [[./syntax][syntax]] is influenced in part by [[https://www.uni-ulm.de/in/pm/forschung/projekte/coreasm][CoreASM]] |
| 7 | +and other ASM languages, but includes language concepts which are well known in modern programming languages as well. |
| 8 | +Different to existing ASM implementations is that CASM is a static strong inferred typed ASM language. |
| 9 | +Before we describe various language constructs lets have a look at the /Hello World/ specification to outline the basic structure of the CASM modeling language: |
| 10 | + |
| 11 | +#+html: <callout type="info" icon="fa fa-code"> |
| 12 | +The /Hello World/ application specified in CASM: |
| 13 | +#+begin_src casm -n |
| 14 | +CASM |
| 15 | +init HelloWorld |
| 16 | +rule HelloWorld = |
| 17 | +{ |
| 18 | + println( "Hello world!" ) |
| 19 | +} |
| 20 | +#+end_src |
| 21 | +#+html: </callout> |
| 22 | + |
| 23 | +Every CASM specification starts with a [[./syntax#Header][header]] containing the keyword =CASM= (line 1). |
| 24 | +The [[./syntax#Header][header]] part is followed by [[./syntax#Definitions][definitions]]. |
| 25 | +In line 2 an [[./syntax#InitDefinition][init definition]] is specified to set the starting rule of the single execution agent to the rule named =HelloWorld=. |
| 26 | +The rule =HelloWorld= is defined in line 3 ranging to line 6 through a [[./syntax#RuleDefinition][rule definition]]. |
| 27 | +Notice that CASM does not require symbol names to be declared before usage. |
| 28 | +Inside the =HelloWorld= rule a [[./syntax#BlockRule][block rule]] creates a parallel execution semantics scope (line 4, 6). |
| 29 | +Last but not least the actual statement to print out the =Hello world!= string defined by a [[./syntax#CallRule][call rule]] to a built-in function named =println=. |
| 30 | + |
| 31 | +CASM does not require any newlines, tabulators, or statement separators like in other specification or programming languages. |
| 32 | +As example the following /Hello World/ application is equivalent to the one given above. |
| 33 | + |
| 34 | +#+html: <callout type="info" icon="fa fa-code"> |
| 35 | +The inline version of the /Hello World/ application specified in CASM: |
| 36 | +#+begin_src casm -n |
| 37 | +CASM init HelloWorld rule HelloWorld println( "Hello world!" ) |
| 38 | +#+end_src |
| 39 | +#+html: </callout> |
| 40 | + |
| 41 | +TBA |
| 42 | + |
| 43 | +** Functions |
| 44 | + |
| 45 | +TBA |
| 46 | + |
| 47 | +** Rules |
| 48 | + |
| 49 | +TBA |
| 50 | + |
| 51 | +** Initialization |
| 52 | + |
| 53 | +TBA |
| 54 | + |
| 55 | +** Comments |
| 56 | + |
| 57 | +TBA |
| 58 | + |
| 59 | + |
0 commit comments