[Feature Request] Program using lua

ok you guys not bringing the conversation forward, i would like to delete some of your comments, jeez this is a kid friendly place…

anyway the tracks i currently see on education is that kids are thought scratch and scratch like visual languages.
i think one of the reasons why scratch is that its in native speaking language since not all country’s english is present so theres a bit a barrier to entry

a visual language might be interesting also as running on hardware with just a dpad and 3 buttons

any thoughts?

1 Like

If i’m not wrong jonne already said he is currently working on visual language. But i’m not sure

i think this is the mention, though that only runs bytecode, no onboard editor

If Pokitto can run Pawn maybe we can use Pawn as scripting language

I think you need to start by picking your goal. Or prioritizing them, if it’s goals.

  1. Is it to encourage kids to use it for the benefit of the mental exercise, as sort of an educational/productive video game?
  2. Is it to be something easy for programmers to produce apps in it’s target space?
  3. Is it to help them become a good programmer?
  4. Is it to get someone started on a career as a programmer?
  5. Something else?

Seems like #1 is the only one for which “Kids like it” is an important criteria. And in this case, the language properties aren’t very important, so something visual would be fine.

The actual language is likewise largely irrelevant for #2. What matters for it is the library & extensions specific to the target applications, so something visual would work here as well.

Visual languages don’t seem to be appropriate for #3 or #4. On the other hand, Developing ON the Pokito as opposed to for it seems like an odd choice for these as well.

3 and 4 are easy, theres c/c++ and thats all you need for those guys, they need full controle, access to memory to write optimized code

one of the benefits we can have with an interpreter is creation on device, but using a virtual keyboard is a slow so i think a visual language might work well

for kids or educational settings, its not a given that there will be enough computers to write, compile, transfer to device. so this idea of standalone might be good

anyway this is the argument for a custom language or custom visual sytem, it could run any interpreter underneath it
it could be brainf*ck for all i care XD

all in all this is a toy, so a “real programming has already been covered” so i guess its just a thing to make fun stuff with and is easy to use

Full control and access to memory to write optimized code may be necessary conditions, but they are hardly sufficient. If those are your only requirements, then you could take assembler, machine code or even a front panel and do equally well.

Which is why the second task - after you’ve defined your goals - is to figure out what the requirements for meeting that goal/those goals are. You’ll need those to choose between C/C++ or a front panel.

Since #3 & #4 were not “be a good programmer” or “have a career as a programmer”, but “become …” and “start …”, requirements like having full control and writing optimized code aren’t your most important requirements. At the very least, that the language let you develop those skills is less important than actually letting you do those things. And there are other skills those call for that may be more important. But this is really about things more like #1 and #2, so I’ll skip that.

So your goals are runs on the Pokitto and some combination of fun and easy. But what are the requirements for those?

Being on the Pokitto means it must work well in a keyboardless environment. That makes me think that development tools that run on mobile might be worth looking into, since you’re stuck with a virtual keyboard in either case. Apple’s Swift Playgrounds https://www.apple.com/swift/playgrounds/ might also be worth a look (I don’t have an iDevice, so can’t do that myself).

Visual - in the sense of pretty pictures of components - doesn’t seem to be the only thing that meets the requirement of working well without a keyboard. There were some experiments in the 80s with development environments that didn’t let you create programs that were syntactically incorrect. So there was a small menu of operations you could perform that transformed the program. This eventually died because it was simply to restrictive for real programming, but that’s not a problem here. The UI would look a lot like a visual language, except that the displayed results would be program text instead of flow control type diagrams. I’d say that’s more educational, but maybe less fun (depending on what you think of as fun).

Another question is can you gamify things? That would make it more fun. Programmers seem to get a kick out of competing with each other on writing the shortest or fastest version of some program. So maybe something like assigning a cost to each element in the program, and displaying the total cost for the program as a score for that program.

again if you want to become a programmer you have to just start with c (or a c style) language no fuss around it, its a better skill to get accustomed with that for beyond pokitto development [quote=“mwm, post:27, topic:297”]
Visual - in the sense of pretty pictures of components - doesn’t seem to be the only thing that meets the requirement of working well without a keyboard. There were some experiments in the 80s with development environments that didn’t let you create programs that were syntactically incorrect. So there was a small menu of operations you could perform that transformed the program. This eventually died because it was simply to restrictive for real programming, but that’s not a problem here. The UI would look a lot like a visual language, except that the displayed results would be program text instead of flow control type diagrams. I’d say that’s more educational, but maybe less fun (depending on what you think of as fun).
[/quote]
i asume you mean smalltalk.
but yea you might be on to something here, going down to basics like logic gates might be possible

i dont think you need to gamify the memory cap XD its prety fast to reach that

but ok i see a couple derections

  • take a language and strap a visual system ontop
  • go towards a logic gate simulator
  • brainf*ck inspired language with simple sequential instructions
  • just wait for basic or port bitlash and use a virtual keyboard

ok what about the system that puzzlescript uses
its a very minimalisting goal oriented system of check for this state do this
i think that can be made into a visual system

just to clarify this is more towareds a game engine with specific objectives (puzzlescript is turn based specific)
i think this might just be the way to go, specific game engines witht here little custom interpreters specific to there use

[quote=“adekto, post:28, topic:297”]
again if you want to become a programmer you have to just start with c (or a c style) language no fuss around it, its a better skill to get accustomed with that for beyond pokitto development[/quote]

Works great for getting a job. Sucks if you want to be a good programmer, pretty much no matter how you define “good programmer”. You spend to much time learning ceremony instead of programming principles in those languages. Fixing that requires sufficiently drastic changes to types that you’re pretty far from being a “C style” language. And as previously noted C & C++ are very unforgiving of errors. There are lots of choices for learning to program that don’t suffer from those problems, though most of them don’t have the employment prospects that C-family languages do.

Nope. I vaguely recall them using Pascal, but it’s been 3 decades since I read those papers. I think it was proceedings of a conference on development tools, but again - 3 decades. Smalltalk has a similar UI, but - at least last time I looked at it - didn’t provide program transformations of any sort.

For instance, in a visual language you might have a way to drag a block “over” an existing block, turning a conditional into a loop. The stuff I’m thinking of would do that directly: you could remove an else clause, or turn an else-less if into a while, etc.

[quote=“adekto, post:28, topic:297”]
i dont think you need to gamify the memory cap XD its prety fast to reach that[/quote]

That was just a suggestion for one way to gamify things, inspired by what programmers appear to enjoy. That’s sort of the obvious one. There may be some other aspect that can be gamified, but I can’t think of any.

I don’t think programming on Pokitto itself will be that beneficial. If you think about it, the screen is a little small when it comes to reading on it and we would need to run the the visual system on the limited memory of pokitto.

A much better approach would be to make an accessible language that you can run on any OS, or in a browser. The code blocks look promising for something kid friendly, and Pawn seems simple enough for people who want to take a dip in writing code instead of writing it from blocks.

I would still prefer a more common language (lua, python), so the skills you learn on pokitto can translate to something else, but I would be happy with something like Pawn.

elua has no compatibilaty for this low end so its prety much out of the question
mirco python might work i dont remeber the details on it but im prety sure they compile it down to intermediate code, so it would not be editeble i think

pawn seems to be in development soo we might just go for that
@VonBednar could you try some graphics for pawn blocks?

i probebly going to write a vnovel parser soon so might be interesting to add an aditional language in it for mini games
(sokoban, card game, match 3) whats a good language for that? prefrebly small or easy to implement (FORTH?)

Sure, I can look into it over the weekend. Do you need them to be in Pokitto resolution (run on pokitto) or something that you will run only on PC?

Pokitto resolution, its more of an experiment, since we never seen this work before

1 Like

Ok, will work on it over the weekend. Are we shooting for 220x176 resolution and are we using the whole screen for those blocks? Also, how many colors are we using?

Some years ago I made a Cortex-M3 device that ran Pawn. Its not all that difficult.

Pawn is a really good scripting language.

Some starting points:

https://developer.mbed.org/users/tylerwilson/code/Pawn4Test/log/3b4d6ea39002/Pawn4.lib

I know that some of you want something that can be programmed on the Pokkito, but the original request was to use Lua. But the Pokkito interface is a serious strain on any kind of conventional programming. And even the previously mentioned bitlash isn’t really interactive on the Arduino unless you’ve got a serial connection to your Arduino.

So how about going another step in the bitlash direction, with something like Firmata? This makes it easy to use whatever language you want to control device. There’s a rather impressive list of languages on that page and while Lua isn’t there, there’s a number of implementations on github), including Haskell, which probably won’t fit on the Cortex-M0 controlling an Arduino.

Ideally, a Pokitto version would be provide the same API on both sides, so you could do development in an interactive environment with a keyboard, and when you’re ready for production move to using the same API talking directly to the hardware instead of via Firmata.

1 Like

Implementing Scratch or something else over the serial is not a big deal at all. Serial is serial regardless of whether the device is and Arduino or Pokitto. Firmata is also possible.

The real problem with Arduino/Scratch versions over the serial, is that the Arduino part is designed to toggle digital outputs and thats about it. Pokitto has a screen and sound, so naturally people would expect much more.

The suggestion wasn’t “implement scratch or something over a serial line”, or anything specific to the Arduino. it’s to implement a serial protocol for talking to a Pokitto.

Firmata may or may not be suitable. The protocol page claims it’s suitable for any microcontroller, but the “most complete” implementation is for the Arduino, and they only list one other one, so it doesn’t look so good. But it does exist, so would be worth spending a little time checking to see if maybe all those PC-side clients would work with a Pokitto version.

If that fails, then the code is still the easy part: it’s simple program that create’s the appropriate objects for a game, then loops reading serial commands that translate into method invocations and calls them, sending back the results (if any).

I’ve played around with the Scratch over serial & Firmata and stuff. Even compiled the source.

I have zero use for them, so never pursued learning more.

Edit: what I am trying to get at is Firmata & other variants of the same idea have a very limited use