6 ms·
Kotlin is like TypeScript
- yoshiokatsuneo 9y agoderived from Swift is like Kotlin: https://github.com/Nilhcem/swift-is-like-kotlin https://github.com/Nilhcem/swift-is-like-kotlin
- mbel 9y agoI guess that the next one will be: "Kotlin is like Rust", or perhaps there should be "Kotlin is like Go" first?
- bauerd 9y agoIf I squint my eyes hard enough TypeScript looks like a LISP
- avoidwork 9y agomaybe because it's javascript, which is borrows from scheme, which is a lisp?
- pavlov 9y agoMaybe the generalized version is simply: "All these new languages with C-derived syntax and automatic memory management are pretty much the same -- so pick the one that is most supported on your target platform, get to work, and don't worry about it." I'm kind of expecting someone to do a "Meta-Kotlin" next: a language that has the common intersection of features from Swift, Kotlin, C# and TypeScript, and offers tidy code generation for any of these.
- qcz 9y agoWhy not do "Kotlin is like PHP" or "Kotlin is like Visual Basic 6" immediately?
- mike_hearn 9y agoKotlin isn't much like Rust. A comparison to Go would be interesting, especially now Kotlin has coroutines.
- pjmlp 9y ago> "Kotlin is like Go" Curious how they would relate all the features Go lacks.
- melling 9y agolet x = 1 const x = 1 val x = 1 var x = 2 It's unfortunate each language has a different keyword for constants and variables.
- realharo 9y agoTypeScript has structural typing, that is a HUGE difference.
- seanmcdirmid 9y agoYa, I'm not away of any other popular OO language that goes this route. The implications of structural sub-typing are huge, though I guess many programmers wouldn't be able to call it out.
- boubiyeah 9y agoYes, that would be its biggest differentiator. Scala has it too indeed, but it's not the default mode and feels awkward, also has known limitations. The nice thing with typescript is that structural typing makes sense for 90% of the use cases, and for the remaining 10%, you can very easily simulate nominal typing by adding a field like so: interface Robot { __Robot: true }
- realharo 9y ago>interface Robot { __Robot: true } I would much prefer if they just added a new keyword to the language, instead of hacks like this. https://github.com/Microsoft/TypeScript/issues/202 https://github.com/Microsoft/TypeScript/issues/202
- janwillemb 9y agoWhy this comparison?
- yoshiokatsuneo 9y agoKotlin, Swift, and TypeScript have modern features like type inherence, null-safe, closure, and are supported by big company.
- TeMPOraL 9y ago> modern features like type inherence, null-safe, closure This is one of the more annoying problems with our industry. People rediscover solutions from 60s and 70s and sell them as if they were new and revolutionary...
- pjmlp 9y agoStill waiting for web developers to rediscover 90's RAD tooling.
- realharo 9y agoI don't think we're ever going to go back to that. Those UIs were pretty static, i.e. you only created the "initial state" in the UI designer, and then modified it during the application run-time (sometimes even creating new widgets in code), or attached some kind of data-binding models to it. With the popularity of things like React, you now have a powerful way to express how the UI looks in every state, not just the initial one.
- COil 9y agoI think we get it, every languages are like Kotlin!
- toppy 9y agoQuite opposite - Kotlin is like every language ;)
- atemerev 9y ago"Happy languages are all alike; every unhappy language is unhappy in its own way".
- realharo 9y agoname: string; constructor(name: string) { this.name = name } You don't have to do this in TypeScript either, you can just do constructor(public name: string) { } Also, the "Empty collections" section doesn't do the same thing, the collections you created in Kotlin are immutable. And the TypeScript ones have the value `undefined` (unfortunate that strictNullChecks doesn't catch things like that https://github.com/Microsoft/TypeScript/issues/8476 https://github.com/Microsoft/TypeScript/issues/8476). And for some nitpicking, please be consistent with your semicolons, either use them or don't use them, but don't mix it randomly like that.
- Cthulhu_ 9y agoSome of the TS examples also include an external library (lodash) to compare features; not sure if that's an apt comparison.
- ccozan 9y agoIs this Kotlin the new "Erlang" of the HN' first page?
- boubiyeah 9y agoKotlin is also like Kotlin
- noway421 9y agoNow, are there languages for which that doesn't hold true?
- dtech 9y agoThis is getting ridiculous
- noway421 9y agoKotlin getting love, this is nice, although in a very peculiar, syntax-comparison type of way.
- mhd 9y agoI wonder what's the oldest and/or most maligned language that you can use to make a similar comparison that's still somewhat valid...
- deleted 9y ago[deleted]
- codesternews 9y agoKotlin is like Swift Kotlin is like TypeScript that infer TypeScript is like Swift am I getting right? or Is there anything else?
- deleted 9y ago[deleted]
- Illniyar 9y agoType script is like c#? Scala is like c#? Is go like scala? Everything is C (or lisp).
- ptx 9y ago"for index in 1–5" is like "for let index of underscore dot range 1–6" in the same way Lisp is like COBOL.