LC to C# conversion

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

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

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:41 am

stam wrote:
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.
Simply existing won’t draw in users <- is exactly right!

But OXT doesn't have to 'compete', because it isn't a commercial product, and I'll keep trying to sustain the LC CE based engine and perhaps other FOSS xTalk engines too, as long as I can still breath.

>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.

I didn't come in here to talk OXT (as I pretty much gave my word that I wouldn't), I came for the OOP/Inheritance discussion.
However since its already being talked about here, I will just say that OXT is NOT just an unbranded Community Edition IDE, and I don't intend for it to ever become stagnant. Although the differentiating un-brand bits has been a primary focus for the first year +, it has in fact already become a different thing from LC CE 9.6.3, including more/different graphics resources, new/ different features, and bug fixes, beyond the state that it was left in Sept. 2021. And I'm still working on it every chance I get.
My GitHub Repos: https://github.com/PaulMcClernan/
Related YouTube Videos: PlayList

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

Re: LC to C# conversion

Post by stam » Thu May 18, 2023 8:45 am

Sure, you can *recreate* an app in C#; but you can't translate the LC app automatically into a C# app - or probably *any* c-style language.
I have seen very good translators from from example XOJO to Swift - put in XOJO code and get accurate Swift code. But you can't do that with LC because it's too different.
As you say, you'd need to first learn C# and then *recreate* the app. Same goes for practically any other non-x-talk language...

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9579
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: LC to C# conversion

Post by dunbarx » Thu May 18, 2023 6:14 pm

Jacque.
No existing AI today knows LC (that's what Xavvi is for.
Haven't I seen Chat GPT make very decent LC handlers?

Craig

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

Re: LC to C# conversion

Post by richmond62 » Thu May 18, 2023 6:59 pm

Why do I think this is a rather pointless thread: LC and C# are totally different beasts.

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9802
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: LC to C# conversion

Post by FourthWorld » Thu May 18, 2023 7:01 pm

jacque wrote:
Thu May 18, 2023 5:50 pm
No existing AI today knows LC (that's what Xavvi is for.)
Generative systems "know" no language. They embody a statistical likelihood of what will follow given what they have to work with.

It's true, as the TIOBE index quantifies, that the training set for languages like JavaScript is orders of magnitude larger than what's available for LC. So yes, expectations of complete runnable code will require extensive investment from our friends' small business in Edinburgh. Whether this will be the thing that finally makes LC a popular choice for learning a programming language, or further entrench the lead JavaScript and others have, is the question this experiment will answer.

But in the meantime we have comfort on both sides:

All code generated today, even that for the most popular languages, is expected to merit review and revision by experts before being deemed suitable for production.

And like all the others, ChatGPT and similar systems can be enjoyed today for generated starting points for LC as with other languages.

These forums, the LC list, and LC's blog provide many examples of how we can incorporate generative tech into our workflows.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9802
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: LC to C# conversion

Post by FourthWorld » Thu May 18, 2023 7:12 pm

richmond62 wrote:
Thu May 18, 2023 6:59 pm
Why do I think this is a rather pointless thread: LC and C# are totally different beasts.
They're all programming languages. I can't fault someone for having a use case that prompts them to consider moving from one system to another. And while we script in LC, the engine is written in C++; there may be much that doesn't need to be translated as much as tossed, given the engine's existing capabilities.

Even some of what might be left after pruning may not need to be translated. Much of that probably isn't driving the UI, and may be a good candidate to be wrapped and recompiled as externals.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

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

Re: LC to C# conversion

Post by richmond62 » Thu May 18, 2023 7:50 pm

Yes, they are both programming languages, but of such different types it might be easier and quicker to recreate the functionality of a program written in one language in the other than develop a huge, cumbersome translation routine.

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

Re: LC to C# conversion

Post by PaulDaMacMan » Fri Jun 02, 2023 2:45 am

stam wrote:
Thu May 18, 2023 8:45 am
Sure, you can *recreate* an app in C#; but you can't translate the LC app automatically into a C# app - or probably *any* c-style language.
I have seen very good translators from from example XOJO to Swift - put in XOJO code and get accurate Swift code. But you can't do that with LC because it's too different.
As you say, you'd need to first learn C# and then *recreate* the app. Same goes for practically any other non-x-talk language...
I don't see why it couldn't be done if the will and energy was there.
There are transpilers out there I've seen from BASIC to C (FutureBASIC does this for example) as an intermediate step when compiling a platform native binary.

"No existing AI today knows LC (that's what Xavvi is for.)"

ChatGPT can write xTalk script AND extension builder scripts with a bit of training it. I had it fairly quickly making simple basic valid scripts, as well having it translate those into Python or JavaScript. So... I'm really NOT sure what Xavvi is for, unless it comes pre-trained on LC language and has an offline dataset?
My GitHub Repos: https://github.com/PaulMcClernan/
Related YouTube Videos: PlayList

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

Re: LC to C# conversion

Post by stam » Fri Jun 02, 2023 7:56 am

PaulDaMacMan wrote:
Fri Jun 02, 2023 2:45 am
I don't see why it couldn't be done if the will and energy was there.
There are transpilers out there I've seen from BASIC to C (FutureBASIC does this for example) as an intermediate step when compiling a platform native binary.
Right… so yeah sure. As the underling engine is written in a C language you could of course express everything as a C language.
Not sure that’s within the scope of “normal” users.

For sure individual algorithms could to some extent be transcoded, but the amount work work that would be needed to create equivalent code from LC would be phenomenal - to the extent that it may actually be easier to write a new language. Which I guess is probably how LCB was born.

Think of it: in LC we have many coding conveniences handed to us. Simple keywords like “each” and commands like “filter” don’t exist - at least not the same “filter” command you can apply to arrays, text or any container. You would have to create a huge amount of C# code to cater for all such conveniences in all their permutations.

So while theoretically possible, maybe, logistically this effort would exceed what any one person could do (which is what this thread is about) and I can’t see a reason for LC inc. to consider this…

Re:Xavvi: my understanding is that this was built before AI was a thing, as a low-code/no-code tool for LC. As it is a lot simpler, AI can be used for most tasks and Xavvi handles the generation of clean LC code, as that was its original purpose, if I’ve understood correctly.

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
Joined: Mon Jan 22, 2007 7:36 am
Location: Berkeley, CA, US
Contact:

Re: LC to C# conversion

Post by mwieder » Sun Jun 04, 2023 3:52 am

Paul- Recreating the business logic of an app is certainly doable, but creating the LC engine and the controls etc would be quite a task.
I've done Rosetta-Stone-style algorithm converters between e.g. LC and Basic, Java, etc but I wouldn't try anything as major an undertaking as cross-compiling a whole application.

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

Re: LC to C# conversion

Post by Xero » Mon Jun 05, 2023 12:38 pm

Having looked into what I want to do, there is definitely a schism between the two types of code that I am sure wouldn't be easily translated, unless you knew both languages. It might be easier with some operations, like filtering arrays, but dealing with pixel data seems to be vastly different.
In LC, yould extract all of the data of an image and then count out multiples of 4 of the data to find a certain pixel in line. 4 bits of info for each pixel, the Alpha, Red, Green and Blue channels, so item 1, 5, 9 etc are the alpha data for the first 3 pixels...
In C#, you just say pixel 1,1 (note that it's done line and column), and ask for the alpha channel "pixel(1,1).alpha" or something of the like... don't quote me, I haven't learnt C# enough yet!
Essentially, you do different things to get to the same point. It would be like taking a map of Disneyland and trying to use it to get to the front gate from Australia. You can see where the ending is, but the map shows you the wrong way to get there. It would take an understanding of what you are doing to convert the two and I am not sure AI etc. is quite at the point of understanding on that level.

Post Reply

Return to “Off-Topic”