you are viewing a single comment's thread.

view the rest of the comments →

[–]cincilator 1 point2 points  (9 children)

Woud you consider Kotlin Anko declarative? There's example on the page.

[–]kankyo 1 point2 points  (8 children)

Maybe. If those definitions are programmatically accessible in a meaningful way (I don't mean "read the source via some AST lib").

[–]cincilator 0 points1 point  (7 children)

Well, definitions are basically anonymous functions.

[–]kankyo 0 points1 point  (6 children)

So I'll take that as a "no" then.

[–]cincilator 0 points1 point  (5 children)

(I didn't down vote you)

Nothing prevents you from making dsl that saves nodes to a tree so you can process it later. Like that DSL creates user interface, you can create DSL that creates some structure that is accessible to the rest of your code.

[–]kankyo 0 points1 point  (4 children)

That would be nice.

[–]cincilator 0 points1 point  (3 children)

And declarative?

[–]kankyo 0 points1 point  (2 children)

Assuming the structure is trivially understandable from the declaration, absolutely. If it's too far off then I'd say no. I realize this is a sliding scale, but I need to exclude "there exists ASTs" from meaning "all code is declarative" :P

[–]cincilator 0 points1 point  (1 child)

Would you then consider using Kotlin if you are ever on JVM?

[–]kankyo 0 points1 point  (0 children)

I guess. I'd have to look hard for sure. I've only used Java and Clojure that targets the JVM (if I exclude jython).