I suggest we stop arguing about variables and functions and do some real
work: we need to define a taxonomy of functions with some properties like:

Functions:

        total: returns a value for all arguments
        partial: may fail on some arguments

        pure: depends only on arguments
        method: may depend on variables

        generator: has side-effects

        procedure: returns nothing

        nonreturn: never returns
        maybe-nonreturn: might return or not

        recursive: directly, indirectly, tail
        polymorphically-recursive


        determinate
        indeterminate

        inlinable
        not inlinabe
        

calls:
        procedural, functional
        inline, no-inline

variables:

        addressable
        not-addressable

        assignable: can be assigned 
        non-assignmable: can't be assigned

        const: does not depend on variables
        
        subst, eager

All of these properties can be specified, the compiler will try to check
they're correct, if not specified try to deduce them. Evaluation technique
chosen restricted by properties.

Some property combinations are common enough to warrant a special
designator in the language. Defaults may be to be chosen.

The core idea in Felix is that the compiler lets the programmer shoot
emself if they want, and always favours interpretations leading to
high performance.

A bug in semantics occurs when the programmer cannot control
what is going on. Its not a bug if the compiler does something leading
to unexpected results if the programmer can control it. Its desirable
to prevent this with the evaluation system, type system, etc,
but it isn't always possible. Felix type system doesn't always do what
you want so you have a cast like in C.

This way arbitrary programs aren't determinate, and average code
will be lightning fast. The program can take more control and
firm up the semantics at the cost of losing performance.

This philosophy is not invented by me. It's the approach taken in C++.

If you want a safe language use Haskell. Sure, arrays, being
purely functional, are just a bit slow. The standard Haskell strings
are lists of characters, also a tad slow. Closures abound because
everything is lazy. GHC today is probably pretty good at optimising
away a lot of this, but the performance isn't predictable.

Felix provides a tradeoff between safety and performance.
No apologies. The design challenge is to give the programmer control of 
the tradeoff, and to improve both safety and performance so they need
to intervene less and less as we develop the product, and they learn
better how to use it.

--
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