Click here to Skip to main content
15,844,011 members
Home / Discussions / Algorithms
   

Algorithms

 
GeneralRe: Aide pour un programme langage c Pin
Eddy Vluggen12-Nov-22 12:04
professionalEddy Vluggen12-Nov-22 12:04 
GeneralRe: Aide pour un programme langage c Pin
trønderen13-Nov-22 15:03
trønderen13-Nov-22 15:03 
GeneralRe: Aide pour un programme langage c Pin
Gerry Schmitz15-Nov-22 9:09
mveGerry Schmitz15-Nov-22 9:09 
JokeRe: Aide pour un programme langage c Pin
Richard Deeming14-Nov-22 23:40
mveRichard Deeming14-Nov-22 23:40 
GeneralRe: Aide pour un programme langage c Pin
jschell14-Nov-22 6:46
jschell14-Nov-22 6:46 
GeneralRe: Aide pour un programme langage c Pin
k505414-Nov-22 7:45
mvek505414-Nov-22 7:45 
GeneralRe: Aide pour un programme langage c Pin
trønderen14-Nov-22 9:33
trønderen14-Nov-22 9:33 
GeneralRe: Aide pour un programme langage c Pin
jschell29-Dec-22 12:48
jschell29-Dec-22 12:48 
trønderen wrote:
The syntax was defined using abstract tokens that could be mapped to various sets of concrete tokens.


In Computer Science the area of Compiler Theory is very old and very well studied.

Your statement is describing something that well designed compilers (and interpreters) already do. Only time I have ever seen a 'compiler' not do that it was coded by someone who had zero training in how the science of Compilers.

As I suggested before the problem is not in creating tokens. The problem is in creating the language in the first place such that it is deterministic and second it creating a compiler that can report errors. That last part is the most substantial part of every modern compiler (even toy ones.)

trønderen wrote:
If the source code was rather stored as abstract tokens,


Parsing text into tokens is the first part of what all compilers/interpreters do.

Following is one source of the very well known process Compilers already do.

Compiler Design - Phases of Compiler[^]

What you are describing does not have anything to do with the actual problem.

English version of a standard (very standard) part of programming languages

if x then y


Now the French version

si x alors y


So in the above for just two natural languages you now have 4 keywords in the language.

Lets add Swedish

om x så y


So for every language added it is reasonable to expect that the number of keywords would be duplicated. Keywords often cannot be used in code both because it makes it much harder for the compiler to figure it out and for it to correctly report on errors. Additionally even when the context allows the compiler to figure it out it does not make it ideal for human maintenance.

Consider the following statement. If one was using a different native language to drive the compiler then the following should be legal. But in the english version do you really want to see this code?

int if = 0;


So not only would the number of keywords increase but the programmer would still need to be aware of all of those keywords while coding.

Now besides the increasing number of keywords the following are some of the problems that I see.
1. Two programmers are working on the same file. The file MUST be syntactically correct before developer A (English) goes on vacation. Because otherwise the mechanism (code) that must translate it back from the english form will not work when Developer B is french.
2. Comments cannot be supported.
3. Third party APIs would still require whatever is supported by by the 3rd party service (library, Rest, TCP, whatever.)
4. Adding new languages to the compiler after first release would mean that existing applications could break because existing code might use them. This also is a well known problem that exists right now when new functionality is added to an existing compiler. So all known languages would need to be supported on first release.
GeneralRe: Aide pour un programme langage c Pin
trønderen30-Dec-22 7:57
trønderen30-Dec-22 7:57 
GeneralRe: Aide pour un programme langage c Pin
jschell2-Jan-23 14:14
jschell2-Jan-23 14:14 
GeneralRe: Aide pour un programme langage c Pin
trønderen3-Jan-23 15:39
trønderen3-Jan-23 15:39 
GeneralRe: Aide pour un programme langage c Pin
jschell10-Jan-23 7:17
jschell10-Jan-23 7:17 
GeneralRe: Aide pour un programme langage c Pin
jsc4211-Jan-23 5:33
professionaljsc4211-Jan-23 5:33 
GeneralRe: Aide pour un programme langage c Pin
trønderen11-Jan-23 7:23
trønderen11-Jan-23 7:23 
GeneralRe: Aide pour un programme langage c Pin
Victor Nijegorodov11-Jan-23 7:30
Victor Nijegorodov11-Jan-23 7:30 
GeneralRe: Aide pour un programme langage c Pin
trønderen11-Jan-23 8:05
trønderen11-Jan-23 8:05 
GeneralRe: Aide pour un programme langage c Pin
jsc4212-Jan-23 6:50
professionaljsc4212-Jan-23 6:50 
GeneralRe: Aide pour un programme langage c Pin
trønderen14-Nov-22 10:12
trønderen14-Nov-22 10:12 
QuestionAppropriate Algorithm for Influencers Ranking Pin
learn zhishi5-Sep-22 21:01
learn zhishi5-Sep-22 21:01 
AnswerRe: Appropriate Algorithm for Influencers Ranking Pin
Gerry Schmitz29-Oct-22 14:32
mveGerry Schmitz29-Oct-22 14:32 
GeneralWhere To Begin - Excel Manipulation Pin
(Mike) ipscone 19-May-22 13:14
(Mike) ipscone 19-May-22 13:14 
GeneralRe: Where To Begin - Excel Manipulation Pin
Richard MacCutchan19-May-22 21:53
mveRichard MacCutchan19-May-22 21:53 
GeneralRe: Where To Begin - Excel Manipulation Pin
(Mike) ipscone 20-May-22 6:22
(Mike) ipscone 20-May-22 6:22 
GeneralRe: Where To Begin - Excel Manipulation Pin
Richard MacCutchan20-May-22 6:35
mveRichard MacCutchan20-May-22 6:35 
GeneralRe: Where To Begin - Excel Manipulation Pin
(Mike) ipscone 20-May-22 11:38
(Mike) ipscone 20-May-22 11:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.