topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Tuesday October 20, 2020, 9:37 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: Brainstorm for a cross-platform programming language  (Read 1683 times)

publicdomain

  • Honorary Member
  • Joined in 2019
  • **
  • Posts: 96
  • Call me Vic!
    • View Profile
    • https://publicdomaindaily.com
    • Read more about this member.
    • Donate to Member
Brainstorm for a cross-platform programming language
« on: January 19, 2020, 11:28 PM »
Hi there! Some ideas for implementing a multi-platform programming language:

User-friendly (think AutoHotKey-like).

Emits source code in the native language of the target platform for "expected format" compilation i.e. exe on windows, apk on android, etc.

It may re-use building blocks from a solution such as Haxe or a brand-new transpiler can also be done from scratch via ANTLR + StringTemplate.

The idea being to use a native technology for the target platform at all times; using their flagship language(s) preferably:

- C#/VB.NET = Windows.
- Java/Kotlin = Android.
- C++/Vala = Linux, GTK.
- Swift = Apple-based operating systems.
- Node.js/Javascript/WebAssembly = server-side, web apps.

...You get the gist.

The core of the functions would be written using platform-neutral instructions while the GUI part would be specific to each target platform.

Think "Environment.NewLine" (automated "\n" or "\r\n") or Path.DirectorySeparatorChar (for dealing with "\" or "/") and so on.

With handy platform-neutral ways + specific GUI functionality you can have the best of both worlds across as many platforms as the industry evolves to use.

Actually, some times I wonder how much interest/support would such future-proof-oriented transpilers gather for ensuring code longevity across platforms.

Some programs are basically the same as they were decades ago! (Think in terms of the same buttons, windows, dialogs, text labels, et cetera).

These programs are basically forced to being re-coded to keep on with the current/new operating systems' way, even if there is not a single improvement in functionality(!).

i.e. I recall doing some VB6 => VB.NET conversion for an Aussie fellow maintaining the exact same functionality. Just because of a 32-bit to 64-bit requirement.

We could simply update the transpiler to support emitting new code for the "popular platform of the day", keeping the original programs fresh-looking and current for longer periods than bound to a particular single technology/framework/compiler/operating system's ways :)

EDIT: not to mention reaching more target platforms with the same code given many platforms share the same foundations, which can be a big plus on itself.

(for instance: same code-base for Windows, Linux, Mac and single-page web app)
New releases: www.PublicDomainDaily.com
Extend your support: PayPal.me/victorvls || Patreon.com/publicdomain || DonationCredits
Email: publicdomainvicgmail.com

2020 Goal: Fulfilling my full-time purpose of helping the fellows & giving to the Public Domain every day!
--Victor
« Last Edit: January 19, 2020, 11:40 PM by publicdomain »

Ath

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 3,481
    • View Profile
    • Donate to Member
Re: Brainstorm for a cross-platform programming language
« Reply #1 on: January 20, 2020, 01:39 PM »
I do like the basic (pun intended) idea you are proposing, but for platform-independence I always choose Java. The required runtime is available for a gazillion different OS's. And Java is very well known programming language across the industry, so anyone else after me can pick up maintenance/extension at will, without having to learn this new, esoteric, programming language, install required tools, runtimes, etc... :o

x16wda

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 812
  • what am I doing in this handbasket?
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: Brainstorm for a cross-platform programming language
« Reply #2 on: January 20, 2020, 07:00 PM »
I do like the basic (pun intended) idea you are proposing, but for platform-independence I always choose Java.

I despise Java (from a break/fix viewpoint at least). My cross-platform go-to (pun intended) is always Rexx.   ;D
vi vi vi - editor of the beast

Deozaan

  • Charter Member
  • Joined in 2006
  • ***
  • Points: 1
  • Posts: 9,162
    • View Profile
    • Donate to Member
Re: Brainstorm for a cross-platform programming language
« Reply #3 on: January 21, 2020, 12:02 AM »
How Programming Languages Proliferate:


wraith808

  • Supporting Member
  • Joined in 2006
  • **
  • default avatar
  • Posts: 10,694
    • View Profile
    • Donate to Member
Re: Brainstorm for a cross-platform programming language
« Reply #4 on: January 21, 2020, 10:02 AM »
Always relevant in these conversations  :Thmbsup:

KodeZwerg

  • Honorary Member
  • Joined in 2018
  • **
  • Posts: 512
    • View Profile
    • Donate to Member
Re: Brainstorm for a cross-platform programming language
« Reply #5 on: January 22, 2020, 01:14 AM »
Hi, RAD Studio (Delphi) is a language wich can compile for all major platforms, but only accepts C++ or Pascal format.
Visual Code might also do what you wrote.

Cheers
sorry bad english and Delphi are my hobby ;)
politeness is not one of my strengths in writing, just because it sounds rough doesn't mean that I mean it rough.

Deozaan

  • Charter Member
  • Joined in 2006
  • ***
  • Points: 1
  • Posts: 9,162
    • View Profile
    • Donate to Member
Re: Brainstorm for a cross-platform programming language
« Reply #6 on: January 22, 2020, 04:03 AM »
So, don't take my last post the wrong way. I don't mean to suggest that you shouldn't proceed with the idea. The idea sounds interesting and probably useful. It also sounds like a lot of work.

Either way, I'm not an expert enough programmer to be of any use on this particular project, so I'll likely not say much else in this thread. That said, I'll likely be watching with interest. :Thmbsup:

publicdomain

  • Honorary Member
  • Joined in 2019
  • **
  • Posts: 96
  • Call me Vic!
    • View Profile
    • https://publicdomaindaily.com
    • Read more about this member.
    • Donate to Member
Re: Brainstorm for a cross-platform programming language
« Reply #7 on: January 22, 2020, 06:16 PM »
Hello, good day & many thanks to all of you -fine posters- for the input!

This brainstorming thread has a worthy purpose as we're going to have such a "pdCode" project made a reality!

Chances are this very year 2020 we can reach v0.1.0 with initial/useful functionality.

So, don't take my last post the wrong way.

Rest assured it is only taken lightheartedly!

We are simply aiming at becoming useful to those who support our ways. The internet world is large enough for everybody to express freely :)

If nothing more, it can be a way for our public domain releases to remain current over time by reaching the "valid platforms of the day" via truly-native executables coming from the same code base.

...Even one (1) happy user beyond that and it's a win!

Functions and objects would be modeled largely after Microsoft's dotnet framework technology.

Code: C# [Select]
  1. pdCode
  2.         version: 0.1.0
  3.         type: console
  4.         targets: net, java, server, web, android
  5.  
  6. Program
  7.         name: "First test"
  8.         description: "Just checking the language's text mode."
  9.  
  10. Main()
  11.         // Set message
  12.         messageText = "Hello world in pdCode!"
  13.        
  14.         // Print one line
  15.         Console.WriteLine(messageText)
  16.        
  17.         // End program
  18.         return 0

It would be dynamically typed, case-insensitive, adhering to the off-side rule (indent-based) and leaning to the verbose side when in doubt --yet aiming at being succinct.

Targets would be platform-based. Any intermediary programming language output working just as a means to generate the target platform's native executable format.

User would simply issue the command:

pdcode HelloWorld.pdc

To compile the program simultaneously into:

HelloWorld.exe ← net
HelloWorld.java ← java
HelloWorld.apk ← android
HelloWorld.js ← node
HelloWorld.html ← web page with a javascript console interface

For GUI mode, it would mostly work with traditional widgets:

Code: C# [Select]
  1. pdCode
  2.         version: 0.1.0
  3.         type: gui
  4.         targets: net, gtk, java, android, web
  5.  
  6. Program
  7.         name: "First GUI app"
  8.         description: "Minimal user interface test plus an event handler."
  9.         version: 0.1.0
  10.         copyright: "John Cody Doe"
  11.         license: CC0-1.0
  12.  
  13. GUI
  14.         mainForm
  15.                 size: 277, 95
  16.                 text: "GUI test"
  17.                 startPosition: FormStartPosition.CenterScreen
  18.  
  19.                 messageLabel
  20.                         size: 253, 23
  21.                         location: 12, 19
  22.                         text: "You must close me three (3) times!"
  23.                         font: "Arial", 11.25F, FontStyle.Bold
  24.  
  25.                 closeButton
  26.                         size: 101, 33
  27.                         location: 88, 53
  28.                         text: "&Close"
  29.                         font: "Arial", 11.25F, FontStyle.Bold
  30.                         foreColor: Color.Red
  31.  
  32. // Variable for holding tries
  33. closingCount = 0
  34.  
  35. CloseButton_Click()
  36.         // Close by button
  37.         Close()
  38.  
  39. MainForm_Closing(e)
  40.         // Rise closing count
  41.         closingCount++
  42.  
  43.         if closingCount < 3
  44.                 // Advise user
  45.                 MessageBox.Show($"You have tried only {closingCount} times!", "Please try again")
  46.  
  47.                 // Prevent closing
  48.                 e.Cancel = true
      
Perhaps the GUI types being inferred from object names can be deemed a bit odd, yet it adds to the overall readability.

Also, event names are signaled by coming after an underscore (_) in the handler function.

The idea is for pdCode to find the sweet spot or via media between intent-based and traditional language.

It can also become an intermediary step in some specific scenarios (more in a new post).
New releases: www.PublicDomainDaily.com
Extend your support: PayPal.me/victorvls || Patreon.com/publicdomain || DonationCredits
Email: publicdomainvicgmail.com

2020 Goal: Fulfilling my full-time purpose of helping the fellows & giving to the Public Domain every day!
--Victor
« Last Edit: January 22, 2020, 08:50 PM by publicdomain »