4 ms·
When prototyping I prefer dynamic languages because they allow partial/"sloppy" programs, as generally you type code along the happy path first. Personally I t
by mhitza 5y ago
When prototyping I prefer dynamic languages because they allow partial/"sloppy" programs, as generally you type code along the happy path first.
Personally I think it wouldn't hurt if more strongly/statically typed languages took a note from the GHC compiler and had an option like -fdefer-type-errors[1]. That way one can write the sloppy/clever/prototype code, then disable the flag and make the program sturdy in the presence of failure.
[1] https://downloads.haskell.org/~ghc/7.8.1/docs/html/users_guide/defer-type-errors.html https://downloads.haskell.org/~ghc/7.8.1/docs/html/users_gui...
- yakshaving_jgt 5y agoHave you ever leaned on deferring type errors to any significant extent? I’ve been writing Haskell primarily for several years and I tested it out maybe once or twice briefly, but otherwise haven’t found the utility.
- mhitza 5y agoI've only used Haskell to experiment with small, gui, command line, networked projects and within that context I did have those flags enabled (deferer type errors and typed holes both proved helpful). However I've recently switched to chicken scheme for that purpose, not because Haskell isn't good but because of type friction I encounter when trying to use new libraries. It's not a rant at Haskell, as I assume were I to use it on a daily basis it would be a nice fit. But as I'm using it a couple of times a year, it doesn't work out.
- lionsdan 5y ago> small, gui, command line, networked projects ... switched to chicken scheme for that purpose What's your preferred gui library for Chicken for this sort of thing?
- mhitza 5y agoNo GUI library used thus far, but since I'm using Linux as my target machine for these things it's probably going to be Gtk. Might write my own helper library on top of some raw FFI bindings.
- danidiaz 5y agoA recent video about -fdefer-type-errors: https://www.youtube.com/watch?v=hPVjA3TO9OI https://www.youtube.com/watch?v=hPVjA3TO9OI
- cies 5y agoI prefer the dynamic langs for their "compile" (maybe more accurately "interpret") speed. It helps to keep short change-recompile-reload-check loops during development.
- gmfawcett 5y agoI write a lot of Python, and I mostly agree. But some languages have fast compilers (like Nim and Go), or fast compilers and fast interpreters (like OCaml). Last night I was playing with an OCaml Web framework called Dream [1]. The change-recompile-reload loops were fast enough that I never had to wait. (OCaml supports separate / incremental compilation, so the benefits tend to scale on larger projects.) It's not a silver bullet, but it might slightly change your mind about why you like dynamic languages. :) [1] https://aantron.github.io/dream/ https://aantron.github.io/dream/
- cies 5y agoYes I know OCaml compiles fast enough, and lets not forget Elm! Also very fast compiling. But I find those two a little on the less featurefull side. I think by the time typeclasses are in things get slow really fast. It's features like that, that just add a lot of complexity at compile time. Just had a look at Dream. Good to see httpaf AND mirage (microkernel) targets! And it allows coding in Reason/Melange, which I find a very nice syntax especially for server-side code. Thanks for mentioning.