On 04/12/2013, at 10:27 AM, srean wrote: > > > If you go up the call chain high enough you get calls from C++ routines > with weird names that I have no idea about since they're generated > by the Felix compiler. > > Oh of course, it can only go up to the C++ source and no higher, one cant > expect more. I would also guess that Felix code undergoes enough > restructuring that it is not realistically meaningful to annotate the C++ > source with corresponding Felix source lines (even for a subset of Felix > source files). If possible this feature would be very useful for debugging > though.
It is possible to do this and there's a switch in flxg to do so. It's off by default because the result isn't readable code because there are so *many* annotations. This may or may not help debugging manually, however it doesn't help with debugging tools because the lines are just comments. There are a couple of things possible here. A major thing is to use meaningful names, eg Felix uses the Felix struct field names in the C++ struct because they have to be locally unique (within the struct) in both cases. For variable it tries to use the variable name if there's only one. Eg var x will be x. A second x will get a mangled up name. It would be good to use namespaces more and take other steps (but its all work). The second major thing that can be done is instrumentation. There is, for example, an EXE_TRACE instruction. By emitting these (as C MACRO calls) one could use this to write stuff to a pipe, read the pipe and use it to show the currently executing *Felix* line. Or, to put that into a circular buffer which can be dumped at some time showing the "last 100 lines executed" or something. Although it isn't bytecode, Felix system could be made to do lots of things to help with debugging. But they're all work. > Side question: apart from the actual sequence of execution of fthreads, > everything is deterministic in Felix if one does not use pthreads right ? Well, flxg is a machine that generates C++ source. So as a machine that process is deterministic. The resulting C++ is as deterministic as C++ would be. As a *language* Felix has a LOT more indeterminism than C++. This is deliberate in most cases. As you know, most functions do not specify eager or lazy evaluation, so your code is as determinate as the function and calls to it are given this. If your function is pure, then it will be deterministic if and only if it is strict. If it isn't pure, the result is more indeterminate: I'm not sure how to even specify this. It's nice to have words like "strict" with solid definitions (F is strict if F(ERROR) = ERROR)). If it's a generator, execution is reasonably deterministic, but the generator mightn't run at all if the result isn't used. -- john skaller skal...@users.sourceforge.net http://felix-lang.org ------------------------------------------------------------------------------ Sponsored by Intel(R) XDK Develop, test and display web and hybrid apps with a single code base. Download it for free now! http://pubads.g.doubleclick.net/gampad/clk?id=111408631&iu=/4140/ostg.clktrk _______________________________________________ Felix-language mailing list Felix-language@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/felix-language