эээ я нашел delta forth
пишут что вроде он компилировал в ява байт-код, но сейчас есть только версии для .НЕТ
так что пока в процессе поиска чего то что компилит форт в байт-код
но вот что я нашел не утешительное
http://www.complang.tuwien.ac.at/forth/ ... ral-5.html5.6 Has anyone written a Forth which compiles to Java bytecode?
Paul Curtis writes:
The JVM, although a stack machine, can't really be used to compile Forth efficiently. Why? Well, there are a number of reasons:
* The maximum stack depth of a called method must be known in advance. JVM Spec, p. 111
* JVM methods can only return a single object to the caller. Thus, a stack effect ( n1 n2 -- n3 n4 ) just isn't possible.
* There is no direct support for unsigned quantities.
* CATCH and THROW can't be resolved easily; you need to catch exceptions using exception tables. This doesn't match Forth's model too well. JVM Spec, p. 112
* You'd need to extend Forth to generate the attributes required for Java methods.
* There is no such thing as pointer arithmetic.
* You can't take one thing on the stack and recast it to another type.
* You can't manufacture objects out of raw bytes. This is a security issue.
* There is no support for the return stack.
That said, it is possible to write something Forth-like using JVM bytecodes, but you can't use the JVM stack to implement the Forth stack. ...
If you're serious, try getting Jasmin and programming directly on the JVM.
А я то думал что стековая ява машина почти равна фортовской, увы вопрос кажеться сложнее
Нельзя просто взять форт текст и перевести в байт-код явы почти один к одному, скорее всего придеться писать доп.классы на яве, которые будут реализовать форт стек и т.п.
И тут встает вопрос блин об эффективности всего етого дела