I've been studying a lot about things like Lambda Calculus, Combinatory Logic, and Tacit Programming lately, and I think this is a fairly interesting topic. I wanted to know if you knew of other languages that use this style. So far the main ones I know of are the concatenative languages like Joy and Forth, and the J/APL languages. I think Raynes was saying something before about Factor or something being one of these. In either case, in case you're not entirely familiar with what I mean by tacit programming, I'm talking about programming without bound variables in functions and the like.
An example from J:
(1:`(]*$:@(<:@]))@.*)
This is a full recursive function definition for a factorial that can be saved inside any variable and used as a function. As you can see it uses no bound variables (the only variable actually used here is ] which simply means "the right operand") although there is a pseudo-variable used as a placeholder, it's not actually a specific variable declared as the function was created and indeed it can be used independent of a function definition. This method seems to make good use of combinators as well, and it seems like it would be a very powerful and interesting programming style, I just don't know much about it yet.
Tacit programmingProgramming without bound variables
Page 1 of 1
6 Replies - 1604 Views - Last Post: 16 September 2009 - 07:59 AM
Replies To: Tacit programming
#2
Re: Tacit programming
Posted 09 September 2009 - 05:34 AM
I wonder how hard it is to debug that.
#3
Re: Tacit programming
Posted 09 September 2009 - 03:15 PM
generally error messages are specific to the operator you're using, so if you see something like "self-referential operator issue" or something like that, you know it's specifically referring to the $: operator...
#4
Re: Tacit programming
Posted 13 September 2009 - 07:34 AM
Did someone just invent a language made entirely out of smilies?
<:@]
<:@]
#5
Re: Tacit programming
Posted 13 September 2009 - 03:27 PM
#6
Re: Tacit programming
Posted 16 September 2009 - 07:31 AM
At the end:
@.*
Fear the winking monocle man!
@.*
Fear the winking monocle man!
#7
Re: Tacit programming
Posted 16 September 2009 - 07:59 AM
Haskell supports this, and calls it Point-Free style. Here is a simple example:
secFromLast = last . init -- As you can see, this function does have any bound variables. It's a function that returns a function that takes a list, so it doesn't need to have bound variables. -- Here is an example of using it at the REPL *Main> secFromLast [1,2,3,4] 3 *Main>
Page 1 of 1
|
|

New Topic/Question
Reply



MultiQuote








|