Slashdot Mirror


Douglas Crockford Envisions A Post-JavaScript World (infoworld.com)

JavaScript developer (and JSON proponent) Douglas Crockford recently described "a theoretical post-JavaScript World," according to InfoWorld. Crockford "believes the web development staple needs a successor that can fix multiple programming nuances." An anonymous reader summarizes their report: Despite its status as the world's most popular language, Crockford told an audience at the Oracle Code conference, "It would be sad if JavaScript turns out to be the last language." He complained that JavaScript has two different ways of declaring variables -- let and var -- as well as two different "bottom variables" with no value -- both null and undefined. "There's an argument among language designers, should we have bottom values at all? But there's nobody who thinks you should have two of them."

According to InfoWorld, Crockford "also presented a scenario with JavaScript being turned into a purely functional programming language by getting rid of 'impurities' like date, the delete operation, math.random and object.assign. Afterward, he stressed replacing JavaScript rather than adding functional capabilities to it... The next language also should be better able to deal with multiple cores. Most languages have followed the sequential model of Fortran, executing one operation after another, he said. 'That's not how the world works anymore. We now have lots of cores available to us, which all want to be running at the same time.'"

In other news, Crockford also proposed ending the "spaces vs. tabs" debate by simply eliminating tabs altogether.

35 of 300 comments (clear)

  1. tabs4lyf by fuo · · Score: 5, Insightful
    Crockford also proposed ending the "spaces vs. tabs" debate by simply eliminating tabs altogether.

    You go to hell and you die.

    1. Re:tabs4lyf by Anonymous Coward · · Score: 3, Insightful

      After 33 years of working as a programmer, I think you're wrong. Junior devs just don't grok tabs. They interchange tabs and the wrong number of spaces and even worse, mix them. I gave-up long ago on tabs and just started using spaces. That's the only way you can work well with people not smart enough to understand tabs.

    2. Re:tabs4lyf by Actually,+I+do+RTFA · · Score: 3, Insightful

      Yeah, that's like me "proposing an end to emacs/vi war" by suggesting everyone uninstall emacs*. It bakes in the side you want to win.

      *I flipped a coin. No way was I going to reveal a real preference on such a hotly contested issue.

      --
      Your ad here. Ask me how!
    3. Re: tabs4lyf by Anonymous Coward · · Score: 2, Insightful

      If a dev can't grok that, you've got bigger problems to worry about.

    4. Re:tabs4lyf by Anonymous Coward · · Score: 3, Insightful

      spaces for spaces
      tabs for indentation

    5. Re: tabs4lyf by dilvish_the_damned · · Score: 2

      You might want a white space between your case statement and loop end, I suggest a tab for clarity.

      --
      I think you underestimate just how much I just dont care.
    6. Re:tabs4lyf by Waffle+Iron · · Score: 2, Informative

      The problem is that if you look at the code in any tool other than your favorite editor, it's probably displayed with 8 spaces per tab, which is annoying and stupid.

      Tabs should be completely eliminated. They are a obsolete vestige left over from mechanical teletypes. If people want to adjust the apparent indent amount while they edit code, then text editors should be enhanced with a feature to scale any leading spaces on each line to arbitrary widths. There's no need to hard-code text files with special invisible magic characters just for that purpose.

    7. Re: tabs4lyf by ColdWetDog · · Score: 4, Funny

      Nine for mortal man doomed to die.

      --
      Faster! Faster! Faster would be better!
    8. Re: tabs4lyf by bigjocker · · Score: 2

      One for the dark lord in his dark thong

      --
      Life isn't like a box of chocolates. It's more like a jar of jalapenos. What you do today, might burn your ass tomorrow.
    9. Re: tabs4lyf by murdocj · · Score: 2

      as I said, if the leading space on line is tabs, you are fine, including multi-line statements. I know, I've done it. And if you want to see two spaces per tab and I want to see 4 spaces per tab, we both can get what we want. Trust me, it works fine. Just requires people to pay attention to what the group wants, rather than insisting on going their own way, no matter what.

  2. Why on Earth? by Anonymous Coward · · Score: 4, Interesting

    >also presented a scenario with JavaScript being turned into a purely functional programming language by getting rid of 'impurities' like date, the delete operation, math.random and object.assign.

    Getting rid of those things does not make JS a functional programming language.

    Also, writing in purely functional languages just fucking sucks, they aren't and won't ever be a multi-core-coding panacea, and if highly-parallel-performance computing is your concern for the future, being ignorant to how parallel processing environments work by "letting the compiler decide" isn't going to make things better.

  3. Re:Tabs v. Spaces by helga+the+viking · · Score: 2

    But you can use a regular expression to replace tabs with spaces or the opposite way around? That's what i do anyway, generally i don't see tabs, spaces or positioning of curly braces as issues at all. People have their arguments but its not worth mentioning as its easily solved with one command in say vim or whatever powerful ide does regex. Even better yes please to an entire ecosystem of languages. Its one of the fundamental flaws of software engineering. We bend the spoon because we don't have time to make a soup ladel. Stuff that should be competed out of existence [bent spoons] gets band-aided and adopted by everyone.

  4. We don't need a new language by Uranium+Willy · · Score: 5, Interesting

    We need a standardised virtual machine that languages can be compiled to run on, that way the language of choice is more free to change. And Web browsers developers can deal with a simpler virtual machine language to translate.

    1. Re:We don't need a new language by robmv · · Score: 5, Informative
    2. Re:We don't need a new language by Gravis+Zero · · Score: 5, Insightful

      We need a standardised virtual machine that languages can be compiled to run on

      NO!!! What we need is for people stop using scripting to turn web pages into applications when 99.99% of the time I JUST WANT TO READ THE GODDAMNED WORDS ON THE PAGE!

      --
      Anons need not reply. Questions end with a question mark.
    3. Re:We don't need a new language by Tablizer · · Score: 2

      NO!!! What we need is for people stop using scripting to turn web pages into applications when 99.99% of the time I JUST WANT TO READ THE GODDAMNED WORDS ON THE PAGE!

      Much of it is marketing me-to-ism as people have to copy the UI fads of other sites to look "with it". A focus on logic, simplicity, and practicality of UI's and pages has been shot in the head point blank.

    4. Re:We don't need a new language by munch117 · · Score: 2

      The next thing missing are animation actions

      FTFY. If you go down that road, it'll never stop. There's always going to be one more feature that's missing, and with new features comes bugs, and with bugs come security holes.

      At the end of the day, you need something that's Turing-equivalent, so you can recombine known features in new and interesting ways. I just hope CSS doesn't end up being that Turing-equivalent something.

  5. even 4 is too much by lucm · · Score: 4, Funny

    yaml uses 2 spaces for indents.

    Maybe tab should be 1 space, then everyone would be happy.

    --
    lucm, indeed.
  6. Re:Tabs v. Spaces by Dutch+Gun · · Score: 2

    Even better yes please to an entire ecosystem of languages. Its one of the fundamental flaws of software engineering.

    At work, I write game and engine code in C++, some platform-specific Mac stuff in Objective-C, tools in C#, all managed by a build system written in Java, customized with Python, and Bash and Powershell scripts, with a web interface in Javascript. And that's just the languages I've interacted with myself.

    Domain-specific or specialty languages work great in other industries, so don't blame it on "software engineering". This is problem for web developers.

    --
    Irony: Agile development has too much intertia to be abandoned now.
  7. Re:End it by eliminating spaces by Chris+Mattern · · Score: 4, Funny

    Wellyoucan'teliminatedspacesbecausethey'dstillbeneeded.Soifyouwanttoeliminatejustonethingit'dhavetobetabs.

  8. Javascript really sucks by Snotnose · · Score: 5, Interesting

    In the last 40 years I've used lots of languages from BASIC to Z80 assembly, 8080 assembly, 8086 assembly, 68k, C, awk, sed, sh, perl, C++, TCL/Tk, ADA, Python, Java, Javascript. Some I really liked (assembly, C), some I used with trepidation (C++, perl), some I actively hated (TCL/Tk, ADA).

    But the one and only language that I felt was actually working against me was javascript. Damned script would pass all my tests, then fail on someone else's machine because they chose different options when installing, or had a different version, or just reasons. Note my scripts wouldn't actually fail, as in an error message. No, they just gave the wrong damned results.

    I fucking hate Javascript with a passion and wish it would die by the end of the year.

    1. Re:Javascript really sucks by SendBot · · Score: 3, Insightful

      As a dev who primarily works in JS, I'm extremely curious to hear about this! When I talk about limitations of JS, I point out the shortcomings (lack of native 64-bit integer support, or anything other than its singular "number" type is a big one), their workarounds, then conclude by saying it will probably be addressed in the future. The ecmascript standards are very well specified, and compatibility is well mapped out.

      Are you talking about node.js by chance? I'm confused about what was "installed" and what options were available. Normally js runs in a browser, and there's not much in the way of options when installing those. Are you talking about the language itself, or the environment such as npm modules?

      I like to criticize c# myself, but I think the complaints more accurately pertain to the .net framework.

      Please share some details, because I love to know about JS caveats and pitfalls and share them with others. Without this information, they sound like pebkac issues.

      Wishing for JS to die out is for wusses. Why not be proactive about killing it off with a better alternative for browser providers to implement? What would you suggest? Samsung has a lot invested in their Tizen OS, and they're not about to abandon that any time soon.

    2. Re:Javascript really sucks by BlackPignouf · · Score: 2

      +1
      I can learn a new language relatively fast. Any language, except for JS.
      This clusterfuck of a language would rather return something than throw an error. Bugs appear apparently out of nowhere, because some data has been passed in the wrong format for the last 10 functions.

      As an example :
          '1' + 0.1 is '10.1'
      but
          '1' - 0.1 is 0.9

      Then comes a JS 'expert' telling you "It's perfectly normal! It's been described in ECMAScript clusterfuck Specification"

      Just for fun :

          Array(16).join("lol" - 2) + " Batman!";

    3. Re:Javascript really sucks by UnknownSoldier · · Score: 2

      > why should that be NaN? 1/0 is Infinity, not NaN.

      Incorrect. You need to go back to school and review what divide by zero actually means.

      a/b = c
      a = b*c

      However when a != 0, and b =0,

      a/0 = c

      There is NO value of c that produces a.

      a = 0*c (impossible)

      Furthermore, mathematicians define division by zero as undefined because x/0 has TWO simultaneous values: +inf and -inf, depending on which side you approach x from: the negative side of zero, or the positive side of zero. The mathematical set of Reals is NOT closed under division by zero -- it produces a singularity.

      0/0 is "indeterminate" which naturally maps into NaN.

      console.log( 0/0 );
      NaN
      console.log( isNaN(0/0) );
      true

      All is good and fine so far.

      However Javascript uses the broken IEEE 754 definition of x/0 = Infinity. This is is retarded because is broken math

      Proof:

      1/0 = +inf (assume retarded definition of divide by zero is valid)
      0*(1/0) = 0*inf
      (0/0)*1 = 0
      undefined *1 = 0
      NaN = 0
      WTF

      Note: NaN is NOT equal to ANY value, including itself.

      console.log( NaN === NaN );
      false
      console.log( NaN == NaN );
      false

      > Is there some standard that says that "big" signed integers should be surreptitiously changed into unsigned ones?

      Your mistake is assuming Javascript has integers in the first place. Javascript does NOT have signed integers. All values are 64-bit floating point values.

      4.3.20 Number value

      primitive value corresponding to a double-precision 64-bit binary format IEEE 754-2008 value

      and

      6.1.6The Number Type

      The Number type has exactly 18437736874454810627 (that is, 264-253+3) values, representing the double-precision 64-bit format IEEE 754-2008 values as specified in the IEEE Standard for Binary Floating-Point Arithmetic, ...

      One of the reasons Javashit is such a crappy language because it has no uint32_t nor uint64_t. This leads to subtle over-flow bugs that are difficult or impossible to work around.

      But what do you expect from a language designed in 10 days.

  9. Comma-separated vs. tab-separated by tepples · · Score: 5, Interesting

    Tabs should be completely eliminated. They are a obsolete vestige left over from mechanical teletypes.

    "Completely" is a strong word. I can understand using spaces for indentation, but if you "completely" eliminate tabs, you break compatibility with POSIX Make. Furthermore, if you "completely" eliminate tabs, then what format for delimited flat files? In my experience, tab-separated values format is more efficient than comma-separated values format because a value is far more likely to need escaping because it contains a comma than because it contains a tab.

    1. Re:Comma-separated vs. tab-separated by phantomfive · · Score: 4, Funny

      The solution is easy. The tab character is ascii 0x09. We can remove it, and slide down all the other ascii characters to match and fill in the hole. For example, ascii 'A' would go from 0x41 to 0x40. People can just rewrite their software to handle the new character set, and then the world is cleaner and easier. And don't talk to me about backwards compatibility that's how we get messy software to begin with, lazy people unwilling to refactor to keep things clean. All we need to do is refactor ascii: the benefit is that unicode being a subclass inherits the change automatically OOP is soo cool.

      --
      "First they came for the slanderers and i said nothing."
    2. Re:Comma-separated vs. tab-separated by Anonymous Coward · · Score: 2, Funny

      The solution is easy. The tab character is ascii 0x09. We can remove it, and slide down all the other ascii characters to match and fill in the hole.

      Great, we even have an opening for a new ASCII character in 0x7F ! how about some kind of special character for programmers to help them manage indentation levels more easily, like a space but without having to press space n times! that way we also eliminate the debate about how many spaces is the correct level of indentation.

  10. Re:No thanks by tepples · · Score: 2

    Would you prefer that applications that actually need those features instead be native applications that are specific to an operating system other than the one you use?

  11. Crockford's Legacy: It's time for E! by MostAwesomeDude · · Score: 3, Interesting

    Okay, so this might be a bit of a ramble. Hi, I'm one of the developers of Monte https://monte.rtfd.org/, a new programming language based on E. E http://erights.org/ is a language from the 90s. Crockford worked on E. E's TermL mini-language became JSON. Another person who worked on E was Mark Miller. Miller's thesis project was formalizing and describing systems built with E. Crockford and Miller both are part of the committees that steer JS.

    Now, to bring it all together: Object capability security is a security discipline based on the principle of least authority and perfect encapsulation. It allows us to build secure distributed computations with pretty good security properties; wf-stringe can prove that certain data cannot be exfiltrated, that certain I/O cannot happen, and that certain computations are arbitrarily safe to evaluate. It's not perfect, but it's a massive improvement on the state of things.

    E and Monte, as well as a few other languages like Caja, Pony, and Waterken, are object-capability languages. Just like languages without manual memory management cannot misbehave in certain ways, these languages also promise that they cannot fail in certain desirable security-related ways.

    Crockford, Miller, and others have been deliberately steering JS towards more capability-safe constructions. The object model has been tightened up, and tools like weakmaps, promises, and "template strings" (we call them quasiliterals in the literature) have been added. However, JS is still defined by its weak points, and those points are weak indeed.

    Obviously, my bias is towards Monte. It's my preferred language and I want it to be popular. But, more importantly, I want the ideas that went into Monte to be popular. So, in that spirit, I'm going to give you a short list of questions. I want you to think, "How can I do that in my favorite language? Why would I want it?" Monte is meant to be the next Blub http://wiki.c2.com/?BlubParadox, the next language that is mediocre but built on a good foundation, and part of that is trying to see how Monte answers questions like:

    • The encapsulation problem: How do I produce an object which perfectly encapsulates a value; i.e. the object refers to a value but referring to the object is not sufficient to gain reference to the value?
    • The concurrency problem: How do I run two interacting plans of code at once?
    • The privacy problem: How do I prove, (in)formally, that a value cannot be exfiltrated from my program except through designated channels?
    • The confused deputy problem: What ambient authority is assigned to a "deputy", a program which can be fooled into misusing that authority?

    ...I've gotta stop writing blog posts on not-my-blog.

    --
    ~ C.
  12. Re:No thanks by WaffleMonster · · Score: 4, Insightful

    Would you prefer that applications that actually need those features instead be native applications that are specific to an operating system other than the one you use?

    Absolutely I prefer it. Native applications provide a much better experience vs. attempting to turn document viewers into general purpose operating systems.

    There are a million different solutions to software portability. Our choices are far from shove everything into the browser or going without.

    Putting everyone at unnecessary risk in pursuit of the goal of transforming document viewers into operating systems is as foolish as it is counterproductive.

  13. Not tab vs space but "Dual bottom variables" by Terje+Mathisen · · Score: 3, Interesting

    I've read all comments as of this time and nobody seems to have taken note of his suggestion about bottom vars:

    "There's an argument among language designers, should we have bottom values at all? But there's nobody who thinks you should have two of them."

    I would like to _strongly_ disagree, you _do_ need two different kinds:

        undefined (Not a Number/Not a Result) which traps if you try to use it, and none which means empty/ignore!

    In the Mill cpu architecture (http://millcomputing.com/) we have those two different kinds and they make coding both easier/more elegant/more compact, and at the same time faster and more secure!

    Another example:

    I am currently on the group that works on the 2018 revision of the IEEE 754 (i.e. floating point) standard. In the original '754 version the "Not a Number" (NaN) type was defined as a way to create a "sticky" error marker in a numeric calculation. I.e. if you accidentally try to calculate 0/0 or Inf/Inf the result will be undefined, the operation might trap or not depending upon how your language runtime is setup, but the result will always be a NaN. There are two kinds of NaNs, Signaling NaN and Quiet NaN, the only difference is that the next time a SNaN is taken as input to an operation it will trap and then be converted to the equivalent QNaN while a QNaN as input will just propagate to the output.

    It should be obvious that if your runtime initializes all FP variables to NaN, then any accidental use-before-load should be detected, right?

    The problem is that for the 2008 (current) revision of the standard, enough people wanted a totally different behavior when searching for the maximum value in an array, typically used to scale a matrix: They managed to define minNum(a,NaN)/maxNum(NaN,b) so as to ignore any quiet NaN val
    ues, always returning the other value. I.e. in those functions they got NaN to behave as None!

    The real problem, and the main reason these functions are going away is how the definition above interact with the SNaN/QNaN rules:

    maxNum(1.0, QNaN) -> 1.0
    maxNum(QNaN, 1.0) -> 1.0

    maxNum(1.0, SNaN) -> QNaN
    maxNum(SNaN, 1.0) -> QNaN

    So if you look for the maximum of 4 values, one of them a SNaN, the result will depend on the order of comparisons, i.e. if you do them pairwise you get this result:

    max(1.0, SNaN, 2.0, 3.0) -> maxNum(maxNum(1.0, SNaN), maxNum(2.0, 3.0)) -> maxNum(QNaN, 3.0) -> 3.0

    while taking alternate inputs results in

    maxNum(maxNum(1.0, 2.0), maxNum(SNaN, 3.0)) -> maxNum(2.0, QNaN) -> 2.0

    I.e. we would have been much better off here with a single bit pattern meaning None which would never propagate.

    --
    "almost all programming can be viewed as an exercise in caching"
  14. Re:Missing the point by BronsCon · · Score: 2

    And every time I have to edit code written by some dickface who uses 2 or 8 (as examples) spaces, I want to invent a way to murder someone with a Git commit. My preference is 4; if yours is something else, you set yours to something else. For the times when you have to use an editor in which you can't figure out how to change the tab with, well, either figure it our or deal with it.

    What your argument boils down to is "I can't have my way all the time unless I force my way on everyone, so I'm going to be a dick and force my way on everyone, because I'm a dickish dick."

    --
    APK quotes people (including myself) without context and should not be trusted. Just thought you should know.
  15. Re:End it by eliminating spaces by thegarbz · · Score: 3, Funny

    Is that German?

  16. Re:Tabs v. Spaces by AntiSol · · Score: 2

    But you can use a regular expression to replace tabs with spaces or the opposite way around?


    user@host:~/code $ git log --stat

    commit: 10048
    user: tabluvr
    message: replace idiotic spaces with tabs
    files changes: 10000
    lines changed: 1000000

    commit: 10047
    user: spaces4eva
    message: fix broken tab formatting by replacing with spaces
    files changes: 10000
    lines changed: 1000000

    commit: 10046
    user: tabluvr
    message: fix mangled indentation from previous commit
    files changes: 10000
    lines changed: 1000000

    commit: 10045
    user: spaces4eva
    message: replace tabs with spaces
    files changes: 10000
    lines changed: 1000000

    (more)

  17. Re:End it by eliminating spaces by Richard_at_work · · Score: 2

    Its not Welsh, too many vowels...