Re: [stack] Barebone implementation of concatenative language in c or c++

"blazeski" <[email protected]> Wed, 19 May 2010 07:38:00 -0000
Newsgroups gmane.comp.lang.concatenative
Message-ID <[email protected]>
Just what I was looking for, many thanks.

Slobodan

--- In [email protected], "Ruurd" <r.wiersma26@...> wrote:
>
> 
> 
> If you want a minimal implementation:
> 
> http://github.com/jdp/concom
> 
> Or, if you want it to be like joy:
> 
> http://www.latrobe.edu.au/philosophy/phimvt/sympas/s42minjoy.html
> 
> concom does not have numbers; the small joy version has numbers, characters, booleans, symbols and it has more operators than concom.
> 
> Joy is built up from three concepts: concatenative notation, quotations and combinators. The structured programming paradigm is built from the concepts: sequencing, selection, iteration, subroutines, arrays. When comparing the two paradigms: concatenative notation is roughly the same as sequencing; selection and iteration are covered by combinators; subroutines and arrays by quotations.
> 
> When comparing Joy to other functional programming languages, it looks like Joy does not hide data, but makes it accessible on a stack. Other functional programming languages hide data in the parameters to their functions. Having data accessible means that it is possible to think about Joy is if it were an imperative programming language. But it is not, because it does not have assignment.
> 
> And it is not a stack language either. The order of evaluation is not specified. Take for instance a small example: 2 3 [+] i. This evaluates to 5, but I do not have to start the rewriting at the left.[+] i is equal to + and 2 3 + is equal to 5, so I can start at the right if I like.
> 
> > For example from reading Brent Kerby Theory of concatenative combinators http://tunes.org/~iepos/joy.html if I implement : swap, dup, zap, unit, cat, cons, i, dip + (numbers and symbols) would that be enough to have a primitive joy like language?
> >
>