GNU social JP
  • FAQ
  • Login
GNU social JPは日本のGNU socialサーバーです。
Usage/ToS/admin/test/Pleroma FE
  • Public

    • Public
    • Network
    • Groups
    • Featured
    • Popular
    • People

Conversation

Notices

  1. Embed this notice
    Niki Tonsky (nikitonsky@mastodon.online)'s status on Friday, 01-May-2026 02:28:03 JST Niki Tonsky Niki Tonsky

    If I ever to create my own programming language, I’ll make sure that |x| means abs(x)

    In conversation about 2 months ago from mastodon.online permalink
    • Embed this notice
      Niki Tonsky (nikitonsky@mastodon.online)'s status on Friday, 01-May-2026 02:54:53 JST Niki Tonsky Niki Tonsky
      in reply to
      • Mark Dominus

      @mjd I am not sure I ever dreamed of overloading brackets but I still want a language strings use paired “” quotes instead of identical "" ones. I just feel slight discomfort when start and end symbol of a sequence are the same

      In conversation about 2 months ago permalink
    • Embed this notice
      Mark Dominus (mjd@mathstodon.xyz)'s status on Friday, 01-May-2026 02:54:54 JST Mark Dominus Mark Dominus
      in reply to

      @nikitonsky For a while I was thinking about a language where the semantics of brackets was user-definable at compile time. You could have (a,b,...) assemble one sort of list, and [a,b,...] assemble a second sort, and then similarly “applying” (juxtaposing) the expression E to the object from [a,b,...] might perform an array lookup on E or something like that.

      My main idea was to permit the programmer to choose and define notations for things like sets, bags, tuples, and vectors, and for array and hash subscripting to be controllable and not hardwired into the syntax. But I'm sure that `|x|` was one of my example use cases.

      Some paper of @pigworker has a horrible hack in which `Ii x y z … iI` is defined so as to perform a certain sort of computation, with `Ii` and `iI` playing the role of brackets `Ii` has a typeclass defined so that `Ii x y z...` accumulates the `[x, y, z, ...]` at compile time, and then `iI` is some unique value with a special type that triggers the compiler to figure out that it has seen the whole list and should actually do the thing.

      In conversation about 2 months ago permalink

      Attachments


    • Embed this notice
      Niki Tonsky (nikitonsky@mastodon.online)'s status on Friday, 01-May-2026 18:51:42 JST Niki Tonsky Niki Tonsky
      in reply to
      • Andrew Helwer

      @ahelwer shame it didn’t work out. But this is specific to TLA+, most other languages don’t have | and || infix operators. The only problem with parsing would be that you can’t nest it, like you can’t write abs(abs(x)) and then parse it reliably ||x||

      In conversation about 2 months ago permalink
    • Embed this notice
      Andrew Helwer (ahelwer@discuss.systems)'s status on Friday, 01-May-2026 18:51:43 JST Andrew Helwer Andrew Helwer
      in reply to

      @nikitonsky we looked at adding this to TLA+ recently for set cardinality, but the already-existing | and || infix operators made for some really horrifying parse ambiguities https://github.com/tlaplus/rfcs/issues/9

      In conversation about 2 months ago permalink

      Attachments

      1. Domain not in remote thumbnail source whitelist: opengraph.githubassets.com
        Support `|S|` as alternative to `Cardinality(S)` · Issue #9 · tlaplus/rfcs
        I and others occasionally wish to write the more concise |S| instead of Cardinality(S). Perhaps, this is a feature that can be piggybacked on the Unicode-related changes, although |S| will be a bre...

Feeds

  • Activity Streams
  • RSS 2.0
  • Atom
  • Help
  • About
  • FAQ
  • TOS
  • Privacy
  • Source
  • Version
  • Contact

GNU social JP is a social network, courtesy of GNU social JP管理人. It runs on GNU social, version 2.0.2-dev, available under the GNU Affero General Public License.

Creative Commons Attribution 3.0 All GNU social JP content and data are available under the Creative Commons Attribution 3.0 license.