Git Product home page Git Product logo

demu's Introduction

logo

EO principles respected here DevOps By Rultor.com We recommend IntelliJ IDEA

mvn PDD status codecov Maven Central Hits-of-Code Lines of code License

DeMu

It's a well known fact that programs with immutable objects much easy to maintain, test and use, but the main benefit form immutable objects is that they allow performing more aggressive optimizations [1] and apply more valuable analysis. DeMu is exactly the tool for removing mutable objects like memory and cage from EO programs. Actually, DeMu is acronym for De-Muatabilization.

Methodology

There isn't single formal methodology or algorithm for converting mutable objects into immutable, but we can use some separate methods to achieve this.

Using SSA form for simple cases

We actually can apply SSA [2] form for eo programs. This approach can immediately remove some usages of mutable objects. Let's consider the following example:

[] > example
  cage 0 > index
  seq > @
    index.write 1
    stdout
      sprintf
        "%s"
        index
    TRUE

After applying SSA form we get something like the next:

[] > example
  seq > @
    stdout
      sprintf
        "%s"
        1
    TRUE

And as you can see - we removed usage of cage from the result program. The relation between SSA form and Dataflow Languages (like EO and, particularly, Functional Programming Languages) is quite well described in that article [3].

Using recursion for loops

The second method is to convert loops into recursive calls.

Related articles and links

  1. Immutability specification and its applications
  2. Global Value Numbers and Redundant Computations
  3. SSA is Functional Programming

How to Contribute

Fork repository, make changes, send us a pull request. We will review your changes and apply them to the master branch shortly, provided they don't violate our quality standards. To avoid frustration, before sending us your pull request please run full Maven build:

$ mvn clean install -Pqulice

You will need Maven 3.3+ and Java 8+.

demu's People

Contributors

renovate[bot] avatar rultor avatar volodya-lombrozo avatar yegor256 avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

demu's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

github-actions
.github/workflows/codecov.yml
  • actions/checkout v4
  • actions/setup-java v4
  • actions/cache v3
  • codecov/codecov-action v4
  • ubuntu 22.04
.github/workflows/mvn.yml
  • actions/checkout v4
  • actions/setup-java v4
  • actions/cache v3
.github/workflows/pdd.yml
  • actions/checkout v4
  • ubuntu 22.04
.github/workflows/xcop.yml
  • actions/checkout v4
  • ubuntu 22.04
maven
pom.xml
  • com.jcabi:parent 0.64.1
  • org.eolang:eo-parser 0.33.0
  • com.jcabi:jcabi-xml 0.29.0
  • org.cactoos:cactoos 0.55.0
  • org.eolang:jucs 0.2.0
  • org.eolang:xax 0.0.5
  • org.yaml:snakeyaml 2.2
  • org.junit.jupiter:junit-jupiter-api 5.10.1
  • org.junit.jupiter:junit-jupiter-params 5.10.1
  • com.qulice:qulice-maven-plugin 0.22.0

  • Check this box to trigger a request for Renovate to run again on this repository

DeMuTest.java:36-37: We have to implement full...

The puzzle 2-a83636d3 from #2 has to be resolved:

* @todo #2:90min We have to implement full integration tests for DeMu. It is convenient to have
* some examples of eo programs, parse them to XMIR and then apply DeMu.

The puzzle was created by @volodya-lombrozo on 21-Dec-22.

Estimate: 90 minutes, role: DEV.

If you have any technical questions, don't ask me, submit new tickets instead. The task will be "done" when the problem is fixed and the text of the puzzle is removed from the source code. Here is more about PDD and about me.

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.