tsbRapidFX

Write a form once.
Run it on the desktop, in a browser,
and on Android.

tsbRapidFX is a programming language with VB6 grammar that compiles straight to JVM bytecode — not to Java, not to JavaScript. No transpiler sits in the middle, so there is no generated source to read, to debug or to keep.

Around it sit three designers that draw the forms, and a runtime that carries the same Swing form to a window, to a browser as SVG, and to an Android device.

32,708lines of compiler, written in Java
18,131lines of RapidFX written with it so far
3platforms from one designer file
0runtime dependencies beyond the JDK

It reads like the language a lot of people already know

VB6 grammar, on purpose. Not because it is fashionable — because a great many working programs and a great many working programmers are written in it, and neither should have to be thrown away to reach a modern runtime.

Signing in — two steps, from tsbCommunity
Private Sub OnSignIn(e As ActionEvent)
    Dim attempt As tsbWebSignInAttempt = tsbWebSession.startSignIn( _
            txtUser.Text, txtPassword.Password)

    If attempt.isComplete() Then
        Main.Message = "Welcome back."
        Main.Show("home")
        Exit Sub
    End If

    If attempt.needsCode() Then
        Main.CodeHint = attempt.getHint()      ' "a code is on its way to t••••n@…"
        tsbWebSession.rebuild()
        Exit Sub
    End If

    ' Wrong password, unknown name, or too many attempts - one sentence for all three.
    ' Telling them apart would answer "does this account exist" for anybody who asked.
    lblHint.Text = "Sign-in failed. Please try again."
End Sub
A query, with the parameters bound
Public Function Topic(id As Integer) As TopicRow
    Using c As Connection = Database.Connect()
        Dim b As PreparedStatement = c.prepareStatement( _
                "SELECT id, title, slug, posts, state " _
                + "FROM topic WHERE id = ?")
        b.setInt(1, id)
        Return First(b)
    End Using
End Function
The two lines most hand-written SMTP clients forget
' Without them the handshake succeeds against any
' certificate at all, including one somebody in the
' middle made this morning - and the AUTH that
' follows hands them the password.
Private Sub Verify(secure As SSLSocket)
    Dim p As SSLParameters = secure.getSSLParameters()
    p.setEndpointIdentificationAlgorithm("HTTPS")
    secure.setSSLParameters(p)
End Sub

Anything the JVM can do, this language can call. java.sql, javax.net.ssl, java.util.concurrent, any jar you drop into lib/. There is no foreign-function layer and no binding to write: a Java class is simply a class.

One form. Three places it can run.

The designer writes a plain .rfx file — readable source, not a binary layout format. What changes between the three is where the form is drawn, and nothing else.

Desktop

A window

Swing, drawn by the JVM you already have. One jar plus a lib/ folder, and an installer for every desktop system from the same build.

Web

A browser

The same Swing form, mirrored to the browser as SVG. Events go up by POST, changes come down on one event stream. No HTML to write, no JavaScript framework, no build step.

Mobile

An Android device

The same form again, drawn through a Swing-compatible layer on Android. Built on the device's own toolchain, not cross-compiled through a second language.

The web path deserves a number rather than an adjective. A visitor watching a mirrored form costs one session and the platform thread that belongs to it; measured on one machine, 4,001 concurrent sessions held 1.5 GB of heap and sat exactly on macOS's ceiling of 4,096 threads per process. Beyond roughly three thousand, put a load balancer in front — the same thing one does with anything else.

What has been built with it

Four applications, all written in RapidFX. They live with the designers and are not in this repository — what is here is the compiler. They are described anyway, because every number on this page was counted in one of them.

ProjectWhat it isSize
tsbErp Desktop Customers, articles, documents. Lists, sheets, printing, a database — the ordinary business application the designer is obviously for. 23 files · 4,404 lines
tsbErp Web The same application in a browser. Line for line the same data code; only the database behind it differs. 17 files · 3,880 lines
The website This product's own site, as a mirrored Swing application. Eleven pages, a documentation section with search, a downloads page. 19 files · 4,995 lines
tsbCommunity A public forum: accounts, a six-digit code by mail as a second factor, boards, topics, replies — and a plain HTML view a search engine reads without costing a session. 22 files · 4,852 lines

The one worth opening first

tsbCommunity, and not because it is a forum. Because it contains the three things somebody would assume had to be written in another language, and none of them are:

An SMTP client STARTTLS with certificate host verification, AUTH PLAIN, RFC 2047 subjects, dot stuffing, back-off on a temporary failure and never on a permanent one.
Schema migrations PRAGMA user_version, one transaction per step, append-only, and a refusal to start against a file newer than the code.
HTTP routes /forum/, robots.txt and sitemap.xml as ordinary HTML, answered before a session exists. Sixty fetches, zero sessions.

What is sold, and what is free — and why that is the whole design

The three designers are the product. They are what you pay for, and they are what saves the time.

The compiler and the runtime are free and open, under the Apache License 2.0 — for the desktop and for Android, together with the tsb.mobile façade a form binds against. Not as a trial and not as a limited edition, because otherwise a customer who builds their business on this is locked to a company that might not be here in twenty years.

The consequence is meant literally: in a hundred years somebody should still be able to take the source of an application written with this, download the compiler, and rebuild it. Without the designer's automation, and slower — but without asking anybody's permission. That is why the compiler is not the thing being sold.

Get started

A JDK is the only thing you need in advance.

git clone https://github.com/thorstenstueker/tsbRapidFX.git
cd tsbRapidFX

' the compiler for the desktop
cd compiler
./gradlew installDist
cli/build/install/cli/bin/cli hello.rfx --run

' the compiler for Android
cd ../mobile/rfxc-mobile
./gradlew installDist

The designers

Desktop and web are drawn in a plugin for IntelliJ IDEA; mobile has a designer of its own that runs on the device's own toolchain. They are being prepared for the JetBrains Marketplace — open an issue if you would like to be told when they are there.

Something not working?

Issues go to the tracker. A version, what you did and what happened instead is enough to start with — and the compiler's error messages name the file and the column, so pasting one of those is usually the fastest thing you can do.