Devlog 4
Hey everyone. Yeah, it’s been a while. Don’t worry though, I didn’t abandon this thing. I’ve actually been working way harder than these 4 logged hours suggest. Major improvements happened. Also, I laid the groundwork for something kind of insane: PlainScript C++ for Arduino. You read that right. Arduino support is coming, and I’m maybe 12 hours of actual implementation away. (REAL UNDERSTATEMENT) 😭
Anyway, here’s what went down.
Hour 1: JS Generation and Smart Syntax
First hour was all about hardening the JS generation. I added what I’m calling “smart syntax.” Unlike Python, where a syntax error just kills your program, PlainScript will actually catch it, suggest a fix, and apply it automatically.
I also threw together a setup script for anyone who actually wants to use this, plus some compiler customization. You can tweak how aggressive the smart syntax correction is, or turn on auto-run after compilation if you’re into that.
Hour 2: SQL and File System Stuff
Built in SQL database creation and management tools. Also gave it full local filesystem access, but I made sure it won’t destroy anything. Ran 15 different scenarios to test that and they all passed, so… it’s probably fine. Probably.
Also added support for both symbols and regular English in the syntax because honestly, sometimes you want to type fast and sometimes you want to actually read what you wrote. Both works.
Hour 3: Cleanup and VS Code Extension
The code was a mess. Like, genuinely unreadable. I split the original 5 files into around 15 separate ones so it’s actually maintainable now.
Also added color coded words (syntax highlighting, It’s syntax highlighting.) My brain is absolutely fried right now, sorry. It’s packaged as a VS Code extension too, though I still need to get it approved on the marketplace. That part’s pending.
Hour 4: Arduino Framework (Actually 3 Hours)
This logged as one hour but it was really three hours of work. I have lost my sanity slightly but it’s fine. I planned out and wrote a chunk of the C++ and Arduino framework.
The plan is: PlainScript compiles to C++, which compiles to an Arduino binary, which you just flash. Simple. (Nope..)
The hard part is that I can’t just port every C++ library over manually. That would take forever. So instead of oversimplifying everything, I looked at how library calls actually work. A normal C++ line looks like this:
library.action(params);
If you break it down, you really only care about two things: the library name and the action. So in PlainScript, that becomes:
library do action on pin (whatever) with (x, y, whatever you need)
This feels solid. I’ll figure out the weirder libraries later, but this approach should cover most cases. I just need to pick a good prefix word for library calls, like cpp or something. I’ll sleep on it.
What’s Next
The JS side is basically done. All that’s left is finishing the Arduino implementation.
Wish me luck.
Oh, and here’s what the syntax highlighting looks like:
(quick edit, I spent wayyy too long writing this than I should have. I wanted it to look good since it’s a major achievement in development)
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.