Giter Club home page Giter Club logo

Comments (7)

Silmathoron avatar Silmathoron commented on June 19, 2024

Wouldn't it be possible to simply consider as declaration any left member where a variable name appears for the first time?
Otherwise I have no particular problem with the use of := for declaration, but this would be a breaking change in user api, so I guess this would depend on the policy that @heplesser and @DimitriPlotnikov want to follow (and of the current number of users)

from nestml.

PTraeder avatar PTraeder commented on June 19, 2024

@Silmathoron
While I dont see how that would be impossible, it would mean rearranging the AST as provided by the parser, since this is a grammar problem. I do this on other occasions. In this case it would be during symbol table creation, and a bit overkillish compared to the simple grammar change I proposed.
(Unless there is some grammar magic to be worked here. But I have little knowledge about MC/Antlr)

I have to note again:
This would not be a problem if I would not extend the solution from function declarations to all variables. The function keyword in the corresponding rule would be enough to distinguish bewteen declarations and assignments.

from nestml.

DimitriPlotnikov avatar DimitriPlotnikov commented on June 19, 2024

@PTraeder
Could you, please, write your short feedback, that we should do it and I'll close the issue?.

from nestml.

DimitriPlotnikov avatar DimitriPlotnikov commented on June 19, 2024

:= would be fine.

from nestml.

heplesser avatar heplesser commented on June 19, 2024

First a question to ensure that I understand everything correctly:

  • function f = a + b defines f as an alias for a+b, so that wherever f appears, it would be replaced by a+b and upon evaluation use the values of a and b that a current at the moment of evaluation
  • c = a + b is permitted only in an update section, in this update section---and only there---operations have a temporal order, and here the expression on the right hand side is evaluated and the resulting value assigned to c. Later changes to a and b do not affect the value of c

Is this correct? Then, I think, it would make sense to use := for the latter case independent of what we do about units. One might then even wonder if one needs the function keyword.

Concerning units, the question is what to do if units in an expression either do not match perfectly or are combined multiplicatively forming new units. Some examples:

  • Let a pA and b nA: which of the two would be choose as unit of f = a + b?
  • Let g nS and V mV: then neurosciencist would expect that the current g * V has units pA---can we infer this automatically?

I assume that people elsewhere have worked on inference of units, but I don't know that literature.

from nestml.

jougs avatar jougs commented on June 19, 2024

I agree with @heplesser's assessment that the function keyword is actually not be needed if we use := for the assignment of what we earlier called an alias.

Regarding the question of units, I think this should be possible by always using the natural neuroscientific unit (ms, mV, nS, pA, GOhm) if things become unclear with respect to the magnitude.

from nestml.

DimitriPlotnikov avatar DimitriPlotnikov commented on June 19, 2024

We decided to postpone the support of this due to more complex implementation of the language background. The effort for implementing it is currently not justified (since we are moving to PyNESTML)

from nestml.

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.