[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: "Missing" libraries/concepts found in other languages/ecosystems?

From: Chris Vine
Subject: Re: "Missing" libraries/concepts found in other languages/ecosystems?
Date: Wed, 8 Jul 2020 12:29:38 +0100

On Wed, 08 Jul 2020 09:38:28 +0200
Simen Endsjø <> wrote:
> Hi, I'm new to scheme/lisp, so I'm trying to find out how to do 
> things the "lisp
> way". On the other hand, I like things from other ecosystems too, 
> and I'm having
> problems finding this for Guile. It might be because there's no 
> need for it/I'm
> terrible at searching/nobody had the time yet, or something else.
> I've been trying to find implementations for 
> without any
> luck. And I'm unable to find implementation of FP concepts as 
> found in Haskell
> and other languages. Functor, Monad, lenses (and other helpers for 
> working with
> immutable data).
> Does things like this exists, or is it better to use something 
> else?

I should go with where the particular language leads you.  Scheme has:

1.  Dynamic typing rather than static typing, so that amongst other
    things functions can take and return multiple different types;

2.  Mutable variable bindings (set! and so on);

3.  Mutable objects (mutable fields in records, setcar! and setcdr! for
    lists, and so on);

4.  Exceptions and continuation objects.

5.  Macros which operate at compile time on s-expressions.

Functors (mappables) abound in scheme, notably in the form of lists,
and scheme has mandatory tail call elimination which encourages
some immutable techniques such as iterative recursion.  However I don't
think that in practice monadic uses, such as the state monad or option
or result monad, are really of much value in scheme, apart from for
pedagogical purposes (flatmap though can be very useful).  I have
written scheme code which for various reasons used a result type
indicating success and failure instead of exceptions, with associated
bind (and map), but I think that for that case using exceptions is
generally easier and more natural, and how guile itself operates.

If you want to see where scheme can take you, you might want to google
for the "Structure and Interpretation of Computer Programs" (SICP):
still a classic.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]