- cross-posted to:
- [email protected]
- cross-posted to:
- [email protected]
This project was interesting. Recently, I’ve been digging into the functional programming paradigm. This is one of my first tries at it. I’ve been doing OOP until recently, but this project really was impressive to me. The whole implementation took about nine hours. Functional programming is much less convoluted. I spent more time programming than deciding on a good name for a certain identifier.
Not only is functional programming more efficient, but I can also see that it’s much less tedious to write automated tests for. I only have to take care of the local scope of the function I am writing a test for; there is no need to deal with the parent’s inherited mess or even any parent’s mere state. I just have to write the test for the function.
I have scraped the Cambridge Dictionary to collect the data.
The project is licensed under MIT at:
As someone else mentioned, you should rewrite this in Haskell (or Purescript or Scala or even Python’s ‘Coconut’) because using vanilla Python for functional programming is like driving Formula 1 with a Toyota Camry.
I will try porting this project to Haskell and Coconut later. I am currently doing a rewrite of this in Nim.
Update: https://github.com/eeriemyxi/povi
Nice. I don’t know much about Nim.
I should also mention: Once Purescript switches over to a Chez Scheme compiled back end, it would be (IMO) the ideal lightweight Haskell, suited to quick terminal apps that you’re looking for.
Thanks for note. Do they currently have that backend?
That aside, you might want to try Nim. It’s pretty cool. It can compile to C and C++, and JS. There have been browser extensions made with it. Heck, it even has an LLVM backend. And the C code it generates it pretty fast on benchmarks. It’s filled with tons of metaprogramming stuff and AST-level macros. And it has this cool thing where it can ignore name casing of identifiers like variables and functions; so
isSome
==is_some
.