데이터 교환 형식

발행: (2026년 2월 5일 오전 10:03 GMT+9)
4 분 소요
원문: Dev.to

I’m happy to translate the text for you, but I need the actual content you’d like translated. Could you please paste the article (or the specific sections) you want me to translate? I’ll keep the source line and all formatting exactly as you requested.

Source:

동적 타입 구문

파일 정보

// Data Interchange Format
// File Extension: .data, .schema
// Schema Definition Header File: .schema
// Data Interchange Source File: .data
// .data Files May be Dynamically Typed
// .data Files May be Statically Typed
// .data Files are Required
// .schema Files Must be Statistically Typed
// .schema Files Cannot be Dynamically Typed
// .schema Files are Optional

데이터 구조 초기화

// Syntax – Name = {fields}
DataStructure = {
    integer        = 1;    
    float          = 1.0;
    boolean_type   = true;
    character      = 'd';
    string         = "string";
    array          = [];
    hash_map       = [()];
    DataStructure  = {}; 
}

기본형 초기화

형식변수예시
Booleanboolean_typeboolean_type = true;
Charactercharactercharacter = 's';
Floatfloatfloat = 1.0;
Integerintegerinteger = 1;
Stringstringstring = "string";

배열 초기화

array = [
    1,
    2,
    3,
    4,
    5
]

해시‑맵 초기화

hash_map = [
    (1|"string"),
    (2|"string"),
    (3|"string"),
    (4|"string"),
    (5|"string")
]

파일 정보 재진술

// Data Interchange Format
// File Extension: .data, .schema
// Schema Definition Header File: .schema
// Data Interchange Source File: .data
// .data Files May be Dynamically Typed
// .data Files May be Statically Typed
// .data Files are Required
// .schema Files Must be Statistically Typed
// .schema Files Cannot be Dynamically Typed
// .schema Files are Optional

옵션‑타입 구문

// option name = value;

데이터 구조 선언

// May be Declared with Initialized Fields
// Syntax – type Name = {fields}
// Optional Field Syntax – optional name;
struct DataStructure = {
    option   unsigned_integer_8bit;
    uint16               unsigned_integer_16bit;
    uint32               unsigned_integer_32bit;
    uint64               unsigned_integer_64bit;
    optional    unsigned_integer_128bit;
    option    signed_integer_8bit;
    int16                signed_integer_16bit;
    int32                signed_integer_32bit;
    int64                signed_integer_64bit;
    optional     signed_integer_128bit;
    optionfloat_32bit;
    float64              float_64bit;
    optional   float_128bit;
    bool                 boolean_type;
    option   character_8bit;
    char16               character_16bit;
    optional    character_32bit;
    option    string_8bit;
    str16                string_16bit;
    optional      string_32bit;
    array(5)      one_dimensional_array;
    array(5:2)    two_dimensional_array;
    map      hash_map;
    DataStructure        data_structure;
    EnumatorType         enumerator_type;
}

열거자 선언

// May be Declared with Initialized Fields
// Syntax – type Name = {fields}
enum EnumeratorType = {
    FIRST_VALUE,   // value = 0
    SECOND_VALUE,  // value = 1
    THIRD_VALUE,   // value = 2
    FOURTH_VALUE,  // value = 3
    FIFTH_VALUE    // value = 4
}

Source:

데이터 구조 초기화

// Syntax – type name = {fields}
DataStructure data_structure = {
    uint8   unsigned_integer_8bit   = null;
    uint16  unsigned_integer_16bit  = 2;
    uint32  unsigned_integer_32bit  = 3;
    uint64  unsigned_integer_64bit  = 4;
    uint128 unsigned_integer_128bit = 5;
    int8    signed_integer_8bit     = null;
    int16   signed_integer_16bit    = -2;
    int32   signed_integer_32bit    = -3;
    int64   signed_integer_64bit    = -4;
    int128  signed_integer_128bit   = -5;
    float32 float_32bit             = null;
    float64 float_64bit             = 2.0;
    float128 float_128bit           = 3.0;
    bool    boolean_type           = true;
    char8   character_8bit         = null;
    char16  character_16bit        = 'c';
    char32  character_32bit        = 'd';
    str8    string_8bit            = null;
    str16   string_16bit           = "string";
    str32   string_32bit           = "string";
    array(5) one_dimensional_array = [];
    array(5:2) two_dimensional_array = [];
    map hash_map = [()];
    DataStructure data_structure = {};
    EnumratorType enumerator_type = FIRST_VALUE;
}

열거자 초기화

// Syntax – type name = value;
// OR Null Syntax – type name = null;
EnumeratorType enumerator_type = FIRST_VALUE;

원시 초기화 (타입 지정)

bool    boolean_type      = true;
char8   character_8bit    = 's';
float32 float_32bit       = 1.0;
uint8   unsigned_integer_8bit = 1;
str8    string_8bit       = "string";

일차원 배열 초기화

// Syntax – type(length) name = [values]
// OR Unknown Size Syntax – type(?) name = [values]
// OR Null Syntax – type(length) name = [null]
array(5) one_dimensional_array = [
    1,
    2,
    3,
    4,
    5
]

2차원 배열 초기화

// Syntax – type(length:width) name = [values]
// OR Unknown Size Syntax – type(?:?) name = [values]
// OR Null Syntax – type(length:width) name = [null]
array(3:2) two_dimensional_array = [
    1,
    2,
    3,
    4,
    5,
    6
]

해시‑맵 초기화

// Syntax – type name = [(key|value)]
// OR Null Syntax – type name = [(null|null)]
map hash_map = [
    (1|"string"),
    (2|"string"),
    (3|"string"),
    (4|"string"),
    (5|"string")
]
Back to Blog

관련 글

더 보기 »

기타 자료 구조

튜플 (tuple) – 여러 값을 소괄호로 묶어서 표현합니다. 리스트와 동일하지만 변경이 불가능해 추가·삭제·수정이 X입니다. 사전 (dict) – 열쇠와 값이 짝을 이루는 형태의 자료 구조이며, 순서보다 열쇠가 중요한 경우에 사용합니다. 중괄호 {} 로 표현합니다. python의 .get 메서드를 사용하면 없는 키의 경우…

클래스란 무엇인가

클래스는 데이터와 함수를 함께 그룹화하는 사용자 정의 구조입니다. 인스턴스 객체를 생성함으로써 이러한 멤버에 접근하고 사용할 수 있습니다. 그것은...

#100DaysOfCode 6일 차 — TypeScript 소개

현대적인 JavaScript 애플리케이션—특히 React—을 구축하고 있다면 TypeScript를 어디서든 보게 될 것입니다. 이것은 100DaysOfCode의 6일 차이며, focused ent...