DonationCoder.com forum
 
Read-only archive. This is a static copy of the DonationCoder.com forum. Reading and searching work as before; logging in, posting and private messages do not.
Archive of 2026-10-21 · About this archive · Main site

Author Topic: Brainstorm for a cross-platform programming language  (Read 13,582 times)

publicdomain

  • Honorary Member
  • Joined in 2019
  • **
  • Posts: 732
    • Participated in NANY Challenge Three Times
    • Linux User
Brainstorm for a cross-platform programming language
« on: January 20, 2020, 05:28 AM »
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)
« Last Edit: January 20, 2020, 05:40 AM by publicdomain »

Ath

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 3,649
    • Participated in NANY Challenge Eleven Times
    • Coding Snacks
    • Linux User
    • Hardware Hacker
Re: Brainstorm for a cross-platform programming language
« Reply #1 on: January 20, 2020, 07: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
/Ton
Ath's software collection, Quote: "A problem well stated is a problem half-solved." (Charles Kettering)

x16wda

  • what am I doing in this handbasket?
  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 888
    • Participated in NANY Challenge Once
Re: Brainstorm for a cross-platform programming language
« Reply #2 on: January 21, 2020, 01:00 AM »
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
  • ***
  • Posts: 9,827
    • Participated in NANY Challenge Eight Times
    • Cody Award
Re: Brainstorm for a cross-platform programming language
« Reply #3 on: January 21, 2020, 06:02 AM »
How Programming Languages Proliferate:

wraith808

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 11,205
    • Participated in NANY Challenge Fourteen Times
    • Coding Snacks
    • Writer
    • Hardware Hacker
Re: Brainstorm for a cross-platform programming language
« Reply #4 on: January 21, 2020, 04:02 PM »
Always relevant in these conversations  :Thmbsup:

KodeZwerg

  • Honorary Member
  • Joined in 2018
  • **
  • Posts: 718
    • Participated in NANY Challenge Four Times
    • Coding Snacks
Re: Brainstorm for a cross-platform programming language
« Reply #5 on: January 22, 2020, 07: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

Deozaan

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 9,827
    • Participated in NANY Challenge Eight Times
    • Cody Award
Re: Brainstorm for a cross-platform programming language
« Reply #6 on: January 22, 2020, 10: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: 732
    • Participated in NANY Challenge Three Times
    • Linux User
Re: Brainstorm for a cross-platform programming language
« Reply #7 on: January 23, 2020, 12:16 AM »
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 2021 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: (csharp)
pdCode
	version: 0.1.0
	type: console
	targets: net, java, server, web, android

Program
	name: "First test"
	description: "Just checking the language's text mode."

Main()
	// Set message
	messageText = "Hello world in pdCode!"
	
	// Print one line
	Console.WriteLine(messageText)
	
	// End program
	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:

Code
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: (csharp)
pdCode
	version: 0.1.0
	type: gui
	targets: net, gtk, java, android, web

Program
	name: "First GUI app"
	description: "Minimal user interface test plus an event handler."
	version: 0.1.0
	copyright: "John Cody Doe"
	license: CC0-1.0

GUI
	mainForm
		size: 277, 95
		text: "GUI test"
		startPosition: FormStartPosition.CenterScreen

		messageLabel
			size: 253, 23
			location: 12, 19
			text: "You must close me three (3) times!"
			font: "Arial", 11.25F, FontStyle.Bold

		closeButton
			size: 101, 33
			location: 88, 53
			text: "&Close"
			font: "Arial", 11.25F, FontStyle.Bold
			foreColor: Color.Red

// Variable for holding tries
closingCount = 0

CloseButton_Click()
	// Close by button
	Close()

MainForm_Closing(e)
	// Rise closing count
	closingCount++

	if closingCount < 3
		// Advise user
		MessageBox.Show($"You have tried only {closingCount} times!", "Please try again")

		// Prevent closing
		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).
« Last Edit: January 03, 2021, 08:20 PM by publicdomain »

Original address: https://www.donationcoder.com/forum/index.php?topic=49417.0