LC to C# conversion

Want to talk about something that isn't covered by another category?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9250
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: LC to C# conversion

Post by richmond62 » Tue Mar 21, 2023 1:56 pm

Message deleted as it just repeated something posted earlier. :?
Last edited by richmond62 on Tue Mar 21, 2023 1:58 pm, edited 1 time in total.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9250
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: LC to C# conversion

Post by richmond62 » Tue Mar 21, 2023 1:57 pm

So, I take it you haven't tried the ChatGPT thing?

Xero
Posts: 152
Joined: Sat Jun 23, 2018 2:22 pm

Re: LC to C# conversion

Post by Xero » Tue Mar 21, 2023 2:12 pm

richmond62 wrote:
Tue Mar 21, 2023 1:57 pm
So, I take it you haven't tried the ChatGPT thing?
No... from what I have seen of Chat GPT it's good for telling you how to make a fruit salad out of fruit, but much more complex than that and it will struggle. :D This is one of those breaking ground things that it can't just trawl the internet for the answer and regurgitate it, so I am not sure it will be useful.
XdM

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9250
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: LC to C# conversion

Post by richmond62 » Tue Mar 21, 2023 2:42 pm

Nothing wrong with fruit salad.

But I get your point.

However, some folk were suggesting it could write LiveCode . . .

stam
Posts: 2599
Joined: Sun Jun 04, 2006 9:39 pm
Location: London, UK

Re: LC to C# conversion

Post by stam » Wed Mar 22, 2023 10:07 pm

NoN' wrote:
Mon Mar 20, 2023 2:04 pm
I've been wondering for a long time - probably very naively - about "inheritance" in Livecode.
We regularly read that there is no inheritance in LC. But can't/shouldn't we consider that the "start using" command constitutes a declaration of inheritance?
The called stack then becomes the base class and the calling stack becomes the derived class?
Sorry for the late answer - too much 'actual' work ;)

You can kinda do what you say, and in fact it's been explored in detail:
Part 1: http://newsletters.livecode.com/novembe ... etter2.php
Part 2: http://newsletters.livecode.com/novembe ... etter2.php

So yes, while you can emulate aspects of OOP with inheritance, in practice it becomes more work that it's worth IMHO - it's not native to the language, and therefore requires a lot of effort from the developer... Now perhaps that would be a good target for OpenXTalk's development...

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9250
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: LC to C# conversion

Post by richmond62 » Thu Mar 23, 2023 9:05 am

Now perhaps that would be a good target for OpenXTalk's development...Now perhaps that would be a good target for OpenXTalk's development...
As far as I understand, at he moment, ALL that OXT is aiming at is an unlabelled version of the last community release of LC.
therefore requires a lot of effort from the developer
I would have thought that that sort of effort would need to be driven by the stimulus of potential financial gain.

stam
Posts: 2599
Joined: Sun Jun 04, 2006 9:39 pm
Location: London, UK

Re: LC to C# conversion

Post by stam » Thu Mar 23, 2023 9:13 am

This is, as you may have guessed, the point of my comment.

Simply existing won’t draw in users. IMHO if OXT is to become sustainable, thrive and draw in more developers and users it has to offer something above and beyond rather than being a pale imitation.
Given the resources that LC have, competing on a feature by feature basis is going to be hard.

However the tools for an OOP approach are there; just not encouraged by the language and IDE. If OXT were to change that it may actually be a preferable destination for many… if marketing itself as object-oriented xTalk that would, I suspect, be a selling point for many non-LC-users.

Or maybe not - but just being a “free” pale imitation will only work for so long and then slowly disappear I suspect.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9250
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: LC to C# conversion

Post by richmond62 » Thu Mar 23, 2023 9:19 am

I have a feeling that this is NOT the right place to discuss OXT [in fact the list-Mum has told me that directly], so it might
be sensible to either restart it or continue it on the OXT Forums.

https://openxtalk.org/forum/viewtopic.php?f=2&t=457

NoN'
Posts: 75
Joined: Thu Jul 03, 2008 9:56 pm
Location: Paris
Contact:

Re: LC to C# conversion

Post by NoN' » Sun Mar 26, 2023 12:35 pm

"Sorry for the late answer - too much 'actual' work ;)"

Hello

@ Stam, It is my turn to be sorry for this late reply. What is curious is that I was not notified of your answer (?!).

And above all, I also apologize to Xero for diverting the course of his initial question.

Renaud

stam
Posts: 2599
Joined: Sun Jun 04, 2006 9:39 pm
Location: London, UK

Re: LC to C# conversion

Post by stam » Sun Mar 26, 2023 2:42 pm

NoN' wrote:
Sun Mar 26, 2023 12:35 pm
And above all, I also apologize to Xero for diverting the course of his initial question.
Don't think it's a diversion really - the OP was a question about how to convert LCscript (a non-OOP language) to C# (an OOP language) - so to do this one would necessarily have to view the differences. Of course the actual question asked turned out to be a bit different, but that was the OP ;)

Your question (now that I re-read it) was asking if 'start using' is a form if inheritance - well for me the answer has to be 'no'. It's just a library call, that's not what OOP/inheritance means... In no way does it substantiate a class, you cannot subclass a library or apply interfaces to it. The links I provided actually do show a good way to implement OOP structures in LC, but as neither the IDE nor language are geared towards this, it's a lot of hassle to implement (for now - perhaps the rumoured new widgets from LC groups will change that).

S.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9250
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: LC to C# conversion

Post by richmond62 » Sun Mar 26, 2023 3:10 pm

rumoured
Well after 10 months of apparent stagnation I would tend to ignore rumours and work with what we have.

stam
Posts: 2599
Joined: Sun Jun 04, 2006 9:39 pm
Location: London, UK

Re: LC to C# conversion

Post by stam » Sun Mar 26, 2023 3:13 pm

With that logic none of the things we paid for (ie v10) will come to pass!
I remain an optimist ;)
But admittedly an optimist with patience :)

NoN'
Posts: 75
Joined: Thu Jul 03, 2008 9:56 pm
Location: Paris
Contact:

Re: LC to C# conversion

Post by NoN' » Sun Mar 26, 2023 3:42 pm

Thank you, Stam, for this very precise answer.

Renaud

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9250
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: LC to C# conversion

Post by richmond62 » Sun Mar 26, 2023 7:04 pm

Some of "the things we paid for" were supposed to manifest themselves in the Open Source version,
for which quite a few people donated sums of money.

PaulDaMacMan
Posts: 616
Joined: Wed Apr 24, 2013 4:53 pm
Contact:

Re: LC to C# conversion

Post by PaulDaMacMan » Tue Apr 11, 2023 2:13 am

stam wrote:
Wed Mar 22, 2023 10:07 pm
NoN' wrote:
Mon Mar 20, 2023 2:04 pm
I've been wondering for a long time - probably very naively - about "inheritance" in Livecode.
We regularly read that there is no inheritance in LC. But can't/shouldn't we consider that the "start using" command constitutes a declaration of inheritance?
The called stack then becomes the base class and the calling stack becomes the derived class?
Sorry for the late answer - too much 'actual' work ;)

You can kinda do what you say, and in fact it's been explored in detail:
Part 1: http://newsletters.livecode.com/novembe ... etter2.php
Part 2: http://newsletters.livecode.com/novembe ... etter2.php

So yes, while you can emulate aspects of OOP with inheritance, in practice it becomes more work that it's worth IMHO - it's not native to the language, and therefore requires a lot of effort from the developer... Now perhaps that would be a good target for OpenXTalk's development...
I'd say that, although xTalk language did arrive before the prevalence of Object Oriented C's (Objective C / C++), it's always felt very, sort of proto-OOP to me. And there has been various syntax added by different xTalk implementations over the years that have provided capabilities needed for doing OOP things ( object, aka 'controls', custom property for example, associative arrays for 'struct'-like data containers, etc.).

Extension Builder Widgets can maybe be thought of as custom objects too, they have their own methods or custom implementations of common methods.

The engine DOES in fact use inheritance to fill in property values when the property hasn't already been explicitly set, for example things like font or default foreColor, backColor, highlight colors , etc. will be inherited in order from text<field<-card<-stack<-window<-app(engine)<-operating system. Notice the 'use owner's font' or 'use owner's color' in the font menus, selecting those menu items tells the engine to use an inherited value for that property.
My GitHub Repos: https://github.com/PaulMcClernan/
Related YouTube Videos: PlayList

Post Reply

Return to “Off-Topic”