phimvt | 2 Sep 07:40 2005
Picon
Picon

[stack] Condolences


Australia extends its sympathy to the U.S. in the wake
of Katrina's devastation. We share your grief.

I can only hope that members of this group have not been
directly affected and not lost any loved ones.

  - Manfred

------------------------ Yahoo! Groups Sponsor --------------------~--> 
Most low income households are not online. Help bridge the digital divide today!
http://us.click.yahoo.com/cd_AJB/QnQLAA/TtwFAA/saFolB/TM
--------------------------------------------------------------------~-> 

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/concatenative/

<*> To unsubscribe from this group, send an email to:
    concatenative-unsubscribe <at> yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/

phimvt | 7 Sep 10:07 2005
Picon
Picon

Re: [stack] Re: an exchange on flatness


On Fri, 26 Aug 2005 phimvt <at> LURAC.LATROBE.EDU.AU wrote:

[..]

> Define Floy ("Flat Joy") to be that subset of Joy in which the only
> lists or quotations are [] and the unit lists of atoms.  Can we write
> a translator j2f (Joy to Floy) which takes a quoted Joy program J
> and produces a quoted Floy program F such that [J] i == [F] i ?

That should have been [J] i == [F] i i

> (Note that even if F is a Floy program, its quotation [F] generally
> will not be.) Moreover, can the translator j2f be written in Joy?
> If so, then the translator can also be written in Floy, by passing
> it through itself. So there will be a j2f.joy and a j2f.floy. Compiler
> writers do that sort of thing all the time. I don't think that j2f.joy
> will be longer than five short lines, and j2f.floy will just have longer
> lines. I'll work on this, it looks like fun.

Well, it took much much longer than I anticipated - how embarrassing.
But it was fun, and I think I'll write it up as a more detailed note.
I haven't passed it through itself yet to get j2f.floy, but here is
the simple version, j2f.joy :
	
DEFINE 
	    c  ==  concat; 
	    HIDE 
	        h == 
	            [ list ] 
(Continue reading)

stevan apter | 10 Sep 16:18 2005

[stack] jon harrop's ray-tracer in c++, ocaml, factor, k2/3, and k4

jon harrop's original implementations, in c++ and ocaml:

http://www.ffconsultancy.com/free/ray_tracer/comparison.html

105 and 62 lines, respectively.

the benchmark image (160x160 pixels, level 6 scene-graph) is 
at the bottom of my main page:

http://www.nsl.com

slava has a factor implementation (of level 3, 200x200):

http://www.jroller.com/page/slava?entry=two_factor_programs_intel_8080

a 7-line scalar version in k2/3:

http://www.nsl.com/k/ray/ray.k

an array version in k2/3:

http://www.nsl.com/k/ray/rayv.k

a faster array version in k2/3:

http://www.nsl.com/k/ray/rayv_.k

factoring out some common code:

http://www.nsl.com/k/ray/rayw_.k
(Continue reading)

Chris Double | 11 Sep 04:45 2005
Picon

[stack] Space Invaders emulator in Factor

I've written a Space Invaders emulator in Factor. Screenshots here:

http://factor.modalwebserver.co.nz/factor_space_invaders.jpg
http://factor.modalwebserver.co.nz/factor_space_invaders2.jpg
http://factor.modalwebserver.co.nz/factor_space_invaders3.jpg

The code is in Factor CVS and in my darcs repository. I took a
declarative approach to emulating the 8080 CPU. Using parser combinators
I parsed a syntax for describing the instructions and generate the code
to do the emulation from that. So the instructions look like:

INSTRUCTION: DEC  DE      ; opcode 1B cycles 06
INSTRUCTION: INC  E       ; opcode 1C cycles 05
INSTRUCTION: DEC  E       ; opcode 1D cycles 05
INSTRUCTION: LD   E,n     ; opcode 1E cycles 07
INSTRUCTION: RRA          ; opcode 1F cycles 04
INSTRUCTION: LD   HL,nn   ; opcode 21 cycles 10
INSTRUCTION: LD   (nn),HL ; opcode 22 cycles 16

INSTRUCTION: is a parsing word that, at parse time, uses the parser
combinators to process the instruction body. It generates quoations for
the registers being used, etc and looks up an 'instruction family',
which contains a pattern of how that instruction should operate:

    [[ "POP-RR"    [ [ pop-sp ] keep $2 ] ]]
    [[ "PUSH-RR"   [ [ $1 ] keep push-sp ] ]]
    [[ "INC-R"     [ [ $1 ] keep [ inc-byte ] keep $2 ] ]]
    [[ "DEC-R"     [ [ $1 ] keep [ dec-byte ] keep $2 ] ]]
    [[ "INC-RR"    [ [ $1 ] keep [ inc-word ] keep $2 ] ]]
    [[ "DEC-RR"    [ [ $1 ] keep [ dec-word ] keep $2 ] ]]
(Continue reading)

icpdesign | 11 Sep 21:49 2005
Picon

[stack] NFA to DFA in joy

Does someone used Joy as a finite automata? How  Deterministic Finite Automton should be 
defined in Joy. Also, how do we implement the algorithm of converting a nondeterminisitic 
finite automata (NFA) to a determinisitic finite automata (DFA).

I am learning Joy and looking for Joy programs implementing known algorithms, like  the one 
to covert an NFA to DFA

Thanks
Taoufik

------------------------ Yahoo! Groups Sponsor --------------------~--> 
Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life.
http://us.click.yahoo.com/A77XvD/vlQLAA/TtwFAA/saFolB/TM
--------------------------------------------------------------------~-> 

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/concatenative/

<*> To unsubscribe from this group, send an email to:
    concatenative-unsubscribe <at> yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/

William Tanksley, Jr | 11 Sep 23:59 2005
Picon

Re: [stack] NFA to DFA in joy

icpdesign <taoufik.dachraoui <at> wanadoo.fr> wrote:
> Does someone used Joy as a finite automata? How  Deterministic Finite Automton 
> should be
> defined in Joy. Also, how do we implement the algorithm of converting a nondeterminisitic
> finite automata (NFA) to a determinisitic finite automata (DFA).

I've done DFAs in Forth, but never in Joy. I used a little toolkit
someone else wrote that lets you build a jump table using a table-like
syntax, so I was able to draw the state transition table directly in
the source code.

If you're wanting to convert an NFA to a DFA, you'll want a graph
structure rather than a table structure. That should be pretty easy in
Joy.

> Taoufik

-Billy

------------------------ Yahoo! Groups Sponsor --------------------~--> 
Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life.
http://us.click.yahoo.com/A77XvD/vlQLAA/TtwFAA/saFolB/TM
--------------------------------------------------------------------~-> 

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/concatenative/

(Continue reading)

icpdesign | 13 Sep 14:40 2005
Picon

[stack] DFA and NFA to DFA in Joy

I found an article by J.V. Noble (Finite State Machines in Forth) that 
describes an elegant implementation of Finite State Machines using 
FORTH  http://www.jfar.org/article001.html

I am very eager to learn Joy Language by examples, I read many 
examples from the main web site of Joy, but even though the language 
looks very interesting to me, i need more examples/articles to learn 
how to design algorithms/applications in Joy.

For example I would like to read articles on how to write a compiler 
(from parsing to generating machine code) in Joy. 

I believe writing a book 'Modern Compiler Implementation in Joy' would 
be very interesting; 

Kind regards
Taoufik

------------------------ Yahoo! Groups Sponsor --------------------~--> 
Fair play? Video games influencing politics. Click and talk back!
http://us.click.yahoo.com/T8sf5C/tzNLAA/TtwFAA/saFolB/TM
--------------------------------------------------------------------~-> 

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/concatenative/

<*> To unsubscribe from this group, send an email to:
(Continue reading)

Ivan Tomac | 13 Sep 16:23 2005
Picon

[stack] Re: Concatenative language compilers (was DFA and NFA to DFA in Joy)

--- In concatenative <at> yahoogroups.com, "icpdesign"
<taoufik.dachraoui <at> w...> wrote: 
> For example I would like to read articles on how to write a
compiler 
> (from parsing to generating machine code) in Joy. 
> 
> I believe writing a book 'Modern Compiler Implementation in Joy'
would 
> be very interesting; 
> 

This is a bit off topic but somewhat related. I've recently been
reading about the SSA form and it's functional equivalent, ANF
(Administrative Normal Form) and it got me thinking, since those two
intermediate representations are both based on lambda calculus, is
there a combinatorial representation that can be as useful?

Somehow compiling a concatenative language down to SSA or ANF form
seems redundant - in case of ANF it's almost like converting Joy-like
code to some primitive dialect of Scheme. There has to be a more
suitable intermediate form for concatenative languages.

I've tried to find some papers on this but the only thing I've found
so far is a paper called "A combinator-based compiler for a functional
language" by Hudak and Kranz. Unfortunatly it's only available to ACM
members so I haven't been able to access it
(http://portal.acm.org/citation.cfm?id=800523).

I suspect (this is just a hunch - I could be totally wrong) that a
stack based intermediate representation is not ideal. Possibly
(Continue reading)

icpdesign | 13 Sep 16:43 2005
Picon

[stack] Re: Concatenative language compilers (was DFA and NFA to DFA in Joy)

I was probably not clear, but I meant to use Joy to write compilers 
for other language and was not asking on how to write a compiler for 
Joy.

The reason I find writing a book 'Modern Compiler implementation in 
Joy' is probably a good idea, is because it will certainly show the 
elegance and power of Joy Language, since implementing an optimized 
compiler contains many challenges.

It is probably good to have a place where we can find many known 
algorithms found in computer science books written in Joy (ex. NFA-
>DFA, sorting (quick sort, buble sort, radix sort,...) , shortest 
path, ...)

Taoufik

--- In concatenative <at> yahoogroups.com, "Ivan Tomac" <e1_t <at> y...> wrote:
> --- In concatenative <at> yahoogroups.com, "icpdesign"
> <taoufik.dachraoui <at> w...> wrote: 
> > For example I would like to read articles on how to write a
> compiler 
> > (from parsing to generating machine code) in Joy. 
> > 
> > I believe writing a book 'Modern Compiler Implementation in Joy'
> would 
> > be very interesting; 
> > 
> 
> This is a bit off topic but somewhat related. I've recently been
> reading about the SSA form and it's functional equivalent, ANF
(Continue reading)

icpdesign | 13 Sep 16:43 2005
Picon

[stack] Re: Concatenative language compilers (was DFA and NFA to DFA in Joy)

I was probably not clear, but I meant to use Joy to write compilers 
for other language and was not asking on how to write a compiler for 
Joy.

The reason I find writing a book 'Modern Compiler implementation in 
Joy' is probably a good idea, is because it will certainly show the 
elegance and power of Joy Language, since implementing an optimized 
compiler contains many challenges.

It is probably good to have a place where we can find many known 
algorithms found in computer science books written in Joy (ex. NFA-
>DFA, sorting (quick sort, buble sort, radix sort,...) , shortest 
path, ...)

Taoufik

--- In concatenative <at> yahoogroups.com, "Ivan Tomac" <e1_t <at> y...> wrote:
> --- In concatenative <at> yahoogroups.com, "icpdesign"
> <taoufik.dachraoui <at> w...> wrote: 
> > For example I would like to read articles on how to write a
> compiler 
> > (from parsing to generating machine code) in Joy. 
> > 
> > I believe writing a book 'Modern Compiler Implementation in Joy'
> would 
> > be very interesting; 
> > 
> 
> This is a bit off topic but somewhat related. I've recently been
> reading about the SSA form and it's functional equivalent, ANF
(Continue reading)


Gmane