Remix.run Logo
h4ch1 3 days ago

Tangential, but I've been wanting to dive back into FP for quite sometime; for context I used Haskell at a payments corp ~10 years back, working mostly with Typescript, Zig and Nim for the past couple of years, realizing I am basically trying to do FP in most of these languages.

Is Racket a good language to pick up and re-learn my concepts + implement some tools? Or are there some other languages that would be better to both brush up and learn the syntax of, I do not want to fight the syntax but rather express functions as seamlessly as I can.

skrishnamurthi 3 days ago | parent | next [-]

Racket is a rich and powerful language, but it is also designed with certain specific ideas in mind. You can learn more about the "zen" of Racket here:

https://cs.brown.edu/~sk/Publications/Papers/Published/fffkb...

That might help you decide whether Racket will help you with what you're trying to brush up on.

h4ch1 3 days ago | parent [-]

Thank you for the response professor, really appreciate it from one of the creators of the language itself;

I did give your document a read and my (naive) understanding is you basically create DSLs for each sub-part of the problem you're trying to solve?

>A LOP-based software system consists of multiple, cooperating components, each written in domain-specific languages.

and

>cooperating multi-lingual components must respect the invariants that each participating language establishes.

So basically you're enforcing rules/checks at the language level rather than compile time?

How would you recommend a complete novice attain this sort of state of mind/thought process while working in this language? Because my thoughts go simply to creating types and enforcing type-checking coupled with pure functions to avoid successful-fail at runtime programs.

Also how would one navigate the complexity of multiple abstractions while debugging?

The paper also mentions a web-server language (footnote 27), if I use racket will I be productive "out of the box" or is the recommended path to take is writing a web server language first.

Thank you again for taking the time to respond, and please do forgive me for these naive questions.

skrishnamurthi 3 days ago | parent [-]

These are great questions!

Yes, what you're describing is the "extreme" version of LOP. Of course you don't have to do it that aggressively to get working code.

Two references I like to point to:

https://www.hashcollision.org/brainfudge/

https://beautifulracket.com/

They will give you a sense of how one uses LOP productively.

You do not need to write a "web server language"! To the contrary, the Web server provides several languages to give you a trade-off between ease and power in writing server-side Web applications. So you can just write regular Racket code and serve it through the server. The server also comes with some really neat, powerful primitives (orthogonal to LOP) — like `send/suspend` — that make it much easier to write server-based code.

h4ch1 3 days ago | parent [-]

Understood. Will dive deeper into Racket to get a proper understanding since it's created an itch because I still don't understand it :)

Even if I don't go fully into it as a production language, hopefully it'll open some avenues of thought that I do not yet possess.

Thank you for taking the time to respond, have a great day!

humanfromearth9 2 days ago | parent | prev [-]

You could try Purescript, with the book¹ written by Charles Scalfani.

It focuses exclusively on FP and does not deviate from it.

¹ https://leanpub.com/fp-made-easier/