Block-based programming is in a bit of a rough spot in FIRST.
LabVIEW
LabVIEW, once used by a third of all teams, now sees less usage than C++, and only ~181 teams are reported using it. Vendor support, while often present, is second-class in maintenance priorities to Java and C++. But more importantly, it lacks the same volume of libraries and community support that languages that use WPILib enjoy.
This is a really big problem for LabVIEW teams: as swerve is now the dominant competitive drivetrain in FRC, it means thereās far less software support and plug-and-play libraries available for them ā your best bet is to look at some other team who has figured it out, and pray you can figure out how to fix it. This has come up in recent discussions on LabVIEW swerve and the appropriateness of suggesting that teams switch off LabVIEW has become a point of contention. Whichā¦isnāt a great look for the current state of the language or its ecosystem in FRC.
The low usage numbers have other effects too in volunteer and mentor availability ā I suspect fewer CSAs have ever used LabVIEW than Python even if they have never run RobotPy with a team before. And anecdotally it seems far less people know how to help LabVIEW issues online than in any other language.
Moreover, LabVIEW isnāt a hard requirement for the 2027 RFP either in the same way Java, C++, and Python are, so the long-term viability of the software is in question if NI doesnāt submit a bid. Which, after their recent acquisition by Emerson, seems particularly likely to me.
Blocks
In FTC, we use Blocks. We used to have LabVIEW in the NXT era but I donāt know much about how that went over. Itās backed by a JavaScript API which somehow calls the underlying Java systems of the robot controller Android app. Thereās an official tutorial here that guides new teams on how to build simple programs, which I personally think is quite nice.
Like LabVIEW, itās limited by the lack of version control or collaboration tooling, but Iām personally just not sold on the core execution. Hereās an example program from FIRSTās official guide:
And hereās the roughly equivalent Java code:
// some boilerplate omitted
@Override
public void runOpMode() {
// Put initialization code here
// vestigial silliness inherited from a now-illegal control system:
DcMotor motorTest = hardwareMap.get(DcMotor.class, "motorTest");
waitForStart();
double tgtPower = 0;
while (opModeIsActive()) {
// Put loop code here
tgtPower = -gamepad1.left_stick_y;
motorTest.setPower(tgtPower);
telemetry.addData("Target Power", tgtPower);
telemetry.addData("Motor Power", motorTest.getPower());
telemetry.update();
}
}
Fundamentally, the Blocks code isnāt less complex than the Java code. Blocks just dresses up the syntax a little bit. And this rubs me the wrong way. Itās like focusing on making punctuation easier without paying attention to grammar, so to speak.
When I was in FLL, if you wanted to move your robot a fixed distance, it was a single move block. The block would take care of steering, counting encoder ticks, and it was really easy to use. Iām not entirely convinced Blocks is that much easier than Java despite the claims.
On the bright side, you can now use Blocks with external Java libraries, so I guess thatās a step above LabVIEW.
So how do we make something better?
Iām not entirely sure.
It should probably build on top of WPILib and be able to use WPILib-targted libraries
ā¦rather than be mutually exclusive to WPILib. If it was easy to add LabVIEW support to something like YAGSL Iād imagine itād already exist. If you have a system that hopes for a ton of outside development specifically for your block-based language, itās probably ending up like LabVIEW again.
Have simpler abstractions
Iām not sure how feasible it is but the simplicity that NXT-G and Scratch have appeals to me. I will say that Scratch-likes handle control flow and variables a lot better than NXT-G does.
Make it git-diffable�
If you encoded every block as a line of text somewhere, you could conceivably have block code that can be visually merged in git. I donāt know how feasible this is though
I donāt really know a good answer hereā¦
ā¦and Iām really curious what yāall think. Please leave your comments!