Author Topic: Lua/HTML5 Web Interpreter  (Read 23605 times)

0 Members and 1 Guest are viewing this topic.

Offline Juju

  • Incredibly sexy mare
  • Coder Of Tomorrow
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 5730
  • Rating: +500/-19
  • Weird programmer
    • View Profile
    • juju2143's shed
Re: Lua/HTML5 Web Interpreter
« Reply #30 on: March 28, 2013, 02:15:29 pm »
Bump! Added a save file dialog! You Nspire-owners should test it out...



Edit: Oh and I forgot. https://github.com/juju2143/LuaIDE
« Last Edit: March 28, 2013, 03:06:35 pm by Juju »

Remember the day the walrus started to fly...

I finally cleared my sig after 4 years you're happy now?
THEGAME
This signature is ridiculously large you've been warned.

The cute mare that used to be in my avatar is Yuki Kagayaki, you can follow her on Facebook and Tumblr.

Offline Spenceboy98

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 547
  • Rating: +59/-2
    • View Profile
Re: Lua/HTML5 Web Interpreter
« Reply #31 on: March 28, 2013, 03:06:01 pm »
Have you done the keys for luazm yet? Can't wait until I can test my programs. :)
I like milk.

Offline Juju

  • Incredibly sexy mare
  • Coder Of Tomorrow
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 5730
  • Rating: +500/-19
  • Weird programmer
    • View Profile
    • juju2143's shed
Re: Lua/HTML5 Web Interpreter
« Reply #32 on: March 28, 2013, 03:07:49 pm »
I began doing this. Should finish it.

Remember the day the walrus started to fly...

I finally cleared my sig after 4 years you're happy now?
THEGAME
This signature is ridiculously large you've been warned.

The cute mare that used to be in my avatar is Yuki Kagayaki, you can follow her on Facebook and Tumblr.

Offline Adriweb

  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1708
  • Rating: +229/-17
    • View Profile
    • TI-Planet.org
Re: Lua/HTML5 Web Interpreter
« Reply #33 on: March 28, 2013, 03:13:06 pm »
Nice :)

Feedback : print("hello") gets in the tns as :    print(%22hello%22)  so it errors   :P
« Last Edit: March 28, 2013, 03:13:29 pm by adriweb »
My calculator programs
TI-Planet.org co-admin.
TI-Nspire Lua programming : Tutorials  |  API Documentation

Offline flyingfisch

  • I'm 1337 now!
  • Members
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1620
  • Rating: +94/-17
  • Testing, testing, 1...2...3...4...5...6...7...8..9
    • View Profile
    • Top Page Website Design
Re: Lua/HTML5 Web Interpreter
« Reply #34 on: March 28, 2013, 03:32:12 pm »
Still no infinite loop support?



Quote from: my dad
"welcome to the world of computers, where everything seems to be based on random number generators"



The Game V. 2.0

Offline Juju

  • Incredibly sexy mare
  • Coder Of Tomorrow
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 5730
  • Rating: +500/-19
  • Weird programmer
    • View Profile
    • juju2143's shed
Re: Lua/HTML5 Web Interpreter
« Reply #35 on: March 28, 2013, 03:45:42 pm »
Nice :)

Feedback : print("hello") gets in the tns as :    print(%22hello%22)  so it errors   :P

Thank you, this has been fixed.
Still no infinite loop support?
No, not yet :/
Have you done the keys for luazm yet? Can't wait until I can test my programs. :)
Actually maybe this has been done already. So now you might want to poke me about infinite loop support.

Remember the day the walrus started to fly...

I finally cleared my sig after 4 years you're happy now?
THEGAME
This signature is ridiculously large you've been warned.

The cute mare that used to be in my avatar is Yuki Kagayaki, you can follow her on Facebook and Tumblr.

Offline Adriweb

  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1708
  • Rating: +229/-17
    • View Profile
    • TI-Planet.org
Re: Lua/HTML5 Web Interpreter
« Reply #36 on: March 28, 2013, 08:56:27 pm »
Btw Juju, on the source code, I see at https://github.com/juju2143/LuaIDE/blob/master/luna.php#L10 :
Code: [Select]

Do you check/sanitize/whatever the input ?

It wouldn't be good if the php process were to execute some things like "shell_exec('luna '. 'test.lua' . ' ' . 'test.tns ; rm -Rf /');" :D
« Last Edit: March 28, 2013, 08:56:35 pm by adriweb »
My calculator programs
TI-Planet.org co-admin.
TI-Nspire Lua programming : Tutorials  |  API Documentation

Offline Juju

  • Incredibly sexy mare
  • Coder Of Tomorrow
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 5730
  • Rating: +500/-19
  • Weird programmer
    • View Profile
    • juju2143's shed
Re: Lua/HTML5 Web Interpreter
« Reply #37 on: March 28, 2013, 09:51:16 pm »
Btw Juju, on the source code, I see at https://github.com/juju2143/LuaIDE/blob/master/luna.php#L10 :
Code: [Select]

Do you check/sanitize/whatever the input ?

It wouldn't be good if the php process were to execute some things like "shell_exec('luna '. 'test.lua' . ' ' . 'test.tns ; rm -Rf /');" :D

Yes, actually at line 2 and 3 PHP generate a random filename (something like /tmp/lunaAsdfasdf), so there's no chance the user could put a rm -rf / in there. Then at line 14 a header with an actual file name is sent (which have no incidence on the filesystem).

Remember the day the walrus started to fly...

I finally cleared my sig after 4 years you're happy now?
THEGAME
This signature is ridiculously large you've been warned.

The cute mare that used to be in my avatar is Yuki Kagayaki, you can follow her on Facebook and Tumblr.

Offline Juju

  • Incredibly sexy mare
  • Coder Of Tomorrow
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 5730
  • Rating: +500/-19
  • Weird programmer
    • View Profile
    • juju2143's shed
Re: Lua/HTML5 Web Interpreter
« Reply #38 on: March 29, 2013, 06:22:33 pm »
Well. After the The Fun Has Been Doubled Update, (yeah, codenaming updates sure is fun, I should do that more often) we now have the long-awaited... The Infinite Loop Update!

That is, infinite loops work! Try it out with this sample code:

Code: [Select]
i = 0
zmg.clear()
while true do
zmg.drawText(0,0,i,zmg.makeColor("black"),zmg.makeColor("white"))
zmg.fastCopy()
time = zmg.ticks()
while time+128 >= zmg.ticks() do end
i = i+1
end

then select Tools > Run (threaded). You should put a sleep loop (line 6 and 7) in there or else the browser crashes. So yeah, the Lua code is now ran in a web worker, that is, a different thread from the UI one. All the recent major browsers (including IE10) should support it (or else it would tell you). Have fun, and, as usual, report all the bugs here :)
« Last Edit: March 29, 2013, 06:26:58 pm by Juju »

Remember the day the walrus started to fly...

I finally cleared my sig after 4 years you're happy now?
THEGAME
This signature is ridiculously large you've been warned.

The cute mare that used to be in my avatar is Yuki Kagayaki, you can follow her on Facebook and Tumblr.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Lua/HTML5 Web Interpreter
« Reply #39 on: March 30, 2013, 01:03:45 am »
Glad you managed to fix them. :D How well would the typical Nspire Lua and PRIZM LuaZM game work for now? Would Aspirin run?

It seems like the IDE doesn't work at all in Opera. If I click Run or Run Threaded, nothing happens and the browser just starts being laggy.
« Last Edit: March 30, 2013, 01:06:25 am by DJ Omnimaga (Not Admin) »

Offline Juju

  • Incredibly sexy mare
  • Coder Of Tomorrow
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 5730
  • Rating: +500/-19
  • Weird programmer
    • View Profile
    • juju2143's shed
Re: Lua/HTML5 Web Interpreter
« Reply #40 on: March 30, 2013, 01:11:52 am »
Nspire Lua: not supported yet. Nor are keys in threaded mode. Yet. Aspirin: I dunno I think there's a syntax error somewhere. Also tested Bloxorz: works fine. But as I said, I still have to work on keys. Maybe test moar stuff too. Such as Opera. And other games. Did you tried the default program?
« Last Edit: March 30, 2013, 01:18:30 am by Juju »

Remember the day the walrus started to fly...

I finally cleared my sig after 4 years you're happy now?
THEGAME
This signature is ridiculously large you've been warned.

The cute mare that used to be in my avatar is Yuki Kagayaki, you can follow her on Facebook and Tumblr.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Lua/HTML5 Web Interpreter
« Reply #41 on: March 30, 2013, 01:23:42 am »
Yep and nothing at all happened either other than browser lag almost freezing Opera.

Offline Juju

  • Incredibly sexy mare
  • Coder Of Tomorrow
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 5730
  • Rating: +500/-19
  • Weird programmer
    • View Profile
    • juju2143's shed
Re: Lua/HTML5 Web Interpreter
« Reply #42 on: March 30, 2013, 01:28:31 am »
That's something I should look at, then.

Remember the day the walrus started to fly...

I finally cleared my sig after 4 years you're happy now?
THEGAME
This signature is ridiculously large you've been warned.

The cute mare that used to be in my avatar is Yuki Kagayaki, you can follow her on Facebook and Tumblr.

Offline Juju

  • Incredibly sexy mare
  • Coder Of Tomorrow
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 5730
  • Rating: +500/-19
  • Weird programmer
    • View Profile
    • juju2143's shed
Re: Lua/HTML5 Web Interpreter
« Reply #43 on: March 30, 2013, 01:21:29 pm »
It works for me in Opera 12.14, I can't move the windows though.

Also added a sample browser and some small fixes. (Hope you don't mind I've put your ball program in there Spenceboy98.)

Remember the day the walrus started to fly...

I finally cleared my sig after 4 years you're happy now?
THEGAME
This signature is ridiculously large you've been warned.

The cute mare that used to be in my avatar is Yuki Kagayaki, you can follow her on Facebook and Tumblr.

Offline Spenceboy98

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 547
  • Rating: +59/-2
    • View Profile
Re: Lua/HTML5 Web Interpreter
« Reply #44 on: March 30, 2013, 06:48:09 pm »
It works for me in Opera 12.14, I can't move the windows though.

Also added a sample browser and some small fixes. (Hope you don't mind I've put your ball program in there Spenceboy98.)

I don't mind. :) Looks good so far. :D
I like milk.