Skip to content

FerroBASIC 0.0.6 (pre-alpha)

Pre-release
Pre-release

Choose a tag to compare

@FeliceMente FeliceMente released this 05 Nov 09:20
· 169 commits to main since this release
babb9db

Level 0 is now settled by B4J itself in many more corners: recording runs 14 to 20 (B4J 10.70, OpenJDK 19, Windows 10) answered 131 pending tests, and FerroBASIC follows every answer.

Language, as in B4J:

  • Select Case x is a synonym of Select x, and Each may be a name.
  • An assignment to an undeclared name declares a String; a Sub without As returns a String, so Return <value> builds and its call has a value.
  • Dim o As Object with no value gives a new java.lang.Object (local, module variable, or a Type field after Initialize), compared by identity. Before, it was Null (deviation D8, now gone).
  • A For Each without As declares its variable an Object: over an undeclared name (a module variable in Process_Globals) or over any Object; over a variable of another type, or after an assignment or a read of the name, it is an error.
  • In Process_Globals, the declaration pairs B4J builds (two Dims, a Const and a Dim, two Int Consts) are one variable; a For counter declares an Int in source order; loops over a variable named like a Sub build wherever the variable's rules allow.

Runtime, as in B4J:

  • For evaluates its step, limit and start in B4J's order; Select evaluates every Case value before comparing.
  • < and > compare numbers, parsing a String; a number = Null raises NumberFormatException; a Char compared with a number takes the first character of its text.
  • A List used as a Map key keys by its contents; GetType of a record is <package>.main$_<name>.

Some programs 0.0.5 accepted are now errors, as B4J refuses them (listed in CHANGELOG.md).

Recorded from B4J:

  • 272 conformance tests pass against recordings, in the interpreter and as standalone binaries; 6 are documented deviations, and 2 pending probes wait for the next recording run.

Tools:

  • scripts/check-all.sh runs every check before a push; ferro-compare checks about 94,000 generated programs for what a change to the checker accepts or refuses.

Details in CHANGELOG.md; known differences from B4J (D1, D3–D7) in docs/deviations.md; open questions in docs/open-questions.md.

Known limitations:

  • A For Each over an Object that holds a number stops with an internal error instead of a Java exception, and converting an Object holding a List or Null to a number raises the wrong exception; both are next.
  • Classes, other modules, libraries other than jCore, DateTime, Sleep and Wait For arrive at later levels. The REPL and the Language Server are next (M1).

Build from source with cargo build --release -p ferro-cli.