OOP framework
-
- Posts: 475
- Joined: Fri May 15, 2015 5:15 pm
- Location: Waterville, Minnesota USA
OOP framework
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.
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.
I'm on registered MorphOS using FlowStudio.
Re: OOP framework
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
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
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.
Maybe you can look at Codea (https://codea.io).
It also is Lua based but you can do something like:
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
It also is Lua based but you can do something like:
Code: Select all
Local MyClass = Class()
/* ctor */
Function MyClass:init()
End
/* method declarations */
-
- Posts: 475
- Joined: Fri May 15, 2015 5:15 pm
- Location: Waterville, Minnesota USA
Re: OOP framework
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.
I'm on registered MorphOS using FlowStudio.
Re: OOP framework
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
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
-
- Posts: 475
- Joined: Fri May 15, 2015 5:15 pm
- Location: Waterville, Minnesota USA
Re: OOP framework
I've never written Lua code. That's why it's difficult for me to read the syntax.
I'm on registered MorphOS using FlowStudio.
Re: OOP framework
Hmm, OK. So you provide a plugin for this coding it in C/C++?
-
- Posts: 475
- Joined: Fri May 15, 2015 5:15 pm
- Location: Waterville, Minnesota USA
Re: OOP framework
No, it's an include file written in Hollywood.
I'm on registered MorphOS using FlowStudio.
Re: OOP framework
Ah, OK.
But Hollywood is Lua, actually. Isn't it? OK, the preprocessor replaces some things , but still.
But Hollywood is Lua, actually. Isn't it? OK, the preprocessor replaces some things , but still.
-
- Posts: 475
- Joined: Fri May 15, 2015 5:15 pm
- Location: Waterville, Minnesota USA
Re: OOP framework
Only the underpinnings are the same as Lua. The syntax and keywords are totally different.
I'm on registered MorphOS using FlowStudio.