<@U0B89TFRD> framework free is not so interesting....
# javascript
a
@alex framework free is not so interesting. As I wrote before, it will not attract people until they don’t able to use their favourite frameworks. Would you use Kotlin if it hadn’t java interop?)
k
@apomelov are you a front-end/JavaScript developer?
a
@konsoletyper no, I’m not. I’m a backend developer and the whole my live a was trying to avoid frontend development. The main reason for this was javascript 😃 I’m doing a small project with react and ES6. It looks better, but I still want to write all code in a single language. Just not to switch "syntax context” developing full-stack app
👍 1
k
If you are not front-end developer, how can you have favourite framework for JavaScript? As a Java developer myself, I feel all these JS framework are clumsy. I wish there was a brand new framework for Kotlin, based on idioms natural for Kotlin.
a
I know what means, when you use some frameworks and somebody brings a new language with it’s own framework “based on idioms”. When I work with spring and need to perform several DB actions in a single transaction I just put
@Transactional
to the service method. But we have a project, written in scala that uses slick framework for db interaction. It’s 100% pure functional. You can’t just create a user and then send him a message. You should create an “action” and call a map/flatMap on it to create a next action based on results of the first one. And you need something more complicated you need to fuck your brain first 😃 But there is “for comprehension” in scala that will show this chain of maps flatMaps and filters as a imperative code. Anyway I’ll never use slick. And if it would be the only way to connect to database in scala I will never use scala. Kotlin is a general purpose language so I’m not sure it’s correct to say “framework based on idioms”. You can write code “based on idioms”, but for frameworks all general patterns are already invented and implemented. If you chose only one and there will be no ability to use anothers, your audience will be quite small. DISCLAIMER: my very personal opinion 🙂
k
It's true for JavaScript developer who already used to JavaScript frameworks. A JavaScript developer is comfortable with JavaScript/ES6/TS, and they don't have enough motivation for changing the language. Who has more motivation is a person who already has chosen Kotlin for back-end and wants to write front-end in Kotlin as well. And Kotlin is quite popular in Java developers' comminity
Idioms are quite different, anyway
For example, JS/ES does not have types at all (whereas Kotlin comes with powerful type system). And even comparing to TS, Kotlin is quite different. Examples are: 1. Union types in TS vs. algebraic data types (aka sealed classes) in Kotlin 2. Unions of strings in TS vs. enums in Kotlin 3. Bivariance in TS vs. invariance/covariance/contrvariance in Kotlin Etc, etc
So, what will be wonderful is a framework for developing FE which is easily interoperable with existing back-end technologies, for example: 1. JAXB, Jackson, JAX-WS and JAX-RS for comminicating between server and client 2. CDI and Spring annotations for DI 3. Templating engine similar to existing ones for Java, for example, to Thymeleaf. Similar, but not exacly the same. Bidirectional mapping, validation and auto-update are required. May be reuse some annotation and template syntax, may be enrich with some additional features (say, to support bidirectional databinding).
It's my personal opinion as well
a
imho it’s just details, details of the language, they're low level. When we a talking about frameworks, there are high level ideas. I’m a backend developer because I don’t like javascript, but I understand that being a full-stack developer can be more efficient.
k
No one says that Kotlin FE framework should be based on different new ideas. Ideas are the same for multiple JS frameworks, the problem is how to express these ideas.
s
Imagine that somebody build it, what are the latest guidelines to publish and use such Kotlin FE framework from a Kotlin2JS app ?
Should it be published as a JAR?
I have not followed latest 1.1 updates on that so I am not 100% sure
ping @konsoletyper
k
There isn't one. You are free to publish it in any format. You can pack JS files together with metadata into jar file and publish it on maven or jcenter. You can publish your code to npm.