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

One of the strengths of JS is how the runtime environment can be dynamically interrogated and polyfilled, and how it can often gracefully degrade if there's a mismatch between static assumptions and runtime behavior.

Is there a vision for how PureScript/ReasonML/Elm etc. can accomplish the same thing?

The brute force approach is to place a boundary between everything external and handle it via an FFI. This adds friction: apps built under this approach are less capable and evolve less gracefully. I hope there's a better solution.



Nim is another language with a JS backend and it is also kinda good at this: it has a pretty good type system, but it's easy to use it gradually for JS code.

You have a `JsObject` type (which is basically `any`) which lets you write your Nim->JS code in a dynamic way and cast to static types whenever you need to interface with static parts of your program. You can still also define the type signatures of a JS API as well and have a fully type safe experience, but you can do it lazily: just for the functions/types you need.

Basically you can use a JS api in any way you want: from almost fully dynamically to gradually more and more type safe way


Look like this is one of the idea? Build on Crystal programming language with less to code and reduce clutter.

https://www.mint-lang.com/

Mint to Javascript is what any languages to web assembly.

I’m not sure who is comfortable to evaluate Real World code example: https://github.com/mint-lang/mint-realworld

Along with some Crystal shards (LLVM, assembly, C librares) to validate your data or other structure formats is a breeze to work in.




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

Search: