Announcement

Collapse
No announcement yet.

Ome: A New Cross-Platform Desktop Environment

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #21
    Originally posted by devius View Post
    Why is it a bad language?
    Where to start?

    What happens when you refer to a variable that hasn't been bound in JavaScript? You get back 'undefined', which, unless you immediately try to use in some other way, will just float to some other part of your program before causing an actual error, leaving you to trace down the actual problem. The sane thing to do would be to immediately say that an unbound variable was accessed, and even better would be to catch these errors as a static check.

    But of course, there's a complete lack of static checking unless you use one of the wrapper languages that attempts to rectify that, like TypeScript. There's an entire cottage industry of making languages that compile to JavaScript to try and fix some of its flaws, which probably says something. Meanwhile, in JavaScript, if I accidentally write 'function (x) { x === 9 }', I get no warning that I have written something useless, even though there are multiple easy ways for a language to help me out with such simple mistakes.

    It lacks a module system, so people have to create module systems using first-class functions. This wouldn't be so bad, because it's rather like Scheme, except Scheme has macros to make the syntax sane. Meanwhile, at work, we have module imports like:

    Code:
    module ('myModule', ['foo', 'bar', 'baz', 'quux', 'quuux', 'quuuux'],
      function (foo, bar, baz, quux, quuuux, quuux) {
        ...
      }
    );
    Except with double the imports, making it even harder to match up the lists.

    As a target, JavaScript fails for, for instance, functional languages, because it lacks proper tail calls. So, you'd have to implement your own trampolining if you wanted that. JavaScript was going to have it, but then Microsoft torpedoed the language revision that was adding it back in the day.

    I'm sure there's more. But I've only been collecting my list for a few weeks. By the way, my last two imports above were in the wrong order accidentally, so I had to waste a couple debug cycles figuring that out.

    Originally posted by Pajn
    Asm.js isn't meant to be executed as JS
    I know. But frankly, I think it ony sounds like a good idea if you've given up on anything but JavaScript ever being widely adopted. Maybe that's realistic, but that means the situation sucks, and asm.js is (maybe) making the best of it.

    Comment


    • #22
      Originally posted by devius View Post
      Why is [Javascript] a bad language?
      Dynamic objects + prototype inheritance + weak-typing is horribly bug-prone. Not to mention slow as shit and doesn't even a proper concept of modules. You only have access to 31 bit floats (yes, 31 not 32 bit, the first bit is reserved, at least in V8, for optimizing when a var type changed), meaning you need to run-time floor/round values if you want to guarantee integers, etc, etc.

      It's possible these days to lock down object structures, and use third-party libs to reasonably create structured applications, but you have to go out of your way to do it (especially without the third-party libs), and it's still very bug prone. For instance, you can't have a array of things and guarantee each object is of the same type. One programmer could accidentally add a string to your list of numbers (cause they added a return value from a function they thought returned a number, but actually returned a string) and instead of a compile-time bug, you have to wait till your program hits that specific facet of code at run-time before you're even aware if. Even worse, Javascript automatically converts numbers which are '+/-/ect' with strings to strings. So that random string in your list of numbers may just end up converting some other var into a string, which in turn converts another, etc, and you end up with a very hard to find culprit.

      And that's just one example of many. Granted, W3C is at least trying to address some of these issues for future versions of Javascript, but we will all likely be dead before all major browsers actually support them.

      It's funny, I remember watching this Google Tech Talk about how they made their V8 Javascript engine so much faster than others (at the time) by JIT compiling all objects to "native" memory structures, and doing some very complex code analysis to predict when a structure might change (even though it still wasn't perfect, and they couldn't really get around run-time type checking, etc). They claimed this helped because 90-95% of the time, applications don't want their structures to change randomly (durr), and therefor didn't need to often pay for JIT compiling dynamic structures to static ones. I was left with the obvious, but unanswered, question of: then why the fuck not make the language strong typed/structured for the 95% of code, and only use dynamic objects for the other 5% (like almost every other strong-typed language on the planet).

      Comment


      • #23
        Originally posted by Pajn View Post
        Great idea, that would be like using JS as Assembly language. We should call it something like Asm.js

        Before bashing a technology you should take care to actually read what that technology does
        because bashing a technology by describing a better way that is actually what that technology
        is intended to do would be pretty embarrassing, don't you think?
        I know exactly what ASM.js is, and what it's intended for (note my "ASM.js is just a JS bytecode" and "good for web devs" statements). That was completely irrelevant to my point, which was: Why use (and/or promote) JS when you have can use Native for core software on a new technology platform? Firefox OS, to my understanding, only supports web tech, and it's one of the driving factors behind ASM.js and their boasts about it. That's a horrible idea, and Mozilla's strong opposition to Native apps makes no sense, technically speaking. Their vision of a "web only" software world is naive, and doomed to fail, IMO. In fact, the only sane solution I see to the future of "the web" is Google's NaCL (or something like it), which gives developers virtually full control (including running any VM on top, JS or otherwise) with all the security benefits of sandboxed VMs.

        Comment


        • #24
          Originally posted by F i L View Post
          Firefox OS, to my understanding, only supports web tech, and it's one of the driving factors behind ASM.js and their boasts about it.
          You keep saying that you are well informed but you make statements that contradict this. Mozilla can choose to implement stuff in either native or web for FirefoxOS. How can you not see the benefits of using web technologies? We are using the web with different browsers, different operating systems, different cpu architectures, different screen sizes etc. ASM.js is very close to native and only really is too slow on cheap $100 phones.

          Comment


          • #25
            Originally posted by Ferdinand View Post
            You keep saying that you are well informed but you make statements that contradict this. Mozilla can choose to implement stuff in either native or web for FirefoxOS. How can you not see the benefits of using web technologies? We are using the web with different browsers, different operating systems, different cpu architectures, different screen sizes etc. ASM.js is very close to native and only really is too slow on cheap $100 phones.
            He is saying that you don't need to create some weird thing called asm.js instead of using something that is for the job and already there, like LLVM. AFAIK asm.js is not to be hand written because of its weird syntax and static-typed languages will be converted to asm.js in a similar way with EmScripten.

            So why use JS for a desktop environment? There are static languages that can target many architectures like C. Why bother write in static-typed language X, and convert it to asm.js and implement a whole new VM to parse that and try to optimize that VM while there is no need (e.g. NaCl)?

            Comment


            • #26
              Asm.js is a good thing because browser's won't agree upon a better language as a standard. Hell they don't even fully support current standards on JS.

              On topic: Desktop env. in JS is stupid because of the above reasons. If they really want to use web tech. they can use them in parts where it is needed and only in those, like GNOME Shell does, kind of.
              Last edited by the303; 26 January 2014, 07:01 PM.

              Comment


              • #27
                Originally posted by the303 View Post
                He is saying that you don't need to create some weird thing called asm.js instead of using something that is for the job and already there, like LLVM. AFAIK asm.js is not to be hand written because of its weird syntax and static-typed languages will be converted to asm.js in a similar way with EmScripten.

                So why use JS for a desktop environment? There are static languages that can target many architectures like C. Why bother write in static-typed language X, and convert it to asm.js and implement a whole new VM to parse that and try to optimize that VM while there is no need (e.g. NaCl)?
                How would that work? You send your desktop environment over the internet to me and... What do I do? This Ome desktop environment sounds like it is sent just like a webpage so I just need Firefox and it works.

                Comment


                • #28
                  Originally posted by Ferdinand View Post
                  How would that work? You send your desktop environment over the internet to me and... What do I do? This Ome desktop environment sounds like it is sent just like a webpage so I just need Firefox and it works.
                  You don't need to write it in completely JS to get the same render. Neither I send you Firefox source code and make you compile it for you to view a web page nor Firefox is written in JS.

                  Comment


                  • #29
                    Why this urge for native code?
                    Todays computers (and phones, however in my book they are the same) are fast enough to
                    run what we need it to run even if we write it in a language that is platform agnostic and where
                    I as a developer doesn't have to care about what underlying hardware there is, it works
                    everywhere.

                    Also the web standard is the only thing that provides a complete solution. Sure C++ is
                    standardized, however using only its stdlib is not possible.

                    And why not come up with something new and better? Well, the fact that it works today is
                    pretty nice. And if you think you just can create a new standard that everyone will adopt you
                    are wrong.

                    LLVM is not standardized and doesn't provide a complete solution with graphical UI, standardized
                    API against hardware, accessibility support and such.

                    NaCl is not platform agnostic.

                    Your problem with JS seems to be that you try to use it for something it were never designed for.
                    If you want to write webapps, use C++ and compile to Asm.js or use Dart and compile to js (and
                    provide the Dart code to so browsers that support runs faster).

                    Originally posted by dolio View Post
                    I know. But frankly, I think it ony sounds like a good idea if you've given up on anything but JavaScript ever being widely adopted. Maybe that's realistic, but that means the situation sucks, and asm.js is (maybe) making the best of it.
                    Personally I hope for Dart. But for near native I hope for Asm.js. Nothing else is platform
                    agnostic and backward compatible (=we can use it today). Also with newer versions of JS
                    it will have yet higher performance.

                    Comment


                    • #30
                      Originally posted by Ferdinand View Post
                      You keep saying that you are well informed but you make statements that contradict this. Mozilla can choose to implement stuff in either native or web for FirefoxOS. How can you not see the benefits of using web technologies? We are using the web with different browsers, different operating systems, different cpu architectures, different screen sizes etc. ASM.js is very close to native and only really is too slow on cheap $100 phones.
                      First, i never claimed to be well informed about Firefox OS, only ASM.js. In fact, the very first thing I said about FFOS was "As far as I know", leaving the possibility open for myself to be corrected on the issue. Second, of course Mozilla has the ability to write native code... how else would they even write anything for it if they did not? That makes little difference as (again, to my knowledge) application developers are completely restricted to "web technology", which makes no sense from both a performance perspective, and a practical one too. Why the restriction? Obviously Modzilla, (who in some ways I respect highly) has an agenda to promote HTML/JS more than anything else, and it's most likely tied to their source of income being entirely dependent on that tech, and needing to maintain an edge in that market. I'm not claiming Mozilla is corrupt, only that such is the nature of their focus, due to profit.

                      And don't fool yourself about the portability of HTML5 today. I have written HTML apps for smart devices, and it's far from complete. Just try playing a simple sound effect on iOS or Android through HTML5 APIs and then talk to me about how cross-platform this tech is. Or try and get decent frame-rates on any Android devices with HTML5 (Canvas or otherwise) and then try telling me Native isn't leaps and bounds better. Don't even get me started on Microsoft and Internet Explorer, who only just recently started giving half a shit about web-standards because they'd fall even further behind in an increasingly profitable market if they did not. Writing cross-browser CSS/JS was a complete pain-in-the-ass only 3-4 years ago. Today, if you're a game/app dev, Unity3D is a much more agnostic (and complete) platform than HTML5 is. Period.

                      Moreover, why wont Firefox support NaCL (or something like it) which gives developers real power? I mean, I could run a Javascript VM (or Python, or Lua, or whatever) on top of NaCL with very little performance impact, contrary to your beliefs about ASM.js, which (last time i checked) could only come within 25-50% performance of native code in some tests. In the real-world, ASM.js apps probably perform much worse today compared to their native equivalents (not that it can't and wont improve). Especially in domains like Physics and AI, which rely heavily on low-level SIMD access only Native code or more mature bytecode like LLVM support. And yes, I know about WebCL and that Mozilla has plans for a SIMD Javascript lib. However, as the303 points out (and what was my original point) is why even go through the trouble of using ASM.js or WebCL or whatever on platforms which can, and should, simply give developers native control?

                      In short, ASM.js is a good thing, but only because browsers are limited. Ultimately it's pointless and inferior if you have the ability to run native, which pretty much every OS should (smartphone, desktop, or otherwise).

                      Comment

                      Working...
                      X