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.
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.
You go to hell and you die.
>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.
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.
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.
yaml uses 2 spaces for indents.
Maybe tab should be 1 space, then everyone would be happy.
lucm, indeed.
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.
Wellyoucan'teliminatedspacesbecausethey'dstillbeneeded.Soifyouwanttoeliminatejustonethingit'dhavetobetabs.
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.
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.
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?
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:
~ C.
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.
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"
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.
Is that German?
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)
Its not Welsh, too many vowels...