Hacker News new | past | comments | ask | show | jobs | submit | xigoi's comments login

I’m sad that the “fix” was to disallow “no” as a more readable alternative to “false”, rather than to disallow unquoted strings.

It’s silly to have so many keyword synonyms as specified in that earlier regex. I’m also glad we can’t specify numeric literals as roman numerals. KISS

Honestly I’d prefer if “yes” and “no” were the only ways to spell the boolean values. They make sense in pretty much all contexts where booleans are used, whereas “true” and “false” rarely make sense.

Boolean algebra with true and false was well established decades before computers were invented

Boolean algebra deals with logical propositions, not with configuration. The true/false terminology makes sense there.

In boolean logic true/false is ubiquitious and well known. As you can see, if one tries to be cute with it, one will get all sorts of issues. So at this point it doesnt make sense to use anything else.

The true/false terminology makes sense in boolean logic because you’re dealing with the truth of propositions. However, it does not make sense in the context of a configuration language, where there are no propositions that could be true or false.

It makes sense in the context of a configuration language because virtually 100% of programmers and other technical computer users understand “true” and “false” as the canonical Boolean values, and as far as I know that has always been the case. It never would have made sense to invent different unfamiliar terms like “yes” and “no” because of some niche philosophical distinction between “Boolean logic” and “configuration” that almost nobody in the real world cares about.

“yes” and “no” are “unfamiliar terms”? What the fuck? Everyone who knows even the basics of English knows what these words mean.

They are familiar as English words, yes, but unfamiliar as terms of art for Boolean values in computing. It’d be like replacing “if” statements with “whenever” statements.

Don’t give them any ideas! They already tried to make inroads with ruby’s “unless”.

Huh, I never considered this. we take true and false for granted everywhere but they aren't the most meaningful.

The fix is to make conversion user-controllable. If you want to disallow bare scalars except for booleans and numbers or whatever, it's just a little bit of configuration away.

Why do you need an alternative spelling of false?

`logging: no` clearly says “I do not want logging”. `logging: false` is less explicit – what exactly is false?

Then it should be on/off, not yes/no.

on/off also doesn’t make sense in many contexts, for example `isRegistered: on`.

I often prefer enums over booleans for this. It seems more readable for most cases, and can be extended with new values.

This:

    isRegistered: true
could be replaced with

    accountStatus: "UNREGISTRED"

Logging: no could also be log in norwegian. Or log only for the norwegian region. That's the thing with too many keywords and optional quoting, you can't know.

And for this reason, "logging: false" would be clearer than "logging: no" to represent "I do not want logging".


`false` could be a code for something else just as well as `no`. For example, it could mean that I only want to see logs of false information appearing in the system. The only proper solution is to require quotes around strings.

Options are either

1. Specify in the key

  loggingEnabled: false
2. Specify in the value:

  logging: disabled

Logging: ignore/print/file

Don’t use bool at all.


This, along with number formats, could be a good argument for strings being the only primitive type in config languages.

I recently learned about NestedText: https://nestedtext.org/

While it has the YAML-like significant whitespace, it looks nice because it doesn't try to be clever.


Yeah, you still get the same issue that 3 is an integer, 3.3 is a float and 3.3.3 is a string.

Function pointers can’t close over variables.

The other important bit here is garbage collection.

Local and anonymous functions that capture lexical environments really, really work much better in languages built around GCs.

Without garbage collection a trivial closure (as in javascript or lisps) suddenly needs to make a lot of decisions around referencing data that can be either on the stack or in the heap.


C++ does this and the decision to make is to capture by reference or value.

Environments aren’t a thing in Haskell etc. does that mean it’s not functional?


Yes, C++ is a great example of having to make decisions that don't have good solutions without a GC or something like. See mentions of undefined behaviour in relevant sections of the standard, i.e. when a lambda captures something with a limited lifetime.

Are you saying that Haskell doesn't have lexical environments? It very much does, just as all major languages of the ML language family do.


That has nothing to do with the value/pointer distinction.

And “close over” semantics differ greatly depending on the language.


A watch is more convenient. I don’t need to take my phone out of my pocket to see the time, I just look at my wrist.

I think you're quite underestimating how many times a person takes their phone out and it's way more than they turn their wrist around to see their watch

I bought a watch about half a year ago just because I was tired of taking out my phone to check the time, so I know what I’m talking about.

Yeah you are talking about yourself and only yourself.

Surely I’m not the only person on the planet who finds it useful, otherwise there would be no cheap watches because nobody would buy them.

I think V might be what you’re looking for?

We’re talking about the official website for a programming language, which has to reason to lie.

How much of that time is spent on text wrapping?

Murder is illegal, but still happens. Therefore, by your logic, we should legalize murder.

No, but when discussing laws against murder, we should not assume that they would eliminate murder. This article does assume that laws against advertising would eliminate advertising.

How is V a fraud? Last time I checked, the compiler worked and I was able to write and run complex programs, although I did run into some bugs.

I’ll bet my entire net worth that you can’t get an LLM exactly recreate Dropbox from this mescription alone.

> Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away.

—Antoine de Saint-Exupéry

If you’re writing thousands of lines of code for what can be described in a few words, the code is probably horribly overcomplicated.


Or maybe you're really good at writing words?

If you use too many words, you’re not good at writing words.

Join us for AI Startup School this June 16-17 in San Francisco!

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

Search: