Tacit programming

Programming without bound variables

Page 1 of 1

6 Replies - 2104 Views - Last Post: 16 September 2009 - 07:59 AM

#1 Jaakuuta  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 1
  • View blog
  • Posts: 163
  • Joined: 02-July 09

Tacit programming

Post icon  Posted 09 September 2009 - 04:42 AM

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.

Is This A Good Question/Topic? 0
  • +

Replies To: Tacit programming

#2 syfran  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 83
  • View blog
  • Posts: 1,103
  • Joined: 12-July 09

Re: Tacit programming

Posted 09 September 2009 - 05:34 AM

I wonder how hard it is to debug that.
Was This Post Helpful? 0
  • +
  • -

#3 Jaakuuta  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 1
  • View blog
  • Posts: 163
  • Joined: 02-July 09

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...
Was This Post Helpful? 0
  • +
  • -

#4 cfoley  Icon User is online

  • Cabbage
  • member icon

Reputation: 2021
  • View blog
  • Posts: 4,194
  • Joined: 11-December 07

Re: Tacit programming

Posted 13 September 2009 - 07:34 AM

Did someone just invent a language made entirely out of smilies?

<:@]
Was This Post Helpful? 0
  • +
  • -

#5 Jaakuuta  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 1
  • View blog
  • Posts: 163
  • Joined: 02-July 09

Re: Tacit programming

Posted 13 September 2009 - 03:27 PM

View Postcfoley, on 13 Sep, 2009 - 06:34 AM, said:

Did someone just invent a language made entirely out of smilies?

<:@]


haha, that's awesome

also note
:`(
and
:@(
lol

This post has been edited by Jaakuuta: 13 September 2009 - 03:31 PM

Was This Post Helpful? 0
  • +
  • -

#6 cmwise  Icon User is offline

  • D.I.C Head

Reputation: 5
  • View blog
  • Posts: 169
  • Joined: 14-February 09

Re: Tacit programming

Posted 16 September 2009 - 07:31 AM

At the end:

@.*

Fear the winking monocle man!
Was This Post Helpful? 0
  • +
  • -

#7 Raynes  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 611
  • View blog
  • Posts: 2,815
  • Joined: 05-January 09

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> 


Was This Post Helpful? 0
  • +
  • -

Page 1 of 1