Navigation is at the bottom.

Táto stránka bola presunutá na novú adresu! Viac o presune sa dočítate tu.

This webpage has been moved to a new address!

Brod general purpose Language

Influenced by my experiences in various programming languages like: Assembler, Basic, “C”, PHP, Java, Pascal, BaSh, LoGo, HTML, and INI, I decided to design my own language.

Compilation

The source file is first translated to bytecode file. The bytecode file is then post-processed to move some intermediate data to tables. And when the BRL code is about to be run, it is compiled by JIT to native code for the processor.

BRL can be freely converted between it’s plaintext form and the bytecode form. Everything, including the comments, is preserved. This means that you can decompile the bytecode and get the same sorce code. One exception is that case insensitive tokens are uppercased.

Syntax

Example

CLASS /example/hello/world
 META
  DESCR An example class to demonstrate syntax of brl$
  MORE some more meta datas$
  NOTE Strings are terminated with dollar sign$
  NOTE The NOTE keyword means start of a comment$
 RECV OPEN
  NOTE in addition to "open" you can recieve: INPUT i, CTRL i, OPEN, CLOSE, CREATE, DESTROY$
  DO
   BLOCK ALL NOTE This blocks all calls until end of current call$
   REPLY /stream/string Hello World!$
   NOTE REPLY is used to send data to output, you can also use ERROR to send errors$

CLASS /example/hello/vars
 META
  DESCR An example class to demonstrate the use of variables$
 RECV OPEN
  CLIENTVAR user-name TYPE STRING
  NOTE We just declared an client-global variable! It is automatically destroyed on RECV CLOSE.$
 RECV CTRL SET USER-NAME 
  NOTE This implicitly decrales CTRL interface element /SET/USER-NAME
  DO SET user-name -
  NOTE The - here means the whole content of the element /SET/USER-NAME
 RECV CTRL GREET
  DO
   TO - OPEN /str/concat CONNECT OUTPUT
    SEND /stream/string Hello $
    SEND user-name
    SEND , nice to meet you!$
    NOTE The "-" is an anonymous handle. It is closed after leaving the TO block$
    NOTE all other undeclared variables and handles are closed after leaving the RECV block$