1、 1 / 6Yakiis Language MoldI have learned Python, Ruby, Perl, C and some LISP. I have discovered funny of learning programming languages. And I want to learn languages faster. So, I have created a tool to help me done my goal. It called Yakiis language mold by me. I think it not only can help me lear
2、ning faster, but also can help people raising their comprehension of programming language. If you understand better, you do batter. So I write down it. PrefaceYakiis Language Mold is a tool. It means it is flexible, and you can modify it to fit your environment. And its goal is to help people buildi
3、ng a clear blueprint of programming language. The blueprint is set up by three parts: syntax, semantic and philosophy view. (See Figure 1 Blueprints Structure)Figure 1 Blueprints StructureI will describe the three parts in the following content. Now, I put a list in which synopsizes are.Philosophy V
4、iew: The core concepts The OOP mold The design-target of the language2 / 6 Date typeSyntax View: Statement rules Syntax BlockSemantic View: Symbol semantic Central semantic wordPhilosophyCore ConceptThere are some common concepts for all programming language. I list here. (Quote from my note) Rubbis
5、h collection Object quotation Dynamic type: Type is an objects attribution not variables attribution. A variable just is a name for object, it havent types as an attribution by which people can distinct it. Its just a pointer that is used to act an efficient quotation of an object. Iterate: scan the
6、 elements that are belonged a set sequentially (one by one) Domain rules. Name-space: a tool that build the programs structure, allow repeated names control. Immutable: an attribute of an object that cannot be operated by the method, and usually returns a new object that usually is a copy of origina
7、l object to respond methods invoking. 3 / 6 An expression is just to let the interpreter calculating to get a value or an object. But a statement leads an action. (All programming language is the same)The OOP moldThe core concepts of OOP are common knowledge for programmers. So I wouldnt repeat here
8、. I just prompt you to focus on how the language supports these concepts.The design-target of the languageThe design-target of the language is a key that can help you to really grasp a new language. In the general, it reflects the design goal of author who designs the language. Such as, Rubys design
9、-target is that free programmer from complex input while they are programming. So, Rubys statement is meaningful. You can express more with type less. The Perls design-target is to build a tool that can process the text fluently. Thus, the Perl involve the regular expression, and it just copies the
10、Cs control structure. (Not design it for its own)Date TypeThe build-in date type is a basic element in program, so programming language provides them. They are: Single Type (scalar quantity) Number Character Boolean Sequence List Set Dictionary Tuple Array Hash String4 / 6SyntaxProgram is consisted
11、by order list. So, the syntax is rules of organizing order. I recon there have two kinds of order. I call them statement and syntax block.StatementUsually, statement holds in a line, and is limited by a semicolon or a n.My own statement concept evolves the common expression and common statement.A st
12、atement is consisted by mark and Symbol mark (arithmetic mark). (See Core Concept)Syntax BlockMy syntax block can cover the whole syntax structure in a programming language. It is consisted by head and body. Such as a function definition is a Syntax Block. (See Figure 2 Syntax Block)Figure 2 Syntax
13、BlockAnd some control structures are also Syntax Block. (See Figure 3 If block)Figure 3 If blockThe iterator syntax can also be analyzed by Syntax Block. But its decorated by syntax sugar. Such as:5 / 61.upto(3) |x| puts x “1.upto(3)” is the central word, and “|x|” is bodys variable. The structure h
14、asnt decorator. (Dont forget Rubys philosophy: less input)SemanticSymbol semanticsThe basic semantic unit is symbol (arithmetic mark, key words and assignment mark).There is one point that we need pay attention: Type of returning or kind of action (Priority-level, combination). Such as:1 * 8Just ret
15、urn a number.max or minReturn an object.X = puts “Hello, I am Yakii.” #= X = 1The “puts” is just a name of a build-in function. It will let an action, and return 1. Then = assign the 1 to variable X.Central semantic wordLets see the example:public viod display(int) some statements Commonly, the head
16、s meaning will determine the bodys structure and usage. For this example, “display()” is a mark to indicate the body is function body. Thus the body just defines a sequence of order. The “display()” is also called central word, because it determine the main meaning of head. Lets see another example:Foreach (array) print $_;6 / 6“foreach” is the central word in this example, because it determine a main meaning of head. It indicate the body is a iterate body. The decorator is limitation word for central word, such as “public, int and some name-mark”.