wel if you have the bytecode interpreter, you can write a optional compiler on device
and even do funky stuff like making it a visual scripting language since typing with a dpad seems like a pain
might even write that in the bytecode language depending on implementation
If youāre going to put a compiler in flash, you can optimize for that. Specifically, you execute an AST instead of bytecode.
Iām not sure if a port is the right name, but itās not something similar. It translates existing Bitsy games into C++. Bitsy games have scripts for logic, and since I havenāt looked into the language yet, Iām not sure if Iāll be able to translate that into C++, so I might have to port their scripting engine.
Itās the quickest way to get bitsy games running on the Pokitto. Once this part of the work is complete, making it parse bitsy games from the SD card is not that hard and can be done later if we really need to.
Alternatively, we could just translate them all en masse and run them like normal Pokitto games.
Edit: Basically, the Bitsy games can be seen as a whole lot of data. Too much data to fit in RAM. Loading that data is half of the problem. If I put this data in flash, I can (temporarily?) skip this entirely. Running the game is the other half of the problem, and itās the one Iām tackling first. Kind of backwards, but it lets us test things from the start.
For the case of the ESP chip, the ability to upload new scripts while itās still running without flashing the chip.
For the case of the RPG, to load the script from SD into RAM, again without flashing.
The maps will probably have several scripts that need to be loaded along with the map.
Though in the ESP case an on-board compiler might make sense, depending on what sorts of scripts are needed.
Bootstrapping the compiler would almost certainly make it larger and slower than implementing it C++ side.
(defun area-circle(rad)
"Calculates area of a circle with given radius"
(terpri)
(format t "Radius: ~5f" rad)
(format t "~%Area: ~10f" (* 3.141592 rad rad))
)
(area-circle 10)
The language is generally a subset of Common Lisp, and uLisp programs should also run under Common Lisp.
it can run on an Arduino uno which puts the bar low enough for specs
RAM: At least 2 Kbytes.
Program memory: At least 32 Kbytes (the program currently uses about 29 Kbytes of program memory on the Arduino and 31 Kbytes on the MSP430).
EEPROM, flash, or FRAM memory: Used for saving and loading the uLisp workspace.
oh is it using polish notation? it looks fairly clean and straightforward
Itās not like we need to maintain backward-compatibility with anything, weāre not trying to run Emacs on the Pokitto. If a port can be used, then that variant, whatever it is. If a new implementation would need to be done, then implement just whatās necessary, make a new variant.
The syntax is simple, it uses RPN and itās practically an AST, so the compiler shouldnāt be too big. I canāt think of an easier language to get running (except, maybe, one of the esoteric/useless ones). Especially if only a subset is used.
Iāve written mostly small snippets as thatās what Emacs uses for everything.
Just go on an create your own. That will certainly be a very educating and fun experience. Just decide what your target is to keep the work amount manageable: showing graphics, creating UIs, making game logic, etc. You could even target it for coding tiny scripts on Pokitto itself on-the-go
To make it easy for others to take it into use in different environment, try to put everything to just few C++ source files, make a very simple interface and keep dependencies to other libraries to the minimum.
Oh I totally forgot, I pulled pin 12 on esp32 high and it then has a build in version of basic
Itās not much it seems to work
How can I hook this up to the pokitto? Currently itās running in a serial monitor at 115200 baud
Technically itās reverse polish notation.
Polish notation would be (10 area-circle) rather than (area-circle 10).
Nope, youāre right.
Polish notation is prefix notation and reverse polish notation is postfix notation.
I got a bit confused there for a minute.
I never said anything about backwards compatibility.
Iām asking about variants because the variant defines what can and canāt be done.
The syntax is simple, but the language itself isnāt particularly easy to use.
If youāre used to functional languages (e.g. Haskell) then itās not too strange, but if youāve only ever done procedural languages (which is probably the case for most people here) then itās going to be significantly alien.
Not just because of the RPN syntax, but becuase of the lack of arrays and use of cons-lists. Cons-lists take time to get used to.
(Forth on the other hand does usually support arrays and dynamic allocation.)
In that case Iām definitely leaning towards Pawn then (for the ESP hat).
Aside from its small size, its C-like syntax will be more familiar to people here so thereās less of a learning curve.
A very interesting link.
Worth looking at even if only to hear the authorās opinions of the other languages (a number of which weāve actually mentioned/considered already).
My concern about TCL would be the speed, even if the ESP chip is reasonably fast.
I agree with this for the RPG case,
but for the ESP case I think it would be too much effort and end up not being general purpose enough.
Still looking for the right language I talked to a local teacher.
There doing something new with kids in school these days,
Programing but itās all node/block based
So maybe at least on the end user this might be a good idea
There using a couple of them and use them on Arduino and micro:bit type devices
There still have to use PC or iPads to do it though Wich is expensive for some schools, maybe on device programing could help with that?