The Functor Pattern in C++(fpcomplete.com) |
The Functor Pattern in C++(fpcomplete.com) |
Then you should try out D. Bartosz Milewski in fact has been involved in D development for a long time. It certainly makes it easier to apply a lot of the FP techniques.
I’m actually working on a compiler for a high-performance functional language, to serve in those cases when I would want to go back to C++…
http://www.cprogramming.com/c++11/c++11-lambda-closures.html http://stackoverflow.com/questions/7627098/what-is-a-lambda-...
Is it statically typed? Do you have ADT support and/or an object system? GC / refcounting or manual memory management?
How are you implementing bind() and currying in a compiler? I'm targeting x86 and my approach is to make little stubs on the heap that push a single parameter, then i can throw them around as ordinary function pointers (lambda lifting every single parameter rather than looking up things through environment pointers at runtime). The problem with this is that i end up with a huge amount of small fixed-size objects on the heap, which is a little less than ideal but at least i can write a special allocator for that case.
EDIT: Upon a little background reading (and your illuminating february blog post on concatenative languages) i realise you're probably referring to Kitten, in which case i'm not sure any of my current questions are remotely applicable.
As you may have realised, currying doesn’t really apply to concatenative languages because they lack application. The analogue of partial application is deferred composition, i.e., just concatenating quotations:
[1] [+] compose [1 +] =
I’ve been working on the language actively, but haven’t pushed code lately. Do watch the repo[1] if you’re interested, though, and link me to yours. I also think I know you from #esoteric or something? My memory sucks and I haven’t been on there lately.