Front Page All Articles Recent Changes Random Article

Contents

Concatenative language

  • ACL
  • Ait
  • Aocla
  • Breeze
  • Callisto
  • Cat
  • Cognate
  • colorForth
  • Concata
  • CoSy
  • Deque
  • DSSP
  • dt
  • Elymas
  • Enchilada
  • ETAC
  • F
  • Factor
  • Fiveth
  • Forth
  • Fourth
  • Freelang
  • Gershwin
  • hex
  • iNet
  • Joy
  • Joy of Postfix App
  • kcats
  • Kitten
  • lang5
  • Listack
  • LSE64
  • Lviv
  • Meow5
  • min
  • Mirth
  • mjoy
  • Mlatu
  • Ode
  • OForth
  • Om
  • Onyx
  • Plorth
  • Popr
  • Porth
  • PostScript
  • Prowl
  • Quest32
  • Quackery
  • r3
  • Raven
  • Retro
  • RPL
  • SPL
  • Staapl
  • Stabel
  • Tal
  • Titan
  • Trith
  • Uiua
  • Worst
  • xs
  • XY
  • 5th
  • 8th

Concatenative topics

  • Compilers
  • Interpreters
  • Type systems
  • Object systems
  • Quotations
  • Variables
  • Garbage collection
  • Example programs

Concatenative meta

  • People
  • Communities

Other languages

  • APL
  • C++
  • Erlang
  • FP trivia
  • Haskell
  • Io
  • Java
  • JavaScript
  • Lisp
  • ML
  • Oberon
  • RPL
  • Self
  • Slate
  • Smalltalk

Meta

  • Search
  • Farkup wiki format
  • Etiquette
  • Sandbox

Freelang

Freelang is a stack-oriented, concatenative, compiled language for Freeputer.

Freeputer is a free computer. Free as in freedom.

Freeputer is a tiny virtual machine easily ported to most modern architectures, including bare metal, and requiring neither file system nor operating system. This offers extreme portability and the freedom to use software forever without designed obsolescence.

  • Freeputer is a virtual machine: the Freeputer Virtual Machine (FVM).
  • Freeputer is a self-hosted, self-contained software development platform.
  • Freeputer is a platform for modular software that lasts forever.
  • Freeputer is a powerful platform for bare metal computing.
  • Freeputer is a user's computer not a vendor's computer.
  • Freeputer supports the freedom of the user.
  • Freeputer is a not an operating system.

Freelang is a fairly low-level language, whose core vocabulary is essentially that of the FVM instruction set, but it is surprisingly productive and capable. It is inherently extensible. Its syntax uses reverse Polish notation (RPN).

Here is an example of a simple Freelang program that greets the user in Chinese and English:


HelloWorld{ \ This is the start of the HelloWorld namespace

  newline                 \ Write one blank line
  ." 你好 " print          \ Say hello in Chinese (comment out if unsupported)
  ." Hello world! " print \ Say hello in English
  newline
  halt                    \ Exit with success

  \ Write the supplied Freeputer string one byte at a time
  \ but do not write (that is, skip) any byte having a value of 0.
  \ This means whatever character encoding happened to have been used
  \ during the storage of that string is crudely preserved to some extent.
  \ In this case, this source code was saved using UTF-8 character encoding
  \ and so this simple technique of skipping 0-value bytes works nicely.
  \ Note: a Freeputer string starts with a word indicating its
  \ size in characters and each character is 32 bits wide.
  : print ( s -- )
    [@] 4 * swap incw swap    \ ( a z ) a=addr of 1st char   z=number of bytes
    writing:                  \ ( a z )
      go[<=0] :end            \ ( a z )
        dec swap [@b]         \ ( z- a b )
          go[==0] :skip       \ ( z- a b )
            writorb ::wfail   \ ( z- a )
            go :next          \ ( z- a )
        skip:                 \ ( z- a b )
          drop                \ ( z- a )
        next:                 \ ( z- a )
          inc swap            \ ( a+ z- )
          go :writing         \ ( a+ z- )
    end:                      \ ( a z )
      drop2                   \ ( )
      newline                 \ ( )
  ;

  \ Write a newline character
  : newline ( -- ) 10 writorb ::wfail ;

  \ Exit point upon I/O error
  wfail: halt

}HelloWorld \ end of namespace

The self-hosted Freelang compiler, flc, is written in Freelang, runs on the FVM and can compile itself.

For further information please see:

  • The official Freeputer site freeputer.net
  • The Freeputer project on GitHub

This revision created on Thu, 27 Aug 2015 07:49:02 by Freeputer (Fixed reversed order of links)

Latest Revisions Edit

All content is © 2008-2024 by its respective authors. By adding content to this wiki, you agree to release it under the BSD license.