Page 1 of 3
OOP framework
Posted: Tue Aug 14, 2018 1:40 pm
by SamuraiCrow
Posting in the unit-test thread reminded me of an attempt to write a framework of object oriented code like that of Java or the latest version of JavaScript that I started some time ago. I'm trying to decide how or whether to proceed.
What are some of your favorite frameworks and the OOP languages they are written in? I'm more familiar with classical OOP than alternative ones in early JavaScript monads. Also, name some of your least favorite OOP implementations and frameworks.
Re: OOP framework
Posted: Tue Aug 14, 2018 7:34 pm
by asrael
I'm using Scala, Java, Kotlin, C#, Objective-C, Swift and others.
Where Scala I'm using the most.
All of them except Objective-C are statically typed, so not really comparable with Lua/Hollywood.
I believe that all of them except Scala do not allow multi-inheritance.
I do not like multi-inheritance. Scala does allow it only though so called 'mix-ins' which are traits, interfaces that can contain implementation.
https://docs.scala-lang.org/tour/mixin- ... ition.html
That is something I find pretty neat.
Manfred
Re: OOP framework
Posted: Tue Aug 14, 2018 7:58 pm
by asrael
But generally, I think, keep it simple.
For the most part it would be great to remove the boilerplate-code necessary to define a class.
Code: Select all
Function SomeClass:new (o)
o = o or {}
setmetatable(o, self)
self.__index = self
return o
EndFunction
Maybe you can look at Codea (
https://codea.io).
It also is Lua based but you can do something like:
Code: Select all
Local MyClass = Class()
/* ctor */
Function MyClass:init()
End
/* method declarations */
Re: OOP framework
Posted: Tue Aug 14, 2018 11:27 pm
by SamuraiCrow
So far the code I have written has interface support and single inheritance. I don't recognize the Lua syntax of your posts but it looks good in Hollywood.

Re: OOP framework
Posted: Wed Aug 15, 2018 8:33 am
by asrael
That sounds good.
What do you mean with you don't recognise the Lua syntax of my posts?
The former or the later?
The former is here:
https://www.lua.org/pil/16.1.html
Manfred
Re: OOP framework
Posted: Wed Aug 15, 2018 10:55 am
by SamuraiCrow
I've never written Lua code. That's why it's difficult for me to read the syntax.
Re: OOP framework
Posted: Wed Aug 15, 2018 11:00 am
by asrael
Hmm, OK. So you provide a plugin for this coding it in C/C++?
Re: OOP framework
Posted: Wed Aug 15, 2018 3:19 pm
by SamuraiCrow
No, it's an include file written in Hollywood.
Re: OOP framework
Posted: Wed Aug 15, 2018 5:15 pm
by asrael
Ah, OK.
But Hollywood is Lua, actually. Isn't it? OK, the preprocessor replaces some things , but still.
Re: OOP framework
Posted: Wed Aug 15, 2018 5:47 pm
by SamuraiCrow
Only the underpinnings are the same as Lua. The syntax and keywords are totally different.