On Wed, 2007-11-07 at 19:44 -0800, Erick Tryzelaar wrote:
> On 11/7/07, skaller <[EMAIL PROTECTED]> wrote:

> > > 2.21 iterators not explained
> >
> > True.. they're just char* .. i.e. like STL iterators.
> 
> The lexer was written a while ago, and so it doesn't use some of the
> new features we have added since then. We can probably should update
> the interface.

Just a comment: this problem is general. Last version of Felix
we got Haskell style type classes. This completely changed the
way we could handle generic things like iterators, I/O,
data structures, etc.

Upgrading the library to use the new technology is still a work
in progress.

As one person complained (and rightly so): Felix doesn't currently
have a nice simple consistent way to do basic I/O, which is the
first thing any programmer wants! And should be right up front
in the tutorial.

We can do portable asynchronous socket I/O .. but not read
and write files :)

> The biggest, in my opinion, is trying to figure out
> how to deal with errors. It's such a fundamental idea that can really
> drive how a programs are created.

FYI: I agree. In particular note that Felix does NOT have
any exception handling: in this respect it is like C,
you have to check your results for errors (unlike C, this
is *enforced* by use of option types etc).

Exceptions as in C++ are very bad design. There is a newer
theory which has 'delimited exceptions' which looks much better.
What we want is to escape the current context, but still 
to *ensure* the error is handled.

Roughly: exceptions are just too dynamic and global. Whereas
using variants (option types etc) are too static and local.

Haskell can partly solve this with Monads, but the solution
still isn't really satisfactory (because it is too invasive).

Felix actually provides a non-local goto which can escape
context (it unwinds the stack etc like an exception).
However it is impossible to fail to handle such a goto because
the target is static, i.e. a label, so it is always safe
to 'throw' one of these labels (i.e. do a goto). And the
goto statement can be wrapped in a closure (function value)
and passed as an argument to a place the label isn't visible.
So you have a combination of static and dynamic stuff here,
under programmer control, which ensures that an unhandled
exception cannot be thrown.

However this mechanism has its own problems, and it definitely
needs syntactic sugar to make it more 'exception-like'.


-- 
John Skaller <skaller at users dot sf dot net>
Felix, successor to C++: http://felix.sf.net

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Felix-language mailing list
Felix-language@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/felix-language

Reply via email to