OOP framework

Discuss any general programming issues here
SamuraiCrow
Posts: 475
Joined: Fri May 15, 2015 5:15 pm
Location: Waterville, Minnesota USA

OOP framework

Post 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.
I'm on registered MorphOS using FlowStudio.
asrael
Posts: 31
Joined: Mon Jul 23, 2018 6:57 pm

Re: OOP framework

Post 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
asrael
Posts: 31
Joined: Mon Jul 23, 2018 6:57 pm

Re: OOP framework

Post 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 */
SamuraiCrow
Posts: 475
Joined: Fri May 15, 2015 5:15 pm
Location: Waterville, Minnesota USA

Re: OOP framework

Post 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. :D
I'm on registered MorphOS using FlowStudio.
asrael
Posts: 31
Joined: Mon Jul 23, 2018 6:57 pm

Re: OOP framework

Post 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
SamuraiCrow
Posts: 475
Joined: Fri May 15, 2015 5:15 pm
Location: Waterville, Minnesota USA

Re: OOP framework

Post by SamuraiCrow »

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.
asrael
Posts: 31
Joined: Mon Jul 23, 2018 6:57 pm

Re: OOP framework

Post by asrael »

Hmm, OK. So you provide a plugin for this coding it in C/C++?
SamuraiCrow
Posts: 475
Joined: Fri May 15, 2015 5:15 pm
Location: Waterville, Minnesota USA

Re: OOP framework

Post by SamuraiCrow »

No, it's an include file written in Hollywood.
I'm on registered MorphOS using FlowStudio.
asrael
Posts: 31
Joined: Mon Jul 23, 2018 6:57 pm

Re: OOP framework

Post by asrael »

Ah, OK.
But Hollywood is Lua, actually. Isn't it? OK, the preprocessor replaces some things , but still.
SamuraiCrow
Posts: 475
Joined: Fri May 15, 2015 5:15 pm
Location: Waterville, Minnesota USA

Re: OOP framework

Post by SamuraiCrow »

Only the underpinnings are the same as Lua. The syntax and keywords are totally different.
I'm on registered MorphOS using FlowStudio.
Post Reply