Giter VIP home page Giter VIP logo

Comments (6)

dbrattli avatar dbrattli commented on June 3, 2024 1

At least the Map implementation is the exact same code as F#. Block uses tuples which should be very efficient (since Python knows they are immutable and backed by c-code). I'm considering changing the Fable List impl. to use tuples when targeting Python. But it's hard to optimize lists. They just get better at one thing, and worse at another 😄

from expression.

dbrattli avatar dbrattli commented on June 3, 2024 1

Yes, I could have done that now using Fable, but at the time I did it manually line by line. You can see that the Fable code (to the right) is not that different from Expression (on the left), but Fable still has a few more typing issues.

Screenshot 2022-09-21 at 11 03 34

from expression.

ShalokShalom avatar ShalokShalom commented on June 3, 2024 1

Oh wow, thats impressive on both sides 😄

from expression.

dbrattli avatar dbrattli commented on June 3, 2024

@ShalokShalom the collections are implemented as immutable data-structures, but in Python nothing is really immutable except str, tuple, so for example the Block is an immutable list built on a tuple, and using the Block with the API provided will keep it immutable. But the class containing the tuple is not immutable, so you could always replace the tuple. We could try to make that harder to do, but it's not really the goals of this library to work around such issues with Python. But for classes like Block we could improve things and make the contained value e.g prefixed with underscore or double underscore.

from expression.

ShalokShalom avatar ShalokShalom commented on June 3, 2024

Oh, I mean do they copy or reference? I mean, are they efficient, as immutable data structures in Clojure or FSharp? Or do they really copy stuff around, even though nothing is changed?

from expression.

ShalokShalom avatar ShalokShalom commented on June 3, 2024

Exact same code? You mean you transpiled your/a F# map implementation to Python?

from expression.

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.