r/functionalprogramming • u/Defection7478 • Apr 30 '24
Question Functional language to replace python
Hi all, I'm looking for some suggestions on a functional language to learn.
Some background: I write a lot of code in c# and python. I write a lot of ci/cd tooling in python or bash, and small to medium sized apps in python, and large apps in c#. For web frontends I use htmx + hyperscript. A very important feature I can use in both of these languages is templating (jinja2 / razor pages).
Presumably, I could try swapping in f# for c#, but I typically only use c# for very large apps, and I'd like something that I can start chewing on at a smaller scale. Something for ci/cd scripts, automation tasks, basic web servers, etc.
What I'm looking for in another language:
- (obviously) the goodness that comes with functional languages, a lot of things have been making their way to c# as I understand, but I figure I might as well get it straight from the source
- a mature templating library
- a mature standard library
- nice to have: static typing system
- simple dependency definition. I like that in both of the above languages I can define my dependencies in a single human-readable file (
requirements.txtorpyproject.toml,*.csprojalthough managing shared dependencies between csproj files is annoying) - simple modularity. I love how easy it is in c# to just add a separate project to a solution to keep things organized. I hate how obtuse it is to maintain the
.slnfile and all the namespaces. It is impossible without an IDE. python doesn't have this issue, but understanding how modules work,__init__.pyand__main__.py, modules vs packages, all that stuff is so annoying. I've been enjoying Rusts module system. - quick and easy startup. from 0 -> helloworld in python is literally
echo "print('hello world')" > hello.py. compared to the saga of booting of vs, creating a new solution, picking a name, ... that is c#.
any suggestions?
View all comments
Show parent comment
3
u/arthurno1 May 01 '24
I always meant to look at OCaml but never had time. The link you posted was my first look at OCaml, and I also wrote my first fizzbuzz ever, though in EmacsLisp:
The pattern matching syntax in OCaml seems cleaner compared to all the backtics in elisp due to the use of macros, while the loop definition is cleaner in elisp. But simple things are simple in all languages.