PLoop-Another OOP lib is ready

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

PLoop-Another OOP lib is ready

W Kurapica

I’m happy to introduce another OOP library for Lua  https://github.com/kurapica/PLoop, it provide a C# like syntax OOP system, overload method, aspect-oriented programming, full type validation and other features, it’s a little heavy one compares to the others.

 

Although this project started more than 8 years ago, but more like a toy until I decided to use it on my company’s  project, I recode it from ash in the last year, and now it’s almost production ready.  It could be helpful for enterprise projects.

 

Any advice would be appreciated.

 

-- 
Best regards, 
k

Reply | Threaded
Open this post in threaded view
|

Re: PLoop-Another OOP lib is ready

Grey Knight-2
On Monday, April 23, 2018, W Kurapica <[hidden email]> wrote:
> I'm happy to introduce another OOP library for Lua
> https://github.com/kurapica/PLoop, it provide a C# like syntax OOP system,
> overload method, aspect-oriented programming, full type validation and other
> features, it's a little heavy one compares to the others.
> Although this project started more than 8 years ago, but more like a toy
> until I decided to use it on my company's  project, I recode it from ash
> in the last year, and now it's almost production ready.  It could be
> helpful for enterprise projects.
> Any advice would be appreciated.
> --
> Best regards,
> k

--

I can definitely see the C# family resemblance.  :-)
How well does it interact with the regular Lua types?  E.g. what happens if I pass a plain string to a function expecting a System.String?

I have a couple of comments, although I didn't get time to read every detail yet:

* I like the idea of having an attribute system, I don't think I've seen that in a Lua object system before
* There are a few functions like Map, Filter, Range, ToList, Reduce, Each, Any, All, First, FirstOrDefault which I expected to be on Iterable rather than IList, why is that?  Do they produce lists rather than iterators?
* one thing I always thought C# could improve would be to have bitflags be a separate concept from enums (I think they just did it that way because C does so)
* about GetDefault(enum): another C#-ism I didn't like was that everything is defaultable.  Sometimes I have types for which there is no sensible default value, I expect the user must always provide something explicitly.
* I'm not clear on the difference between struct and class in your model
* I see that you have events in here, so that makes me happy!

--
GK


Reply | Threaded
Open this post in threaded view
|

Re: PLoop-Another OOP lib is ready

W Kurapica
In reply to this post by W Kurapica

 

To Grey Knight

 

>How well does it interact with the regular Lua types?

 

The struct system are built for value validation, any lua string can pass the System.String’s validation, there is no special data for the struct part, they are regular Lua types with contracts.

 

> There are a few functions like Map, Filter, Range, ToList, Reduce, Each, Any, All, First, FirstOrDefault which I expected to be on Iterable rather than IList, why is that?

 

Well, I diff the collections to List & Dictionary(for hash), I don’t think a dictionary can have any value as its first. So the IList is focused on the value, and the IDictionary is focused on the key-value paris.

 

> about GetDefault(enum): another C#-ism I didn't like was that everything is defaultable.  Sometimes I have types for which there is no sensible default value, I expect the user must always provide something explicitly.

 

You can find more details in the member struct, its fields can be requirable.

 

> I'm not clear on the difference between struct and class in your model.

 

The struct are designed for value validation, and also provide structures for tables who have no meta-table related, so they are simply data types, normally used as value in the system.