On Mon, 2006-12-18 at 02:49 -0800, Erick Tryzelaar wrote: > Hi everyone, > > I finally got around to implementing my port of the tiny lisp > implementation from here: > > http://www.defmacro.org/ramblings/lisp-in-haskell.html > > It's pretty fun. While it doesn't actually parse syntax yet,
A parser should be fun to write .. and quite easy using the GLR parsing feature .. although lisp is rather trivial to parse .. and I guess you would probably use lisp to parse lisp .. :) > Eventually I'd like to implement the monadic form from this tutorial, > but that requires monads :) Ah .. a monad is a two line typeclass. I should try it sometime :) > A couple comments. First off, it takes a surprisingly long time to > compile this code. Felix compiler or C++ compiler? >On my mac it takes > about 9 seconds to compile and run. Some of the optimisation routine are less than optimal. However my experience is most of the time is spent in lookup. The file flxg_stats.txt keeps track time spent per compiler phase. > Second, I got hit by the classic "if you don't use the output of a > function it can get optimized away" bug/feature. In what way? The code should be type checked whether or not it is used, it simply isn't instantiated if it isn't used: the optimiser optimises it away. In theory, there's no way you can tell, so why is it a problem? One answer is: some bugs aren't detected until late. One solution is: export the function. That makes it a root and then it can't be optimised away. I would like to have export fun f .... but currently this causes a parsing error .. and leaves open whether the export is as a C name or a C++ name (at the moment C++ names can't be exported, only C linkage names .. so the above would cause problems if 'f' were overloaded). > Third, typeclasses rule. I really like the show typeclass, and I can't > wait to add it to the standard library, once we resolve some of the > surrounding issues. What is there to wait for? Even if I don't like your changes I can always change them more, revert them, or discuss it, but I can't do any of those thing *until* you commit :) > Forth, hitting compiler exceptions really can make things difficult. You mean bugs in the compiler? Or you mean bugs in the error reporting? Some errors are very well reported, some are not. -- John Skaller <skaller at users dot sf dot net> Felix, successor to C++: http://felix.sf.net ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Felix-language mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/felix-language
