Re:Felix - a fast scripting language
by PuerkitoBio on Friday January 04, 2013 @11:40AM
(#5008370)
Looks very interesting, well done to whoever did this. After an admittedly quick and superficial glance at the tutorial, I'm not fan of chapter 6 though. Why so many ways to write calls? With no idiomatic syntax, it means I have to know all these variations if I hope to understand Felix code (since it is ok for anyone to choose whichever style).
[ Parent
| on HN ]
Re:Felix - a fast scripting language
by andrewflnr on Friday January 04, 2013 @02:09PM
(#5009170)
I just don't understand why there are both gen and proc functions. Why have a separate kind of thing for functions that don't return anything?
Re:Felix - a fast scripting language
by egonschiele on Friday January 04, 2013 @02:26PM
(#5009264)
Functions aren't supposed to have side effects and procs are. It makes sense since functions without side effects would allow for some nice compiler optimizations. The part that scares me is that the compiler doesn't enforce no side effects. This means you need to be extra careful when using someone else's code.
Re:Felix - a fast scripting language
by andrewflnr on Friday January 04, 2013 @02:59PM
(#5009499)
Yeah, I got that, but gen's and proc's both have side effects. Why?
Basically this is to support "expression" like syntax such as people are used to in C, for example i++ and x=y are expressions with side effects in C and a lot of C idioms depend on such things. This kind of thing was originally not allowed but I personally found it clumsy to manually split out the imperative parts from the functional parts, so I taught the compiler how to do it for me :)
Re:Felix - a fast scripting language
by andrewflnr on Monday January 07, 2013 @10:41AM
(#5021459)
But those expressions also return things. Why can't they be gen? Why would I use a proc instead? It seems like I must be missing something, but I can't see it.