Giter Club home page Giter Club logo

ketolang's People

Contributors

artem-zinnatullin avatar kenrube avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

ketolang's Issues

Build sample as part of CI

We already run tests of course, but would be nice to also build samples on CI to validate their correctness

Sample should be built targeting both JVM and Native platforms.

Migrate code analysis to FIR

After multiple discussions with JetBrains people, I was explained that Kotlin compiler is getting rearchitectured, in particular IR (intermediate representation) is getting split into Frontend IR (FIR) and Backend IR parts.

Currently, Ketolang hooks into IrGenerationExtension.

Ketolang code analysis should be moved to FIR when FIR is stabilized (currently in Alpha):

  • IntelliJ will be running FIR analysis via compiler and configured compiler plugins to validate code in IDE, which will automatically integrate Ketolang analysis into IntelliJ! (errors)
  • New IR architecture is faster than current IR — JB claims 4x improvement, since it doesn't rely on complete type inference nor complete code DOM tree being prepared in many cases nor global map of PSI symbols to parsed resolutions
  • FIR is the right place to analyze code and generate stubs of declarations, Backend IR is the right place to generate actual IR bodies

Ketolang code generation (if added) should be moved to Backend IR:

  • This way it won't slow down IntelliJ by generating code during code analysis, only FIR is going to be run in IntelliJ
  • Code generated in Backend IR or IrGenerationExtension is not available for IntelliJ within the same module, however FIR can generate declarations of the members while Backend IR can later inflate them with IR bodies.

See:

JB contact for this: Dmitry Novozhilov @demiurg906

[Feature Request/Question] Higher-Order Function with Receivers

Hi.

First off, this seems like a great project, and I am looking forward to keeping track of it's development.

I was wondering, will this project support higher-order functions with receivers? This seems like it would be very useful for allowing for common types of Kotlin-style DSLs for being defined in Ketolang, is (in my opinion) one of the most distinctive features of Kotlin, and I believe is still compatible with the goals of Ketolang.

One issue I see with this is that in order to be useful, Kotolang would probably have to also support interfaces to allow for useful receivers for builder DSLs. But then again, maybe defining data classes in a "record of functions" manner would be sufficient, e.x.

data class BuilderScope(
    val add: (Int) -> Unit
)

fun sillyBuilder(handler: BuilderScope.() -> Unit): List<Int> {
    // Internal mutable var -- allowed in Ketolang
    var ints = listOf<Int>()
    val scope = BuilderScope { ints = listOf(it) + ints }
    scope.handler()
    return ints
}

val example = sillyBuilder {
    add(1)
    add(2)
    add(3)
}

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.