Ahmed FASIH is a user on octodon.social. You can follow them or interact with them if you have an account anywhere in the fediverse. If you don't, you can sign up here.
Ahmed FASIH @22

Are there languages with static types that compile to the way and compile to or how to or ♯ to .NET CLR?

· Web · 1 · 0

@22 What's the benefit? I generally use static typed languages for system programming, if performance matters. If performance is neglectable I use a programmer-friendly (dynamic typed) language. Why would I expose myself to the hassle of static typing, if the code finally gets translated to something closer to natural language?

@stefan I think many programmers use static types to manage complexity and aid abstraction, and not (mainly) for performance. Consider the TypeScript compiler which strips type information during codegen—types are only used up to compile-time, as programmer aids (maybe there's some optimizations that are enabled but I haven't seen any in my emitted code). Static typing my webapps and data analysis scripts makes refactoring and extending much easier than if dynamic. Does that explain my angle?

@22 the craft of programming is a cosmos of choices. It's always exciting to learn how other developers solve problems.

@22 @stefan I'm not sure about the last claim, at least in my own experience it is not harder or easier to refactor/extend Haskell than Perl. But of course it may very well be different for you.

@wim_v12e @stefan Maybe I'm over-imagining how often this happens but—I'll change the name or type of something in one corner of my code, and suddenly my editor shows me four other places that I need to now update. I love that love that Rust and Elm have for me. It was a stark contrast, having that experience while developing frontend in Elm, versus the much scarier experience of writing the backend in plain JS, where the editor/language dgaf about my problems 😓

@wim_v12e @stefan But… while I have warm memories of Elm and Rust, and am confident that I could dive into those apps now, months after I wrote them, and break all kinds of things before fixing them up again, I do not have warm memories of developing (tiny little algorithms) in Haskell, which felt much less protective and much more, um, sadistic. Haskell didn't inspire the fear I had when developing dynamic languages like JS or Clojure, but it wasn't nice either… probably I'm not doing it right.

@22 @stefan I think that just shows how important personal preferences are when it comes to programming languages. And I guess it also depends a lot on what you already know. And probably also on the purpose or nature of the program you're writing. I write compilers, and for that purpose, programming in Haskell is still "wow, sooo elegant!".
It does in deed not have much in the way of editor support -- or maybe I just don't invest enough in learning what my editor can do.

@22 @stefan Not that I quite understand how a programming language can be protective or sadistic.

@22 @stefan I see. I didn't think about editor support as it is not a property of the language, but of course in practice they belong together. What editor are you using that has these nice features for Rust and Elm?

@wim_v12e @stefan Atom has absolutely superb support for Elm and Rust, and Haskell too! (I used the IHaskell Jupyter kernel with the Hydrogen Atom plugin.) See screenshots at

twitter.com/gratidue/status/81

Yes, I should be clear that in my mind "a language" is the whole experience—Elm and Rust are new and very focused on "DX" (developer experience), but Haskell also gave me great feedback about what was wrong with my code and how to make it better. I will do more Haskell/PureScript someday for sure.

@stefan @22 To clear out the misunderstanding, check the languages cited.

@22 #Idris has codegen backends for a lot of things, it might have one for Python? It has one for whitespace and one for PHP, so.

And you don't easily get any more typed than Idris. (not unless you go to something even more experimental. or maybe use ATS??? but that's for C.)

@grainloom Thanks for reminding me how nice the Idris book looks on my bookshelf 🤣 I guess I was looking for something more pedestrian than Idris but it, and Futhark, are something to keep in mind, as I dream about re-implementing Pandas and Numpy in Rust or OCaml (or any language that compiles to both bare metal and JavaScript).

@22 There's a discussion on r/ProgrammingLanguages on this that's started yesterday. Apparently it's not very common no : reddit.com/r/ProgrammingLangua

@typochon Thank you! I think I knew that the the Python VM's bytecode was fluid but didn't know the AST was as well, so it'd be hard to play the games that TypeScript and Eta play. I'm sure there's also a huge social/serendipity angle (CoffeeScript unleashed so much creativity in the JavaScript space). Thanks for pointing this out! Lazyweb at work :)

@22 If you need it just for fun, there were some efforts to compile PureScript to Python.