Follow Slashdot stories on Twitter

 



Forgot your password?
typodupeerror
×
Programming

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.

This discussion has been archived. No new comments can be posted.

Creator of JSON Unveils New Programming Language 'Misty'

Comments Filter:
  • by Guspaz ( 556486 ) on Monday December 18, 2023 @01:47AM (#64088343)

    Why is the entire summary about whitespace? Who cares about the whitespace? It's the least important thing about a language.

    • by CaptQuark ( 2706165 ) on Monday December 18, 2023 @02:04AM (#64088359)

      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?

      • by Junta ( 36770 ) on Monday December 18, 2023 @02:31AM (#64088397)

        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.

        • by saloomy ( 2817221 ) on Monday December 18, 2023 @01:16PM (#64089435)
          Indentation by a programming language as a form of structure is so asinine, it actually tells you all you need to know about the language. So, the fact that it went into detail in the summary tells you all you actually do need to know about it: steer clear. White-spaces are not uniform. There are tabs, spaces, nbsp;, indentation in custom document formats, etc... to use them as syntax in a programming language for structure is absolutely a dumb ass solution, and I refuse to even hear counter-arguments as to why it is a good idea. It isn't. Take whatever good argument you have for it, like it makes code always readable, and throw that argument away. You're wrong. Code should be able to be minified, put in blocks, organized, read, written by clipboards, represented in a browser, code block, etc... all the while maintaining syntax, which is important. Whitespaces fails that, so fails at its task. What's next? Important variables are in bold? Please. Whitespaces ruin python. Just because you got used to fucking with it doesn't make it good.
        • by ceoyoyo ( 59147 )

          The author is trying to describe a tab character as spaces and also make it sound like it's a cutting edge new feature.

        • 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.

          • by Junta ( 36770 )

            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

      • by narcc ( 412956 ) on Monday December 18, 2023 @02:43AM (#64088409) Journal

        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.

      • 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

    • Yeah, this is absolutely dumb. If you want indentation enforcement in this manner, use Python. If you want code that is easier to read, limit the number of blocks within a function and the number of sub-blocks as well. This will stop the 500 line function and is likely the ultimate goal.
    • Probably because the rest of it is just another bunch of random language ideas thrown against a wall. There's nothing else specific to focus on and summarise, so whitespace it is.
    • 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 ...

      • by N1AK ( 864906 )
        Awefully snarky for someone who can't manage to comprehend that something being the least important thing about a language doesn't make it irrelevant. If Python only ran on 8 bit processors, was 10,000x less efficient, had to be programmed in a specific godaweful IDE, and had restrictive licensing controlled by a known bad actor, then no one would be using it and how it interprets whitespace wouldn't be discussed because it's trivial by comparison.
    • 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.

      • by ChunderDownunder ( 709234 ) on Monday December 18, 2023 @04:02AM (#64088505)
        A milestone in a programmer's decline starts when they write a blog post about pronouns.

        Stallman [stallman.org] prefers "Person" (or "perse"), "per", and "pers".

        Crockford [crockford.com] prefers "pe" and "per".

        • 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.

        • by znrt ( 2424692 ) on Monday December 18, 2023 @06:16AM (#64088609)

          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)

    • 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).

    • by Rufty ( 37223 )
      Except in the language WhiteSpace [wikipedia.org] where the white space is the language.
  • by Mr. Dollar Ton ( 5495648 ) on Monday December 18, 2023 @02:01AM (#64088355)

    Are we getting an "AI"-generated computer language soon?

  • No. Really. Why?!

    At this point we have more garbage languages than problems

    • Can't wait for his next language named GIGO
      Is that name taken already?

    • 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.

  • Sounds like a derivation of Scheme. I rather take care of parentheses than white spaces.
  • 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)

    by OverlordQ ( 264228 ) on Monday December 18, 2023 @02:19AM (#64088375) Journal

    Python, but somehow worse.

    • Re:So (Score:5, Informative)

      by fahrbot-bot ( 874524 ) on Monday December 18, 2023 @02:57AM (#64088429)

      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?

      • Well, tabs are evil since they are not the same size in every editor. But.....all such issues are irrelevant If you autoformat on save, no matter what language you're in.
        • Re: So (Score:5, Informative)

          by Meneth ( 872868 ) on Monday December 18, 2023 @03:55AM (#64088497)
          Tabs are good since they can be whatever each user wants.
          • That assumes the ability to see the same code different ways is a virtue. In fact, it assumes the whole concept of personal style has merit. I'm not convinced of that. Pick a style rule and autoformat. You'll be happier.
            • 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.

      • Just in case you needed another language to learn and clutter up the world.

    • Re:So (Score:5, Interesting)

      by narcc ( 412956 ) on Monday December 18, 2023 @04:37AM (#64088525) Journal

      I didn't think such a thing was possible outside of languages with intentionally bad design, but here we are...

    • by gweihir ( 88907 )

      Sounds like it. I don't think I can even be bothered to have a look.

  • A few tidbits (Score:5, Informative)

    by Samantha Wright ( 1324923 ) on Monday December 18, 2023 @02:30AM (#64088391) Homepage Journal

    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)

      by Junta ( 36770 ) on Monday December 18, 2023 @02:54AM (#64088425)

      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.

      • by dargaud ( 518470 )
        Lately I've been programming in C using a font called Fira Code that does ligature and all kind of weird graphical shortcuts. It looks nice and doesn't require you to learn anything, unlike this proposed system.
    • Thanks for wading through that sludge for us.

    • 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

    • by ceoyoyo ( 59147 )

      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...

      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.

      • 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.

    • by youn ( 1516637 )

      insightful, informative and very objective, thanks

  • by vbdasc ( 146051 )

    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.

    • by Pieroxy ( 222434 )

      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.

      • by LesFerg ( 452838 )
        I recently came across the Nim language and it was interesting enough to look into it further. When I got to the part in the intro describing indentation defined code blocks I was a bit disappointed, but may still continue to learn and try it out. Really just for a change from the .Net and older tech that I work with, and a general disinterest in gaming lately, more than a search for a new and/or better programming language.
      • 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

        • by Pieroxy ( 222434 )

          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.

  • by peppepz ( 1311345 ) on Monday December 18, 2023 @02:51AM (#64088419)
    Pardon the rant, but I've just received a lot of stuff I don't like all in one gulp: Javascript, semantic whitespace, and impositions from groups of people who "know better" in order to create social harmony.

    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.

  • by Opportunist ( 166417 ) on Monday December 18, 2023 @02:53AM (#64088423)

    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.

    • by jeti ( 105266 )
      Most Germans speak English. If they are programmers, it's a given. I would always read "Misty" as an English term and not associate it with "Mist".
      • Believe me, it would.

        Just like "cloud" gets tongue-in-cheek translated as "klaut", imperative plural of klauen, to steal.

      • 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.

    • "manure" would be the closest equivalent

  • by goranb ( 209371 ) on Monday December 18, 2023 @02:55AM (#64088427)

    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

    • by ceoyoyo ( 59147 )

      Nah, it would be awkward because there isn't a key on the keyboard for it.

      • by goranb ( 209371 )

        maybe use the tab key? ;)

        • by ceoyoyo ( 59147 )

          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.

    • 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.

  • 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.

    • by bn-7bc ( 909819 )
      meh on demand printing is a thing, no shelfsopace or initial print volume needed
    • 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.

  • by 93 Escort Wagon ( 326346 ) on Monday December 18, 2023 @03:19AM (#64088459)

    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!

  • Indents vs. spaces. Hehehe.
  • by Traf-O-Data-Hater ( 858971 ) on Monday December 18, 2023 @03:57AM (#64088501)
    You can say that you're leading me on
    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.
  • 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?

    • 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

  • by lsllll ( 830002 ) on Monday December 18, 2023 @04:20AM (#64088511)
    - You heard of this thing, the 2-space indentation?
    - Yeah, sure, 2-space indentation. It's standard
    - Yea, this is going to blow that right out of the water. Listen to this. 4 .... space .... indentation
    - 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).
  • I assume those evil tab characters are out too. The tab key is fine but the lack of a widely accepted standard for how many spaces a tab is make them evil when they find their way in to file.
    • 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.

    • Tabs are the manifestation of Satan.

  • 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?

  • 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.

  • After a watching a youtube talk Doug Crockford gave on what's wrong with the current crop of programing languages, I had high hopes for Mysty. Like me, Crockford is a big fan of Erlang, which its founder Joe Armstrong described as a concurrency oriented programming language. It's only modern competitor is Go. A frustration I have with Erlang is it's core team don't think much of JSON, understandably since its compound data syntax predates JSON and looks fairly similar, but with advantages such as being able
    • "basically I live in the 70s"

      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

      • 70s programing languages are like 70s rock bands... way more original and exciting than anything available today.
  • Not yet another language because he doesn't like what's already available. There are already way too many languages, and none really improve what's already available.
  • Significant white space is terrible. I hate it about python and I discourage it's use in adoption and will fight tooth and nail to avoid ever writing a single line in this programming language because required white space is total bullshit. You should be out all right code and whatever shape you like as long as it's legit syntax and parsed correctly.
  • 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.

  • Isn't JSON just static Javascript object definitions consisting of only literals? How is that inventing something?

  • Likely to be one of the shortest books.

    Standards XKCD: https://xkcd.com/927/ [xkcd.com]

  • Does it allow comments ?
  • Anyone else notice how the holidays start earlier and earlier every year?

  • Meh. Another month has passed.
  • "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.

  • "says Crockford "has created a new programming language called Misty"

    We need another programming language like we need a hole in the head!

    How about spend your time making an EXISTING programming language better.
  • 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.

  • Yet Another Programming Language.

Children begin by loving their parents. After a time they judge them. Rarely, if ever, do they forgive them. - Oscar Wilde

Working...