Creator of JSON Unveils New Programming Language 'Misty' (crockford.com) 157
He specified the JSON notation, and developed tools like JSLint and the minifier JSMin. His Wikipedia entry says he was also a senior JavaScript architect at PayPal — but he's probably better known for writing O'Reilly's book JavaScript: the Good Parts.
But Doug Crockford has a new challenge. O'Reilly's monthly tech newsletter says Crockford "has created a new programming language called Misty. It is designed to be used both by students and professional programmers."
The language's official site calls it "a dynamic, general-purpose, transitional, actor language. It has a gentle syntax that is intended to benefit students, as well as advanced features such as capability security and lambdas with lexical scoping..." The language is quite strict in its use of spaces and indentation. In most programming languages, code spacing and formatting are underspecified, which leads to many incompatible conventions of style, some promoting bug formation, and all promoting time-wasting arguments, incompatibilities, and hurt feelings. Misty instead allows only one convention which is strictly enforced. This liberates programmers to focus their attention on more important matters.
Indentation is in increments of 4 spaces. The McKeeman Form is extended by three special rules to make this possible:
indentation
The spaces required by the current nesting.
increase_indentation
Append four spaces to the indentation.
decrease_indentation
Remove four spaces from the indentation.
The indentation is the number of spaces required at the beginning of a line as determined by its nesting level.
indent
increase_indentation linebreak
outdent
decrease_indentation linebreak
The linebreak rule allows the insertion of a comment, ends the line, and checks the indentation of the next line. Multiple comments and blank lines may appear wherever a line can end.
But Doug Crockford has a new challenge. O'Reilly's monthly tech newsletter says Crockford "has created a new programming language called Misty. It is designed to be used both by students and professional programmers."
The language's official site calls it "a dynamic, general-purpose, transitional, actor language. It has a gentle syntax that is intended to benefit students, as well as advanced features such as capability security and lambdas with lexical scoping..." The language is quite strict in its use of spaces and indentation. In most programming languages, code spacing and formatting are underspecified, which leads to many incompatible conventions of style, some promoting bug formation, and all promoting time-wasting arguments, incompatibilities, and hurt feelings. Misty instead allows only one convention which is strictly enforced. This liberates programmers to focus their attention on more important matters.
Indentation is in increments of 4 spaces. The McKeeman Form is extended by three special rules to make this possible:
indentation
The spaces required by the current nesting.
increase_indentation
Append four spaces to the indentation.
decrease_indentation
Remove four spaces from the indentation.
The indentation is the number of spaces required at the beginning of a line as determined by its nesting level.
indent
increase_indentation linebreak
outdent
decrease_indentation linebreak
The linebreak rule allows the insertion of a comment, ends the line, and checks the indentation of the next line. Multiple comments and blank lines may appear wherever a line can end.
AI generated article? (Score:5, Insightful)
Why is the entire summary about whitespace? Who cares about the whitespace? It's the least important thing about a language.
Re:AI generated article? (Score:4, Interesting)
The entire braces-vs-whitespace debate is very important and also confusing to many new programmers.
Simple things like converting commands to comments and back can break programs. Not all IDEs do a good job of round-tripping program lines to comments and back again with the proper indenting. Comments lines that are already commented then back also leaves weird artifacts (again, in some IDEs)
Knowing ahead of time that indentation standards are fixed and strictly enforced might be enough for some people to either totally avoid or be interested in the language for teaching purposes.
--
My 2 cents worth of opinion. How much is that worth in 2024 mintage?
Re: AI generated article? (Score:5, Insightful)
Sure, but for the summary to be so consumed by the details seems odd. "Indentation is mandatory and is always 4 spaces" would have covered it. Instead we have an abnormally long summary which tells us even less than usual. It's just a copy paste of a rather arbitrary and long portion of the introduction section. Which is odd enough for the "introduction" to include in this way, but is even stranger when it consumes the summary.
Re: AI generated article? (Score:4, Insightful)
Re: (Score:2)
The author is trying to describe a tab character as spaces and also make it sound like it's a cutting edge new feature.
Re: AI generated article? (Score:2)
Just saying indentation is 4 characters and mandatory definitely does not cover it. It is described very poorly though, since I can see how you would come away with that.
It isnâ(TM)t really even about indentation. Python uses indentation to denote block scopes, he is using it to denote list, array, and parameter separators. In other words in his language:
4 spaces == a comma.
Not defending this madness btw, but that is what he is doing.
Re: (Score:3)
Actually, the newline is the 'comma' in those cases where it can stand in for a comma, but that's a whole other section. So much more stuff that would have been worth tossing in a sentence to cover, newlines in lieu of commas, non-ascii characters mandated for basic operators and function syntax (hello copy/paste, compose key, alt-key, etc), and the fact that this appears to be mostly just a formalized grammar and a few concepts described without an actual language implementation, which would generally be
Re:AI generated article? (Score:5, Funny)
The entire braces-vs-whitespace debate is very important and also confusing to many new programmers.
Then the solution is obvious: Ban Python. No one will ever need to be confused by that disgusting thing again.
Re: (Score:2)
It is not at all important to enforce it. "Braces" as a delimiter is super-ugly compared to some of the alternatives. Only a Unix guy would come up with something like that.
But, properly formatting your program does enhance readability and there are plenty of perfectly acceptable style conventions that will solve the problem when it is important to solve. So, writing a new language solely to solve this supposed "problem" is typically spurious, that is, typical of the unnecessar
Re: AI generated article? (Score:3)
Re: (Score:3)
Re: (Score:3)
Why is the entire summary about whitespace? Who cares about the whitespace? It's the least important thing about a language.
Yes, completely unimportant. Python works great w/o white space. Oh, wait ...
Re: (Score:2)
Re: (Score:3)
Who cares about the whitespace? It's the least important thing about a language.
The creator cares about it. They care about it so much that the summary is literally the first part of the spec itself. Maybe this can tell you all you need to know about whether you want to use this language going forward, but the summary is actually telling you something very important here by only talking about whitespace.
Re:AI generated article? (Score:4, Informative)
Stallman [stallman.org] prefers "Person" (or "perse"), "per", and "pers".
Crockford [crockford.com] prefers "pe" and "per".
Re: (Score:2)
Thank you for the link and your restraint. While public displays of insanity can serve as a warning to others, when witnessing them it is important not to descend into ridicule and denunciation.
Re:AI generated article? (Score:5, Insightful)
So you go out of your way to be an asshole when someone simply requests for you to acknowledge how they have self-determined? Is it really that hard for you to talk to someone in a manner that makes them comfortable?
The irony is that it's the "rugged individualist" crowd that predominantly holds this incredibly selfish view that using different words somehow causes harm to the speaker instead of the people they are referring to - let me guess, you feel that you should still be able to call LGBT people "faggots" and black people "n*gger" too, right?
Re: AI generated article? (Score:5, Informative)
You act like you're being principled but you're not. You're dismissing others experience of consciousness while insisting your own is the standard. That's called solipsism and I promise you it's not new.
Re:AI generated article? (Score:5, Insightful)
Or maybe they just prefer to have gender ambiguity due to the still relevant sexism rampant in many workplaces and career disciplines?
Are you a trained and board certified mental help professional? No? Then maybe you shouldn't comment on someone else's mental health with absolutely no context, analysis, facts, or other information beyond their fucking pronoun choice.
What does that post say about your own mental health, dear amateur mental health enthusiast?
Re:AI generated article? (Score:4, Insightful)
A milestone in a programmer's decline starts when they write a blog post about pronouns.
well, stallman is indeed just about the common gender-neutrality "don't hurt my feelings" trope, he has always been political. being political doesn't make a programmer bad,
crockford however actually makes a good point about how gender and number are broken in english for several reasons and how that mess could be cleaned up. it's an exercise in language normalization and optimization. he's a different animal, "pe just like to tinker with languages"
(i don't particularly like the particular "pe/per" proposal but some sort of epicene pronouns would be indeed a good addition to english. in the meantime methinks "it" could do the job splendidly if we just accept that getting offended because of not being explicitly referred to as a person but a neuter entity instead is really pushing it a bit too far)
Re: AI generated article? (Score:2)
Almost the entire web page for the language is about whitespace. Being prescriptivist about whispers appears to be the entire point of the language, with no real care for anything that has actual semantic impacts.
I guess it makes it clear what is important in the heads of JavaScript programmers (or even architects).
Re: (Score:2)
Yay! (Score:3)
Are we getting an "AI"-generated computer language soon?
Obligatory Why? (Score:2)
No. Really. Why?!
At this point we have more garbage languages than problems
Re: (Score:2)
Can't wait for his next language named GIGO
Is that name taken already?
Re: (Score:3)
Garbage In, Greatness Out?
Re: (Score:2)
Kinda reminds one of the 50s when the kids out-did each other in coming up with new ridiculous dances for every single song out there.
Re: (Score:2)
Oh dang, I couldn't believe this until I actually went to the site. Taking sides in tabs vs. spaces is one thing, but making owners of ASCII keyboards jump through Unicode hoops just to write a function takes it to a whole new level, LOL. I can't believe this was done with an entirely straight face. The shortest common abbreviation "fn" is going to be easier for almost everybody. Florin? They don't even use those in Italy any more. Might as well use that Easter Island head emoji.
Scheme (Score:2)
"Misty instead allows only one convention" (Score:2, Funny)
Yeah, that'll avoid the arguments. Fucking idiot. Also, if you have to brag about your Javascript work to get people to pay attention to your new programming language, you may not like the result.
So (Score:5, Funny)
Python, but somehow worse.
Re:So (Score:5, Informative)
Python, but somehow worse.
Yup.
Commas as both item and statement separators *and* optionally replaceable with newlines.
Indentation required at 4-space increments -- so, not a simple Tab or other number of spaces.
We need this why?
Re: So (Score:2)
Re: So (Score:5, Informative)
Re: So (Score:3)
Re: (Score:3)
That assumes the ability to see the same code different ways is a virtue.
It is. One of the good things you learn as a web developer is the importance of separating presentation style from the underlying information.
Re: (Score:2)
Just in case you needed another language to learn and clutter up the world.
Re:So (Score:5, Interesting)
I didn't think such a thing was possible outside of languages with intentionally bad design, but here we are...
Re: (Score:2)
Sounds like it. I don't think I can even be bothered to have a look.
A few tidbits (Score:5, Informative)
It didn't take long to read through the entire Misty spec. Basically it's the software equivalent of a conlang [wikipedia.org]: there's only one short program written in the language, no actual implementation, and it includes a bunch of slightly insane features that would be annoying as hell to actually use. Here are some highlights:
- The syntax for variable assignment is set foo: bar — I initially let this one slide since Doing Weird Things With Colons is a big part of the Make Parsers Dumb Again revolution of the past 10 years or so, but in retrospect it kinda looks like the creator's imagination is being subsumed by the legacy of JSON...
- Many operators are not ASCII. Throw out / * = and adopt their Unicode equivalents! Have fun learning how to make your keyboard do any of that.
- Question marks in variable names for marking predicates and booleans! Schemers, start your grudging!
- Some very conspicuous Not Invented Here terminology: arrays are either "stone" or "antestone" (immutable or not—just call them 'final'!)
- Lots of Crockford's other pet projects get screentime: numbers are always stored in his DEC64 format (a 64-bit float with a 56-bit mantissa and an 8-bit decimal exponent), there are native functions for handling strings encoded in a variant UTF-8 format that's slightly more dense, and it seems JSON has been updated to Nota (mainly by making commas and quotes around field names implicit where possible).
- Probably the biggest pet project, patterns are embedded directly into the spec and don't seem to have any other documentation. The gist is that they're regexes with indenting (not an innovation) and slightly less hairy names for common character classes. The goal of fixing regexes is admirable, but I think more research should have been done on what the state-of-the-art in regex legibility actually looks like, rather than starting from vintage 90s PCREs. At any rate, I don't think the rework is radical enough.
- An attempt at handling parallelism through a fairly unremarkable message-passing system called actors, which is more like a multi-process RPC API than a threading model; there is no way to have multiple threads sharing access to a variable. Should the sharp knives be hidden from the children? You decide!
Re: A few tidbits (Score:5, Informative)
I thought you had to be misunderstanding when you said non keyboard operators, but lo and behold, you are right.
He expects programmers to heavily use compose key, or for IDEs to otherwise translate input to these characters. Not to mention how confusing it would be if you are using programming ligatures that make the ASCII equivalents look like those Unicode, hard to tell if genuine "not equals" or ligature rendered "!=".
Between the oddly jargony grammar specification approach to introducing the language and all sorts of weirdness like you cite, it's hard to imagine this as a sincere attempt at a usable language rather than a really weird conceptual description of a language not intended for use.
Re: (Score:3)
Re: (Score:2)
Thanks for wading through that sludge for us.
Re: (Score:2)
I honestly would have expected his type-free functions with what Crockford calls "Design by Contract" "preconditions" to cause much more dev howling than anything mentioned here. But let's address your points . . .
The syntax for variable assignment is set foo: bar — I initially let this one slide since Doing Weird Things With Colons is a big part of the Make Parsers Dumb Again revolution of the past 10 years or so, but in retrospect it kinda looks like the creator's imagination is being subsumed by the legacy of JSON...
That also is completely unambiguous with an equality operator. Probably a good thing for neophytes, even if you've never personally used "=" where you meant "==" or vice versa.
Many operators are not ASCII. Throw out / * = and adopt their Unicode equivalents! Have fun learning how to make your keyboard do any of that.
I'll wait to see what happens with those. I expect them to change. Soon. I don't know how to type ""[thing that this text
Re: (Score:2)
The use of a colon or := in a definition is pretty old in both math and programming. The use of a single = for definition and == for comparison is dumb and leads to lots of errors.
Re: (Score:2)
I don't disagree with you, but as far as I can tell even the colon isn't necessary for Crockford's syntax to be unambiguous, which annoys me.
Re: (Score:2)
insightful, informative and very objective, thanks
Yawn (Score:2)
After Rust, Go and Swift (and a dozen of others) there's not much place left for new modern(istic) languages, I'm afraid. The window of opportunity has mostly closed. And what's the matter with every new language being advertised as suitable for students? Teaching students an obscure language only for them to ditch and forget it when they meet the real world, what a waste of time and effort.
Ah, and this silly name doesn't really help the language's cause.
Re: (Score:3)
There is always an opportunity for a new language that bring something of value to the table. Rust was like that. Swift definitely not. Some good parts, but its success is mostly due to the fact that the only alternative is deprecated and also it is Objective C. So captive audience is captive. Go doesn't bring much to the table compared with the other languages.
Misty, I am afraid, doesn't bring much to the table either.
Re: (Score:2)
Re: Yawn (Score:2)
Go brings a pretty good async implementation to the table. Even in other languages that have this, they are kind of half in (e.g. python default suggestions are frequently not friendly to async usage, with a whole parallel world of async, rust async is similar, but also requires you to explicitly pull in a reactor). Go's "channel" syntax is pretty nice too.
I'll also say that of the languages that compile to native code, it tends to require the least micro management. Of course that does come at a cost of
Re: (Score:2)
Thanks for clarifying, that's exactly what I meant. Rust bring something that is groundbreaking. IMHO, Go brings stuff that is nicer than other languages, but definitely not a game changer. I would not consider rewriting my app in Go just for what Go brings. I would consider Rust.
Re: (Score:2)
Swift is in fact the best wide spread used language at the moment.
The BEST ??? The best at what ?
Re: (Score:2)
Everything made by Apple is the BEST, haven't you heard? Objective C was the best until it was replaced with Swift, which became the new best. The Newton was the best until it was replaced by a phone that you're probably holding wrong but it's still the best. PowerPC was the best CPU architecture until it was replaced by what it replaced, but then later Apple Silicon became the best. The Lisa was the second best product that Apple made, replacing the original Apple series as the first best microcomputer
Personally, I'll pass (Score:4, Insightful)
Also, the freedom of adapting the style of your own code to your own needs is "promoting bug formation", while a syntax that will silently and drastically change its meaning if you type the wrong number of spaces is safety?
Think about what happens when you copy and paste portions of code across different nesting levels. Sorry but one can't have any experience in programming and write such nonsense.
I can't help but think the name is apt (Score:5, Funny)
But in the wrong language.
In German, "Mist" means "dung" or "rubbish".
So it's "rubbish-y"... yeah, I think that's a pretty good characterization.
Re: (Score:2)
Re: (Score:2)
Believe me, it would.
Just like "cloud" gets tongue-in-cheek translated as "klaut", imperative plural of klauen, to steal.
Re: (Score:2)
I would always read "Misty" as an English term and not associate it with "Mist".
That's only because you haven't used it yet.
Re: (Score:2)
"manure" would be the closest equivalent
Re: (Score:2)
Quite frankly, I didn't want to dig that deeply into it. ;)
WTF, specified 4 spaces for indentation?!? (Score:4, Insightful)
if only we could just invent a single character for indenta... oh, wait
regarding the rest... the whole language seems ... weird, to be honest
don't think it'll take off
Re: (Score:2)
Nah, it would be awkward because there isn't a key on the keyboard for it.
Re: (Score:2)
maybe use the tab key? ;)
Re: (Score:2)
Silly, that key already has an important job balancing out the delete/backspace key.
Actually, I might be wrong. Reading the comments here, I think it summons the devil or messes up your ASCII art or something.
Re: (Score:2)
Time to fork the project and update it only 2-space indents. That's half way between tabs and 4-space indents, so everybody will be a little happy and a little unhappy.
I miss print books (Score:2)
Having to physically print quality manuals really pumped the brakes on people publishing new hobby languages. And having to have shelf space for these books kept people from buying into too many of languages at a time.
Re: (Score:2)
Re: I miss print books (Score:2)
No, the technical community is just massively bigger than it was back then. It was not lack of shelf space that drove lack of languages, it was overall size of community.
Also, these concept languages come and go frequently anyway. There's only a handful worth keeping track of, just like there was only a handful back in the day.
Whoo hoo! The time is ripe! (Score:4, Funny)
Since people are apparently deciding white space and indentation are cool again... Going forward, I'm gonna start writing everything in FORTRAN 77! It was good enough for the young me - it'll be good enough for the old me!
Loved that episode of Silicon Valley. (Score:2)
Play Misty for Me (Score:3)
But it's just what I want you to do
Don't you realize how hopelessly I'm lost
That's why I'm following you
Yep, I think this language is aptly named.
Pissed at Misty (Score:2)
Imagine being a student who worked hard at learning "Misty" and then went out and tried to get a job with it.
And what do you want to bet some percentage will think the language had something to do with Pokemon?
Re: (Score:2)
I think that if you're going to teach CS fundamentals in some non-commercial language it should have features that suit that didactic purpose specifically.
The programs I wrote at university were generally short assignments to demonstrate some principle of programming, the end goal was not to produce a marketable product
Obligatory Ref to There's Something about Mary (Score:3)
- Yeah, sure, 2-space indentation. It's standard
- Yea, this is going to blow that right out of the water. Listen to this. 4
- Right. Yes. OK. alright. I see where you're going
- Think about it. You're looking at some code and you see one with 4-space indentation and one with 2-space indentation. Which one's more readable?
- I would go for the 4-space indented code
- Bingo, man, bingo. 4-space indentation. And we guarantee just as good a readability as the 2-space folks.
- You guarantee it? That's - how do you do that?
- If you're not happy with the 4-space indentation, we're gonna give you the option to configure the compiler to accept 6-space indentation for free. You see? That's it. That's our motto. That's where we're coming from. That's from "A" to "B".
- That's right. That's - that's good. That's good. Unless, of course someone comes up with 3-space indentation. Then you're in trouble, huh?
- No! no, no, not 3! I said 4. Nobody's comin' up with 3. Who can see the indentation with just 3 spaces? You can't even line begin and end blocks.
- That - good point.
- 4's the key number here. 4 sides to a square, 4 is 2x2 and 2^2 and 2+2, 4 is the magic number, man. Number 4, a square with a grin, in a world of numbers, it loves to spin, not odd or even, it's right in between, the jester of math, a digit so keen! Step into my office.
- Why?
- 'Cause you're fuckin' fired!
* The "Number 4" poem provided by ChatGPT. I'm not that clever (or stupid).
Re: (Score:3)
No tabs? Yay! (Score:2)
Re: No tabs? Yay! (Score:2)
19th century typewriter technology let you set multiple tab stops. There is no rationale for there to be a particular number of spaces. Except for what a DEC terminal has on boot up, but even there it was configurable.
Re: (Score:2)
Tabs are the manifestation of Satan.
Re: (Score:2)
Suggestion: hire some editors! (Score:2)
What a badly written story. Seriously unreadable, mostly drivelling on about indentation rather something important, laid out as if to prove how annoying bad layout can be. /. should hire some editors who could, well, you know, edit stories and fix up this crap. Oh wait, they have already people called "editors"? What do they do?
DOA (Score:2)
No real value added. Transpiler situps, extra tooling and heavily opinionated - and abysmally shitty - indentation.
Won't fly, dead on arrival.
Typescript I get, as do I get Dart, to some degree. Dito for Go and Rust. This PL is just a waste of time.
Where's an "homoiconic" JSON? (Score:2)
Re: (Score:3)
So you're saying you are actually productive and don't have extremely complicated environments where there are thousands of complex packages that all competing for attention and resources and interfering with each other in obscure ways so that an update can plunge you into a nightmare of incompatibility, not to mentions when some obscure sub-sub-sub component is either hijacked or corrupted or removed because the developer had a hissy fit and the entire ecosystem falls apart.
W
Re: (Score:2)
oh no... (Score:2)
Yuk (Score:2)
Creator of JSON (Score:2)
Like JSON is some kind of milestone. JSON is something that a real programmer would simply do as part of getting their work done. Anyone who thinks JSON is their crowning achievement is a failure.
Creator of JSON (Score:2)
Isn't JSON just static Javascript object definitions consisting of only literals? How is that inventing something?
Quick! someone write Misty - The Good Parts (Score:2)
Standards XKCD: https://xkcd.com/927/ [xkcd.com]
; Misty (Score:2)
Happy April 1st (Score:2)
Anyone else notice how the holidays start earlier and earlier every year?
Yawn, another nearsighted web-centric language (Score:2)
Bad philosophy from the get-go (Score:2)
"People might disagree on this, therefore I'll choose it to stop them from arguing" is such a stupid trend among some software developers. Ideally we avoid anything written by people like that.
Really? (Score:2)
We need another programming language like we need a hole in the head!
How about spend your time making an EXISTING programming language better.
The One True Indent Style (Score:2)
I've heard about the "one true brace style." This takes that to a whole new level.
So what, you get a compiler error if you have the wrong number of spaces? Lovely.
YAPL (Score:2)
Yet Another Programming Language.
Re: (Score:2)
It's kind of a neat idea when languages define a canonical representation. Go fmt offers something like that and most people follow it. But despite using Go for many years I'm not sure if there is a technical advantage to setting your formatting as part of the language spec.
Re: (Score:2)
But despite using Go for many years I'm not sure if there is a technical advantage to setting your formatting as part of the language spec.
For the compiler/parser, I doubt there's any technical advantage. As for programmers, anyone who complains about enforced indentation clearly has never had the misfortune of dealing with code without consistent and correct indentation. If having indentation define code blocks changes how your code looks at all, you would be Doing It Wrong without it.
Re: (Score:2)
This also indirectly enforces slightly more sensible metrics. In one place I worked, any change, even whitespace, counted as a source code change, so wrapping 1000 lines of code in an if...then counted as 1002 changed lines (which, of course, was coupled with a maximum 250 SLOC/hour inspection rate). The only way around this was to leave the original indentation in place, which made the code as messy as it sounds.
Compiler-enforced indentation would have solved this (but then again, so would development mana