Hacker News new | past | comments | ask | show | jobs | submit login

This seems unnecessarily terse. If you want types, why not make it look like one of the existing popular languages with types? (Rust/TypeScript/protobuf)

Instead of:

    uxf 1
    =Database server:str ports:list connection_max:int enabled:bool
    =DateTime when:datetime tz:str
    =Owner name:str dob:DateTime
    =Hosts name:str
    [
      (Owner <Tom Preston-Werner> (DateTime 1979-05-27T07:32:00 <-08:00>))
      (Database <192.168.1.1> [8000 8001 8002] 5000 yes)
      (Hosts
        <alpha>
        <omega>)
    ]
Why not:

    type Database {
      server: str,
      ports: list,
      connection_max: int,
      enabled: bool,
    }
    type DateTime {
      when: datetime,
      tz: str,
    }
    type Owner {
      name: str,
      dob: DateTime,
    }
    type Hosts {
      name: str,
    }

    [
      Owner('Tom Preston-Werner', DateTime('1979-05-27T07:32:00', '-08:00')),
      Database('192.168.1.1', [8000, 8001, 8002], 5000, yes),
      [
        Hosts('alpha'),
        Hosts('omega'),
      ],
    ]
Evidence shows that people like that kind of format, for "plain text human readable" purposes. They are also used to it. It's only 20% longer, and you can also go with a Haskell-style syntax if you dislike braces.

What's the point of a plain-text format that is not human-friendly? Especially for type definitions, do you expect people to write this or do you want them to compile their schema from a different human-readable format into your human readable-format (and why)?




I agree, visually parsing things that are all on one line is more difficult than it needs to be. Putting separate things on separate lines is preferable.


> Evidence shows that people like that kind of format,

I agree, but I don't know that why people like that kind of format is settled. I suspect it's because the majority of today's software has to touch the web, and the only programming language built into web browsers happen to consume and produce that kind of format natively.

In other words, I think it's popular, but I think it's popular because it's the path of least resistance for interfacing with the web, which isn't necessarily a priority all the time.


> Evidence shows that people like that kind of format

Please cite this evidence. I like your proposed format, just interested in that research.


The existing programming languages are the evidence. Sorry I thought that was clear. I'm suggesting they take hints from the structured languages that humans actually read and write.


They're evidence that people like that style. Which is not evidence that people wouldn't like another style.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: