Hi there,
Since objects are closing in, I begin to work on the new version of
Befunge, that will be written in imcc.
Anyway, whatever the reason, I'm playing with imcc and have some
questions about it:
- will objects introduce a speed overhead? I'm asking this question
because the Lahey space can be modelized by an object, with attributes
(min and max x, min and max y, content) and methods (set_max, set_min,
get_value_at, etc.). But since there will be only one Lahey space, an
object may be overkill (especially if there are speed issues), and I'd
better create a regular module with file-scoped vars and global
subroutines.
- if I implement the Lahey space module as a regular module, how can I
declare file-scoped vars that will be accessible by the subroutines of
the file and only them? Since imcc parses compilation units first, I
don't see how to do this... Maybe with the ".namespace" keyword?
- if I can't use file-scoped lexical vars, maybe the solution is to
declare some global var with the "global" keyword (in some sort of
init_module function). The question is once again if this comes with a
speed overhead? And if yes, which will be faster: a Lahey space
full-blown object or a regular module with globals (that one need to
retrieve)?
- can you think of another solution that will be imcc-friendly?
On a side note:
- the global does not seem to be available:
$ cat foo.imc
sub _main
.local int width
width = 0
global "lhs_width" = width
end
.end
$ imcc foo.imc
error:imcc:iANY file foo.imc line 5: op not found 'store_global_sc_i'
(store_global<2>)
$
Will the feature be implemented soon?
- when using the global keyword, can the string where one stores the
value be anything? For example, can I use "foo::bar" as a global name?
- when including a file with .include, the line numbering continues to
increase without being zeroed, and it's quite difficult to track errors
because of this behavior
- when including a file, if it isn't properly newline terminated, you
get an error even if the line is a comment...
$ imcc main.imc
(error) line 26: parse error, unexpected $undefined, expecting '\n'
Didn't create output asm.
Thanx for your answers,
Jerome
--
[EMAIL PROTECTED]