GithubHelp home page GithubHelp logo

Comments (1)

alehander92 avatar alehander92 commented on May 26, 2024

That would be actually easy to implement. The problem with most kinds of compilers / transpilers is that they can't see the whole picture and they can't assume that there is no external dependency that e.g. uses I/O.
Pseudo-Python does whole program analysis and it supports a limited subset of external dependencies(currently a subset of the standard library) for which it can maintain all kind of metadata.
It would be trivial to add "uses IO" and "pure"(as in no other side effects) markers to the current type signatures and to add a Pseudo middleware that infers them for user-defined methods / functions.

The other issue with converting to Haskell / Clojure is local variable changes. Pseudo AST semantics are similar to those of a classic imperative language in order to support easily Python, Ruby, JS, C# transpilers as a target. That means that often logic in a function can be encoded with .push / []= / sort in place / a lot of temp variables. It's easy to convert that to nested let/letrec in Clojure or let in Haskell, however it would be probably very ugly. It would be nice to add a middleware that turns that kind of heavy-imperative style of code to more functional style so the actual generated code would be more idiomatic.

from pseudo.

Related Issues (18)

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.