Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. What's a "real" programming language?

What's a "real" programming language?

Scheduled Pinned Locked Moved The Lounge
javascriptcsharptutorialc++com
85 Posts 20 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    honey the codewitch
    wrote on last edited by
    #1

    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? :~

    G D 0 J K 16 Replies Last reply
    0
    • H honey the codewitch

      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? :~

      G Offline
      G Offline
      Gary R Wheeler
      wrote on last edited by
      #2

      My experience has been that programming languages evolve mostly to meet practical needs. You can substitute the words economic or business for the word practical and still have a valid statement. While there is a certain amount of 'need' for the ability to implement computer-sciencey algorithms in a language in a performant way, I think it's a lower priority than other features that simplify or extend expression of common idioms.

      honey the codewitch wrote:

      Consequently, there is no performant way to do subset construction to convert an NFA to a DFA in this language

      I take it that it's not impossible, and your objection is to the performance of the implementation required by the language? It sounds like an edge case you run in to with almost every language that needs an alternative solution. For example: Since you're implementing this in TypeScript, it's a web app. That implies a server. What about serializing the NFA, shipping it to the server for conversion, and deserializing the DFA returned? 'Out-of-the-box', as it were :-D .

      Software Zen: delete this;

      H 1 Reply Last reply
      0
      • G Gary R Wheeler

        My experience has been that programming languages evolve mostly to meet practical needs. You can substitute the words economic or business for the word practical and still have a valid statement. While there is a certain amount of 'need' for the ability to implement computer-sciencey algorithms in a language in a performant way, I think it's a lower priority than other features that simplify or extend expression of common idioms.

        honey the codewitch wrote:

        Consequently, there is no performant way to do subset construction to convert an NFA to a DFA in this language

        I take it that it's not impossible, and your objection is to the performance of the implementation required by the language? It sounds like an edge case you run in to with almost every language that needs an alternative solution. For example: Since you're implementing this in TypeScript, it's a web app. That implies a server. What about serializing the NFA, shipping it to the server for conversion, and deserializing the DFA returned? 'Out-of-the-box', as it were :-D .

        Software Zen: delete this;

        H Offline
        H Offline
        honey the codewitch
        wrote on last edited by
        #3

        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

        G J M H 4 Replies Last reply
        0
        • H honey the codewitch

          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

          G Offline
          G Offline
          Gary R Wheeler
          wrote on last edited by
          #4

          honey the codewitch wrote:

          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.

          I was trying to express the notion that the ability to implement algorithms efficiently depends upon the utility of that algorithm in the target environment.

          honey the codewitch wrote:

          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.

          My knowledge of TypeScript/JavaScript is limited. Would it be possible re-implement maps and sets that supported at least a limited form of the capabilities you require?

          honey the codewitch wrote:

          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?

          There's the key word (no pun intended).

          Software Zen: delete this;

          H 1 Reply Last reply
          0
          • G Gary R Wheeler

            honey the codewitch wrote:

            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.

            I was trying to express the notion that the ability to implement algorithms efficiently depends upon the utility of that algorithm in the target environment.

            honey the codewitch wrote:

            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.

            My knowledge of TypeScript/JavaScript is limited. Would it be possible re-implement maps and sets that supported at least a limited form of the capabilities you require?

            honey the codewitch wrote:

            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?

            There's the key word (no pun intended).

            Software Zen: delete this;

            H Offline
            H Offline
            honey the codewitch
            wrote on last edited by
            #5

            Gary R. Wheeler wrote:

            I was trying to express the notion that the ability to implement algorithms efficiently depends upon the utility of that algorithm in the target environment.

            Okay, fair enough. Though again, I'm still worried about this given this is my first attempt to do something non-trivial with typescript, or even - in years - javascript. The first attempt, and I run into such a fundamental and showstopping limitation it definitely gets the hair on the back of my neck on end, you know?

            Gary R. Wheeler wrote:

            My knowledge of TypeScript/JavaScript is limited. Would it be possible re-implement maps and sets that supported at least a limited form of the capabilities you require?

            Not efficiently using JS itself, as far as I can tell. I haven't profiled to be sure, but it's a lot of work for something that probably won't solve the issue.

            Gary R. Wheeler wrote:

            There's the key word (no pun intended).

            Which brings me back to me above response, about this being my first real go at TS, and my first time running into a major wall with it. It doesn't bode well at least to me.

            Check out my IoT graphics library here: https://honeythecodewitch.com/gfx And my IoT UI/User Experience library here: https://honeythecodewitch.com/uix

            1 Reply Last reply
            0
            • H honey the codewitch

              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? :~

              D Offline
              D Offline
              Daniel Pfeffer
              wrote on last edited by
              #6

              IMO, any computer language that is Turing-complete is a "real" computer language. As it is possible to implement a Turing machine in JavaScript, it is a "real" computer language. JavaScript is undoubtedly not the best language for implementation of certain algorithms, but one can find non-performant examples of algorithms in almost any language.

              Freedom is the freedom to say that two plus two make four. If that is granted, all else follows. -- 6079 Smith W.

              1 Reply Last reply
              0
              • H honey the codewitch

                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? :~

                0 Offline
                0 Offline
                0x01AA
                wrote on last edited by
                #7

                I have long dreamed of a universal 'meta language' to describe a task. And of course also then, 'simply' writing tools that converts this 'meta language' into the currently available tools. I think this is pretty much on your wavelength with parsers, whatever...

                J 1 Reply Last reply
                0
                • H honey the codewitch

                  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? :~

                  J Offline
                  J Offline
                  jschell
                  wrote on last edited by
                  #8

                  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.

                  H 1 Reply Last reply
                  0
                  • H honey the codewitch

                    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

                    J Offline
                    J Offline
                    jschell
                    wrote on last edited by
                    #9

                    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?

                    H 1 Reply Last reply
                    0
                    • H honey the codewitch

                      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? :~

                      K Offline
                      K Offline
                      k5054
                      wrote on last edited by
                      #10

                      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

                      P J 2 Replies Last reply
                      0
                      • 0 0x01AA

                        I have long dreamed of a universal 'meta language' to describe a task. And of course also then, 'simply' writing tools that converts this 'meta language' into the currently available tools. I think this is pretty much on your wavelength with parsers, whatever...

                        J Offline
                        J Offline
                        jschell
                        wrote on last edited by
                        #11

                        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.

                        0 1 Reply Last reply
                        0
                        • J jschell

                          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.

                          0 Offline
                          0 Offline
                          0x01AA
                          wrote on last edited by
                          #12

                          Not sure, but you answer with irony? But what I have in my mind is the next step from compiler-compiler

                          J 1 Reply Last reply
                          0
                          • H honey the codewitch

                            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? :~

                            P Offline
                            P Offline
                            PIEBALDconsult
                            wrote on last edited by
                            #13

                            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

                            J T 2 Replies Last reply
                            0
                            • K k5054

                              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

                              P Offline
                              P Offline
                              PIEBALDconsult
                              wrote on last edited by
                              #14

                              An assembler is what assembles an assembly language. And, of course, even that is just syntactic sugar over machine language.

                              D 1 Reply Last reply
                              0
                              • P PIEBALDconsult

                                An assembler is what assembles an assembly language. And, of course, even that is just syntactic sugar over machine language.

                                D Offline
                                D Offline
                                Daniel Pfeffer
                                wrote on last edited by
                                #15

                                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.

                                J 1 Reply Last reply
                                0
                                • D Daniel Pfeffer

                                  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.

                                  J Offline
                                  J Offline
                                  jschell
                                  wrote on last edited by
                                  #16

                                  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.

                                  D 1 Reply Last reply
                                  0
                                  • J jschell

                                    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.

                                    H Offline
                                    H Offline
                                    honey the codewitch
                                    wrote on last edited by
                                    #17

                                    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

                                    J 1 Reply Last reply
                                    0
                                    • J jschell

                                      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?

                                      H Offline
                                      H Offline
                                      honey the codewitch
                                      wrote on last edited by
                                      #18

                                      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

                                      1 Reply Last reply
                                      0
                                      • P PIEBALDconsult

                                        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

                                        J Offline
                                        J Offline
                                        jschell
                                        wrote on last edited by
                                        #19

                                        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.

                                        H P 2 Replies Last reply
                                        0
                                        • H honey the codewitch

                                          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

                                          J Offline
                                          J Offline
                                          jschell
                                          wrote on last edited by
                                          #20

                                          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.

                                          H 1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • World
                                          • Users
                                          • Groups