4 ms·
I started trying to learn FP this last year. I started trying to understand Clojure and then watched the SCIP lectures and worked through the problems in the bo
by chinpokomon 11y ago
I started trying to learn FP this last year. I started trying to understand Clojure and then watched the SCIP lectures and worked through the problems in the book with the class. At this point, I think I _get_ LISP.
What I don't get is how I build an application using LISP. From the article, the todo list wasn't really a list, it was a todo function call that took tasks as arguments unless there was a missing quote. That seems to be a point missed by the author. With the macro, he was able to format the tasks themselves, but after applying the macro you'd still be left with a todo function and done arguments. I don't see where that gets called.
LISP seems to work best as an evolving environment. I can see where a LISP machine could be powerful for defining your own DSL as you try to parse through some data. I also saw the power in how you abstract the problem, really taking advantage of code reuse in a powerful way. I don't see how you write an application.
Is there some resource or there that can help me bridge this gap? I feel like this is like trying to use Mathematica to write a program. Mathematica is great for calculating as LISP seems great for processing data, but I'm stuck in seeing how I can utilize it for anything beyond a contained process. At least with Clojure or F#, I could still use Java or C# for the entry point and call into an FP block of code for calculations and processing. How would I do something with Haskell or Scheme?
- karamazov 11y agoEventually, some of your code will make a call to IO: reading from or writing to disk, responding to a web query, updating a DB, drawing something on the screen, etc, etc. For example, you could put up a web server written entirely in Scheme or some other dialect. This would process and respond to queries entirely in Scheme, including some sort of engine for generating and serving html. Hacker News itself is an example of this: it's written in a lisp dialect called Arc. Incidentally, Haskell is functional, but it isn't a lisp.
- chinpokomon 11y agoYeah, I know that about Haskell, but my question was about FP in general. I didn't know that about HN. I'll just have to keep looking I guess.
- codygman 11y ago> I could still use Java or C# for the entry point and call into an FP block of code for calculations and processing. If you post an example of this to Github (or similar) I can help you replace the Java or C# entry point with a Clojure or F# entry point.