Unit-testing a web service in Rust

One of the things I'm most proud of the Rust web services I have written is how I can run their tests with zero setup and within milliseconds, all while making me confident that "main" can always be shipped to production. I've previously touched upon how this all works in other articles, but it's time for a deep dive. To make things specific, I'll be describing the testing infrastructure of EndTRACKER, the EndBASIC Service, and the sample key/value store app of III-IV. These services are all structured in three separate layers, and I'll be covering the testing strategy for each of them.

July 7, 2023 · Tags: endbasic, endtracker, iii-iv, programming, rust
Continue reading (about 19 minutes)

BASIC parsing difficulties in EndBASIC

The original BASIC parser in EndBASIC 0.1 was very rudimentary and it stayed pretty much unmodified until the 0.10 release last month. This release brought major changes to the parser to support new features, but it wasn’t easy to implement them. In this post, I want to look into various difficulties that arose implementing certain BASIC constructs in EndBASIC. Overcoming these difficulties was difficult, but it was also fascinating because it gave me a glimpse of the design choices that the original BASIC designers must have faced. Capturing these ah-ha moments in a post is also tricky, but I’ll try anyway.

January 13, 2023 · Tags: endbasic
Continue reading (about 14 minutes)

EndBASIC 0.10: Core language, evolved

After three months of early-morning hacking, I’m pleased to announce that EndBASIC 0.10 is now available—right on time for some holiday-time experimentation! This release marks a huge milestone because it makes the language usable for real-world development. You see, when I started this project over two years ago, I wrote a rudimentary interpreter for something that resembled BASIC and then launched EndBASIC 0.1. Since then, I have been piling onto those insufficient foundations by adding flashy features such as a web interface, a cloud file sharing service, and a hybrid text/graphics console. These features have been well-received in every demo I’ve given but… the feedback that always came back was the same: “Give me some sort of functions or subroutines!”, or “This is no BASIC without GOTO!”. And these criticisms were right. Trying to write any sort of non-trivial program in EndBASIC was a daunting and frustrating experience. I had tried to simplify coding to the foundations of structured programming, but without a way to perform unstructured jumps (aka go-tos) or define custom functions… it was impossible to factor out common code, which is a need for the vast majority of programs that exceed a screenful of text. There were also usability deficits such as the lack of line numbers in error messages, which made it incredibly difficult to debug any failing program. The situation had to change, and change it has in EndBASIC 0.10.

December 27, 2022 · Tags: endbasic, featured
Continue reading (about 5 minutes)

From AST to bytecode execution in EndBASIC

Since its inception two years ago, the EndBASIC interpreter has been using an AST-based execution engine. And during all this time, people have mocked the language for not allowing 10 GOTO 10. Well, fear not: the upcoming 0.10 release has full support for GOTO and GOSUB, features that were made possible by moving to a bytecode-based interpreter. Let’s take a peek at what the problems were and how I addressed them.

November 22, 2022 · Tags: endbasic, rust
Continue reading (about 9 minutes)

EndBASIC 0.9: Run shared demos easily

It is with great pleasure that I announce the release of EndBASIC 0.9.0 😎️. The major feature in this new release is the ability to launch publicly-shared files via a click of a URL without having to create an account first. Here, try running my jmmv/bounce.bas or jmmv/paint.bas demos in your browser, now!

June 5, 2022 · Tags: endbasic
Continue reading (about 7 minutes)

EndBASIC 0.8: Now, with graphics!

Graphics support has finally landed in EndBASIC and, with that, the 0.8 release is finally here. This release marks a huge milestone in the development of EndBASIC. Supporting graphics is something I’ve had in mind since the very beginning but had been procrastinating on until a couple of months ago. I feared everything that would be involved in delivering this feature, and to be fair, I was right: getting the desktop console to work on all platforms, and especially getting it to work in CI for automated testing, was tedious. But it’s done now.

November 11, 2021 · Tags: endbasic
Continue reading (about 3 minutes)

EndBASIC 0.7: Hello, cloud!

Several months have passed since the last EndBASIC release and, since then, you might have seen me talk nonstop about an “EndBASIC service” in social media… which has sounded like vaporware. That changes today. After about four months of work, I am ecstatic to announce that EndBASIC 0.7 is here. And these haven’t been four months of idle time. No, no, no. It has taken four months of my scarce free time to deliver this because 0.7 is a humongous release on various fronts.

July 3, 2021 · Tags: endbasic
Continue reading (about 9 minutes)

EndBASIC 0.6 release announcement

After a very active month of development since the 0.5 announcement, it is time to welcome EndBASIC 0.6! This new 0.6 release is super-exciting for three reasons: preliminary GPIO support in the standard library specifically tailored to the Raspberry Pi; multidimensional array support in the language; and availability of binary releases for the most common platforms. You can dive right in by: visiting https://repl.endbasic.dev/ for an interactive session, reading more about the project at https://www.

February 19, 2021 · Tags: endbasic, programming, release, rust
Continue reading (about 8 minutes)

Embedding EndBASIC into a (Rust) program

One thing that bothers me quite a lot about various language implementations is that the core of their interpreter isn’t clearly separate from their standard library. This makes it hard to embed those interpreters into other programs because it’s not obvious how to limit their side-effects and because the interpreter dependency can be heavy. In this post, we will see how EndBASIC’s design tries hard to keep the core as small as possible, and we will see some examples on how to use EndBASIC from Rust and vice versa.

January 26, 2021 · Tags: endbasic, programming, rust
Continue reading (about 7 minutes)

EndBASIC 0.5 release announcement

A month has passed since the 0.4.0 announcement so it is about time to say hello to yet another EndBASIC release because 0.5.0 is here! So, what’s new? Not much… unless you look under the covers, in which case a ton has changed. About 30% of the codebase has been affected in one way or another to improve general quality, so read on to see how.

January 24, 2021 · Tags: endbasic, programming, release, rust
Continue reading (about 3 minutes)

Why am I wasting time on EndBASIC?

If you have been following this blog or my social profiles for the last year, you are probably aware that I have been working on something called EndBASIC. You also probably know that this is a retro-looking BASIC interpreter written in Rust that happens to run on the web. And if you know those two things, you are probably wondering, like some of my friends do: why am I wasting time developing such a useless project?

January 19, 2021 · Tags: endbasic
Continue reading (about 4 minutes)

EndBASIC 0.4 release announcement

About a month ago and after a long hiatus, I published EndBASIC 0.3 and the adrenaline rush that came with it got my wheels spinning again full-steam ahead. So here I am today, ready to announce the 0.4 release. But… “what could have possibly changed in just a month of someone’s free time”, you wonder? Enough, actually! EndBASIC 0.4 is the release that fulfills my original goal of being able to run a “guess the number” game.

December 25, 2020 · Tags: endbasic, programming, release, rust
Continue reading (about 13 minutes)

Unit-testing a console app (a text editor)

The most notable feature in EndBASIC 0.3 is its new full-screen console-based text editor. In this post, I describe why it is important and useful to unit-test a console app like this, and I will dive into how to implement unit tests that catch regressions and inefficiencies. Code samples are in Rust, but the concepts presented here are applicable to any language with minimal data abstraction facilities.

December 8, 2020 · Tags: endbasic, featured, programming, rust
Continue reading (about 16 minutes)

Using the builder pattern to define test scenarios

I’ve been playing with the builder patter to express test scenarios in a succinct and declarative manner. I’ve liked the outcome and feel that this design can yield to pretty good test code, so I’ll dig through this idea here. Note that, while this post and the associated code talk about Rust, the ideas presented here apply to any language. So don’t leave just because I said Rust!

December 4, 2020 · Tags: endbasic, programming, rust
Continue reading (about 6 minutes)

EndBASIC 0.3 is here

After a 6-month long hiatus caused by me hunting and changing jobs and cities, I am pleased to announce the release of EndBASIC 0.3! The Thanksgiving break has been as fruitful as I had hoped 😁 There are two major changes in this release. The first is the official debut of the web-based interface. I introduced this months ago and have had it running on a “push on green” model, which means that the web deployment of EndBASIC is always tracking Git HEAD.

November 29, 2020 · Tags: endbasic, programming, release, rust
Continue reading (about 2 minutes)

Bridging the web gap in EndBASIC

After a ton of work, a lot of which was unexpected, I am ecstatic to announce that EndBASIC is now a reality on the web! The whole language interpreter can now run as a fully client-side web app on a computer, on a tablet… and even on a phone. Yes: the whole thing, which is written in Rust (94%), works in a modern browser with just a tiny bit of JavaScript glue (1%).

May 30, 2020 · Tags: endbasic, programming, rust
Continue reading (about 7 minutes)

EndBASIC 0.2.0 is here

A couple of weeks ago, I announced EndBASIC: a simple BASIC language interpreter written in Rust with a goal to provide an environment for teaching my kids how to code. That first release provided what-I-think-is a robust interpreter, but that was about it: the language features were still minimal and the interactive features were non-existent. Well, EndBASIC 0.2.0 is here and things are changing! It’s still far from the vision I want to reach, but it’s slowly moving towards that direction.

May 7, 2020 · Tags: endbasic, programming, release, rust
Continue reading (about 6 minutes)

Hello, EndBASIC!

Introducing EndBASIC, a new interpreter for a BASIC-like language that is inspired by Amstrad’s Locomotive BASIC 1.1 and Microsoft’s QuickBASIC 4.5. Like the former, EndBASIC intends to provide an interactive environment that seamlessly merges coding with immediate visual feedback. Like the latter, EndBASIC offers higher-level programming constructs and strong typing. The main idea behind EndBASIC is to provide a playground for learning the foundations of programming in a simplified environment.

April 22, 2020 · Tags: endbasic, featured, programming, release, rust
Continue reading (about 3 minutes)