Giter Site home page Giter Site logo

Comments (7)

NeuralCoder3 avatar NeuralCoder3 commented on May 27, 2024 1

Example file links to 404. Do you have an update?

Here is the file from when the issue was opened:
https://github.com/NeuralCoder3/thorin2/blob/84af1a073ab4e1a848def18cce2e6afc7fe567f1/enzyme/brussel.thorin

Here is the file currently: (Nothing big regarding this issue should have changed)
https://github.com/NeuralCoder3/thorin2/blob/84af1a073ab4e1a848def18cce2e6afc7fe567f1/enzyme/brussel.thorin
(the enzyme folder was moved into the eval folder)

from thorin2.

leissa avatar leissa commented on May 27, 2024

Example file links to 404. Do you have an update?

from thorin2.

leissa avatar leissa commented on May 27, 2024

I have to double-check with @f-fries but I think the problem is that the whole clos dialect assumes that the first argument is a mem. Otherwise, things go south as in your example.

from thorin2.

leissa avatar leissa commented on May 27, 2024

This is indeed the problem. I opened a new issue #126 as it really is an enhancement and closing this here for now.

from thorin2.

NeuralCoder3 avatar NeuralCoder3 commented on May 27, 2024

This is indeed the problem. I opened a new issue #126 as it really is an enhancement and closing this here for now.

Therefore, one needs a pass that reorders mem to the front and propagates it to functions without mem (higher order arguments and others) in order to generate the code.
Or would it be easier to adapt closure conversion?

from thorin2.

leissa avatar leissa commented on May 27, 2024

I think it makes everyone's life easier if we can just assume that the first argument is mem if present at all. But we should also enhance the closure conversion to also cope with functions without mem. I think it's cool to have this explicitly annotated on the type that a function is pure and it would be a pity if we would enforce impure functions.

from thorin2.

f-fries avatar f-fries commented on May 27, 2024

It might still be a good idea to uniformly add mems before/during closure conversion as @NeuralCoder3 has suggested.
Closure conversion actually introduces new side-effects (environment allocation etc).
So some pure functions would get a "pure closure" while others would end up with an "impure closure" with a different type.

from thorin2.

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.