Coder Social home page Coder Social logo

Comments (4)

UnsignedByte avatar UnsignedByte commented on July 17, 2024

This creates an ambiguity issue with let bindings: let PARAM = PARAM2 now has no syntactic difference from let port = port2. Should we change let port = port2 to let port p= p2 or something like that? @rachitnigam

from filament.

rachitnigam avatar rachitnigam commented on July 17, 2024

No, this is why it’s a non trivial change because it requires syntax disambiguating to figure out what is a port, a param, and an event.

from filament.

rachitnigam avatar rachitnigam commented on July 17, 2024

Let me expand on the comment above a little bit. This ambiguity problem shows up almost every single language. For example, in Rust, type identifier, struct names, and variables all use the same syntax:

struct Foo;
type Bar = Foo;
fn baz(x: Bar) {
  let Bar = x;
}

The problem for the rust frontend is to look at this code and figure out the correct binding for each symbol. In this case, the position of each identifier exposes the binding chain we need to look at. When you look at type <ID> = <Expr>, the Expr can only mention other identifiers in the type name bindings. Similarly, when looking at let <ID> = <Expr>, we know that Expr comes from the identifiers defined as variables.

The reason Rust doesn't have to do what Filament does, which is have distinct looking identifiers for different kinds of terms, is because it separates the frontend from the core representation(s). Now that we also have that separation in Filament, what we should actually do is remove the syntactic difference between ports, params, and events completely and use astconv to resolve these things for us.

from filament.

rachitnigam avatar rachitnigam commented on July 17, 2024

We've made this change!

from filament.

Related Issues (20)

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.