I think you were onto something when you were initially making those JS prototypes, actually. Hopscotch itself runs on JS, so you would get it 1:1 with the interpreter it runs if it were run, say in node.js? That’s a theory though, you know better lol
I’ve been wanting to make a player mod to run hopscotch projects with node, but i didn’t get very far at all before getting distracted by something completely different. But yeah it would definitely be very cool to do.
Again, I’m just talking about the transpiler here. Not the runtime! Just some way to get live feedback on my code with ESLint, if that’s at all how Hopscotch works in relation to JS and its variables. It just sounds cool. :')
For this specific idea, I’m assuming that because Hopscotch runs in the browser, and it runs with a canvas, it probably handles variables similarly with all the weird “undefined” behavior that happens with Hopscotch’s very loose type systems.
Shoutouts to sometime in 201X, the time when Valgo placed a number value into a Color block to make a custom color. Before custom colors were even added as their own block in the first place. :D
It’s actually particularly harder with JS than a language like Python because JS doesn’t let you do things like operator overloads. You are basically limited to strings since .valueOf() is called when you add things together, which as you imagine can be a pain
Python operator overloads means that if you, for example, add an operator to another operator, you can return a third operator that contains both previous ones in one parameter
Yeah language features are a big plus in comparison. And that’s sort of what I was getting at with Rust, in a way.
And speaking of that - packages. It’ll be so cool!!! Seriously, with Python you can do some crazy things that would be tremendously more annoying to implement with a dedicated programming language, ie. Hopscript.
This is probably possible using Python and a Hopscotch API layer: Imagine making a Google clone on Hopscotch built with premade scraped web data, using BeautifulSoup and requests, and then converting that into Hopscotch objects semantically to display webpages. I would be awestruck lol. Those auto pixel art scripts are just the tip of the iceberg at this point.
I guess that raises sort of an ethical question too, though… Stuff like people not liking pixel art scripts because they’re low effort. But I would just use it to make cooler projects lol
I will never stop quoting BaS’s MIDI hack and how much it blew my mind then. lol
unfortunately there are compromises to make still despite the flexibility given:
It’s not possible to override and and or, so you will have to write conditionals like this using the bitwise operation (single ampersand &), and the conditions will have to be individually parenthesized.
yeah that’s exactly what I’m doing. I’m not sure if you thought I was doing something different.
I was just showing screenshots of code that the user would write. The library automatically converts all of the python code, including the conditionals I wrote, to HS JSON and runs a player with it.
Nothing is stopping a user from still writing python conditionals, it’s just that you have to write them differently if you want it to build into HS code. It’s a library rather than a compiler, so it has to be called