[Seed7-users] Backend
Interpreter and compiler for the Seed7 programming language.
Brought to you by:
thomas_mertes
From: Thomas M. <tho...@gm...> - 2012-10-30 08:56:06
|
On Tue, 23 Oct 2012 00:39:31 +0200, Renato Lenzi <re...@gm...> wrote: > Even if i know that this is a difficult issue and the language itself > is not aimed to go there, but the question itself is simple :-) is > there any plan to support, in future, different backends like > javascript? In the moment I have no plans for other backends. The idea is interesting and in general it would be possible, but I have not the time to do it myself. > This is an interesting point because many modern language (Ceylon, > Kotlin, Fantom, Scala) have (or will have) this feature. > This doesn't affect how Seed7 is a good language, of course. Generating code for statements and expressions is probably not so hard. The Seed7 compiler comp.sd7 could be used as base. The problem is in the runtime library. The Seed7 runtime library provides the same functionality under Linux and Windows. The last estimation showed that 48% of the C code is in the runtime library. There are many alternative code paths, which take different C compiler and library features into account. This includes things like little/big-endian, twos complement representation, 32/64-bit, handling of divide by zero, IEEE 754 floating point conformance, does right shifting sign extend, etc. Other alternate code paths deal with C library differences. This includes questions like: - Does ftell() return -1 when it is called with a pipe? - Does fwrite() work for a read only file? - Is remove() able to remove an empty directory? - Can utime() change the access and modification times of a directory? - Has mkdir() one or two parameters? - Is the function localtime_r() available? - Which file functions must be used to have 64-bit file offsets? - Which operating system functions must be used for Unicode? There are also such things as different path delimiters and paths with and without drive letters. All this C library differences are balanced by the Seed7 runtime library. For new backends this things must be done also. I would really like to have other backends for Seed7. I have not the time to do it myself, but I offer to help, if you or someone else volunteers. Regards, Thomas Mertes |