OOP framework

Discuss any general programming issues here
SamuraiCrow
Posts: 173
Joined: Fri May 15, 2015 5:15 pm
Location: Ft. Collins, Colorado USA

OOP framework

Post by SamuraiCrow » Tue Aug 14, 2018 1:40 pm

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.

asrael
Posts: 20
Joined: Mon Jul 23, 2018 6:57 pm

Re: OOP framework

Post by asrael » Tue Aug 14, 2018 7:34 pm

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: 20
Joined: Mon Jul 23, 2018 6:57 pm

Re: OOP framework

Post by asrael » Tue Aug 14, 2018 7:58 pm

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: 173
Joined: Fri May 15, 2015 5:15 pm
Location: Ft. Collins, Colorado USA

Re: OOP framework

Post by SamuraiCrow » Tue Aug 14, 2018 11:27 pm

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

asrael
Posts: 20
Joined: Mon Jul 23, 2018 6:57 pm

Re: OOP framework

Post by asrael » Wed Aug 15, 2018 8:33 am

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: 173
Joined: Fri May 15, 2015 5:15 pm
Location: Ft. Collins, Colorado USA

Re: OOP framework

Post by SamuraiCrow » Wed Aug 15, 2018 10:55 am

I've never written Lua code. That's why it's difficult for me to read the syntax.

asrael
Posts: 20
Joined: Mon Jul 23, 2018 6:57 pm

Re: OOP framework

Post by asrael » Wed Aug 15, 2018 11:00 am

Hmm, OK. So you provide a plugin for this coding it in C/C++?

SamuraiCrow
Posts: 173
Joined: Fri May 15, 2015 5:15 pm
Location: Ft. Collins, Colorado USA

Re: OOP framework

Post by SamuraiCrow » Wed Aug 15, 2018 3:19 pm

No, it's an include file written in Hollywood.

asrael
Posts: 20
Joined: Mon Jul 23, 2018 6:57 pm

Re: OOP framework

Post by asrael » Wed Aug 15, 2018 5:15 pm

Ah, OK.
But Hollywood is Lua, actually. Isn't it? OK, the preprocessor replaces some things , but still.

SamuraiCrow
Posts: 173
Joined: Fri May 15, 2015 5:15 pm
Location: Ft. Collins, Colorado USA

Re: OOP framework

Post by SamuraiCrow » Wed Aug 15, 2018 5:47 pm

Only the underpinnings are the same as Lua. The syntax and keywords are totally different.

Post Reply