[10:57:48] <valexey> about js evolution: http://habrahabr.ru/company/Voximplant/blog/274739/
[11:02:48] <valexey> original letter: https://mail.mozilla.org/pipermail/es-discuss/2015-June/043307.html
[18:10:58] <valexey> Astrobe has very ugly API for Serial port communication.
[18:11:49] <valexey> This module has't any function for sending or receiving BYTE. It has only functions for CHARs.
[18:11:55] <valexey> Stupid thing.
[18:13:50] <valexey> DEFINITION MODULE Serial;

IMPORT MCU, SYSTEM;

CONST
UART0* = 0;
(* LPC 17xx only *)
UART2* = 2;
UART3* = 3;

(* Parity *)
none* = {};
odd* = {3};
even* = {3, 4};
forced1* = {3, 5};
forced2* = {3, 4, 5};

PROCEDURE* TxReady*(): BOOLEAN;
PROCEDURE* PutCh*(ch: CHAR);
PROCEDURE* RxReady*(): BOOLEAN;
PROCEDURE* GetCh*(VAR ch: CHAR);
PROCEDURE* SetFormat*(wordLength, stopBits: INTEGER; parity: SET);
PROCEDURE InitEx*(uartNo, udlm, udll, mulVal, divAddVal: INTEGER);
PROCEDURE Init*(uartNo, baudRate: INTEGER);

END Serial.
[18:18:04] <TRUE> а какого размера у них чар? Может, это и есть байт?
[18:30:20] <valexey> It think it is.
[18:30:46] <valexey> But anyway I can't just call Serial.PutCh(42);
[18:31:57] <valexey> also CHAR is printable only thing. By definition. And implementation can ignore all "wrong" values.
[18:33:04] <valexey> I don't understand why there is no PutByte(b : BYTE). BYTE type is already exist in Astrobe implementation.
[18:35:32] <valexey> I need do something like Setial.PutCh(CHAR(255)) and pray that this wold not corrupt my data.
[18:36:28] <TRUE> а разве не CHR?
[18:37:05] <valexey> (of cource also I can use SYSTEM.PUT.
[18:37:09] <valexey> CHR, yes.
[18:37:57] <TRUE> в идеале, байт передавать не надо. Надо передавать массивы и записи
[18:38:40] <valexey> Sometimes BYTE is necessary.
[18:39:23] <TRUE> например?
[18:39:56] <TRUE> скорее всего, какая-то команда, но неплохо бы конкретный пример
[18:40:19] <valexey> This is microcontoller API, there is no buffering and so on. If you have good compiler then Serial.SendArray(arr) will works at the same speed as Serial.SendByte via FOR-loop.
[18:41:03] <valexey> I have proprietary protocol. I can't disclose any details. NDA.
[18:42:33] <valexey> So. In some protocols there are several 1-byte size messages/events.
[18:43:50] <valexey> And you can't just send full record because you need think about field order, endiand, padding and so on. And in different languages and different CPUs all this things are different.
[18:44:35] <valexey> SendByte - is smallest building block. If I have it then I can do anything.
[18:45:56] <TRUE> у контроллера закрытый протокол? Как же они умудрились его вам втюхать? Где были гарантии, что он вообще разарботает?
[18:48:27] <TRUE> > and different CPUs all this things are different.
как минимум, для части случаев это решаемо
[18:48:59] <valexey> specs are open. Using Astrobe can just save my time. This is not very big piece of code.
[18:49:00] <TRUE> >SendByte - is smallest building block.
Вот только байт нинужен
[18:51:44] <valexey> The main idea about Serial module port and for example Out module (in Astrobe) that Serial module implements all thing about working with hardware and Out module is one of modules that implements some kind of usage of Serial module (in this case - printing chars and strings and numbers).
[18:52:04] <valexey> So Out imports Serial.
[18:52:33] <valexey> But Out also has PutCh function :-D
[18:52:48] <valexey> This function just calls Serial.PutCh.
[18:53:04] <valexey> Stupid duplication!
[18:53:05] <TRUE> это ко мне претензия? Я говорил, что должны быть записи и массивы
[18:54:30] <TRUE> а Out через Serial печатает символ?
[18:54:45] <valexey> Serial module MUST implement 2 things: PutByte(b : BYTE), ReadByte( VAR b : BYTE). And as optional: Put/ReadByteArray. And thats all (+Tx/Rx ready and initialisation/settings things).
[18:54:51] <valexey> Yes.
[18:55:24] <valexey> After that all other modules can implement high-level abstractions via this Serial module.
[18:55:39] <valexey> chars, strings, records and so on.
[18:56:11] <valexey> Serial module now is too restricted. This is mistake. I think.
[18:58:04] <valexey> DEFINITION MODULE Out;

IMPORT Convert;

TYPE
PutCharProc* = PROCEDURE(ch: CHAR);

PROCEDURE Init*(p: PutCharProc);

PROCEDURE Char*(ch: CHAR);
PROCEDURE String*(s: ARRAY OF CHAR);
PROCEDURE Ln*();
PROCEDURE Int*(n, width: INTEGER);
PROCEDURE Hex*(n, width: INTEGER);

END Out.
[18:58:08] <valexey> "The module Out contains basic formatted text output functions. Output can be directed to
any device that accepts ASCII character data by calling Init with the name of a procedure
that outputs a single character to that device. When the system module Main is initialised,
Serial.PutCh is the procedure passed to Out.Init and subsequent output is directed to the
serial port UART0. "
[18:59:04] <valexey> /me away
[18:59:13] <TRUE> Во-первых, Out как таковой должен быть интерфейсным модулем, а Serial, USB и т.д. будут его реализациями. Во-вторых, мне и самому кажется странным делать для микроконтроллеров SYSTEM. Там по определению всё SYSTEM. А раз так, то и байт можно было бы использовать по полной. Это раз им не захотелось заморачиваться с абстракциями и обставить всё по первому классу.
[18:59:43] <valexey> BYTE is not SYSTEM.BYTE.
[18:59:55] <TRUE> ну тогда тем более
[19:00:17] <valexey> BYTE first class citisen in Oberon now.
[19:00:37] <valexey> (and in Astrobe too)
[19:01:20] <TRUE> мне больше нравится ревизия 88 года, поэтому я остановился на ней.
[19:04:48] <vlad2> Может старые сишники дизайнили? Им без разницы char или byte. А char даже роднее :)
[19:09:37] <vlad2> Про видео на обероне - да, тро-ло-ло :)
[19:20:04] <valexey> anyway this is not a language problem. This is the library problem.
[19:20:42] <valexey> Also may be this is an old artefact. Because old Oberon-07 has't BYTE type.
[20:42:22] <valexey> This is the virst usage of Oberon in this project :-)
[20:42:57] <valexey> *the first
[20:45:10] <valexey> "Oil Seen Heading to $20 by Morgan Stanley on Dollar Strength" : http://www.bloomberg.com/news/articles/2016-01-11/morgan-stanley-sees-20-a-barrel-oil-on-u-s-dollar-appreciation
[20:57:42] <vlad2> путин режиму теперь точно конец!
[20:58:01] <valexey> :-)
[23:54:44] <sda> http://cdn.fishki.net/upload/post/201405/28/1272926/lang_voenka_s500.jpg
некоторые характеристики С-500, постепенно приближаемся к созданию своей ПРО...