Semmal Language

셈말은 셈하는 말, 즉 Programming Language를 뜻합니다. 그래서 "우리의 서울은 서울입니다."처럼 "우리의 셈말은 셈말입니다."라는 돌고도는(meta-circular) 말을 쓸 수 있겠군요.

셈말은 간단한 함수형 언어로 첫번째 계획은 형없는 람다식만 지원하는 겁니다. 다음 계획은 아마도 lazy를 지원하는 초간단 가상기계가 만들어져야 구상할 수 있을 것 같네요.

Syntax Reference

Next Step

  1. guard는 type system에 들어가야함.
  2. tuple, list, array, usertype을 고려해야함.
  3. oop를 고려해야함.
  4. builtin function/type를 정리해야함.

Examples

Symbols

Symbol

Explanation

Example

==

x == y means x and y represent the same thing or value.

1+1==2

!=

x != y means that x and y do not represent the same thing or value.

1!=2

<
>

x < y means x is less than y.
x > y means x is greater than y.

3<4
5>4

<=
>=

x <= y means x is less than or equal to y.
x >= y means x is greater than or equal to y.

3<=4
5>=4

+

4 + 6 means the sum of 4 and 6.

2+7==9

-

9 − 4 means the subtraction of 4 from 9.

8−3==5

*

3 * 4 means the multiplication of 3 by 4.

7×8==56

/

6 ⁄ 3 means the division of 6 by 3.

12⁄4==3

|…|

|x| means the distance along the real line (or across the complex plane) between x and zero.

|–5|==|5|

!

n! is the product 1 × 2 × ... × n.

4! == 1*2*3*4

&&

The statement A && B is true if A and B are both true; else it is false.

3<4&&3>2

||

The statement A || B is true if A or B (or both) are true; if both are false, the statement is false.

5>=4||5<=2

^^

The statement A ^^ B is true when either A or B, but not both, are true.

(!b)^^b

=

x = y means x is defined to be another name for y.

cosh x = (exp x+exp (-x))/2

{{,}} 

{{a,b,c}}  means the set consisting of a, b, and c.

N={{1..}} 

{{|}} 

{{x | P(x)}}  means the set of all x for which P(x) is true.

{{n|n<-N, n{{{^2<20}}=={{1,2,3,4}} }}}

{{}} 

{{}}  means the set with no elements.

{{n|n<-N,1<n{{{^2<4}}=={{}} }}}

<-
<!-

a <- S means a is an element of the set S
a <!- S means a is not an element of S.

(1/2)^-1<-N
2^-1<!-N

작성중...

Implementation

References

  1. http://www.haskell.org/onlinereport/

  2. http://research.microsoft.com/~simonpj/Papers/slpj-book-1987/start.htm

  3. http://en.wikibooks.org/wiki/Haskell

  4. http://www.icu-project.org/


Semmal Language (last edited 2008-10-21 02:47:52 by 125)