Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Readers > More E-Book Readers > iRex > iRex Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 01-16-2009, 06:01 AM   #1
hansel
JSR FFD2
hansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheese
 
hansel's Avatar
 
Posts: 305
Karma: 1045
Join Date: Aug 2008
Location: Rotterdam, Netherlands, Europe, Sol 3
Device: iliad
Cool ANNOUNCE: Lua5.1 package for Iliad

Hello All,

I have assembled an installable package to install Lua5.1 on the Iliad. Lua is a scripting language. It is lean and mean, while being a full fledged and elegant language. It has a small memory footprint. The total install size is less than 1MB! It can do xml and network stuff. It is great to have it running on the Iliad :-)

I'll post a nice example application later (a small webserver running on the Iliad).

More details (and the sources for those who want to build the package themselves) can be found at https://dev.mobileread.com/trac/luailiad/wiki

The package file can be download here: https://dev.mobileread.com/dist/hansel/luailiad/

Have fun!

EDIT 20090404: new versions: luailiad-1.5.0, lgob-0.1.5
EDIT 20090917: new versions: lgob-iliad-0.1.7.ipk (based on lgob-9.09)

Last edited by hansel; 09-17-2009 at 03:06 PM.
hansel is offline   Reply With Quote
Old 01-16-2009, 03:44 PM   #2
Napoleon
Master of the Universe
Napoleon is on a distinguished road
 
Napoleon's Avatar
 
Posts: 54
Karma: 64
Join Date: Dec 2008
Location: Paris, France
Device: Irex Iliad 2/e
Well, well, well, I love it!
Thanks for bringing us Lua. I've got to know it when i switched from kde to ion3, and have loved it ever since. It is indeed an elegant & lean scripting language.

Gotta install it right away! Thanks again, hansel.
Napoleon is offline   Reply With Quote
Old 01-16-2009, 03:51 PM   #3
Napoleon
Master of the Universe
Napoleon is on a distinguished road
 
Napoleon's Avatar
 
Posts: 54
Karma: 64
Join Date: Dec 2008
Location: Paris, France
Device: Irex Iliad 2/e
BTW, when you say it can do network stuff, what do you mean exactly?
I've been thinking about writing something in python to parse a pdf's doi (for scientific articles) and automagically download the corresponding reference in bibtex format in order to have a well organized paper database and also to create the manifest file accordingly (title, author, journal & year). Do you think it is possible with this release of lua?

Thanks again.
Napoleon is offline   Reply With Quote
Old 01-17-2009, 05:40 AM   #4
hansel
JSR FFD2
hansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheese
 
hansel's Avatar
 
Posts: 305
Karma: 1045
Join Date: Aug 2008
Location: Rotterdam, Netherlands, Europe, Sol 3
Device: iliad
Quote:
Originally Posted by Napoleon View Post
BTW, when you say it can do network stuff, what do you mean exactly?
I've been thinking about writing something in python to parse a pdf's doi (for scientific articles) and automagically download the corresponding reference in bibtex format in order to have a well organized paper database and also to create the manifest file accordingly (title, author, journal & year). Do you think it is possible with this release of lua?.
The basic network module has all the basic network functions for tcp/udp: you can connect to hosts on the internet and talk to them. The higher level functions allow you to download files over http or ftp in a few lines of code. There are also helpers to manage MIME, URLS, etc. The docs are here: http://www.tecgraf.puc-rio.br/~diego...roduction.html

Here is how you would fetch a page:

Code:
local http = require("socket.http")

b, c = http.request("http://www.google.com/search?q=lua+iliad")

file = io.open('/tmp/page.html', 'wb')
file:write(b)   -- b is the content
file:close()

print('status= ', c)    -- 200=ok, 404=not found...
I do not know what 'pdf's doi' means... Lua has less libraries than perl or python, but it has all the basic stuff. Handling text (regexp and all the expected string functions are there). I've had no problems with the xml parser to read the Iliad registry...

Last edited by hansel; 01-17-2009 at 06:06 AM. Reason: added small example
hansel is offline   Reply With Quote
Old 01-17-2009, 05:49 AM   #5
Alexander Turcic
Fully Converged
Alexander Turcic ought to be getting tired of karma fortunes by now.Alexander Turcic ought to be getting tired of karma fortunes by now.Alexander Turcic ought to be getting tired of karma fortunes by now.Alexander Turcic ought to be getting tired of karma fortunes by now.Alexander Turcic ought to be getting tired of karma fortunes by now.Alexander Turcic ought to be getting tired of karma fortunes by now.Alexander Turcic ought to be getting tired of karma fortunes by now.Alexander Turcic ought to be getting tired of karma fortunes by now.Alexander Turcic ought to be getting tired of karma fortunes by now.Alexander Turcic ought to be getting tired of karma fortunes by now.Alexander Turcic ought to be getting tired of karma fortunes by now.
 
Alexander Turcic's Avatar
 
Posts: 17,094
Karma: 10000000
Join Date: Oct 2002
Location: Switzerland
Device: Sony PRS-650 / Nexus 7 / Kindle PW
Somehow unrelated, but I just wanted to add that a few caching features on MR's webserver go through Lua scripts. Those are every powerful and fast!
Alexander Turcic is offline   Reply With Quote
Old 01-22-2009, 03:50 PM   #6
hansel
JSR FFD2
hansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheese
 
hansel's Avatar
 
Posts: 305
Karma: 1045
Join Date: Aug 2008
Location: Rotterdam, Netherlands, Europe, Sol 3
Device: iliad
Added posix library

The luaposix library contains Lua bindings for many handy Posix functions: access, basename, chdir, chmod, chown, crypt, ctermid, dirname, dir, dup, errno, exec, execp, fdopen, fileno, files, fork, getcwd, getenv, getgroup, getlogin, getpasswd, getpid, glob, hostid, kill, link, mkdir, mkfifo, pathconf, pipe, readlink, rmdir, rpoll, setenv, setpid, sleep, stat, sysconf, times, ttyname, unlink, umask, uname, utime, wait
hansel is offline   Reply With Quote
Old 01-25-2009, 05:28 AM   #7
gwpl
Junior Member
gwpl began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Oct 2008
Device: Iliad 2nd
Thanks Man for Lua package !
Lua I one of may favourite scripting languages .
I hope with nice UI library we can make a lot of usefull software for iLiad. Especially, Lua is so lightweight !
gwpl is offline   Reply With Quote
Old 01-30-2009, 04:22 PM   #8
hansel
JSR FFD2
hansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheese
 
hansel's Avatar
 
Posts: 305
Karma: 1045
Join Date: Aug 2008
Location: Rotterdam, Netherlands, Europe, Sol 3
Device: iliad
Cool Update... GUI toolkit for Iliad

Hi All,

BREAKTHROUGH: this is really really REALLY cool!!!

I finally (after a long search, lots of downloads, lots of compile attempts) found a gui toolkit for the Iliad: UIP. It has the following properties:
  • Simple to learn
  • Lean and mean: 2 .so library files, total 0.6 MB. That's inclusive the binding for Lua. It is small because it uses the gtk libraries on the Iliad
  • Scriptable: program in Lua (if you want, C/C++ is possible), no need to compile.
  • Cross platform: you can use it to build apps for Linux / Windows, and run the same code on your Iliad

I've managed to port it to the Iliad. I'll make a decent package for it later, but I am so happy now that I wanted to let you know! I can feel the karma already ;-)

Have a look here to see what this is all about...
I think that this toolkit (in combination with Lua and Antartica's xepdmgr) boost the development of small smart apps for the Iliad.

Have fun!

Last edited by hansel; 01-30-2009 at 05:03 PM.
hansel is offline   Reply With Quote
Old 01-30-2009, 10:27 PM   #9
ericshliao
Guru
ericshliao will become famous soon enoughericshliao will become famous soon enoughericshliao will become famous soon enoughericshliao will become famous soon enoughericshliao will become famous soon enoughericshliao will become famous soon enough
 
Posts: 973
Karma: 687
Join Date: Nov 2007
Device: Dell X51v; iLiad v2
Fascinating!!! You are really brilliant.
I know the difficulity because I tried to port PyGTK once. And I gave up.
ericshliao is offline   Reply With Quote
Old 01-30-2009, 10:56 PM   #10
BTolputt
Junior Member
BTolputt began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Jan 2009
Device: iLiad
I've actually used this library before (I'm a big fan and frequent user of Lua), I'm interested in seeing an application running on the iLiad though; even if it is just the samples.
BTolputt is offline   Reply With Quote
Old 01-31-2009, 02:03 AM   #11
ericshliao
Guru
ericshliao will become famous soon enoughericshliao will become famous soon enoughericshliao will become famous soon enoughericshliao will become famous soon enoughericshliao will become famous soon enoughericshliao will become famous soon enough
 
Posts: 973
Karma: 687
Join Date: Nov 2007
Device: Dell X51v; iLiad v2
I haven't tried to make a GUI program in LUA, but I have a question:
Can I access GDK and Pango lib (they are fundamental lib of GTK+) in LUA? Being able to access GTK widget is good, but I still need some function provided by GDK and Pango.

Added:
There seemed a Lua-Gnome project several years ago. But this project was stopped.

Last edited by ericshliao; 01-31-2009 at 02:10 AM.
ericshliao is offline   Reply With Quote
Old 01-31-2009, 02:57 AM   #12
hansel
JSR FFD2
hansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheese
 
hansel's Avatar
 
Posts: 305
Karma: 1045
Join Date: Aug 2008
Location: Rotterdam, Netherlands, Europe, Sol 3
Device: iliad
Quote:
Fascinating!!! You are really brilliant. I know the difficulty...
Thanks. That's what I tried to explain to my wife

If ported FOX once. http://www.mobileread.com/forums/showthread.php?t=28733. That was easy because it only depends on X11. I've also ported Ruby (easy) and the FOX binding FXRuby but it resulted in huge libraries (Full Ruby was a 6MB install, FOX about 5 MB), but the FXRuby lib was 16MB ). IUP is really small. I was lucky that the Iliad's gtk was good enough (=gtk 2.6).
Quote:
Originally Posted by ericshliao View Post
I haven't tried to make a GUI program in LUA, but I have a question:
Can I access GDK and Pango lib (they are fundamental lib of GTK+) in LUA? Being able to access GTK widget is good, but I still need some function provided by GDK and Pango.
You cannot access GDK and Pango from IUP: it's an abstraction layer on top of them. You CAN access anything written in C from Lua, but you have to write the bindings yourself. If its only a few functions it is not difficult at all...
Quote:
There seemed a Lua-Gnome project several years ago. But this project was stopped.
If spend a few evening trying to port Lua-Gnome (or Lua-Gtk). Pros: it gives access to gtk, gdk, pango, etc... ('Currently about 7600 functions and 700 structures'). Cons: hard to build, it probably depends on more recent versions of the gtk libs (quite a task to build for the Iliad). It also depends on some tools (cpp2xml) that depend on gcc4...
Quote:
Originally Posted by BTolputt View Post
I've actually used this library before (I'm a big fan and frequent user of Lua), I'm interested in seeing an application running on the iLiad though; even if it is just the samples.
I have run one of the samples on my Iliad (with a radio button). I'll do a decent (documented) build when I have some more time, and publish it here with some screen shots. I'm also running a small webserver on my Iliad (without gui of course): http://www.mobileread.com/forums/showthread.php?t=36799, but I guess you are looking for a IUP example...

Last edited by hansel; 01-31-2009 at 03:36 AM.
hansel is offline   Reply With Quote
Old 01-31-2009, 06:53 AM   #13
BTolputt
Junior Member
BTolputt began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Jan 2009
Device: iLiad
Yeah, I was after an example of the GUI running on the iLiad. I already know about the web-server

I'd also like to know (empirically) how IUP works out in the refresh sense (as Minimo for example runs fine, but looks crap without decent refresh on eInk screen).
BTolputt is offline   Reply With Quote
Old 01-31-2009, 08:06 AM   #14
Antartica
Evangelist
Antartica has learned how to read e-booksAntartica has learned how to read e-booksAntartica has learned how to read e-booksAntartica has learned how to read e-booksAntartica has learned how to read e-booksAntartica has learned how to read e-booksAntartica has learned how to read e-books
 
Posts: 415
Karma: 754
Join Date: Jun 2006
Location: Madrid, Spain
Device: iliad, onhandpc, newton, zaurus
Quote:
Originally Posted by hansel View Post
BREAKTHROUGH: this is really really REALLY cool!!!

I finally (after a long search, lots of downloads, lots of compile attempts) found a gui toolkit for the Iliad: UIP.
Wow... that's relly great. Congrats.

I'm eager to try it... Being able to do scripted GUI on the iliad opens a lot of usefullness and easy experimentation. Wow again.
Antartica is offline   Reply With Quote
Old 01-31-2009, 08:22 AM   #15
hansel
JSR FFD2
hansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheese
 
hansel's Avatar
 
Posts: 305
Karma: 1045
Join Date: Aug 2008
Location: Rotterdam, Netherlands, Europe, Sol 3
Device: iliad
Quote:
Originally Posted by BTolputt View Post
I'd also like to know (empirically) how IUP works out in the refresh sense (as Minimo for example runs fine, but looks crap without decent refresh on eInk screen).
Refresh will always be a bit ugly... with xepdmgr it will work without programming effort and a small delay (say 1-2 sec). without it the refresh must be programmed in the application.
hansel is offline   Reply With Quote
Reply

Tags
gtk+, iliad, lgob, lua, networking, xml

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Pandigital announce the black Novel Nate the great News 0 08-18-2010 05:21 PM
iLiad China iLiad users can get developer package. ericshliao iRex Developer's Corner 35 03-20-2010 05:21 AM
iLiad Announce: Glade4Lua, develop graphical apps for the Iliad hansel iRex Developer's Corner 1 10-27-2009 05:00 PM
Sony to announce colour e-book ? markiehill News 11 08-22-2009 12:45 PM
Proud to announce our new moderator! Alexander Turcic Announcements 5 12-08-2003 11:18 PM


All times are GMT -4. The time now is 02:33 PM.


MobileRead.com is a privately owned, operated and funded community.