Giter Club home page Giter Club logo

Comments (4)

AleMorales avatar AleMorales commented on May 22, 2024

I can certainly take a look. An option is to explicitly map the initial and final subtypes (e.g. DependentVariable => Variable for the nonlinear system hack) and have some default for the rest.

But I think there is a bigger issue than naming and is the fact that certain DSL will also require to create their own types that eventually lower into a Variable of a given subtype (potentially losing information in the process, which we may not want to). Making Expression an abstract type was a great step forward as I can create my own types that generate correct Operations, when applying the registered functions (and lower them to Variable at the end). But that makes me wonder whether DependentVariable et al. should also be abstract types (or some orthogonal trait system) rather than types.

from modelingtoolkit.jl.

ChrisRackauckas avatar ChrisRackauckas commented on May 22, 2024

But that makes me wonder whether DependentVariable et al. should also be abstract types (or some orthogonal trait system) rather than types.

The issue there is that it will never be inferrable, so we'd want to avoid types as otherwise things could slow to a crawl because every piece of code becomes dynamic. As we have it, most things are non-dynamic except for Expression vectors. This is a lot like Julia's AST which uses symbols for things like functions in order to avoid overtyping. But,

But I think there is a bigger issue than naming and is the fact that certain DSL will also require to create their own types that eventually lower into a Variable of a given subtype (potentially losing information in the process, which we may not want to).

That shouldn't lose any information if we just allow information by composition. If we just allow a boxed composition pointer, then most of the generic routines can safely ignore that without an issue.

An option is to explicitly map the initial and final subtypes (e.g. DependentVariable => Variable for the nonlinear system hack) and have some default for the rest.

I don't think we need to explicitly map since making the names flexible will have other advantages anyways.

from modelingtoolkit.jl.

ChrisRackauckas avatar ChrisRackauckas commented on May 22, 2024

Generic composition is now allowed via the context field.

from modelingtoolkit.jl.

ChrisRackauckas avatar ChrisRackauckas commented on May 22, 2024

(1) is complete.

from modelingtoolkit.jl.

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.