pervognsen ,
@pervognsen@mastodon.social avatar
ALT
  • Reply
  • Loading...
  • pervognsen OP ,
    @pervognsen@mastodon.social avatar

    Anyway, I was reminded of that old HN post because I keep typing opt-level = 2 in Cargo.toml files and getting an error since opt-level is a string. For a human-friendly config format, I think I'd rather have schemas than types. It also solves the backward compatibility problem where you prematurely use a string type because you don't know if you'll need the flexibility in the future. You see this right now with the workspace.resolver field where it's string typed but valid values are numerals.

    pervognsen OP ,
    @pervognsen@mastodon.social avatar

    Maybe we shouldn't have built the world's standard interchange format on one language's choice to only offer floating-point numbers (outside of typed arrays like Int32Array). You're basically left with stringly-typing your scalars if you want to have an actual interchange format.

    zeux ,
    @zeux@mastodon.gamedev.place avatar

    @pervognsen 2^53 positive integers should be enough for everyone

    steve ,
    @steve@discuss.systems avatar

    @pervognsen floating-point isn't the problem here, fixed-width types are. This wouldn't be any different if JS had "Int32" as its universal number type.

    pervognsen OP ,
    @pervognsen@mastodon.social avatar

    @steve I completely agree. If you're going to have numeric types in a format like this they should be actual numbers. Arbitrary-precision integers, and decimal floating-point if you're going to accept decimal notation for fractional numbers. Unfortunately that would probably lose in a "worse is better" way.

    steve ,
    @steve@discuss.systems avatar

    @pervognsen /gleefully rubs hands while sketching out "computational real serialization format"/

    pervognsen OP ,
    @pervognsen@mastodon.social avatar

    @steve Time to define an abstract machine model and have numbers be encoded as programs.

    steve ,
    @steve@discuss.systems avatar

    @pervognsen “my spreadsheet’s been loading for two days, but I can’t tell if the process is hung or not.”

    pervognsen OP ,
    @pervognsen@mastodon.social avatar

    @steve BeaverVM

    pkhuong ,

    @pervognsen Technically, json is agnostic to what you do with the substring of characters that looks like an integer ;)

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • tech
  • kbinEarth
  • testing
  • interstellar
  • wanderlust
  • All magazines