[Feature Request] Program using lua

There is no rush implementing this one, it is something I would like to see added in the future.

I know that there are plans for adding a script language for pokitto, but I would like to make a case for lua to be that (or one of ) language.

A lot of people who are interested in programming and working with little gadgets (like me) do not have the skills to start programming in c. After all it is a “grown up” language and it is a little scary as your first dip into programming.

Lua, on the other hand, slowly becomes something akin to what BASIC was in the 80s (and even the 90s). It is mostly thanks to things like pico-8 and other fantasy consoles, but people can know it from the modding community of quite a few games.

On top of that, the syntax is quite newbie friendly (especially if you look at something like the pico-8 flavor of lua).

AFAIK lua can compile to c, so all the heavy lifting can be done by the computers people code on and pokitto would justworry about the c output. Even if that is not the case, having a language that is slower, but accessible would be a great thing for newbies. It would also encourage some people to start messing with c down the line.

So, would it be possible to add lua support?

1 Like

I can’t express enough how amazing this would be. Then I could make good games haha. Is it possible?

1 Like

lua is nice, however there some things you said that are incorrect
lua cant compile down to c it can compile into its own interpreter
it interfaces with c, but most of the specs like elua (embeded lua) require a large amount of memory
if you want to know wich chips are suported by the elua project
http://www.eluaproject.net/doc/v0.8/en_status.html

this could be solved with a hat co-processor setup, though thats basicly turning the pokitto into the slave device

basicly lua has some overhead that something more basic like well BASIC dousnt have wich give more room for you projects, you could strip down lua a fair bit so it would fit or compile down to basic instructions (its just allot to strip out)

also basic is supposed to be coming:

i would like to see people experiment with interpreters, there realy cool and might benefit some games or even more like game engines with custom mods (rpg maker anyone?)

1 Like

Since eLua runs on the STM32F103 - with less memory than the NXP used in the Pokito - it ought to work on the Poktito. However the STM32F1 is a Cortex-M3 instead of a Cortex-M0, so maybe not.

Another good choice might be microPython: newbie friendly thanks to it’s ABC roots, and it’s very popular in the maker community (another group who aren’t really programmers). But it also looks like it needs a bigger CPU than eLua.

BASIC - well, ok, I’ll stop there.

If you want an interpreted language good for really small systems, there are LISP and Forth variants that can run on the 8-bit AVR’s used in low-end Arduino’s. Some of them are even reasonably portable and written in C. Neither has a particularly newbie-friendly syntax, though Scheme is used in one of the best intro to CS texts ever written (Structure and Interpretation of Computer Programs).

Personally, I’m hoping to get Rust working on it, but that’s a compiled language so doesn’t have some of the advantages you’re looking for.

Getting any of these working on the Pokitto should be a relatively straightforward process of wrapping the Pokitto library for their use, but until you look at both the library and the languages foreign function interface, you can’t be sure how hard it would be.

http://zserge.com/blog/tcl-interpreter.html

If small is the goal, then bitlash is a good bet. It was written for the 8-bit AVR chips on Arduinos.

I managed to wrap the Arduboy library for it, but the results left something like 10 bytes for user code, so not so useful. But lua and python don’t fit in that environment at all. Scheme & Forth will. Not sure about TCL.

i think we need to write a custom language

1 Like

As long as it is newbie friendly, I am in… but I would wait and see what’s happening with that BASIC that @jonne mentioned.

what you think BASIC stands for?
Beginner All purpose Symbolic Instruction Code
can you get more newbie friendly? its what starred during the hole home computing revolution

I was talking about your custom language being newbie friendly :wink:

I used BASIC back in the day…so I know it is, well basic :smiley:

1 Like

To quote Dijsktra:

It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration.

1 Like

Come on :sweat: not that judgement again…

I know plenty of ppl my age who started on Basic on Amstrad or Atari in the 80’s, spent their teenage years writing Basic programs, then learnt C, C++ and Java at university. Basic is as good for learning programming as your beloved C.

What next, do you want I share my religion and sex orientation so that you can make fun of them too?
(oh right, THOSE would be frown upon and considered inadequate…)

You know I have to agree to some extent. I learned BASIC and these days I struggle a lot with the way C/C++ handles included files and using variables across different source files. Mostly because these things are usually handled very differently in most versions of BASIC, if at all.

Right, of course I agree with that too, it certainly takes effort.
But the “mentally mutilated beyond hope of regeneration” is just plain trolling…

what the heck you all talking about, basics fine, the problem is people never leurn the core
what the hardware is actualy doing, asm level stuff

all languages are just abstractions on top the core principles of moving bits around
quote me on that one XD

thats not even part of the language spec that usually boils down to how the IDE or compiler that makes it intentionally difficult due to programming principles

I couldn’t agree more. C is a very, very thin veneer over assembler, and as such is only marginally better suited to teaching programming than assembler. It’s a better than BASIC (always depending on exactly what you mean when you say “BASIC”, which varies quite a bit from implementation to implementation) for teaching the principles of programming, but compensates by being much less forgiving of errors.

These days, MIT teaches Python as an introductory programming language. Before that, they used Scheme.

[quote]What next, do you want I share my religion and sex orientation so that you can make fun of them too?
(oh right, THOSE would be frown upon and considered inadequate…)
[/quote]

We’re not talking about what you do in the privacy of your own home, we’re talking about exposing it to people who don’t know enough to have an opinion yet. Doing that with sex will get you put in jail pretty much anywhere in the world, and in some countries you’ll get to spend the rest of your life registering with the local authorities as a sex offender. Some people consider doing that with religion to be equally bad.

In defense of Dijkstra, you have to remember that when he said that, most BASIC’s were 8-bit implementations of ANSI MINIMAL BASIC with a few extensions as functions. You can find the standard for that at https://www.ecma-international.org/publications/files/ECMA-ST-WITHDRAWN/ECMA-55,%201st%20Edition,%20January%201978.pdf. Note that it doesn’t have an ELSE on it’s IF, doesn’t have a WHILE, variables names are a single letter followed by an optional single digit, and GOSUB is a GOTO that records a return address: no parameters, and no local variables. As such, if you wanted to teach someone how to build a program with good structure and architecture - well, you really couldn’t. All of those topics - which Dijkstra had a hand in creating - are things that are considered fundamental to being a good programmer today, but at the time were still being debated.

Once you fix those flaws in BASIC, the problems go away. But then, what you’ve got isn’t really BASIC any more, so much as a BASIC-like language. Sure, there’s a standard for BASIC after MINIMAL BASIC, but AFAIK almost nobody who fixes BASIC follows that. Which is an even more scathing indictment that Dijkstra’s.

Oh but I do write Basic programs in the privacy of my own home :wink: and worse than that: I like it!

The whole point of this thread is to discuss our programming preference for a ‘newbie’ language on the Pokitto.
There are public forums where you can do that about your religious or sexual preference too (I don’t see what jail has to do here??)
Condemning one or any other of these beliefs is wrong, that’s what you did by taking a quote which -according to yourself- is completely out of context about an archaic version of a language in the 70’s.
Compare the tone of your post to the previous ones mentioning Basic: yours is not constructive at all, don’t play surprised when it triggers people.

Little backstory: I am one of the 2 main contributors on the RFO BASIC! language for Android. I spent 5 years developing it so that newbies could make their own app from their phone and most of them feel extremely proud and grateful to have achieved this without having to learn Android Java and XML. Here are some of their apps on the Play Store.

I’d love to see that on the Pokitto as well.

Nicolas

2 Likes

And in some jurisdictions, minors will be prevented from going to those forums. The point is that what you can do in private - or with other consenting adults - is treated differently from what you do with people who aren’t capable of forming an opinion yet. So while the former is protected in enlightened jurisdictions for most topics, the latter will get you jail time in most jurisdictions for at least one of the topics you compared it to.

Well, the only thing BASIC in a name tells you is that the name was chosen for marketing reasons. Certainly doesn’t tell you anything about the language, and whether or not it might be good for beginners. I could call Haskell “Functional BASIC” and nobody could say that I was wrong to do so. Might even make the language more popular.

Because the name “BASIC” doesn’t tell you anything about the language, claiming that “BASIC” is newbie-friendly basic it’s name is “BASIC” is simply wrong, . The only commonality between languages bearing that name is that archaic minimal basic, and the Dijkstra quote is spot on for that language. You shouldn’t be surprised if people respond to such a vague suggestion by commenting on that one common version.

Last post because there’s no point wasting the time of the fine folks here @Pokitto’s:

  1. hey man, what’s your problem with sex and minors? All I said was that condemning one’s belief (I love Basic language ; I love Allah ; I’m gay) is wrong… Where do you get perverted sex practices from that???
    [note to admin: you may wipe out all the previous references to that, I don’t know where it comes from…]

  2. RFO BASIC! is based on Darthmouth BASIC, the original version of the BASIC programming language. I guess you didn’t click the link. Here’s the wiki page to Darthmouth BASIC. Has more to do with BASIC than C…

Nicolas

Hey man, what’s YOUR problem with sex and minors? You’re the first person to bring up sex, and the first person to mention minors. All I did was point out that while condemning someone’s belief may be wrong, that’s not the case when you want to pass them on to people who don’t know enough to make an informed decision.

Yes, I didn’t follow the link about RFO BASIC, because this discussion is about Pokito programming, not Android programming. The link you provided to Dartmouth BASIC describes a language with all the flaws I described in MINIMAL BASIC except for variable names (which it doesn’t talk about), which doesn’t really help your case. If you port it to the Pokito (and I encourage you to do so, as more choices in tools is always good) I might look at it depending on what else is available.