guile-user
[Top][All Lists]
Advanced

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

Re: Guile outside of Emacs + Geiser


From: Simon Tournier
Subject: Re: Guile outside of Emacs + Geiser
Date: Fri, 13 Oct 2023 15:38:03 +0200

Hi Christine,

On Wed, 27 Sep 2023 at 15:07, Christine Lemmer-Webber <cwebber@dustycloud.org> 
wrote:

> Has anyone had a "good" experience programming with Guile without using
> Emacs?  If so, what was your development experience like?

At work, I collaborate with people using different setup and different
programming languages.  And it can be tedious or time-consuming to
manage all that, for each; context switching, etc.  Therefore, most of
the times, we ends with: an editor (whatever which one) and a terminal
running some “REPL“.

For sure, it is better if $editor and $repl are able to communicate back
and forth.  However, most of the time, the pleasant experience comes
first from the $repl capacities.

Emacs + Geiser is often a way to have better $repl capacities than what
Guile offers by default.

For example, IPython, GHCi, R, Julia, etc. provides all a better
experience by default: completion, quick access to documentation, etc.

For what it is worth – not much! :-), let trivially compare below, in
order to get a feeling about one basic capacities.

Well, I think the “poor” experience programming with Guile without using
Emacs mainly comes from the lack of Guile REPL features by default.

My 2 cents. :-)

Cheers,
simon

--8<---------------cut here---------------start------------->8---
$ guix shell --pure guile -- guile -q
GNU Guile 3.0.9
Copyright (C) 1995-2023 Free Software Foundation, Inc.

Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'.
This program is free software, and you are welcome to redistribute it
under certain conditions; type `,show c' for details.

Enter `,help' for help.
scheme@(guile-user)> ,help map
Unknown command or group: map
scheme@(guile-user)> ,apropos map
(guile): map    #<procedure map (f l) | (f l1 l2) | (f l1 . rest)>
(guile): hash-map->list #<procedure hash-map->list (_ _)>
(guile): char-set-map   #<procedure char-set-map (_ _)>
(guile): array-map-in-order!    #<procedure array-map-in-order! (_ _ . _)>
(guile): array-map!     #<procedure array-map! (_ _ . _)>
(guile): module-map     #<procedure module-map (proc module)>
(guile): or-map #<procedure or-map (f lst)>
(guile): array-index-map!       #<procedure array-index-map! (_ _)>
(guile): and-map        #<procedure and-map (f lst)>
(guile): string-map     #<procedure string-map (_ _ #:optional _ _)>
(guile): map-in-order   #<procedure map (f l) | (f l1 l2) | (f l1 . rest)>
(guile): string-map!    #<procedure string-map! (_ _ #:optional _ _)>
(ice-9 threads): n-for-each-par-map     #<procedure n-for-each-par-map (n 
s-proc p-proc . arglists)>
(ice-9 threads): par-map        #<procedure 7f8076c96180 at 
ice-9/threads.scm:283:2 (proc . lists)>
(ice-9 threads): n-par-map      #<procedure n-par-map (n proc . arglists)>
scheme@(guile-user)> ,describe map
#f
--8<---------------cut here---------------end--------------->8---

--8<---------------cut here---------------start------------->8---
$ guix shell --pure python python-ipython -- ipython 
Python 3.10.7 (main, Jan  1 1970, 00:00:01) [GCC 11.3.0]
Type 'copyright', 'credits' or 'license' for more information
IPython 8.5.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]: ?map
Init signature: map(self, /, *args, **kwargs)
Docstring:     
map(func, *iterables) --> map object

Make an iterator that computes the function using arguments from
each of the iterables.  Stops when the shortest iterable is exhausted.
Type:           type
Subclasses:     
--8<---------------cut here---------------end--------------->8---

--8<---------------cut here---------------start------------->8---
$ guix shell --pure ghc gcc-toolchain -- ghci
GHCi, version 9.2.5: https://www.haskell.org/ghc/  :? for help
ghci> :? map
 Commands available from the prompt:

[...]

   :doc <name>                 display docs for the given name (experimental)

[...]

   :showi language             show language flags for interactive evaluation

 The User's Guide has more information. An online copy can be found here:

   https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/ghci.html

ghci> :doc map
map :: (a -> b) -> [a] -> [b]   -- Identifier defined in `GHC.Base'
 \(\mathcal{O}(n)\). 'map' @f xs@ is the list obtained by applying @f@ to
 each element of @xs@, i.e.,

 > map f [x1, x2, ..., xn] == [f x1, f x2, ..., f xn]
 > map f [x1, x2, ...] == [f x1, f x2, ...]

 >>> map (+1) [1, 2, 3]
 [2,3,4]
--8<---------------cut here---------------end--------------->8---

--8<---------------cut here---------------start------------->8---
$ guix shell --pure r-minimal coreutils -- R 

R version 4.3.1 (2023-06-16) -- "Beagle Scouts"
Copyright (C) 2023 The R Foundation for Statistical Computing
Platform: x86_64-unknown-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> help(map)
No documentation for 'map' in specified packages and libraries:
you could try '??map'
> ??map
Help files with alias or concept or title matching 'map' using regular
expression matching:

base::Filter            Common Higher-Order Functions in Functional
                        Programming Languages
  Aliases: Map
base::mapply            Apply a Function to Multiple List or Vector
                        Arguments

[...]

Type '?PKG::FOO' to inspect entries 'PKG::FOO', or 'TYPE?PKG::FOO' for
entries like 'PKG::FOO-TYPE'.
--8<---------------cut here---------------end--------------->8---

--8<---------------cut here---------------start------------->8---
$ guix shell --pure julia -- julia
WARNING: failed to select UTF-8 encoding, using ASCII
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.8.3 (2022-11-14)
 _/ |\__'_|_|_|\__'_|  |  
|__/                   |

julia> ?
help?> map
search: map map! mapfoldr mapfoldl mapslices mapreduce asyncmap asyncmap! 
macroexpand @macroexpand @macroexpand1 @atomicswap promote_shape ismutabletype

  map(f, c...) -> collection

  Transform collection c by applying f to each element. For multiple collection 
arguments, apply f elementwise, and stop when when any of them is exhausted.

  See also map!, foreach, mapreduce, mapslices, zip, Iterators.map.

  Examples
  ≡≡≡≡≡≡≡≡≡≡

  julia> map(x -> x * 2, [1, 2, 3])
  3-element Vector{Int64}:
   2
   4
   6
  
  julia> map(+, [1, 2, 3], [10, 20, 30, 400, 5000])
  3-element Vector{Int64}:
   11
   22
   33

  ──────────────────────────────────────────────────────

  map(f, A::AbstractArray...) -> N-array

  When acting on multi-dimensional arrays of the same ndims, they must all have 
the same axes, and the answer will too.

  See also broadcast, which allows mismatched sizes.

  Examples
  ≡≡≡≡≡≡≡≡≡≡

  julia> map(//, [1 2; 3 4], [4 3; 2 1])
  2×2 Matrix{Rational{Int64}}:
   1//4  2//3
   3//2  4//1
  
  julia> map(+, [1 2; 3 4], zeros(2,1))
  ERROR: DimensionMismatch
  
  julia> map(+, [1 2; 3 4], [1,10,100,1000], zeros(3,1))  # iterates until 3rd 
is exhausted
  3-element Vector{Float64}:
     2.0
    13.0
   102.0
--8<---------------cut here---------------end--------------->8---





reply via email to

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