I just released <https://nacular.github.io/doodle/...
# feed
n
I just released Doodle. A pure Kotlin UI framework for the Web. The difference compared to other frameworks is that it is not a nicer way to write HTML/CSS. Doodle apps actually don't use browser concepts at all. Single-language Doodle is written entirely in Kotlin and so are its apps. Doodle Applications do not use HTML, CSS styles or Javascript libraries. In fact, apps are not aware of the Browser (or Browser concepts) at all, and can be written entirely as common (cross-platform) code in multi-platform setups. Expressive Creating expressive, intuitive apps is natural with Doodle. It makes complex rendering easy with powerful, vector-oriented rendering, provides fully customizable layouts and simplifies pointer and keyboard handling. Simply define your View hierarchy, business logic and go. Vector Oriented It is easy to build beautifully detailed UIs with Doodle. All rendering in Doodle is vector-oriented; so ellipses, paths, lines, gradients, affine transforms etc. are as simple to use as images and rectangles. Precise Doodle gives you control over all aspects of the UI presentation, including pixel-level positioning, making it easier to precisely control rendering. Modular Doodle has several libraries and a collection of modules. This allows selective adoption of various features and helps with bundle size. Apps written with Doodle are also dependency-injected; and there are no global objects or state to make mocking challenging.
Copy code
class HelloWorld(display: Display): Application {
    init {
        display.children += object: View() {
            init { size = display.size }

            override fun render(canvas: Canvas) {
                canvas.text("Hello, world!",
                    at = Origin, 
                    brush = ColorBrush(Black))
            }
        }
    }

    override fun shutdown() {}
}

fun main() {
    application {
        HelloWorld(display = instance())
    }
}
👍 2
🎉 3
h
how is the dom manipulation?
a
API needs some work. Right now I can't understand what the code does without digging into the documentation.
h
does everything just get dispalyed on a canvas? How does it work? 🤔
a
Well, it is obviouslt game-oriented, so it makes some sense, but still, it is not clear what is the aim in this particular case.
n
Display happens with regular elements and svg. Canvas here is a Doodle concept.
a
And by the way, Doodle is a well-known trademark, so the naming could be confusing.
2
😄 1
n
The API is different from most web frameworks that expose element manipulation directly. Here, apps are not aware of the DOM or browser. I'd like to hear feedback about how easy it is to understand as you go through the docs.
a
Not easy
And the problem is not in documentation, but in the API organization. Your main example is really confusing.
☝️ 1
Just for comaprison, look at minimal example by tornadofx: https://edvin.gitbooks.io/tornadofx-guide/part1/3_Components.html
h
Yes! TornadoFX's API is really nice. I love how it is structures and how intuitive it is. Perhaps you should look into that 🙂
n
A key difference might be declarative styles vs this.
a
Imperative is seldom more expressive than declarative, but it is quite easy to make imperative code readable in kotlin.
👍 1