to be, or not to be, a programming language
to be, or not to be, a programming language
i was working on a project and a really big question hit me,
what makes a programming language, a programming language?
what makes a programming language, a programming language?
Re: to be, or not to be, a programming language
Anything that doesn't fit that definition is not a programming language.Wikipedia (EN) wrote:A programming language is a machine-readable artificial language designed to express computations that can be performed by a machine, particularly a computer. Programming languages can be used to create programs that specify the behavior of a machine, to express algorithms precisely, or as a mode of human communication.
Or do you mean as opposed to a scripting language?
- Firestryke31
- Member
- Posts: 550
- Joined: Sat Nov 29, 2008 1:07 pm
- Location: Throw a dart at central Texas
- Contact:
Re: to be, or not to be, a programming language
The ability to be translated into the machine code that the computer understands.
I'm sure that a form of English could be made into a computer language if someone were to write a compiler.
Edit: Blarg, too slow. Second part still works, though.
I'm sure that a form of English could be made into a computer language if someone were to write a compiler.
Edit: Blarg, too slow. Second part still works, though.
Owner of Fawkes Software.
Wierd Al wrote: You think your Commodore 64 is really neato,
What kind of chip you got in there, a Dorito?
Re: to be, or not to be, a programming language
well, i was working on macros for the fasm assembler, mainly for development on my operating system, and some people consider a script or include library to be a programming language, how can a bunch of macros be a programming language?
>> well all in all, does it have to be something that does not require fasm? stand alone? <<
>> well all in all, does it have to be something that does not require fasm? stand alone? <<
Re: to be, or not to be, a programming language
You could have a programming language that compiles the language down into assembly statements. This is basically what GCC does. It takes the language, converts it to a processor-independent intermediate language, then to assembly, than calls GAS to assemble that.
Formally, assembler is a programming language, but is just not considered one in an informal sense. There's no reason why a complicated-enough set of assembler macros could not be considered a programming language. Most people would start making the distinction when the new language requires a new tool (the compiler) to compile the macros and so on, instead of using the assembler's built-in macro processing rules.
Formally, assembler is a programming language, but is just not considered one in an informal sense. There's no reason why a complicated-enough set of assembler macros could not be considered a programming language. Most people would start making the distinction when the new language requires a new tool (the compiler) to compile the macros and so on, instead of using the assembler's built-in macro processing rules.
Re: to be, or not to be, a programming language
thats not a bad idea, i might try that, if big problems show up in my os, i might just stick with making a script or just a developers include file of macrosYou could have a programming language that compiles the language down into assembly statements. This is basically what GCC does. It takes the language, converts it to a processor-independent intermediate language, then to assembly, than calls GAS to assemble that.
i will keep that in mind or keep that as reference just in case i forget (stupid me) or for anyone else who tries to pretend that they have their own programming languageFormally, assembler is a programming language, but is just not considered one in an informal sense. There's no reason why a complicated-enough set of assembler macros could not be considered a programming language. Most people would start making the distinction when the new language requires a new tool (the compiler) to compile the macros and so on, instead of using the assembler's built-in macro processing rules.
anyway though,
Thanks for the responses
Re: to be, or not to be, a programming language
I'd say it becomes a programming language in its own right when the syntax is changed sufficiently. When someone good at assembler would stop felling like "this is Assembler with GhostXoPCorp-o-Macros", and start feeling like "this is hostXoPCorp-o-Language. Funny thing is it doesn't need a compiler on its own, only FASM and this here include library."GhostXoPCorp wrote:well, i was working on macros for the fasm assembler, mainly for development on my operating system, and some people consider a script or include library to be a programming language, how can a bunch of macros be a programming language?
Every good solution is obvious once you've found it.
Re: to be, or not to be, a programming language
i got the point, thanks thoughi might just stick with making a script or just a developers include file of macros
- NickJohnson
- Member
- Posts: 1249
- Joined: Tue Mar 24, 2009 8:11 pm
- Location: Sunnyvale, California
Re: to be, or not to be, a programming language
Maybe you could say it's a dialect of FASM instead of a new language altogether, just like LISP has many dialects that can all be derived from one another using the macro system. I think one of the major criteria for having a new language instead of an extension or dialect is that it is no longer backwards compatible with the original language (C++ is pretty close, but not perfectly backwards compatible with C.)
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Re: to be, or not to be, a programming language
I think a dialect is the proper term when a programmer who is familiar with a dialect of a language, can easily pick up another dialect of that language and put that to good use.
Which doesn't hold for C vs C++/ObjC/D (thanks to adding object oriented programming)
Which doesn't hold for C vs C++/ObjC/D (thanks to adding object oriented programming)
Re: to be, or not to be, a programming language
Well, I don't think it's so bad an analogy.
C++ adds quite something to the C language proper (and yes, it changes some things too, but I'll ignore them for the sake of the point). But if you can do C, you can do (the C subset of) C++, too. You don't have to use the things C++ adds, and (almost) everything that was there in C is there in C++, too.
Same for GhostXoPCorp's macro set. It adds to FASM, but everything FASM can do is still there. Anyone who can do FASM can do GhostXoPCorp Macro Language, just without the macros. (No more pointless than doing only the C subset of C++.)
C++ adds quite something to the C language proper (and yes, it changes some things too, but I'll ignore them for the sake of the point). But if you can do C, you can do (the C subset of) C++, too. You don't have to use the things C++ adds, and (almost) everything that was there in C is there in C++, too.
Same for GhostXoPCorp's macro set. It adds to FASM, but everything FASM can do is still there. Anyone who can do FASM can do GhostXoPCorp Macro Language, just without the macros. (No more pointless than doing only the C subset of C++.)
Every good solution is obvious once you've found it.
Re: to be, or not to be, a programming language
then it would be to easy and some of us may not get jobs as easy cuz every one could do it >_<Firestryke31 wrote:I'm sure that a form of English could be made into a computer language if someone were to write a compiler.
Lol, think of this,
Code: Select all
move the number 129 into the AX thingy, then
make the value ax ax into some weird thing, then
just clear the screen because I feel like it.
My hero, is Mel.
Re: to be, or not to be, a programming language
It could be possible.. The compiler itself would have to learn, and there would still be a "standard library"
There is a reason an english compiler will never be created though. It would not be useful, as it is extremely verbose, about like an extreme version of COBOL. English is also not precise enough to describe a program without being ambiguous or making assumptions..
Code: Select all
moving memory:
To move memory, copy source memory to target memory. Increment both of those, and repeat until executed as many times as needed.
....
to refresh the screen:
move the memory from video buffer to address 0xb8000 80*25*2 times.
-
- Member
- Posts: 2566
- Joined: Sun Jan 14, 2007 9:15 pm
- Libera.chat IRC: miselin
- Location: Sydney, Australia (I come from a land down under!)
- Contact:
Re: to be, or not to be, a programming language
The problem is that English varies across countries (spelling and use of words, slang, etc...) and is far too ambiguous for use in programming. Tone and context can change the meaning of words, not to mention the fact that there are so many different ways to say the same idea.
The only way to make an English programming language would be to enforce a strict subset of the language. At which point you get something a lot like BASIC
The only way to make an English programming language would be to enforce a strict subset of the language. At which point you get something a lot like BASIC
Re: to be, or not to be, a programming language
You don't have to go all the way to a plain English parser. It doesn't take much to make a script / shell interface more intuitive.
AmigaDOS:
copy src to dest all
Copy ALL from SRC to DEST
COPY TO=dest ALL FROM=src.txt
All three commands to the same. Case insensitive, non-abbreviated both in command and in options, with optional "from" and "to" keywords so there's not only "one true way" of writing the command, and you don't have to remember which way around the parameters need to be put. (From - to is intuitive, but then the whole C standard library has it the other way 'round...)
And if the OS provides such an easy way to parse those options... Using an actual coding example from the Amiga Guru Book, slightly simplified and commented (and please remember that this API predated the first edition of "The C++ Programming Language" by about a year, so don't complain about C-style strings and memory handling):
AmigaDOS:
copy src to dest all
Copy ALL from SRC to DEST
COPY TO=dest ALL FROM=src.txt
All three commands to the same. Case insensitive, non-abbreviated both in command and in options, with optional "from" and "to" keywords so there's not only "one true way" of writing the command, and you don't have to remember which way around the parameters need to be put. (From - to is intuitive, but then the whole C standard library has it the other way 'round...)
And if the OS provides such an easy way to parse those options... Using an actual coding example from the Amiga Guru Book, slightly simplified and commented (and please remember that this API predated the first edition of "The C++ Programming Language" by about a year, so don't complain about C-style strings and memory handling):
Code: Select all
int main()
{
// This will be used to iterate through "from" files vector
char const * const * p;
// Handle for handling memory used by function
struct RDArgs *rda;
// One array element per template element
LONG vec[3] = {};
// Third parameter to ReadArgs() can be a struct RDArgs
// holding e.g. additional help text to be displayed on 'copy ?'
if ( ( rda = ReadArgs( "From/M,To/A,All/S", vec, NULL ) ) != NULL )
{
// 'From/M' - 'From' is the keyword, '/M' means "multi",
// i.e. return type is an array of char pointers.
// Because 'From/M' was the first element in the template,
// the pointer to that array is the first element in the return vector.
// Array of char pointers ends with a NULL element.
if ( ( p = ( char const * const *)vec[0] ) != NULL )
{
for ( ; *p != NULL; ++p )
{
printf( "File = %s\n", *p );
}
}
// 'To/A' - 'To' is the keyword, '/A' means it is compulsory
// to provide this option. No multi, so return type is a pointer
// to a C string. Second template entry, second array element.
printf( "To = %s\n", (char const *)vec[1] );
// 'All/S' - 'All' is the keyword, '/S' means it is a switch.
// Return type is a boolean.
printf( "All = %s\n", vec[2] ? "TRUE" : "FALSE" );
// ReadArgs() had to store the parsed tokens somewhere, so
// we have to release them.
FreeArgs( rda );
}
else
{
printf( "Error while parsing options.\n" );
}
return 0;
}
Every good solution is obvious once you've found it.