Giter Site home page Giter Site logo

aardvark's People

Contributors

chop0 avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

aardvark's Issues

Swap bitwise with logical operators

Proposal

The shorter variants should be used for logical operators rather than bitwise operators as the former is used more often, so

  • & | ~ are the logical AND, OR, and NOT operators, respectively.
  • && || ! are the bitwise AND, OR, and NOT operators, respectively.

^ should also be reserved for exponentiation, so XOR can be something obscure like ^^.

Rationale

&, |, and ~ have roots that might be more recognizable. For example, & is used in English for "and," and ~ is used for negation in math. | is already used in some syntaxes for multiple options, like regex a|b. ^ is commonly used for exponentiation.

In addition, a single character is easier to type (though admittedly the impact of this is negligible), so it should be used for the operator that is used more often.

Duplicating the symbol for bitwise operators would be in line with the bitwise shift operators, >> and <<. Good thing existing languages don't do it the other way around!

Epic syntax idea:

Epic syntax idea:
>> means return

Example (using kotlin syntax but with the return idea)

fun addThree(x: Int): Int {
    >> x + 3
}

Originally posted by @ky28059 in #2 (comment)

RFC guide

RFCs (request-for-comment)s should be posted here; these are proposals to the language, which may include:

New syntax
Standard library features
Bug fixes
Language features
Once accepted, they will be marked as so, and further discussion of the feature will continue.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.