4 ms·
You are right C is a good choice for arduino, but if Python can be used with it, I believe Haskell can also be used in similar way. It will bring many high lev
by dragonsh 7y ago
You are right C is a good choice for arduino, but if Python can be used with it, I believe Haskell can also be used in similar way.
It will bring many high level features like type safety, immutability, runtime error free code and code that is easy to refactor, once the Haskell learning curve is climbed. I like Haskell for its brevity and pseudo code like syntax which really runs like Python with all the necessary safety.
Given Haskell share in the overall eco-system of languages, I don’t expect it to have any significant impact. But this little steps are necessary to move forward Haskell.
I think the biggest stumbling block Haskell need to overcome is to have good documentation like Python. I believe if instead of just features, language research Haskell community needs to put extraordinary efforts in documentation. In spite of Haskell being an old language more than 50% of packages on hackage do not have proper documentation and unless that do not go up to 90% or more Haskell won’t be able to be used effectively by programmers to solve computing problems. We all stands on giants of shoulders and for that to happen need documentation. I believe people underestimated the power of good documentation. It should be twice or thrice more efforts than the language feature development itself.
- jonny383 7y agoGreat points, thanks.
- droithomme 7y ago> if Python can be used with it Which Arduino models are people running Python on? Surely not the most common models?
- StavrosK 7y agoNo, the Uno has nowhere near enough RAM to be useful with Python. However, MicroPython runs beautifully on an ESP8266, which everyone should always use instead of an Uno, in my opinion.
- droithomme 7y agoI run Lua and compile C on my ESP8266's. I'm sure MicroPython could fit there as well. But even MicroPython doesn't run on a Arduino Uno, much less Haskell.
- naasking 7y agoCopilot is an EDSL that generates a C program, so the Haskell runtime is not in the final binary running on the Arduino.
- exdsq 7y agoI recently tried out uLisp which was trending on HN the other day on an Uno. It left me with ~500 bytes of memory and ~1000 bytes of storage. Unfortunately that’s not enough to do many interesting things!
- taeric 7y agoI think the biggest stumbling block is going to be that most of my complexity is in wiring the Arduino to something else. That and you don't even start with a system that can log. This is strictly for Arduino/embedded. For general purpose programming? I don't know.
- ph2082 7y agoMy 2020 goal is to learn Haskell, so beginner here. Is there a way other people can contribute to documentation ? Also how to generate documentation like found in Hoogle ?
- chowells 7y agoThe Haskell documentation generation tool is named haddock. It comes with GHC. I've never run it standalone, so I don't know how involved that is. But I frequently run it with the command "cabal haddock", which takes care of telling it where all your source files are and where to drop the output.
- ph2082 7y agoThank for reply. I'll dig into it. Kind of documentation I am thinking about not only description of what method do, but also include example of 'how to use' it.
- sjakobi 7y agoDoctests are often useful to briefly demonstrate how something works: http://hackage.haskell.org/package/doctest http://hackage.haskell.org/package/doctest They are a bit finicky to set up though. Another good resource: http://yannesposito.com/Scratch/en/blog/Haskell-Tutorials--a-tutorial/ http://yannesposito.com/Scratch/en/blog/Haskell-Tutorials--a...
- sjakobi 7y agoHm, I'm afraid to say that I can't find a good resource on how to write and build docs for Haskell libraries. Maybe that's a tutorial you could write once you've figured it out?! ;) Here are a few links though: * https://ndmitchell.com/downloads/slides-drive-by_haskell_contributions-09_jun_2017.pdf https://ndmitchell.com/downloads/slides-drive-by_haskell_con... * https://haskell-haddock.readthedocs.io/en/latest/markup.html https://haskell-haddock.readthedocs.io/en/latest/markup.html * https://docs.haskellstack.org/en/stable/build_command/#synonyms https://docs.haskellstack.org/en/stable/build_command/#synon... Also, maybe join the #haskell-beginners channel on Slack: https://fpchat-invite.herokuapp.com/ https://fpchat-invite.herokuapp.com/ There are other platforms too though, e.g. https://www.reddit.com/r/haskellquestions/ https://www.reddit.com/r/haskellquestions/, https://discourse.haskell.org/ https://discourse.haskell.org/