John Nowak | 7 Dec 06:18
Gravatar

[stack] 5th's type system

 

I've updated 5th's entry on the concatenative wiki with a (very) short description of its type system for anyone who's interested:

https://concatenative.org/wiki/view/5th

No, I'm not still working on it. Has been dead for years now.

- jn

__._,_.___
Recent Activity:
    .

    __,_._,___
    Ruurd | 9 Dec 11:20
    Picon

    [stack] Sieve of Eratosthenes

     

    The Sieve has been mentioned before in this newsgroup, but I didn't see a solution in Joy. Here is my proposal.

    (* popen ( Q -> )

    __._,_.___
    Recent Activity:
      .

      __,_._,___
      Ruurd | 9 Dec 11:32
      Picon

      [stack] Sieve of Eratosthenes

       

      The Sieve of Eratosthenes has been mentioned earlier in this newsgroup, but I didn't see a solution in Joy. Here is mine:

      (*
      popen ( Q -> ) starts a new task. The stdout of the current
      task is connected to the stdin of the new task.
      *)
      DEFINE sieve == get dup put [sieve] popen
      [] [get [swap mod] [put] [pop] ifte] while.

      DEFINE count == 2 [] [dup put succ] while.

      [sieve] popen count.

      Of course, there is no such thing as a multi-tasking version of Joy,
      but maybe this example shows that it worth the trouble building such
      a thing. Is it?

      __._,_.___
      Recent Activity:
        .

        __,_._,___
        Picon

        Re: [stack] Sieve of Eratosthenes

         

        A message-passing multiprocess Joy would be interesting indeed.

        I know of two innately multiprocessing concatenative languages,
        Enchilada and Ripple. Both depend on multiprocessing behavior
        (although I'm not sure that either one currently USES multiple
        processes or threads). Ripple is the more extensively developed of the
        two; Enchilada is a research project.

        -Wm

        __._,_.___
        Recent Activity:
          .

          __,_._,___
          Simon Kongshøj | 9 Dec 18:05
          Picon
          Picon
          Favicon

          Re: [stack] Sieve of Eratosthenes

           

          One of my hobby projects when I was working on my master's thesis was Merlin, a combination of a concatenative sequential language and an Actor-based concurrency system.

          The idea was to have simple asynchronous message-passing similar to that of Erlang, but rather than using pattern matching on a "mailbox", the semantics of the "receive" operator would be to simply place a message from the "mailbox" on top of the stack. Each actor then consisted of a data stack, a return stack, and a mailbox. The concatenative, sequential sublanguage was purely functional, and state was entirely a property of the fact that actors can replace their stacks in response to messages, so everything that was stateful was an actor, and everything else was immutable.

          When I started tinkering on it, I didn't really know anything about concatenative languages, apart from having hacked some Forth code on my Amiga way back when, and having once learned to code in PostScript. My favourite languages being Forth and Lisp, I tried to hybridize them, and - not surprisingly - I ended up with something that resembled Joy quite a lot. When I became aware of Joy, I changed some bits of sequential Merlin to be more Joy-like, when I liked Joy's solutions better than my own (for instance, I didn't have polymorphic operators that worked on both numbers and lists, like Joy does, but I liked that, so I ripped it off), and ended up with something that could probably justifiably be called a dialect of Joy.

          Unfortunately, I ended up rewriting the whole implementation several times, because I kept being unsatisfied with it. I don't have much time to hack on it anymore; my PhD work takes up most of my time. I should probably try to find time to tidy up my old code, fix up the remaining flaws and put it up somewhere for others to play with.

          Regards,
          Simon

          [Non-text portions of this message have been removed]

          __._,_.___
          Recent Activity:
            .

            __,_._,___
            Ruurd | 10 Dec 11:04
            Picon

            Re: [stack] Sieve of Eratosthenes

             

            > I know of two innately multiprocessing concatenative languages,
            > Enchilada and Ripple.
            > -Wm

            Another example is Niue: http://vmathew.in/niue/docs/niue-lang.pdf

            It uses !! (spawn) Executes a code block in a new process.
            Pushes the process id of the new process on to
            the data stack of the parent.

            I am a bit worried about having to keep track of those process id's
            and I am not convinced that it must be asynchronous message passing.
            Also, the Sieve example:
            http://rosettacode.org/wiki/Sieve_of_Eratosthenes#Niue
            does not use the message passing.

            __._,_.___
            Recent Activity:
              .

              __,_._,___
              Chris Double | 31 Dec 02:23
              Picon
              Gravatar

              [stack] Concatenative scripting language in Bitcoin

               

              I thought this might interest some concatenative people. The virtual
              currency Bitcoin has a stack based scripting language built in for
              creating transactions. The intent was to allow extending the types of
              transactions (other than just "send money to address X") via scripting
              to allow various types of contracts, escrow, etc. Some information on
              the language is here: https://en.bitcoin.it/wiki/Script

              Recently there has been discussion on adding an 'eval' feature that
              allows popping a program off the stack and executing it. This is
              similar to concatenative languages like Joy. the general proposal is
              here: https://en.bitcoin.it/wiki/BIP_0012

              This has raised some discussion on the bitcoin development mailing
              list about whether this gives the scripting language too much power.
              Can it now be used to create loops or otherwise work around some of
              the existing languages constraints and subvert the bitcoin transaction
              system. Discussion is on this mailing list post:
              http://sourceforge.net/mailarchive/message.php?msg_id=28602033

              This is an interesting example of stack based languages in real world systems.

              Chris.
              --
              http://www.bluishcoder.co.nz

              __._,_.___
              Recent Activity:
                .

                __,_._,___

                Gmane