Forth и другие саморасширяющиеся системы программирования Locations of visitors to this page
Текущее время: Вт мар 19, 2024 11:57

...
Google Search
Forth-FAQ Spy Grafic

Часовой пояс: UTC + 3 часа [ Летнее время ]




Начать новую тему Ответить на тему  [ Сообщений: 120 ]  На страницу 1, 2, 3, 4, 5 ... 8  След.
Автор Сообщение
 Заголовок сообщения: Straight Forth
СообщениеДобавлено: Вс дек 18, 2016 07:32 
Не в сети

Зарегистрирован: Сб дек 17, 2016 23:03
Сообщения: 60
Благодарил (а): 0 раз.
Поблагодарили: 0 раз.
:hey;

Hello Russian Forthers! I am developing a new standard that I call: Straight Forth --- I am not here to promote ANS-Forth which I consider to be a failure --- I am not here to promote Forth-200x which has all of the same problems as ANS-Forth, but 10 times more complexity.

I am asking for the opinion of the Russian Forthers. I am not going to pretend to be Moses and get my design from God, or Charles Moore --- my design is not written on stone tablets --- if you have opinions supported by good reasons then I will change my design accordingly.

My design is intended to be used on 64-bit desktop computers. It is not intended to be used on micro-controllers. It will support cross-compilers for micro-controllers, but the Forth being cross-compiled will not be Straight Forth (because there are no 64-bit micro-controllers). People who know more about micro-controllers than I do will design the micro-controller Forth --- I can write a cross-compiler for whatever Forth they design --- Raimond Dragomir of Romania has LFT-Forth for the 32-bit ARM which would be a good start.

My design is intended to be used mostly for numerical programming. I have been talking to Ilya Tarasov about this. I also had a good suggestion from Ilya Vasilyev. The data-stack needs to contain numbers, but what is a number? Here are some possible answers:

A.) A number is a 64-bit fixed-point value with an assumed unity of 2^32. The data-stack is 8 bytes wide. Mixed-precision words such as */ will use a 128-bit intermediate value with an assumed unity of 2^64.

B.) A number is an IEEE-754 double. The data-stack is 8 bytes wide.

C.) A number is a pair of 64-bit integers, which are the numerator and denominator of a ratio (the numerator is signed and the denominator is positive). The data-stack is 16 bytes wide.

Note that A. produces the fastest code, but it imposes a limit of about +- 2^31 on the range of the numbers allowed.

Note that B. allows an almost unlimited range of numbers, but is maybe half the speed of A..

Note that C. imposes a limit of about +- 2^61 on the range of the numbers allowed. The primary advantage is better precision (repeating fractions are represented exactly), but it is maybe half the speed of B..

Ilya Vasilyev's suggestion was to allow all three versions to be standard. Most Straight Forth programs can be compiled and executed without modification under all three versions. The numeric results may vary slightly in the least significant digits, but this will not make any practical difference. The downside of Ilya Vasilyev's suggestion is that three compilers have to be written, to support the three versions. The upside is that most programs can be ported from one version to another without modification.

Some programs will only work on B. because they need the huge range of numbers for scientific programs. Some programs will only work on C. because they need the precision. Some programs will work best on A. because they need speed and their data is in the small range of +-2^31 --- these programs could also be compiled with B. or C. though, and still work correctly, but will run more slowly. I predict that 90% of the programs will work fine with A. --- only 10% of the programs will need B. or C. --- these 10% will mostly be scientific programs written by people smarter than me.

My own intention with Straight Forth is to write CAM (Computer-Aided Manufacturing) programs. This involves generating gcode programs for CNC machines. Speed is important, but precision is not important (a CNC machine may need to represent numbers in the range +-100 to a precision of 0.0001). Simplicity is also very important --- most machinists have little or no experience with computer programming --- they want a programming language that is as easy to use as a pocket calculator.

What is your opinion? What is a number?

I have a document describing the Straight Forth design --- I may post it later if there is interest.


Вернуться к началу
 Профиль Отправить личное сообщение  
Ответить с цитатой  
 Заголовок сообщения: Re: Straight Forth
СообщениеДобавлено: Вс дек 18, 2016 12:05 
<pardon, mOleg-trolling has begun>


Последний раз редактировалось gudleifr Пн дек 19, 2016 19:17, всего редактировалось 1 раз.

Вернуться к началу
  
Ответить с цитатой  
 Заголовок сообщения: Re: Straight Forth
СообщениеДобавлено: Пн дек 19, 2016 19:05 
Не в сети
Moderator
Moderator
Аватара пользователя

Зарегистрирован: Чт май 04, 2006 00:53
Сообщения: 5062
Откуда: был Крым, теперь Новосибирск
Благодарил (а): 23 раз.
Поблагодарили: 63 раз.
HughAguilar писал(а):
I have a document describing the Straight Forth design --- I may post it later if there is interest.

fine.

my old scratches

_________________
Мне бы только мой крошечный вклад внести,
За короткую жизнь сплести
Хотя бы ниточку шёлка.
fleur


Вернуться к началу
 Профиль Отправить личное сообщение  
Ответить с цитатой  
 Заголовок сообщения: Re: Straight Forth
СообщениеДобавлено: Вт дек 20, 2016 13:45 
Не в сети
Аватара пользователя

Зарегистрирован: Вт май 23, 2006 04:10
Сообщения: 129
Благодарил (а): 44 раз.
Поблагодарили: 5 раз.
gudleifr писал(а):
<pardon, mOleg-trolling has begun>

... Нет, кто бы что ни говорил, а мсье gudleifr ну оочень культурный товарищ.
Она, культура то-бишь, у него как-бы врождённая.
Он не стал, как обычно, лепить свою коронную фразу <в теме появился...>, --
но, сообразуясь с присутствием иностранного гостя в теме, выдал её англо-французский эквивалент.
Какое-никакое, а всё-таки уважение к забугорному гостю.

А на "местную шушеру" , право, стоит ли тратить драгоценный этикет :?:


Вернуться к началу
 Профиль Отправить личное сообщение  
Ответить с цитатой  
 Заголовок сообщения: Re: Straight Forth
СообщениеДобавлено: Вт дек 20, 2016 19:40 
Не в сети
Moderator
Moderator
Аватара пользователя

Зарегистрирован: Чт май 04, 2006 00:53
Сообщения: 5062
Откуда: был Крым, теперь Новосибирск
Благодарил (а): 23 раз.
Поблагодарили: 63 раз.
Цитата:
Нет, кто бы что ни говорил

А ведь бог шельму таки метит, в данном случае в подписи, gudleifr, а именно:
Цитата:
"Когда я говорю "понимаю" - это не значит, что я согласен, не значит, что я понимаю и вообще не значит, что я слушаю тебя."

_________________
Мне бы только мой крошечный вклад внести,
За короткую жизнь сплести
Хотя бы ниточку шёлка.
fleur


Вернуться к началу
 Профиль Отправить личное сообщение  
Ответить с цитатой  
 Заголовок сообщения: Re: Straight Forth
СообщениеДобавлено: Ср дек 21, 2016 11:23 
Не в сети

Зарегистрирован: Сб дек 17, 2016 23:03
Сообщения: 60
Благодарил (а): 0 раз.
Поблагодарили: 0 раз.
mOleg писал(а):
HughAguilar писал(а):
I have a document describing the Straight Forth design --- I may post it later if there is interest.

fine.

my old scratches

I'm interested in your "scratches" --- I will read through it more thoroughly later.

I will say now that it is important to standardize behavior rather than implementation. I want to define Straight Forth in such a way that it can be implemented by multiple compiler-writers on a variety of processors using a variety of techniques (indirect-threaded, subroutine-threaded, etc.).

This is the theory anyway. As a practical matter, some assumptions about implementation will be made in the design. I think it is reasonable to assume that the processor is 64-bit rather than 32-bit --- this is the 21st century --- nobody uses 32-bit processors for desktop computers anymore (note that Straight Forth is not intended to be used in micro-controllers, which may be 16-bit or 32-bit, but are never 64-bit).

ANS-Forth came out in 1994, and it was obsolete on the first day --- ANS-Forth looked like a product of the 1970s --- it was, in fact, derived directly from Charles Moore's work in the 1970s. Charles Moore got kicked out of Forth Inc. in 1982, and Forth Inc. held onto his obsolete Forth written in the 1970s --- they have been keeping the corpse warm for decades.

I think that the Forth community needs a modern standard --- I'm not saying that it will be a "silver bullet" --- but it would be better than ANS-Forth, which is a bullet made out of obsolete technology and salesmanship.


Вернуться к началу
 Профиль Отправить личное сообщение  
Ответить с цитатой  
 Заголовок сообщения: Re: Straight Forth
СообщениеДобавлено: Чт дек 22, 2016 04:13 
Не в сети
Administrator
Administrator
Аватара пользователя

Зарегистрирован: Вт май 02, 2006 22:48
Сообщения: 7958
Благодарил (а): 25 раз.
Поблагодарили: 144 раз.
HughAguilar писал(а):
I will say now that it is important to standardize behavior rather than implementation.

I'm wrote it here several last years! :))


Вернуться к началу
 Профиль Отправить личное сообщение  
Ответить с цитатой  
 Заголовок сообщения: Re: Straight Forth
СообщениеДобавлено: Пн дек 26, 2016 18:59 
Не в сети
Moderator
Moderator
Аватара пользователя

Зарегистрирован: Чт май 04, 2006 00:53
Сообщения: 5062
Откуда: был Крым, теперь Новосибирск
Благодарил (а): 23 раз.
Поблагодарили: 63 раз.
HughAguilar писал(а):
I may post it later if there is interest

I'm interesting.
Can you give the links?

_________________
Мне бы только мой крошечный вклад внести,
За короткую жизнь сплести
Хотя бы ниточку шёлка.
fleur


Вернуться к началу
 Профиль Отправить личное сообщение  
Ответить с цитатой  
 Заголовок сообщения: Re: Straight Forth
СообщениеДобавлено: Вс янв 01, 2017 07:21 
Не в сети

Зарегистрирован: Сб дек 17, 2016 23:03
Сообщения: 60
Благодарил (а): 0 раз.
Поблагодарили: 0 раз.
mOleg писал(а):
HughAguilar писал(а):
I may post it later if there is interest

I'm interesting.
Can you give the links?

Maybe later I will set up a website for this --- I plan on doing so.

In the meantime, I can email it to anybody who is interested.
My email is: hughaguilar96@gmail.com
Send me a request and I will email it to you.

I only have one chapter written at this time. Also, in the document I am assuming that a "number" will be a 64-bit fixed-point with an assumed unity of 2^32. I may change this --- I am now thinking that a ratio of two 64-bit integers might be better --- I am undecided though.

I hope everybody had a merry Christmas, and I wish all of you a happy new year. :-)


Вернуться к началу
 Профиль Отправить личное сообщение  
Ответить с цитатой  
 Заголовок сообщения: Re: Straight Forth
СообщениеДобавлено: Пн янв 02, 2017 10:06 
Не в сети

Зарегистрирован: Сб дек 17, 2016 23:03
Сообщения: 60
Благодарил (а): 0 раз.
Поблагодарили: 0 раз.
mOleg писал(а):
HughAguilar писал(а):
I may post it later if there is interest

I'm interesting.
Can you give the links?

I noticed on the front page of this forum that I can post messages but I can't have attachments. Could this be changed so I could attach StraightForth.txt to a post? It would be more convenient than email --- I expect the file to change as suggestions are made, so I will have a running document getting posted each step of the way.


Вернуться к началу
 Профиль Отправить личное сообщение  
Ответить с цитатой  
 Заголовок сообщения: Re: Straight Forth
СообщениеДобавлено: Пн янв 02, 2017 10:10 
Не в сети
Moderator
Moderator
Аватара пользователя

Зарегистрирован: Чт май 04, 2006 00:53
Сообщения: 5062
Откуда: был Крым, теперь Новосибирск
Благодарил (а): 23 раз.
Поблагодарили: 63 раз.
HughAguilar писал(а):
Could this be changed so I could attach StraightForth.txt to a post?

You can create new thread on th forum like my scratches.

_________________
Мне бы только мой крошечный вклад внести,
За короткую жизнь сплести
Хотя бы ниточку шёлка.
fleur


Вернуться к началу
 Профиль Отправить личное сообщение  
Ответить с цитатой  
 Заголовок сообщения: Re: Straight Forth
СообщениеДобавлено: Ср янв 04, 2017 04:52 
Не в сети
Administrator
Administrator
Аватара пользователя

Зарегистрирован: Вт май 02, 2006 22:48
Сообщения: 7958
Благодарил (а): 25 раз.
Поблагодарили: 144 раз.
About number formats:

1.23 or 1.23E1 or 1E1 - floating-point numbers ( . OR E/e)
1234:4567 - double-size numbers, also used for fixed-point arithmetic
2/3 - rational numbers

Using dot for fixed-point arithmetic lead to loud protests from programmers who use FPU as a primary hardware device for mathematic calculations. FPU is native device and it is faster than fixed-point, so must have a priority.

However, mechanism of number recognizing should be modified in realtime. So, must be a way to set recognizing 1.23 as fixed-point number. This is easily provided be DEFERring NUMBER, but having as default a controllable version, with some system variables to enable/disable recognizing of all formats listed above.

Also, 0b 0x 0d should point to binary, hexadecimal and decimal bases respectively. With dot required for floating point (it is strange to demand E for floating POINT, isn't it?), floating point may be allowed to process even with non-decimal BASE.


Вернуться к началу
 Профиль Отправить личное сообщение  
Ответить с цитатой  
 Заголовок сообщения: Re: Straight Forth
СообщениеДобавлено: Чт янв 12, 2017 13:03 
Не в сети
Аватара пользователя

Зарегистрирован: Ср фев 23, 2011 20:42
Сообщения: 600
Откуда: Карелия
Благодарил (а): 3 раз.
Поблагодарили: 24 раз.
Hishnik писал(а):
So, must be a way to set recognizing 1.23 as fixed-point number. This is easily provided be DEFERring NUMBER
Да этот механизм существует начиная с самого древнего Форта. Ну вот почему в Форте двойную точность указывают точкой в ЛЮБОЙ позиции ? А потому, что позиция точки попадает в переменную DPL. И после ввода числа, к примеру 12345.6789 у тебя есть 123456789 в виде двойного целого и позиция точки в переменной DPL равная 4. И что тебе еще надо ? Пишешь слово D>F , которое преобразует двойное целое и позицию точки в число с плавающей точкой в формате ТВОЕЙ ЭВМ и используешь если DPL не отрицательно (если никакой точки не было введено, то DPL будет -1). И не надо никакого DEFER. Все уже было придумано Муром.

Да и вообще, HughAguilar писал о внутреннем представлении чисел в стеке, а не об их синтаксической записи.


Вернуться к началу
 Профиль Отправить личное сообщение  
Ответить с цитатой  
 Заголовок сообщения: Re: Straight Forth
СообщениеДобавлено: Чт янв 12, 2017 13:18 
Не в сети
Аватара пользователя

Зарегистрирован: Ср фев 23, 2011 20:42
Сообщения: 600
Откуда: Карелия
Благодарил (а): 3 раз.
Поблагодарили: 24 раз.
HughAguilar писал(а):
C.) A number is a pair of 64-bit integers, which are the numerator and denominator of a ratio (the numerator is signed and the denominator is positive). The data-stack is 16 bytes wide.
Since it is enough slow number presentation you can keep them by determining an extra operators for this type of numbers. For example
+ <-the addition of default fast numbers
%+ <-the addition of numbers with a numerator and denominator
I.e. I mean that the ideology of Forth demands types for operators, not operands. The type of operands must be just stack cell without more exact type specification. 64 bit (or maybe 128 bit) cell in your case.


Последний раз редактировалось Ethereal Чт янв 12, 2017 16:37, всего редактировалось 2 раз(а).

Вернуться к началу
 Профиль Отправить личное сообщение  
Ответить с цитатой  
 Заголовок сообщения: Re: Straight Forth
СообщениеДобавлено: Чт янв 12, 2017 15:38 
Не в сети
Administrator
Administrator
Аватара пользователя

Зарегистрирован: Вт май 02, 2006 22:48
Сообщения: 7958
Благодарил (а): 25 раз.
Поблагодарили: 144 раз.
Ethereal писал(а):
Да этот механизм существует начиная с самого древнего Форта. Ну вот почему в Форте двойную точность указывают точкой в ЛЮБОЙ позиции ? А потому, что позиция точки попадает в переменную DPL. И после ввода числа, к примеру 12345.6789 у тебя есть 123456789 в виде двойного целого и позиция точки в переменной DPL равная 4. И что тебе еще надо ? Пишешь слово D>F , которое преобразует двойное целое и позицию точки в число с плавающей точкой в формате ТВОЕЙ ЭВМ и используешь если DPL не отрицательно (если никакой точки не было введено, то DPL будет -1). И не надо никакого DEFER. Все уже было придумано Муром.

3.1415926 - это Pi. Без дальнейшего D>F. Просто потому, что пользователи не хотят разбираться в тонкостях придуманного когда-то Муром, а хотят число с плавающей точкой записывать именно как число с точкой. Объективно необходимые вещи писать можно и нужно (например, S>F), но зачем навязывать формат записи, от которого пользователь хочет отказаться? Аргумент очень простой: Форт - гибкий язык? В нем все можно сделать как удобно? Ну так сделайте нам разбор чисел таким образом, чтобы нам было удобно работать. И если в ответ на это следуют культовые соображения вида "Мур делал не так, а ему лучше знать", то чего удивляться, что в Форт программистов не загнать?


Вернуться к началу
 Профиль Отправить личное сообщение  
Ответить с цитатой  
Показать сообщения за:  Поле сортировки  
Начать новую тему Ответить на тему  [ Сообщений: 120 ]  На страницу 1, 2, 3, 4, 5 ... 8  След.

Часовой пояс: UTC + 3 часа [ Летнее время ]


Кто сейчас на конференции

Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 1


Вы не можете начинать темы
Вы можете отвечать на сообщения
Вы не можете редактировать свои сообщения
Вы не можете удалять свои сообщения
Вы не можете добавлять вложения

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
phpBB сборка от FladeX // Русская поддержка phpBB