Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

What if I want to use the same language on both client and server?


Kotlin! :) Which incidentally added coroutines and async/await in the recently released version 1.1.

Server-side (running on the JVM): http://kotlinlang.org/docs/reference/server-overview.html

Compiling to JavaScript for the client side: http://kotlinlang.org/docs/reference/js-overview.html

...and for the Android client, compiling to Java bytecode, using the regular Java-based Android APIs and SDK: http://kotlinlang.org/docs/reference/android-overview.html

For iOS and other targets where you don't want the Java or JS runtimes, native compilation via LLVM is in the works: https://github.com/JetBrains/kotlin-native/


Might be a good idea to start using PHP as a browser scripting language then


Rust has a WebAssembly backend :-)

All we need a web framework written in Rust which includes the generation of client-side code.

Paired with incremental compiles (yet to land in stable AFAIK) that should be pretty awesome.

Edit: nose


A very long time ago (1994) I did hack Mosaic about to use Perl as a a client side scripting language... :-)


Dart should take care of that:

https://www.dartlang.org

Note - Haven't tried it yet, but it's on my ToDo list. ;)


Various languages can generate server-side code and javascript. Since you asked, Nim generates C, JS and more: https://nim-lang.org/


You could also use Purescript, even sharing the same modules between the frontend and backend.




Consider applying for YC's Winter 2027 batch! Applications are open till November 2.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: