You are here:

Introducing the new 7th programming language

The 7th® programming language is based on the concepts of Charles Henry Moore's "Problem Oriented Language".

Because of its unique interpreting compiler, Forth™ makes programming quite easy and a compiled program – called “word” – is very compact.
The programming language 7th runs as such an interpreting compiler for stability and portability on the JVM.
Beside Forth's major features 7th brings several enhancements, to name some
 • object orientation
 • help function
 • redirecting of program output
 • complex numbers
 • array and array functions
 • pattern matching

The functions of the "Klassenbibliothek" formerly found here are all included in 7th.
7th comes with an complete development system, with an editor and a code beautifier that does syntax highlighting and correct indentation in a very small package.

Comment syntax

To comment out the rest of the line use //
//  Loop through numbers from 1 to 10.000


to show the stack behavior of a word use ( -- )  "-" two times!
: facul  ( n -- facul )


to comment out a part of a line use (* *)
row i @ (* occupied *) 'x' == if

Text inside round braces is interpreted as an algebraic expression ( )
(5+3*2)

7th IDE – Try Out

Depending on the Java™ security settings, the start of the 7th IDE could be blocked…

7th Try Out Page

***Don't waste too much time, if the IDE won't start over the web. Go to the last tab  Download and click  …the 7th IDE. If You find 7th useful, You will use it locally anyway.***

Webstart on Linux

To execute an .jnlp file on a Linux System You have to install IcedTea Webstart first:

sudo apt-get install icedtea-netx

After starting the IcedTea Webstart program You have to answer the Security Warning dialog. The later stays sometimes hidden behind the IcedTea Webstart main window.

To start the  tryout.jnlp file type  javaws tryout.jnlp in the command window or choose  IcedTea Java Web Start from the  tryout.jnlp file context menu on the graphical desktop.

 

object orientation

variable x

0.5 x !

"string" x !

ERR: ”x” expects java.lang.Number — found java.lang.String…


help function

redirecting of program output

ok> help .us

— .us —

  --  

prints the user stack

options:

--nope     don't execute the word

-n

--verbose  prints what would happen, when the word is executed

-v

--str      pushes the output as string onto the stack instead of printing

-s

--out      redirects the message to the given file

-o

--append   appends the message to the given file

-a


complex numbers

ok> (3, 4i)

ok> (5, 6i)

ok> *

ok> .s

› (-9, 38i)


array and array functions

ok> 8 int-array numbers

ok> 7 numbers 0 !

ok> numbers .s

› Create…Integer[8]+[7, 0, 0, 0, 0, 0, 0, 0]‹numbers›


pattern matching

find a  /pattern/  ~~

match a /pattern/ =~

ok> "text" /ex/    ~~ .s

› true

ok> "text" /.ex./  =~ .s

› true


We respect Your privacy and we neither track You nor use cookies…
7th and the 7th logo are trademarks of 7th Stone Software GmbH. All other product or service names are the property of their respective owners.