'약형'에 해당되는 글 1건

  1. 2010.09.15 type system
Programming/언어론2010.09.15 11:38
일반적으로 많이 접하는 '컴파일'언어들은 '형(type)'이 존재한다.
이러한 형의 존재를 type system 이라고 하고, 동적 형변환과 정적 형변환 그리고 강한 형검사, 약한 형검사로 나윈다.

음.. 결론은 없는 문제이지만,
강형(강한 형검사)/약형(약한 형검사)는 상대적인 것이라 나누는 것이 딱히 의미는 없어 보이고,
중요한건 동적 형 변환/정적 형 변환이냐의 차이가 아닐까 생각이 된다.

강한 형검사(strong typing)
 In computer science and computer programming, a type system is said to feature strong typing when it specifies one or more restrictions on how operations involving values of different data types can be intermixed. The opposite of strong typing is weak typing.

약한 형검사(weak typing)
 In computer science, weak typing (a.k.a. loose typing) is a property attributed to the type systems of some programming languages. It is the opposite of strong typing, and consequently the term weak typing has as many different meanings as strong typing does.

동적 형 변환(dynamic typing)
 A programming language is said to be dynamically typed when the majority of its type checking is performed at run-time as opposed to at compile-time. In dynamic typing, values have types but variables do not; that is, a variable can refer to a value of any type. Dynamically typed languages include Erlang, Groovy, JavaScript, Lisp, Lua, Objective-C, Perl (with respect to user-defined types but not built-in types), PHP, Prolog, Python, Ruby, Smalltalk and Tcl.

정적 형 변환(static typing)
 A programming language is said to use static typing when type checking is performed during compile-time as opposed to run-time. Statically typed languages include Ada, AS3, C, C++, C#, Eiffel, F#, Go, JADE, Java, Fortran, Haskell, ML, Objective-C, Pascal, Perl (with respect to distinguishing scalars, arrays, hashes and subroutines) and Scala. Static typing is a limited form of program verification (see type safety): accordingly, it allows many type errors to be caught early in the development cycle.

[링크 : http://kldp.org/node/55577]
[링크 : http://en.wikipedia.org/wiki/Statically_typed]
    [링크 : http://en.wikipedia.org/wiki/Statically_typed#Dynamic_typing]
    [링크 : http://en.wikipedia.org/wiki/Statically_typed#Static_typing]
[링크 : http://en.wikipedia.org/wiki/Weak_typing]
[링크 : http://en.wikipedia.org/wiki/Strong_typing]


언어별로 대충 훑어 보자면,
정적 형 변환 언어는 C 처럼 변수형을 지정하고 사용하는 언어이고
동적 형 변환 언어는 python이나 스크립트 처럼 변수형이 없이 변수명에 임의의 값을 넣고 사용하는 언어로 보인다.

'Programming > 언어론' 카테고리의 다른 글

dangling if-else  (0) 2014.08.13
double의 정확도 자릿수  (0) 2011.03.25
함수 포인터 (function pointer)  (0) 2010.09.16
type system  (0) 2010.09.15
calling convention(콜링 컨벤션)  (0) 2010.04.17
Posted by 구차니

댓글을 달아 주세요