possible programming challenge: a smart(er) IDE?
#29
(10-15-2022, 06:42 PM)TempodiBasic Wrote: @MadSciJr

??? a MultiLanguage IDE/Translator....
but do you need to translate MID2CSV.C into QB64?
Stopping the joke.

Through vision of  Languages for programming machines

Level 0              Level  1           Level 2
Codebinary        Assembly        LowLevel Language  or
                                             Highlevel Language

Here some questions (those are point of thinking and not attacks to destroy your ideas!)

1. so we start from level2 and arrive at level2....Why do you like this kind of translator?

2. Each Language has its own compiler ... how much compilers do you want to use to get the executable of Level0?
In other words: who worked BASIC in DOS' Time, when he needed more performance got from other language's compilers (see C, TPascal, Masm or TASM) he LINKed the .obj file got from those compilers to .obj got with QB compiler and TADA it appeared the .EXE
In Windows I have no knowledge and experience to put together different codes in different languages to get one executable file.

3. Translation is an hard land, think about how many garbage comes out using Google Translator... also if in years it goes better.
In programming language field the translation is harder than in human languages. The syntax holds heavily on the way to develop the code.
So I don't believe that it is very feasible to get equivalent from a language to another.
Just an example:  
Code: (Select All)
For AA = 30 To -30 Step -10
    Select Case AA
        Case 1 To 19
            Print "CASE 1"
        Case Is > 20
            Print "CASE 2"
        Case Is > -10
            Print "CASE 3"
        Case Is < -10
            Print "CASE 4"
        Case Else
            Print "CASE 5"
    End Select
Next AA

how does it become in C? in Pascal? in Fortran? 
and in an OOP language? Java? Phyton? C++?

Or take a look at Rosetta Code website that collects  different solutions written in different programming languages for a specific task.
these are solution for printing on the screen a text message: "Hello World"
page of task Hello World of Rosetta Code website

Have a fun thinking about your ideas

Thanks for that long thought out answer! 

Here's the value of this and why I think it's worth pursing in some form (and will be more pursuable as time goes on):  

The benefit is somewhat analagous to that of the Java virtual machine, Infocom's Z-code, and .NET intermediate language, where instead of a universal format for running a program, we have a universal format for writing them. 

Where those compile to a common format that runs on an engine that is available any number of platforms, the smart IDE stores a set of instructions internally in a common source format that can be transpiled into another language. 

The internal format is a kind of intermediate language, but intermediate between source code and the compiler, instead of intermediate between the compiler and execution.  

The first version of such a system could be procedural 3rd generation languages like BASIC, Python, C, JavaScript, Pascal.  It would support a subset of functions common to all of these: 
basic variable types, multidimensional arrays, dictionary / associative array, user defined types, constants, if then, else, else if, for next loop, do loop, math operations, some basic screen modes (text, hires), drawing graphics (plot pixels, draw shapes), make sounds, read keyboard input, detect keypresses, read mouse, etc. 

Some of these functions might be readily available in all of the languages, and easy to convert, other functions we may need to get creative with. It would be limited to whatever libraries are available to the IDE that compiles the Intermediate Source into an executable. 

Assuming QB64 is our "target compiler platform", a command like 

Screen _NewImage(xmax, ymax, 32)

would be done in Python syntax when in that language, and the person would consider the QB64 commands as a library or framework. 

This first generation smart IDE would be pretty much a 1:1 translator - it's not smart enough to translate between procedural and OOP and functional, etc. 

As it gets smarter, we can teach it to translate more complicated sets of functionality by recognizing patterns in code, and translating those patterns to preconfigured target patterns, and so on. 

We can even build inbetween layers to emulate the most popular libraries for a given language. 

The benefit is you can have a team work on a program where each developer can use whatever language they want from the ones the smart IDE supports. They'll have to learn a new library, but in a language and syntax they already know. And anyone else on the team can jump into editing that code and work in their own preferred language. 

Also, code can be reused by that many more people. If you find a project you like in a translatable language, you can automatically start using it in your language.
Reply


Messages In This Thread
RE: possible programming challenge: a smart(er) IDE? - by madscijr - 10-19-2022, 02:07 AM



Users browsing this thread: 17 Guest(s)