GithubHelp home page GithubHelp logo

Efficiency of telescopes about sml-telescopes HOT 9 CLOSED

favonia avatar favonia commented on August 20, 2024
Efficiency of telescopes

from sml-telescopes.

Comments (9)

favonia avatar favonia commented on August 20, 2024 1

@jonsterling It seems no one except the library itself uses SnocView. We can probably drop it or make it super expensive. Also I only found two usage of cons in sequent.sml. It is probably not that difficult to implement output-restricted deques either. Maybe just a pair of lists is sufficient.

from sml-telescopes.

favonia avatar favonia commented on August 20, 2024 1

@jonsterling on the second thought the polymorphic recursion is not so hard to deal with. I paused the working because telescopes also support lots of other operations, like splice, where I wonder if there is a better data structure.

from sml-telescopes.

favonia avatar favonia commented on August 20, 2024 1

Closed as the current implementation seems fine.

from sml-telescopes.

jonsterling avatar jonsterling commented on August 20, 2024

@favonia At one time I had tried to do finger trees, but it was just too painful to code in SML sadly, so I would lean towards one of the other two options. Do you have any recommendations?

from sml-telescopes.

favonia avatar favonia commented on August 20, 2024

@jonsterling I think I need to know where and how SnocView and ConsView are used in practice.

from sml-telescopes.

jonsterling avatar jonsterling commented on August 20, 2024

@favonia My guess is that the thing is used most heavily is ConsView, as in: https://github.com/RedPRL/sml-dependent-lcf/blob/master/src/dependent_lcf/lcf.fun#L35

In general, we tend to traverse a telescope from the left (in "cons" style), but we usually append to a telescope from the right (in "snoc" style).

from sml-telescopes.

favonia avatar favonia commented on August 20, 2024

Hmm a queue would be much simpler. Do you think we really need both views?

from sml-telescopes.

jonsterling avatar jonsterling commented on August 20, 2024

@favonia That's a great point; somehow in the beginning, I expected that both views would be used equally often, but it seems like in practice that is not the case. I like your proposal...

from sml-telescopes.

favonia avatar favonia commented on August 20, 2024

@jonsterling Thanks. To decide between the amortized and worst-case analysis, is it common to share the same telescope everywhere? The worst case is that we share the telescope right before the data structure would start to adjust itself, where it will have to do the same adjustment many times.

from sml-telescopes.

Related Issues (7)

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.