Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email
?
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Home
About
Team
Rules
Stats
Status
Sitemap
Chat
Downloads
Forum
News
Our Projects
Major Community Projects
Recent Posts
Unread Posts
Replies
Tools
SourceCoder3
Other Things...
Omnimaga Radio
TI-83 Plus ASM File Unsquisher
Z80 Conversion Tools
IES TI File Editor
Free RAM areas
Comprehensive Getkeyr table
URL Shortener
Online Axe Tilemap Editor
Help
Contact Us
Change Request
Report Issue/Bug
Team
Articles
Members
View the memberlist
Search For Members
Buddies
Login
Register
Omnimaga
»
Forum
»
General Discussion
»
Technology and Development
»
Web Programming and Design
»
Lua/HTML5 Web Interpreter
« previous
next »
Print
Pages: [
1
]
2
3
4
Go Down
Author
Topic: Lua/HTML5 Web Interpreter (Read 23636 times)
0 Members and 1 Guest are viewing this topic.
Juju
Incredibly sexy mare
Coder Of Tomorrow
LV13
Extreme Addict (Next: 9001)
Posts: 5730
Rating: +500/-19
Weird programmer
Lua/HTML5 Web Interpreter
«
on:
February 17, 2013, 09:30:52 pm »
Was bored today, so I made this. It's a Lua interpreter (based on
lua.js
) with a library that works with a HTML5 canvas. Some functions are implemented and I'm slowly implementing more. At the end, it should support both Nspire Lua and LuaZM graphic functions. (Obviously, suggestions are open
)
Documentation
dofile(url) - Asynchronously executes a remote file. Ex.: Try dofile("
http://juju2143.ca/test.lua
")
gc.drawLine(x1, y1, x2, y2)
gc.drawRect(x, y, w, h)
gc.fillRect(x, y, w, h)
gc.setColorRGB(r, g, b) - Same as their Nspire counterparts
zmg.time()
zmg.ticks() - Same as their LuaZM counterparts
Known issues
-
Backspace might not work as expected in some browsers, for some reason.
- dofile() is asynchonous and doesn't lock the terminal while the AJAX thing runs, so print() might print in the input.
- Infinite loops will crash your browser
http://juju2143.ca/lua
«
Last Edit: February 18, 2013, 02:50:07 am by Juju
»
Logged
+1/-0 karm for this message
Remember the day the walrus started to fly...
I finally cleared
my sig
after 4 years you're happy now?
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
.
Sorunome
Fox Fox Fox Fox Fox Fox Fox!
Support Staff
LV13
Extreme Addict (Next: 9001)
Posts: 7920
Rating: +374/-13
Derpy Hooves
Re: Lua/HTML5 Web Interpreter
«
Reply #1 on:
February 17, 2013, 10:46:28 pm »
nice so far!
print("THE GAME")
Logged
THE GAME
Also, check out
my website
If OmnomIRC is screwed up, blame me!
Click here to give me an internet!
Spenceboy98
LV7
Elite (Next: 700)
Posts: 547
Rating: +59/-2
Re: Lua/HTML5 Web Interpreter
«
Reply #2 on:
February 17, 2013, 11:07:47 pm »
You should make it support LuaZM so I can test my programs.
It works nicely, but as you said, Backspace doesn't work.
* Spenceboy98 lost.
«
Last Edit: February 17, 2013, 11:08:28 pm by Spenceboy98
»
Logged
I like milk.
Juju
Incredibly sexy mare
Coder Of Tomorrow
LV13
Extreme Addict (Next: 9001)
Posts: 5730
Rating: +500/-19
Weird programmer
Re: Lua/HTML5 Web Interpreter
«
Reply #3 on:
February 17, 2013, 11:18:29 pm »
Backspace works now. Apparently the compacted version of termlib.js is broke, but not the non-compacted version.
And yeah good idea it should also support LuaZM.
EDIT: Every Nspire Lua and LuaZM graphics function are implemented as stubs. Unless I actually implemented them.
«
Last Edit: February 17, 2013, 11:44:07 pm by Juju
»
Logged
Remember the day the walrus started to fly...
I finally cleared
my sig
after 4 years you're happy now?
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
.
Juju
Incredibly sexy mare
Coder Of Tomorrow
LV13
Extreme Addict (Next: 9001)
Posts: 5730
Rating: +500/-19
Weird programmer
Re: Lua/HTML5 Web Interpreter
«
Reply #4 on:
February 25, 2013, 01:02:42 pm »
Update bump. Added an editor (type run() in the terminal to run the code, if you add an argument it runs like dofile(file)) and a windowing system. Resizing windows doesn't work though, so don't try.
I guess I could rename this to "Lua/HTML5 Web IDE" as I now aim for an IDE-like functionality, now that I added an editor.
«
Last Edit: February 25, 2013, 01:05:04 pm by Juju
»
Logged
Remember the day the walrus started to fly...
I finally cleared
my sig
after 4 years you're happy now?
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
.
DJ Omnimaga
Clacualters are teh gr33t
CoT Emeritus
LV15
Omnimagician (Next: --)
Posts: 55943
Rating: +3154/-232
CodeWalrus founder & retired Omnimaga founder
Re: Lua/HTML5 Web Interpreter
«
Reply #5 on:
February 25, 2013, 01:13:25 pm »
This is very interesting. Do you plan much calculator support such as for LuaZM, Nspire Lua and maybe CPLua? Something that would be cool in long terms if you do is the option to develop for the first two at once so it's easier to modify files to port them over the other calc.
Logged
Juju
Incredibly sexy mare
Coder Of Tomorrow
LV13
Extreme Addict (Next: 9001)
Posts: 5730
Rating: +500/-19
Weird programmer
Re: Lua/HTML5 Web Interpreter
«
Reply #6 on:
February 25, 2013, 01:18:45 pm »
I'm aiming for a complete LuaZM simulator with this (as at least 2 people requested), then I could also add Nspire Lua support (with the help of Jim Bauwens). For CPLua, well I wasn't even aware it existed and I have no ClassPad, so I can't really tell. Same for LuaFX, support for it would also be nice.
Oh, I forgot, you can resize the canvas with canvas.mode(mode) or canvas.mode(width, height) where mode is a constant ("nspire", "prizm" or "big").
«
Last Edit: February 25, 2013, 01:22:08 pm by Juju
»
Logged
+1/-0 karm for this message
Remember the day the walrus started to fly...
I finally cleared
my sig
after 4 years you're happy now?
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
.
Adriweb
Editor
LV10
31337 u53r (Next: 2000)
Posts: 1708
Rating: +229/-17
Re: Lua/HTML5 Web Interpreter
«
Reply #7 on:
February 25, 2013, 01:23:18 pm »
Very nice.
I hope you can work with Jim so that it'd be a great all-in-oen tool for Nspire-Lua too.
At one point, can you consider making an API or something so that it can be integrated on other websites (thinking of TI-Planet
), etc. ?
Also, can you implement by defauls 'class' ? (
http://wiki.inspired-lua.org/class()
)
And I've noticed that when there is an error, it doesnt show the line, can you make it do that ?
Logged
My calculator programs
TI-Planet.org
co-admin.
TI-Nspire Lua programming
:
Tutorials
|
API Documentation
Juju
Incredibly sexy mare
Coder Of Tomorrow
LV13
Extreme Addict (Next: 9001)
Posts: 5730
Rating: +500/-19
Weird programmer
Re: Lua/HTML5 Web Interpreter
«
Reply #8 on:
February 25, 2013, 01:29:38 pm »
Yeah, an integration API will be a pretty good idea.
class can be implemented by default kinda easily (next update?) and AFAIK it actually shows where is the error when there's one. Well, at least on Google Chrome. (What do you mean?)
Logged
Remember the day the walrus started to fly...
I finally cleared
my sig
after 4 years you're happy now?
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
.
Adriweb
Editor
LV10
31337 u53r (Next: 2000)
Posts: 1708
Rating: +229/-17
Re: Lua/HTML5 Web Interpreter
«
Reply #9 on:
February 25, 2013, 02:03:25 pm »
Cool
I meant that it doesnt show (for me, on Chrome, too), at what line of the text the error is (here, 5) :
«
Last Edit: February 25, 2013, 02:03:38 pm by adriweb
»
Logged
My calculator programs
TI-Planet.org
co-admin.
TI-Nspire Lua programming
:
Tutorials
|
API Documentation
Juju
Incredibly sexy mare
Coder Of Tomorrow
LV13
Extreme Addict (Next: 9001)
Posts: 5730
Rating: +500/-19
Weird programmer
Re: Lua/HTML5 Web Interpreter
«
Reply #10 on:
February 25, 2013, 02:13:12 pm »
Ah, yeah, you're right. But it will tell the line number if you made a syntax error (try removing a parenthesis).
Logged
Remember the day the walrus started to fly...
I finally cleared
my sig
after 4 years you're happy now?
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
.
Sorunome
Fox Fox Fox Fox Fox Fox Fox!
Support Staff
LV13
Extreme Addict (Next: 9001)
Posts: 7920
Rating: +374/-13
Derpy Hooves
Re: Lua/HTML5 Web Interpreter
«
Reply #11 on:
February 25, 2013, 07:04:23 pm »
Mhmm, will you be able to import stuff like luasockets and run IRC bots?
Logged
THE GAME
Also, check out
my website
If OmnomIRC is screwed up, blame me!
Click here to give me an internet!
Juju
Incredibly sexy mare
Coder Of Tomorrow
LV13
Extreme Addict (Next: 9001)
Posts: 5730
Rating: +500/-19
Weird programmer
Re: Lua/HTML5 Web Interpreter
«
Reply #12 on:
February 25, 2013, 08:10:39 pm »
Probably not. I guess.
Also you'll like the new sample preloaded in the editor.
«
Last Edit: February 25, 2013, 08:10:55 pm by Juju
»
Logged
Remember the day the walrus started to fly...
I finally cleared
my sig
after 4 years you're happy now?
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
.
DJ Omnimaga
Clacualters are teh gr33t
CoT Emeritus
LV15
Omnimagician (Next: --)
Posts: 55943
Rating: +3154/-232
CodeWalrus founder & retired Omnimaga founder
Re: Lua/HTML5 Web Interpreter
«
Reply #13 on:
February 25, 2013, 08:22:00 pm »
Will we see screenshots of game running soon?
Logged
Juju
Incredibly sexy mare
Coder Of Tomorrow
LV13
Extreme Addict (Next: 9001)
Posts: 5730
Rating: +500/-19
Weird programmer
Re: Lua/HTML5 Web Interpreter
«
Reply #14 on:
February 25, 2013, 08:34:24 pm »
I guess, yeah. Only clipRect and key* are left to implement in the zmg library, then you'll be able to run all your favorite LuaZM games.
Logged
Remember the day the walrus started to fly...
I finally cleared
my sig
after 4 years you're happy now?
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
.
Print
Pages: [
1
]
2
3
4
Go Up
« previous
next »
Omnimaga
»
Forum
»
General Discussion
»
Technology and Development
»
Web Programming and Design
»
Lua/HTML5 Web Interpreter