On 20/08/2012, at 5:01 PM, Dobes Vandermeer wrote:
> 
> Er ... I haven't seen this myself.  The whole felix compiler is written 
> without goto - OCaml doesn't support it as far as I can tell.  Do you find 
> its lack painful in OCaml?

Yes. One of many pains in Ocaml :)

> I certainly don't miss it in Java, I don't use it in C/C++.

Not really relevant. There are lots of things that you cannot do
properly with the provided constructions.

In C, for example, you have "break"? Do you use that?
It's a goto. 

Ever wanted to break out of an outer loop? In C you actually
cannot, you HAVE to use a goto. In Felix you can by the way,
break requires a label :)

There are quite a few simple algorithms that require goto
to avoid duplicate calculations. for example, reading
a file in a loop, where you have to separately test
for the end of the file from reading.

Another example: merging two tapes. Requires a goto
to avoid recalculation.

Its unavoidable: no single "prefabricated" loop can possibly
handle all initial, body, and terminal conditions optimally.


> These days programs go through several representations in the process of 
> optimization.
> 
> One common representation is a directed graph "basic blocks" - the 
> indivisible piece of code in between control flow operations along with 
> bi-directional links between them.  

Indeed, and the links are gotos.

> I don't think turning the code into a linear sequence with a bunch of labels 
> and gotos is very popular as it would be quite difficult to analyse at that 
> point.

It isn't. It is in fact very close to SSA form. That's the whole point of it.

the main difference is that with basic blocks EVERY  block ends
in a conditional branch pair.


--
john skaller
skal...@users.sourceforge.net
http://felix-lang.org




------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Felix-language mailing list
Felix-language@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/felix-language

Reply via email to