Skip to content

BasicPlus v4.0 — consolidación

Choose a tag to compare

@legio-e legio-e released this 06 Aug 10:34
· 2108 commits to main since this release

Español · English below ↓

BasicPlus v4.0 — «consolidación»

Esta versión se ha centrado en consolidar lo ya hecho más que en añadir cosas
nuevas. En especial se han reformado la gestión de memoria y el sistema de
archivos
, que eran las dos piezas que peor envejecían. Aun así, por el camino han
entrado los eventos, la sobrecarga de funciones y un micro simulado dentro
del IDE.

Y lo de siempre, que no cambia: el mismo bytecode corre byte-idéntico en el PC y en el
micro
.

Lo nuevo

  • Memoria por handles. Una referencia ya no es una dirección: es un índice más un
    contador de generación. Si usas un objeto ya liberado, los contadores no coinciden
    y el error salta ahí mismo en vez de corromper datos en silencio. Se midió el coste
    antes de adoptarlo: apenas cuesta rendimiento.
  • El heap deja de crecer. Lista de libres ordenada por dirección y con fusión de
    huecos, y el recolector se dispara por volumen reservado. Verificado en placa con
    10.000 vueltas de un bucle que antes no pasaba de la 1.000. Y quedarse sin memoria
    es ahora un error que puedes atrapar con try/catch.
  • Sistema de archivos unificado (littlefs) en las tres familias, con la flash
    dividida en tres bloques: entorno y registro, sistema de archivos, y Packs. El
    registro sobrevive al reinicio: si una placa se cuelga, luego puedes leer lo último
    que hizo.
  • Packs: varios archivos en uno, sin comprimir, para usarlos directamente desde
    la flash
    sin cargarlos en RAM. Se crean y administran desde el IDE.
  • Eventos y llamadas asíncronas — pensados para el entorno gráfico, pero no
    limitados a él.
  • Sobrecarga de funciones: libres, métodos estáticos, métodos de instancia con
    herencia, constructores y entre módulos.
  • Micro simulado en el IDE: mismo protocolo, mismo sistema de archivos, misma
    consola, pero en el PC, con RAM/PSRAM/flash/pantalla configurables. Para trabajar sin
    placa — y para comparar cuando algo va en uno y no en el otro.
  • Código nativo también en RISC-V (ESP32-P4), además de ARM. En el banco: una función
    de cálculo puro pasa de 58 s interpretada a 0,5 s en nativo.
  • Arranque por capas: si algo falla, la placa se queda en el último nivel bueno y lo
    dice
    , en vez de quedarse muerta. Una placa con el sistema de archivos estropeado sigue
    respondiendo y se recupera desde el IDE.
  • Se acabaron los .bpi: cada módulo compilado lleva su interfaz dentro. Además:
    subida de archivos grandes por trozos, widget de gráfica, random/randomInt, y
    bastante pulido en depurador, lenguaje, GUI e IDE.

Detalle completo en las notas de versión.

Descarga

Un solo fichero: BasicPlus-4.0-win.zip (Windows; requiere JDK 8+). Dentro va todo —
IDE, compilador, librería estándar, ejemplos, documentación, el micro simulado y las cinco
imágenes de firmware. Se descomprime y funciona; no hay instalador.

Las imágenes están en la carpeta firmware/, con su SHA256SUMS.txt al lado:

Imagen Placas
bpvm_pico.uf2 Raspberry Pi Pico 2 y Adafruit Metro RP2350 (BOOTSEL + copiar)
bpvm_esp32_merged.bin ESP32-S3 (esptool write_flash 0x0 …)
bpvm_esp32p4_merged.bin ESP32-P4-Function-EV y Waveshare ESP32-P4
bpvm_stm32_nucleo.bin STM32 Nucleo-U575ZI-Q (ST-LINK / CubeProgrammer)
bpvm_stm32_dk2.bin STM32U5G9J-DK2, con pantalla (ST-LINK / CubeProgrammer)
24a755ae83c8388649bc1f5d2ae3ddcd5dd4a5d08762df698d2a1749df7cbd3c  BasicPlus-4.0-win.zip

Documentación

Limitaciones conocidas

  • Tras un Stop puede desincronizarse la comunicación y hay que reconectar. Sólo en
    algunas placas (bien en STM32, intermitente en P4). Acotado: no es el KILL ni el drenaje
    del IDE.
  • Al cambiar del micro simulado a una placa, el código nativo puede saltarse: el IDE
    se queda con la arquitectura anterior. Ahora avisa por consola y se cura
    reconectando el explorador.
  • loadFont no puede decir que ha fallado: devuelve un identificador válido siempre, y
    poner una fuente que no cargó no hace nada.
  • Los contadores de periféricos del INFO son informativos y no siempre casan con los
    del lenguaje: el mismo núcleo sale en encapsulados distintos.
  • Gui.setRotation no rota en la STM32 Discovery: el evento se dispara y el modelo gira,
    pero el panel no.
  • Sin driver WS2812 fuera del RP2350 — desde esta versión lo dice en vez de pasar en
    verde sin encender nada.

BasicPlus v4.0 — "consolidation"

↑ Versión en español

This release focused on consolidating what was already there rather than adding new
things. In particular, memory management and the filesystem were reworked — the
two pieces that were ageing worst. Even so, events, function overloading and a
simulated micro inside the IDE arrived along the way.

And the usual, which does not change: the same bytecode runs byte-identically on the PC
and on the micro
.

What's new

  • Handle-based memory. A reference is no longer an address: it is an index plus a
    generation counter. Use a freed object and the counters won't match, so the error
    fires right there
    instead of silently corrupting data. The cost was measured before
    adopting it: it barely costs performance.
  • The heap stops growing. The free list is now address-ordered and coalesces adjacent
    holes, and the collector triggers on bytes allocated rather than on heap growth.
    Verified on hardware with 10,000 iterations of a loop that previously died before
    1,000. And running out of memory is now an error you can catch with try/catch.
  • A single filesystem (littlefs) across all three families, with the flash split into
    three blocks: environment and log, the filesystem itself, and Packs. The log
    survives a reset: if a board hangs, you can connect afterwards and read the last
    thing it did.
  • Packs: several files inside one, uncompressed, so they can be used straight
    from flash
    without loading them into RAM. Created and managed from the IDE.
  • Events and asynchronous calls — aimed at the GUI, but not limited to it.
  • Function overloading: free functions, static methods, instance methods with
    inheritance, constructors, and across modules.
  • A simulated micro in the IDE: same protocol, same filesystem, same console, but on
    the PC, with configurable RAM/PSRAM/flash/display. To work without a board — and to
    compare when something works on one and not on the other.
  • Native code on RISC-V too (ESP32-P4), on top of ARM. On the bench, a pure-compute
    function goes from 58 s interpreted to 0.5 s native.
  • Layered boot: if something fails, the board stays at the last good level and says
    so
    , instead of going dark. A board with a broken filesystem still answers and can be
    recovered from the IDE.
  • No more .bpi files: every compiled module carries its own interface. Also: chunked
    upload of large files, a chart widget, random/randomInt, and a good deal of
    polish in the debugger, the language, the GUI and the IDE.

Full detail in the release notes (Spanish).

Download

One file: BasicPlus-4.0-win.zip (Windows; requires JDK 8+). Everything is inside —
IDE, compiler, standard library, samples, documentation, the simulated micro, and the five
firmware images. Unzip and run; there is no installer.

The images live in the firmware/ folder, with their SHA256SUMS.txt next to them:

Image Boards
bpvm_pico.uf2 Raspberry Pi Pico 2 and Adafruit Metro RP2350 (BOOTSEL + copy)
bpvm_esp32_merged.bin ESP32-S3 (esptool write_flash 0x0 …)
bpvm_esp32p4_merged.bin ESP32-P4-Function-EV and Waveshare ESP32-P4
bpvm_stm32_nucleo.bin STM32 Nucleo-U575ZI-Q (ST-LINK / CubeProgrammer)
bpvm_stm32_dk2.bin STM32U5G9J-DK2, with display (ST-LINK / CubeProgrammer)
24a755ae83c8388649bc1f5d2ae3ddcd5dd4a5d08762df698d2a1749df7cbd3c  BasicPlus-4.0-win.zip

Documentation

Known limitations

  • After a Stop the link can desynchronise and you have to reconnect. Only on some
    boards (fine on STM32, intermittent on P4). Narrowed down: it is neither the KILL nor
    the IDE's drain.
  • Switching from the simulated micro to a real board can skip native code: the IDE
    keeps the previous architecture. It now warns on the console, and reconnecting the
    explorer fixes it.
  • loadFont cannot report failure: it always returns a valid id, and setting a font
    that did not load does nothing.
  • The peripheral counts in INFO are informational and don't always match the
    language's: the same core ships in different packages.
  • Gui.setRotation does not rotate on the STM32 Discovery: the event fires and the model
    turns, but the panel doesn't.
  • No WS2812 driver outside the RP2350 — as of this release it says so instead of
    passing green without lighting anything.

El mismo programa que depuras en el PC corre luego en la placa — sin recompilar, sin #ifdef.
The same program you debug on the PC later runs on the board — no recompiling, no #ifdef.