What's a "real" programming language?
-
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.
-
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
-
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? :~
-
Dangit, now I don't feel Turing Complete. I had to look up DFA vs NFA and still don't know what they mean. How have I been programming over 20 years and have no idea what they are. Please don't tell my boss!
Hogan
I actually wrote an article recently to help people understand them FSM Explorer: Learn Regex Engines and Finite Automata[^]
Check out my IoT graphics library here: https://honeythecodewitch.com/gfx And my IoT UI/User Experience library here: https://honeythecodewitch.com/uix
-
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 almost exclusively use C these days. A real programming language as well. I am a old timer raised with Fortran, PL/I, Cobol, Algol, Basic, Pascal,.. C is down and dirty which keeps it elegantly efficient. C++ is up and dirty. I get lost in the clouds of classes.
"A little time, a little trouble, your better day" Badfinger
-
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? :~
What you describe is why I never bothered with JavaScript in years past. C#, as with many other languages, is an object-oriented, general purpose, fully developed language. JavaScript was created as a quick fix, [created in 1995 and called Mocha originally](https://en.wikipedia.org/wiki/JavaScript), to a browser problem back in the early days of browsers. Once it took a foothold with a lot of web developers early on, the resistance to change (or significant improvement) has been unbreakable, resulting in gobs and gobs of JavaScript (and all the hacks built around it) in a lot of web pages. If you want to build web apps, try using open-source WebAssembly (Blazor in Microsoft's environment). Instead of JavaScript, you can use C#. When compiled, it is compiled to WebAssembly (efficiently so, so only compiled code that is necessary is sent to browser) and executed in the browser's WebAssembly engine (not the JavaScript engine). Other languages outside Microsoft also support WebAssembly, but the IDEs are not quite as robust - yet. And most of the companies that provide third-party UI components for other languages (including JavaScript) provide the same ones for WebAssembly. Just don't fall for the dying throes of JavaScript worshippers when they try to get you to include JavaScript in your WebAssembly web front end. The JavaScript Interop is slow, and JavaScript in a WebAssembly app is a waste of time. JavaScript and TypeScript (which is just a JavaScript generator) will be around a long time simply because it has been so widely used in the past (when there was not a viable alternative). There are still lots of COBOL, FORTRAN, and VB6 programs around today, just being maintained because the business side of whomever owns the code does not want to pay the conversion costs to a modern language.
-
What you describe is why I never bothered with JavaScript in years past. C#, as with many other languages, is an object-oriented, general purpose, fully developed language. JavaScript was created as a quick fix, [created in 1995 and called Mocha originally](https://en.wikipedia.org/wiki/JavaScript), to a browser problem back in the early days of browsers. Once it took a foothold with a lot of web developers early on, the resistance to change (or significant improvement) has been unbreakable, resulting in gobs and gobs of JavaScript (and all the hacks built around it) in a lot of web pages. If you want to build web apps, try using open-source WebAssembly (Blazor in Microsoft's environment). Instead of JavaScript, you can use C#. When compiled, it is compiled to WebAssembly (efficiently so, so only compiled code that is necessary is sent to browser) and executed in the browser's WebAssembly engine (not the JavaScript engine). Other languages outside Microsoft also support WebAssembly, but the IDEs are not quite as robust - yet. And most of the companies that provide third-party UI components for other languages (including JavaScript) provide the same ones for WebAssembly. Just don't fall for the dying throes of JavaScript worshippers when they try to get you to include JavaScript in your WebAssembly web front end. The JavaScript Interop is slow, and JavaScript in a WebAssembly app is a waste of time. JavaScript and TypeScript (which is just a JavaScript generator) will be around a long time simply because it has been so widely used in the past (when there was not a viable alternative). There are still lots of COBOL, FORTRAN, and VB6 programs around today, just being maintained because the business side of whomever owns the code does not want to pay the conversion costs to a modern language.
I'm not looking to develop web pages. I just was looking to teach myself typescript since JS is being used outside of the browser now. I was not pleased with what I found.
Check out my IoT graphics library here: https://honeythecodewitch.com/gfx And my IoT UI/User Experience library here: https://honeythecodewitch.com/uix
-
I almost exclusively use C these days. A real programming language as well. I am a old timer raised with Fortran, PL/I, Cobol, Algol, Basic, Pascal,.. C is down and dirty which keeps it elegantly efficient. C++ is up and dirty. I get lost in the clouds of classes.
"A little time, a little trouble, your better day" Badfinger
If they added
template
to C I'd consider switching. But until then, it's C++ for me. I've been seduced by the power of the dark side.Check out my IoT graphics library here: https://honeythecodewitch.com/gfx And my IoT UI/User Experience library here: https://honeythecodewitch.com/uix
-
TypeScript (JS really in this case, since TS is just syntactic sugar and validation) doesn't imply a web app anymore, which was part of the point I was making in my original, arguably too verbose post. It's used on the backend (node.js). It's used on the desktop (angular, react-native). Kevin only knows where next? My concern is it doesn't seem ready for it. As far as computer sciencey algorithms not being needed, consider that constructs in computer science make up nearly every programming problem you'll ever solve. DFA by subset construction is not the only place you'd ever need custom equality. From ECMAScript 6: maps and sets[^]
5.2 Why can’t I configure how maps and sets compare keys and values? Question: It would be nice if there were a way to configure what map keys and what set elements are considered equal. Why isn’t there? Answer: That feature has been postponed, as it is difficult to implement properly and efficiently. One option is to hand callbacks to collections that specify equality. Another option, available in Java, is to specify equality via a method that object implement (equals() in Java). However, this approach is problematic for mutable objects: In general, 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). Comparison by value means that two values are considered equal if their contents are equal. Primitive values are compared by value in JavaScript.
Read that carefully and you'll see the problem is more fundamental than simply maps and sets. You can't override equality. You can't implement custom value equality for objects. That hamstrings your ability to use Sets and Maps in the first place, but that's not the only place it limits you. It also speaks to a large issue of - if this is missing/incomplete/problematic-to-implement based on how the language works under the covers, what else can't it do that is fundamental?
Check out my IoT graphics library here: https://honeythecodewitch.com/gfx And my IoT UI/User Experience library here: https://honeythecodewitch.com/uix
Quote:
It's used on the backend (node.js). It's used on the desktop (angular, react-native).
That is just bad application design. JavaScript on the backend or the desktop is like putting a lawnmower engine in a Chevy Corvette and expecting to get a speeding ticket on the Interstate. C#, VB.NET, Java/Kotlin, Rust, Python, etc. are much better server-side and desktop languages than JavaScript.
-
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? :~
You used JavaScript, a crappy language if there ever was one, and you are surprised at its limitations... :doh:
Steve Naidamast Sr. Software Engineer Black Falcon Software, Inc. blackfalconsoftware@outlook.com
-
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
Quote:
Can the Java VM or C# runtime (and .net framework) be implemented those languages? I doubt it.
C# supports .NET native compilation (since VS 2015), so you can compile C# in Visual Studio to machine code. Someone more proficient in Java could answer whether Java can be compiled to machine language. Also, C# is always run compiled to machine language. C# compiles to Microsoft Intermediate Language (MSIL), and the .NET VM then performs its "Just in Time", or JIT, to machine language when it is run, based on the specific environment in which it is run. The Java VM does something similar, so both do produce machine language differently and more efficiently than an interpreter would.
-
You used JavaScript, a crappy language if there ever was one, and you are surprised at its limitations... :doh:
Steve Naidamast Sr. Software Engineer Black Falcon Software, Inc. blackfalconsoftware@outlook.com
I'm not surprised, more disappointed that it hasn't evolved, even as the industry is putting greater and greater demands on it.
Check out my IoT graphics library here: https://honeythecodewitch.com/gfx And my IoT UI/User Experience library here: https://honeythecodewitch.com/uix
-
I'm not surprised, more disappointed that it hasn't evolved, even as the industry is putting greater and greater demands on it.
Check out my IoT graphics library here: https://honeythecodewitch.com/gfx And my IoT UI/User Experience library here: https://honeythecodewitch.com/uix
From what I understand, the international standards community has not even had the language cleaned of its "dead code", making it more bloated than it has to be...
Steve Naidamast Sr. Software Engineer Black Falcon Software, Inc. blackfalconsoftware@outlook.com
-
I'm not looking to develop web pages. I just was looking to teach myself typescript since JS is being used outside of the browser now. I was not pleased with what I found.
Check out my IoT graphics library here: https://honeythecodewitch.com/gfx And my IoT UI/User Experience library here: https://honeythecodewitch.com/uix
Quote:
I'm not looking to develop web pages.
I see. I misinterpreted what you meant overall. My fault.
Quote:
I just was looking to teach myself typescript since JS is being used outside of the browser now
I would be curious to better understand why you would want to use a slow scripting language on the server when there are a number of better, compiled, languages available. I do not doubt you have a good reason, but in my experience, those using JavaScript on the server is usually because they are front end developers tasked with writing something for the backend, and JavaScript is what they are proficient in. I realize that may not be the only reason, but I would find it interesting to better understand why you are trying to increase proficiency at writing server code in JavaScript. Thanks
-
Quote:
I'm not looking to develop web pages.
I see. I misinterpreted what you meant overall. My fault.
Quote:
I just was looking to teach myself typescript since JS is being used outside of the browser now
I would be curious to better understand why you would want to use a slow scripting language on the server when there are a number of better, compiled, languages available. I do not doubt you have a good reason, but in my experience, those using JavaScript on the server is usually because they are front end developers tasked with writing something for the backend, and JavaScript is what they are proficient in. I realize that may not be the only reason, but I would find it interesting to better understand why you are trying to increase proficiency at writing server code in JavaScript. Thanks
I already know C#. I already know C++. I already know C. I have no intention of learning Java. I learned Typescript for the same reason I'll probably end up learning Python even though I hate it. Because it's used everywhere. Node.js IS the backend these days. For at least half the major paying projects I've seen. Like it or not, it's what's for dinner, and the less I know about that stuff, the further behind I get from where the rest of the world is. Even if Typescript gets retired right now it's relevant. Extremely relevant, because people are producing code in it. I don't have to like it to want to understand what the hell is going on with the state of the world in development these days. I intend to age out gracefully when I do, not get pushed out because I don't understand the way programming is done anymore.
Check out my IoT graphics library here: https://honeythecodewitch.com/gfx And my IoT UI/User Experience library here: https://honeythecodewitch.com/uix
-
I'm not surprised, more disappointed that it hasn't evolved, even as the industry is putting greater and greater demands on it.
Check out my IoT graphics library here: https://honeythecodewitch.com/gfx And my IoT UI/User Experience library here: https://honeythecodewitch.com/uix
Quote:
even as the industry is putting greater and greater demands on it
I would think the industry as a whole is not putting greater demands on JavaScript - just the community of developers who are dedicated to JavaScript and fight tooth and nail to keep from switching to a better language. I think the industry as a whole has recognized JavaScript's limitations (and labor costs to implement) and created the market that gave rise to WebAssembly on the front end and desktop, and higher level compiled languages for server apps.
-
Quote:
even as the industry is putting greater and greater demands on it
I would think the industry as a whole is not putting greater demands on JavaScript - just the community of developers who are dedicated to JavaScript and fight tooth and nail to keep from switching to a better language. I think the industry as a whole has recognized JavaScript's limitations (and labor costs to implement) and created the market that gave rise to WebAssembly on the front end and desktop, and higher level compiled languages for server apps.
As I recall, node.js is a google project, not a community project. Maybe I'm wrong. But nodejs is probably the biggest single offender here, in terms of technology.
Check out my IoT graphics library here: https://honeythecodewitch.com/gfx And my IoT UI/User Experience library here: https://honeythecodewitch.com/uix
-
I already know C#. I already know C++. I already know C. I have no intention of learning Java. I learned Typescript for the same reason I'll probably end up learning Python even though I hate it. Because it's used everywhere. Node.js IS the backend these days. For at least half the major paying projects I've seen. Like it or not, it's what's for dinner, and the less I know about that stuff, the further behind I get from where the rest of the world is. Even if Typescript gets retired right now it's relevant. Extremely relevant, because people are producing code in it. I don't have to like it to want to understand what the hell is going on with the state of the world in development these days. I intend to age out gracefully when I do, not get pushed out because I don't understand the way programming is done anymore.
Check out my IoT graphics library here: https://honeythecodewitch.com/gfx And my IoT UI/User Experience library here: https://honeythecodewitch.com/uix
Quote:
Node.js IS the backend these days. For at least half the major paying projects I've seen.
I have yet to see node.js used to any significance on the projects I have worked on, but my projects tend to be larger projects with a web front end and an API-based backend, or just a service-only API-based backend project, some on-premise, and lately, mostly Azure-hosted or Azure-native. Some of the older projects being updated have a little node.js in them, but it goes away in the updated version. Of course, since I loathe JavaScript, I would tend to gravitate to projects not requiring it, which makes my experience more subjective than objective. Yet, statistically, node.js shows high on the server app language utilization, but these lists I see are not differentiated between overall app size and complexity. Now that .NET 6.0+ (current is .NET 8) is out, stable, full-featured, and can run compiled on multiple OSs, it is a safe candidate for server apps and cloud apps that was not true just a year or so ago.
-
Quote:
Node.js IS the backend these days. For at least half the major paying projects I've seen.
I have yet to see node.js used to any significance on the projects I have worked on, but my projects tend to be larger projects with a web front end and an API-based backend, or just a service-only API-based backend project, some on-premise, and lately, mostly Azure-hosted or Azure-native. Some of the older projects being updated have a little node.js in them, but it goes away in the updated version. Of course, since I loathe JavaScript, I would tend to gravitate to projects not requiring it, which makes my experience more subjective than objective. Yet, statistically, node.js shows high on the server app language utilization, but these lists I see are not differentiated between overall app size and complexity. Now that .NET 6.0+ (current is .NET 8) is out, stable, full-featured, and can run compiled on multiple OSs, it is a safe candidate for server apps and cloud apps that was not true just a year or so ago.
I already know .NET I don't need to expend effort learning it. I was on the Visual Studio development team at Microsoft back when they rolled out C#. I've used it ever since. I'm covering my bases, making sure I have a broad understanding of relevant technologies used in software these days. However you feel about it, node.js is part of that milieu today. Your opinions or mine about how solid it is are not relevant to the fact that it is being used. That can be bitter pill to swallow, but remaining relevant and not holy rolling yourself into a corner sort of requires it.
Check out my IoT graphics library here: https://honeythecodewitch.com/gfx And my IoT UI/User Experience library here: https://honeythecodewitch.com/uix
-
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