9front - general discussion about 9front
 help / color / mirror / Atom feed
* lua9: lua interpreter with plan9 bindings
@ 2020-10-27  8:20 telephil9
  2020-10-27 10:34 ` [9front] " Iruatã Souza
  2020-10-28 11:06 ` Ethan Gardener
  0 siblings, 2 replies; 8+ messages in thread
From: telephil9 @ 2020-10-27  8:20 UTC (permalink / raw)
  To: 9front

Hi,

Building on the lua port by staalmannen (http://github.com/staalmannen/lua), I wrote a custom version of the lua interpreter including bindings to some plan9 libraries.
I feel that lua is a simple (and good enough) scripting language which makes writing GUI code more convenient than in C.
For the time being, this includes bindings for libdraw but I plan to extend this to other plan9 libraries in the future (libplumb for instance).

The code along with documentation and samples is available here:
http://github.com/telephil9/lua9

Suggestions or contributions are welcome.

Regards,
Philippe



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [9front] lua9: lua interpreter with plan9 bindings
  2020-10-27  8:20 lua9: lua interpreter with plan9 bindings telephil9
@ 2020-10-27 10:34 ` Iruatã Souza
  2020-10-27 10:41   ` telephil9
  2020-10-28 11:06 ` Ethan Gardener
  1 sibling, 1 reply; 8+ messages in thread
From: Iruatã Souza @ 2020-10-27 10:34 UTC (permalink / raw)
  To: 9front

On Tue, Oct 27, 2020 at 9:20 AM <telephil9@gmail.com> wrote:
>
> Hi,
>
> Building on the lua port by staalmannen (http://github.com/staalmannen/lua), I wrote a custom version of the lua interpreter including bindings to some plan9 libraries.
> I feel that lua is a simple (and good enough) scripting language which makes writing GUI code more convenient than in C.
> For the time being, this includes bindings for libdraw but I plan to extend this to other plan9 libraries in the future (libplumb for instance).
>

Nice work!
I imagine you wrote a custom interpreter because Plan 9 does not have
a well established dynamic library mechanism. Do you plan on embedding
everything into the interpreter?


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [9front] lua9: lua interpreter with plan9 bindings
  2020-10-27 10:34 ` [9front] " Iruatã Souza
@ 2020-10-27 10:41   ` telephil9
  2020-10-28 20:47     ` raingloom
  2020-10-29 12:09     ` Ethan Gardener
  0 siblings, 2 replies; 8+ messages in thread
From: telephil9 @ 2020-10-27 10:41 UTC (permalink / raw)
  To: iru.muzgo, 9front

> On Tue, Oct 27, 2020 at 9:20 AM <telephil9@gmail.com> wrote:
>>
>> Hi,
>>
>> Building on the lua port by staalmannen (http://github.com/staalmannen/lua), I wrote a custom version of the lua interpreter including bindings to some plan9 libraries.
>> I feel that lua is a simple (and good enough) scripting language which makes writing GUI code more convenient than in C.
>> For the time being, this includes bindings for libdraw but I plan to extend this to other plan9 libraries in the future (libplumb for instance).
>>
> 
> Nice work!
> I imagine you wrote a custom interpreter because Plan 9 does not have
> a well established dynamic library mechanism. Do you plan on embedding
> everything into the interpreter?

Thanks.
Yes, the lack of dynamic library loading gives no other choice than embedding everything in the interpreter.
This is the reason why I wrote this instead of lua modules as you would find on other platforms.



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [9front] lua9: lua interpreter with plan9 bindings
  2020-10-27  8:20 lua9: lua interpreter with plan9 bindings telephil9
  2020-10-27 10:34 ` [9front] " Iruatã Souza
@ 2020-10-28 11:06 ` Ethan Gardener
  1 sibling, 0 replies; 8+ messages in thread
From: Ethan Gardener @ 2020-10-28 11:06 UTC (permalink / raw)
  To: 9front

On Tue, Oct 27, 2020, at 8:20 AM, telephil9@gmail.com wrote:
> Building on the lua port by staalmannen 
> (http://github.com/staalmannen/lua), I wrote a custom version of the 
> lua interpreter including bindings to some plan9 libraries.

Good stuff! My biggest issue with Plan 9 is all the different scripting languages with their different syntaxes. I longed for a single language I could do everything in. There is C, of course, and it's a nicer C than any other platform, but... it's not suited to my aptitudes.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [9front] lua9: lua interpreter with plan9 bindings
  2020-10-27 10:41   ` telephil9
@ 2020-10-28 20:47     ` raingloom
  2020-10-29  6:33       ` telephil9
  2020-10-29 12:09     ` Ethan Gardener
  1 sibling, 1 reply; 8+ messages in thread
From: raingloom @ 2020-10-28 20:47 UTC (permalink / raw)
  To: 9front

On Tue, 27 Oct 2020 11:41:38 +0100
telephil9@gmail.com wrote:

> > On Tue, Oct 27, 2020 at 9:20 AM <telephil9@gmail.com> wrote:  
> >>
> >> Hi,
> >>
> >> Building on the lua port by staalmannen
> >> (http://github.com/staalmannen/lua), I wrote a custom version of
> >> the lua interpreter including bindings to some plan9 libraries. I
> >> feel that lua is a simple (and good enough) scripting language
> >> which makes writing GUI code more convenient than in C. For the
> >> time being, this includes bindings for libdraw but I plan to
> >> extend this to other plan9 libraries in the future (libplumb for
> >> instance). 
> > 
> > Nice work!
> > I imagine you wrote a custom interpreter because Plan 9 does not
> > have a well established dynamic library mechanism. Do you plan on
> > embedding everything into the interpreter?  
> 
> Thanks.
> Yes, the lack of dynamic library loading gives no other choice than
> embedding everything in the interpreter. This is the reason why I
> wrote this instead of lua modules as you would find on other
> platforms.
> 

Do you plan on porting it from APE to native Plan 9 libaries?
That would allow native code to link to liblua.a.

I have a WIP port that does that, but I have other projects that need
my attention more.

Personally, I'd love to use Lua instead of Acid's rather limited
scripting language, that's my biggest motivation for writing the port.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [9front] lua9: lua interpreter with plan9 bindings
  2020-10-28 20:47     ` raingloom
@ 2020-10-29  6:33       ` telephil9
  2020-10-29 11:38         ` Iruatã Souza
  0 siblings, 1 reply; 8+ messages in thread
From: telephil9 @ 2020-10-29  6:33 UTC (permalink / raw)
  To: 9front

> On Tue, 27 Oct 2020 11:41:38 +0100
> telephil9@gmail.com wrote:
> 
>> > On Tue, Oct 27, 2020 at 9:20 AM <telephil9@gmail.com> wrote:  
>> >>
>> >> Hi,
>> >>
>> >> Building on the lua port by staalmannen
>> >> (http://github.com/staalmannen/lua), I wrote a custom version of
>> >> the lua interpreter including bindings to some plan9 libraries. I
>> >> feel that lua is a simple (and good enough) scripting language
>> >> which makes writing GUI code more convenient than in C. For the
>> >> time being, this includes bindings for libdraw but I plan to
>> >> extend this to other plan9 libraries in the future (libplumb for
>> >> instance). 
>> > 
>> > Nice work!
>> > I imagine you wrote a custom interpreter because Plan 9 does not
>> > have a well established dynamic library mechanism. Do you plan on
>> > embedding everything into the interpreter?  
>> 
>> Thanks.
>> Yes, the lack of dynamic library loading gives no other choice than
>> embedding everything in the interpreter. This is the reason why I
>> wrote this instead of lua modules as you would find on other
>> platforms.
>> 
> 
> Do you plan on porting it from APE to native Plan 9 libaries?
> That would allow native code to link to liblua.a.
> 
> I have a WIP port that does that, but I have other projects that need
> my attention more.
> 
> Personally, I'd love to use Lua instead of Acid's rather limited
> scripting language, that's my biggest motivation for writing the port.

That was not the initial plan but I have been thinking about it lately as it would
also give access to more libraries (main interest would be 9p).
I might give this a shot in the upcoming weeks.



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [9front] lua9: lua interpreter with plan9 bindings
  2020-10-29  6:33       ` telephil9
@ 2020-10-29 11:38         ` Iruatã Souza
  0 siblings, 0 replies; 8+ messages in thread
From: Iruatã Souza @ 2020-10-29 11:38 UTC (permalink / raw)
  To: 9front

On Thu, Oct 29, 2020 at 7:33 AM <telephil9@gmail.com> wrote:
> That was not the initial plan but I have been thinking about it lately as it would
> also give access to more libraries (main interest would be 9p).
> I might give this a shot in the upcoming weeks.
>

If you need 9p in Lua, I have written https://github.com/iru-/lua9p.
So far it is client only, but I'd love to add server support
(contributions are more than welcome!).


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [9front] lua9: lua interpreter with plan9 bindings
  2020-10-27 10:41   ` telephil9
  2020-10-28 20:47     ` raingloom
@ 2020-10-29 12:09     ` Ethan Gardener
  1 sibling, 0 replies; 8+ messages in thread
From: Ethan Gardener @ 2020-10-29 12:09 UTC (permalink / raw)
  To: 9front

On Tue, Oct 27, 2020, at 10:41 AM, telephil9@gmail.com wrote:
> 
> Yes, the lack of dynamic library loading gives no other choice than 
> embedding everything in the interpreter.
> This is the reason why I wrote this instead of lua modules as you would 
> find on other platforms.

I once considered implementing libraries in the interpreted language, (Forth in my case,) interacting with the files in /dev, but I realized a big C binary is better. Plan 9 only loads the parts of the binary which are needed, so there's no disadvantage to a big binary. If I remember right, it also shares the text segment when you load multiple instances, saving memory.


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-10-29 12:09 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-27  8:20 lua9: lua interpreter with plan9 bindings telephil9
2020-10-27 10:34 ` [9front] " Iruatã Souza
2020-10-27 10:41   ` telephil9
2020-10-28 20:47     ` raingloom
2020-10-29  6:33       ` telephil9
2020-10-29 11:38         ` Iruatã Souza
2020-10-29 12:09     ` Ethan Gardener
2020-10-28 11:06 ` Ethan Gardener

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).