vak: (Default)
[personal profile] vak
Вдогонку про представление массивов в языке Би. Поддерживались только одномерные массивы, и назывались они векторами. Из описания языка Би:

7.2 Vector Definitions

An external vector definition has one of the following forms:

name [ ] ;
name [ constant ] ;
name [ ] ival , ival . . . ;
name [ constant ] ival , ival . . . ;

The name is initialized with the lvalue of the base of an external vector. If the vector size is missing, zero is assumed. In either case, the vector is initialized with the list of ivals (See 7.1). The actual size of the vector is the maximum of constant+1 and the number of initial values. Any vector elements which are not explicitly initialized have undefined values.

Туманная фраза "The name is initialized with the lvalue of the base of an external vector" означает, что переменная name изначально содержит адрес начала массива.

Date: 2025-04-05 07:00 (UTC)
x86128: (Default)
From: [personal profile] x86128
Прикольный язычок оказывается. Думаю, как время позволит, сделать интерпретатор для упрощённой версии, только грамматику сделать LL, чтобы получился наподобие golang только без типов

Date: 2025-04-06 14:52 (UTC)
x86128: (Default)
From: [personal profile] x86128
Не знал что у него есть возможность выгрузить IR в текстовый вид и скормить отдельно clang. Думал что это только через апишку можно сделать если слинковаться со шлангом