What's a "real" programming language?
-
Myself I am waiting for that self conscious highly intelligent robot butler which is self repairing and runs for a thousand years on its internal power source. Then I could just tell it to do my job for me. And clean the kitchen. Perhaps also to chase me around the house with a stick so I get enough exercise too.
-
Bear with me, because as much as I am loath to holy roll about technology, I still have my peeves. I went about porting my DFA lexer engine from C# to TypeScript. It was primarily an exercise in teaching myself TypeScript, plus brushing up on my JS. So I implement the bones of it, and after adjusting my mental map to the JS way of doing things I got it mostly working. Then I went about trying to use a Map keyed by Sets. Turns out JS Map and Set will only compare by value for "scalar" types (presumably including strings) or otherwise it uses reference comparisons. You can't override your own equality mechanism either. how to customize object equality for javascript set - Stack Overflow[^] Consequently, there is no performant way to do subset construction to convert an NFA to a DFA in this language. I've seen others solve this problem by using string keys, but this falls down for machines of non-trivial size. Regex FA visualizer[^] is one example but I can basically crash it or stall it out for a long time at least with any non-trivial expression. This one also doesn't work properly besides, but I have no other link handy for you to try. This may be academic, but it is also basic computer science. A language should be able to allow you to implement computer sciencey algorithms and constructs - especially those that have been adapted to countless other programming languages. DFA by subset construction is basic. And you can't do it in JS. I can't even begin to imagine what LALR table generation would look like. You may be wondering why do I care? Because node.js. Because Angular Because React-Native it's not just for web front ends anymore. JS is an almost virulent technology these days. It needs to be, if not Turing complete at least cover the fundamentals, or you're just spreading garbage around. Without a way to do custom comparisons at the very least on hashed containers, your language isn't going to be able to do a lot of things other high level languages can accomplish handily. Is it even a "real" language? Is it ready for primetime, or is it just being adopted because we can? :~
Among other things, such as Turing-completeness and datatypes... with a "real" programming language, you can implement it's compiler/assembler. By this requirement, no interpreted language is a "real" programming language. But there are definitely uses for other programming languages, domain-specific languages in particular. And Operating System scripting languages. Is JavaScript a domain-specific language? I don't know, I never use it, but it seems like it might be. In my opinion, the question comes down to do we really need programming languages which are neither "real" nor "domain-specific" nor "Operating System Specific"? E.g. "portable scripting (glue) languages" such as Perl and Python. Gimli: Very handy in a tight spot, these lads
-
Assembler is the only "real" language, everything else is just syntactic sugar.
"A little song, a little dance, a little seltzer down your pants" Chuckles the clown
An assembler is what assembles an assembly language. And, of course, even that is just syntactic sugar over machine language.
-
An assembler is what assembles an assembly language. And, of course, even that is just syntactic sugar over machine language.
And machine language is only syntactic sugar over the rearrangement of charges in the CPU, memory, etc.
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows. -- 6079 Smith W.
-
And machine language is only syntactic sugar over the rearrangement of charges in the CPU, memory, etc.
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows. -- 6079 Smith W.
-
honey the codewitch wrote:
I went about porting my DFA lexer engine from C# to TypeScript
Just noting that javascript has a very feature rich regular expression support.
honey the codewitch wrote:
allow you to implement computer sciencey algorithms and constructs
Your description is incomplete. From what I read in your comment it does allow you to do it. It just is not as fast as you like/want.
honey the codewitch wrote:
is one example but I can basically crash it or stall it out for a long time at least with any non-trivial expression.
Perhaps this is your basis? Without having looked at that solution at all, I can only note that being Turing complete does not mean that the language has no bounds. That is not part of the description. And all languages would fail at that.
honey the codewitch wrote:
or is it just being adopted because we can?
I know a business that was sold for quite a bit of money which ran high performance high volume real time data processing using javascript. Not the platform I would choose and I don't know what hardware costs were. But they certainly did it some how. I doubt most others would choose that also. For complex systems one often uses a mix of technologies.
jschell wrote:
Just noting that javascript has a very feature rich regular expression support.
Can't lex, and won't fulfill the project requirements, which are "learn typescript"
jschell wrote:
Your description is incomplete. From what I read in your comment it does allow you to do it. It just is not as fast as you like/want.
There is a point where something takes too much time and space to be practical. That is a real thing. That is the issue here. So no, it's not "just not as fast as I'd like", it is not usable.
jschell wrote:
Perhaps this is your basis? Without having looked at that solution at all, I can only note that being Turing complete does not mean that the language has no bounds. That is not part of the description. And all languages would fail at that
It's not. Really none of this is relevant.
Check out my IoT graphics library here: https://honeythecodewitch.com/gfx And my IoT UI/User Experience library here: https://honeythecodewitch.com/uix
-
honey the codewitch wrote:
if an object changes, its “location” inside a collection has to change, as well. But that’s not what happens in Java. JavaScript will probably go the safer route of only enabling comparison by value for special immutable objects (so-called value objects).
I realize that is not your statement but I will note it is a silly response. In ANY language if you change the contents of a entities within a collection there is a risk that you violate the constraints of the collection. Any competent programmer that actually understands a Java HashMap (and similar) must understand the impact of attempting to change the semantics of what equals() and hashcode() actually means. I can see a Junior developer doing that. I can also see a Junior developer failing to correctly manage memory allocations in C/C++ also. But Java is not JavaScript nor are either C/C++.
honey the codewitch wrote:
But that’s not what happens in Java
That is perhaps more ludicrous. Is there any language where that happens?
I agree with you about that response. It seems like they refuse to implement the feature until they can overengineer it.
Check out my IoT graphics library here: https://honeythecodewitch.com/gfx And my IoT UI/User Experience library here: https://honeythecodewitch.com/uix
-
Among other things, such as Turing-completeness and datatypes... with a "real" programming language, you can implement it's compiler/assembler. By this requirement, no interpreted language is a "real" programming language. But there are definitely uses for other programming languages, domain-specific languages in particular. And Operating System scripting languages. Is JavaScript a domain-specific language? I don't know, I never use it, but it seems like it might be. In my opinion, the question comes down to do we really need programming languages which are neither "real" nor "domain-specific" nor "Operating System Specific"? E.g. "portable scripting (glue) languages" such as Perl and Python. Gimli: Very handy in a tight spot, these lads
PIEBALDconsult wrote:
with a "real" programming language, you can implement it's compiler/assembler
Interesting definition. So for that it would exclude C#, Java, JavaScript. But would include C/C++, Fortran and Pascal. Focusing on C# and Java they can create a binary file. It is after all just a matter of writing to a file. So they can for example create their own interpreter. Perhaps as a hack, but they can do it. They can definitely create their own compiled (byte code) files. There are actually libraries in both languages for that. So creation, to a certain extent, is not it. So it is a two step process that makes it not fit the definition? Isn't C/C++ 'built' using a compiler and then a linker? Although those can be one application the process of each is distinct. And I have certainly used systems where they were distinct applications. Additionally I can find both a Microsoft and gcc linker right now. So they still exist however they might be used. So there are still two steps. I was also wondering where Lisp fits into the above. Definitely a compiled language. But no way would I want to create a compiler using that.
-
jschell wrote:
Just noting that javascript has a very feature rich regular expression support.
Can't lex, and won't fulfill the project requirements, which are "learn typescript"
jschell wrote:
Your description is incomplete. From what I read in your comment it does allow you to do it. It just is not as fast as you like/want.
There is a point where something takes too much time and space to be practical. That is a real thing. That is the issue here. So no, it's not "just not as fast as I'd like", it is not usable.
jschell wrote:
Perhaps this is your basis? Without having looked at that solution at all, I can only note that being Turing complete does not mean that the language has no bounds. That is not part of the description. And all languages would fail at that
It's not. Really none of this is relevant.
Check out my IoT graphics library here: https://honeythecodewitch.com/gfx And my IoT UI/User Experience library here: https://honeythecodewitch.com/uix
honey the codewitch wrote:
which are "learn typescript"
lol...well yes that doesn't work.
honey the codewitch wrote:
There is a point where something takes too much time and space to be practical. That is a real thing.
At least with regular expressions, in general (so perhaps not your solution, or could be) it is possible to create ones that will never end. Or will take days to complete. So that by itself is not a determinate.
-
honey the codewitch wrote:
which are "learn typescript"
lol...well yes that doesn't work.
honey the codewitch wrote:
There is a point where something takes too much time and space to be practical. That is a real thing.
At least with regular expressions, in general (so perhaps not your solution, or could be) it is possible to create ones that will never end. Or will take days to complete. So that by itself is not a determinate.
This isn't even to run the expression, just to turn it into a state machine.
Check out my IoT graphics library here: https://honeythecodewitch.com/gfx And my IoT UI/User Experience library here: https://honeythecodewitch.com/uix
-
To be fair though the charges are not a language. Although, far as I know, all modern processors use 'micro-code'. Googling does not really answer if that is Turing Complete though.
If you can build a Turing machine out of arrangements of electron charges (which you obviously can), then I would claim that it meets my definition of computer language. We don't usually think of that as a language, but it is no more arbitrary than using certain shapes to represent letters is.
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows. -- 6079 Smith W.
-
Bear with me, because as much as I am loath to holy roll about technology, I still have my peeves. I went about porting my DFA lexer engine from C# to TypeScript. It was primarily an exercise in teaching myself TypeScript, plus brushing up on my JS. So I implement the bones of it, and after adjusting my mental map to the JS way of doing things I got it mostly working. Then I went about trying to use a Map keyed by Sets. Turns out JS Map and Set will only compare by value for "scalar" types (presumably including strings) or otherwise it uses reference comparisons. You can't override your own equality mechanism either. how to customize object equality for javascript set - Stack Overflow[^] Consequently, there is no performant way to do subset construction to convert an NFA to a DFA in this language. I've seen others solve this problem by using string keys, but this falls down for machines of non-trivial size. Regex FA visualizer[^] is one example but I can basically crash it or stall it out for a long time at least with any non-trivial expression. This one also doesn't work properly besides, but I have no other link handy for you to try. This may be academic, but it is also basic computer science. A language should be able to allow you to implement computer sciencey algorithms and constructs - especially those that have been adapted to countless other programming languages. DFA by subset construction is basic. And you can't do it in JS. I can't even begin to imagine what LALR table generation would look like. You may be wondering why do I care? Because node.js. Because Angular Because React-Native it's not just for web front ends anymore. JS is an almost virulent technology these days. It needs to be, if not Turing complete at least cover the fundamentals, or you're just spreading garbage around. Without a way to do custom comparisons at the very least on hashed containers, your language isn't going to be able to do a lot of things other high level languages can accomplish handily. Is it even a "real" language? Is it ready for primetime, or is it just being adopted because we can? :~
-
I'd say that C++ is not a real programming language - it is a complex programming language.
Religious freedom is the freedom to say that two plus two make five.
Don't get me started on imaginary languages. :~
Check out my IoT graphics library here: https://honeythecodewitch.com/gfx And my IoT UI/User Experience library here: https://honeythecodewitch.com/uix
-
PIEBALDconsult wrote:
with a "real" programming language, you can implement it's compiler/assembler
Interesting definition. So for that it would exclude C#, Java, JavaScript. But would include C/C++, Fortran and Pascal. Focusing on C# and Java they can create a binary file. It is after all just a matter of writing to a file. So they can for example create their own interpreter. Perhaps as a hack, but they can do it. They can definitely create their own compiled (byte code) files. There are actually libraries in both languages for that. So creation, to a certain extent, is not it. So it is a two step process that makes it not fit the definition? Isn't C/C++ 'built' using a compiler and then a linker? Although those can be one application the process of each is distinct. And I have certainly used systems where they were distinct applications. Additionally I can find both a Microsoft and gcc linker right now. So they still exist however they might be used. So there are still two steps. I was also wondering where Lisp fits into the above. Definitely a compiled language. But no way would I want to create a compiler using that.
jschell wrote:
Definitely a compiled language. But no way would I want to create a compiler using that.
Where's your sense of adventure? You mean you don't want to have to maintain 247 level nested parentheses 6 months after you put the code down?
Check out my IoT graphics library here: https://honeythecodewitch.com/gfx And my IoT UI/User Experience library here: https://honeythecodewitch.com/uix
-
If you can build a Turing machine out of arrangements of electron charges (which you obviously can), then I would claim that it meets my definition of computer language. We don't usually think of that as a language, but it is no more arbitrary than using certain shapes to represent letters is.
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows. -- 6079 Smith W.
Real programmers use butterflies. *hides*
Check out my IoT graphics library here: https://honeythecodewitch.com/gfx And my IoT UI/User Experience library here: https://honeythecodewitch.com/uix
-
Real programmers use butterflies. *hides*
Check out my IoT graphics library here: https://honeythecodewitch.com/gfx And my IoT UI/User Experience library here: https://honeythecodewitch.com/uix
Obligatory [xkcd: Real Programmers](https://xkcd.com/378/) Real programmers use emacs! (Dons asbestos suit, runs and hides)
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows. -- 6079 Smith W.
-
PIEBALDconsult wrote:
with a "real" programming language, you can implement it's compiler/assembler
Interesting definition. So for that it would exclude C#, Java, JavaScript. But would include C/C++, Fortran and Pascal. Focusing on C# and Java they can create a binary file. It is after all just a matter of writing to a file. So they can for example create their own interpreter. Perhaps as a hack, but they can do it. They can definitely create their own compiled (byte code) files. There are actually libraries in both languages for that. So creation, to a certain extent, is not it. So it is a two step process that makes it not fit the definition? Isn't C/C++ 'built' using a compiler and then a linker? Although those can be one application the process of each is distinct. And I have certainly used systems where they were distinct applications. Additionally I can find both a Microsoft and gcc linker right now. So they still exist however they might be used. So there are still two steps. I was also wondering where Lisp fits into the above. Definitely a compiled language. But no way would I want to create a compiler using that.
jschell wrote:
exclude C#, Java, JavaScript.
Essentially correct. Can the Java VM or C# runtime (and .net framework) be implemented those languages? I doubt it. Yet, as to C# and Java, I'm not sure that they are excluded by definition. Certainly their reference implementations rely on Virtual Machines and runtimes, but I'm not ready to say that their core functionality require those. I reserve the notion that maybe someone could use one or the other to implement a proper compiler which supports some core functionality of the language without needing the full VM/runtime -- such would probably not be able to inter-operate with "normal" applications. I don't know Java, but C#'s core functionality/syntax shouldn't need it. As to C++, I'm not even sure about that. Or, for the most part, any object-oriented language. I think D is implemented in D.
jschell wrote:
it is a two step process
jschell wrote:
C/C++ 'built' using a compiler and then a linker
jschell wrote:
there are still two steps.
I see a statement on another site [ "C++ implementation" means the compiler plus linker plus standard libraries ] and I would respond, "no, forget about any reference implementation and 'standard libraries', look only at the core of the syntax, what is the minimum you require to implement that? Without having to link to the library and such, you don't need a linker. Consider how the first version of the C compiler and library must have been compiled prior to the libraries having been compiled. I know, not very useful, but that's not the point. Consider only the syntax of the language itself, and not any of the baggage you have come to expect to go with it. Surely someone can (has the ability to) take the language syntax and implement a whole new eco-system which does not require the VM or runtime or 'standard libraries' or whatever. Not that I could implement such a thing myself. Codewitch could probably knock one out in a week. The linker and pre-compiled assemblies are just nice-to-haves.
jschell wrote:
Definitely a compiled language
Just being a compiled language isn't enough. I would further assert that basically no programming language is inherently "compiled" or "in
-
jschell wrote:
exclude C#, Java, JavaScript.
Essentially correct. Can the Java VM or C# runtime (and .net framework) be implemented those languages? I doubt it. Yet, as to C# and Java, I'm not sure that they are excluded by definition. Certainly their reference implementations rely on Virtual Machines and runtimes, but I'm not ready to say that their core functionality require those. I reserve the notion that maybe someone could use one or the other to implement a proper compiler which supports some core functionality of the language without needing the full VM/runtime -- such would probably not be able to inter-operate with "normal" applications. I don't know Java, but C#'s core functionality/syntax shouldn't need it. As to C++, I'm not even sure about that. Or, for the most part, any object-oriented language. I think D is implemented in D.
jschell wrote:
it is a two step process
jschell wrote:
C/C++ 'built' using a compiler and then a linker
jschell wrote:
there are still two steps.
I see a statement on another site [ "C++ implementation" means the compiler plus linker plus standard libraries ] and I would respond, "no, forget about any reference implementation and 'standard libraries', look only at the core of the syntax, what is the minimum you require to implement that? Without having to link to the library and such, you don't need a linker. Consider how the first version of the C compiler and library must have been compiled prior to the libraries having been compiled. I know, not very useful, but that's not the point. Consider only the syntax of the language itself, and not any of the baggage you have come to expect to go with it. Surely someone can (has the ability to) take the language syntax and implement a whole new eco-system which does not require the VM or runtime or 'standard libraries' or whatever. Not that I could implement such a thing myself. Codewitch could probably knock one out in a week. The linker and pre-compiled assemblies are just nice-to-haves.
jschell wrote:
Definitely a compiled language
Just being a compiled language isn't enough. I would further assert that basically no programming language is inherently "compiled" or "in
PIEBALDconsult wrote:
C# and Java "compile" to some intermediate form which runs on a VM/runtime, so are they truly compiled or just interpreted? Probably the latter.
There is no technical reason why one could not build hardware which has the Java bytecode as its machine language. Ditto for C#. Therefore, neither language is inherently interpreted.
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows. -- 6079 Smith W.
-
I'd say that C++ is not a real programming language - it is a complex programming language.
Religious freedom is the freedom to say that two plus two make five.
I'll double down on that.
-
PIEBALDconsult wrote:
C# and Java "compile" to some intermediate form which runs on a VM/runtime, so are they truly compiled or just interpreted? Probably the latter.
There is no technical reason why one could not build hardware which has the Java bytecode as its machine language. Ditto for C#. Therefore, neither language is inherently interpreted.
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows. -- 6079 Smith W.
I agree. The reference implementations seem to be interpreted from a certain point of view, but a truly compiled implementation could (conceivably) be created.