Felix is about to get HUNDREDS of operators. It will not only be the fastest and
easiest to use systems and application programming language ...

.. it will also be the most beautiful. :)

For an advance look:

http://felix-lang.org/$/usr/local/lib/felix/felix-latest/lib/std/ctypesets.flx

What? Set union done using an actual set-union operator??

Yes indeed. Almost all the TeX, LaTeX, and AMSTeX operators will soon
be available.

How's it work? Well, first, we have to add the operators to the grammar:

syntax texsyms {
  sym := "\\curlyeqprec" =># '(nos _1)';
  sym := "\\curlyeqsucc" =># '(nos _1)';

  x[scomparison_pri]:= x[>scomparison_pri] sym x[>scomparison_pri] =># 
"`(ast_apply ,_sr (,_2 (,_1 ,_3)))";
}

You can use them like this:

fun \curlyeqprec (x:int,y:int) => x == y - 1;
println$ 1 \curlyeqprec 2;

Felix now allows \letters to be an identifier. Due to the nice GLR parsing, 
which is context
sensitive, we can define a binary operator, but still use it as the name of a 
"fun", since that
isn't part of an expression.

The display is done by MathJax. The Felix webserver wraps up the symbol 
\curlyeqprec
like this:

  \( \curlyeqprec \)

and we load the MathJax javascript in the document header. Mathjax (online) 
does the rest,
and we end up with nicely rendered symbols. You can do this too, with no 
grammar changes:

var \delta = 1;

and you'll see a Greek delta if you examine it with your browser (using the 
Felix webserver!!).

Seems there are Vim plugins for MathJax too.

Down the track a little, I'll examine adding support for more sophisticated 
constructions,
such as matrices, tables, quantifiers, etc. This requires a bit more thought to 
avoid
messing up the existing Felix language too much (but then, no one is using it 
yet 
except me so it hardly matters).

The key thing here is that some basic TeX stuff is readily compatible with
ordinary programming. Complex TeX, of course, is entirely unreadable:
we have to ensure the *unrendered* code is still readable and writable.


--
john skaller
skal...@users.sourceforge.net





------------------------------------------------------------------------------
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual 
desktops for less than the cost of PCs and save 60% on VDI infrastructure 
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
_______________________________________________
Felix-language mailing list
Felix-language@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/felix-language

Reply via email to