2 ms·
Applaud the effort, but it's weird seeing python (and es6) living more and more on top of native static analyzers/transpilers .. at which point will they become
by agumonkey 2y ago
Applaud the effort, but it's weird seeing python (and es6) living more and more on top of native static analyzers/transpilers .. at which point will they become a frontend syntax for ocaml or julia ? :p
- snovymgodym 2y ago> at which point will they become a frontend syntax for ocaml or julia ? At no point. What probably will happen is that both the JS and the Python reference implementations will have first class support for type systems which will allow them to generate optimized native code for the typed sections of your code while keeping the untyped sections as bytecode or as higher level compiled code (i.e. a bunch of runtime function calls dealing with tagged union objects).
- zem 2y agoas someone working in this space, the idea is that most python code is implicitly statically typed anyway, in that your functions are only ever meant to be called with specific types for their arguments, and only return objects of a specific type. all that static type analysis does is to make that explicit via type annotations, and then verify that you have indeed used types correctly in your code. static compilers then say "well, if we know the static types of everything in this function, we can compile it to more efficient code, skipping all the dynamic lookups and runtime type checks and dispatching". typically there is an escape hatch that will fall back to regular python behaviour if your code is indeed dynamic (e.g. reflecting on a database schema to generate models at runtime), but losing the benefits of static analysis and optimisation. if you would like to read more on the topic the keyword is "gradual typing"; in particular you might be interested in looking up stanza, a language designed around gradual types from the outset rather than retrofitting them on top of a dynamically typed language.
- agumonkey 2y agothis https://lbstanza.org/index.html https://lbstanza.org/index.html ? what are places to discuss gradual typing these days ? I stopped looking a few years ago (after clojure and scheme started projects on that topic)
- zem 2y agoyep, that's the one! I don't know if there's any one place to discuss gradual typing. typed racket is probably the language with the largest academic community behind it, so the racket discourse would likely have some good discussions, though I haven't been keeping up with it recently.
- agumonkey 2y agothanks a lot, i'll tag along the racketeers then, i was mostly curious to know if the field became wider, sometimes I get too focused on lisps and forget that other people are doing PLT
- bbkane 2y agoYou might also like Roc. I don't completely understand how but it does type inference over the whole program - so you can use a loose type that "tightens" when you use it in a different way. Maybe that's a bad explanation. I think the following video is the one that demonstrates this https://m.youtube.com/watch?v=7R204VUlzGc https://m.youtube.com/watch?v=7R204VUlzGc
- pjc50 2y agoPeople aren't going to learn ocaml nor julia, nor can you easily call a python package from them nor run them in the browser against the DOM. Javascript has a uniquely privileged position as the native browser language, and a couple of decades of effort has been expended on making it usable.