From: Simon Tournier <zimon.toutoune@gmail.com>
To: Christine Lemmer-Webber <cwebber@dustycloud.org>, guile-user@gnu.org
Subject: Re: Guile outside of Emacs + Geiser
Date: Fri, 13 Oct 2023 15:38:03 +0200 [thread overview]
Message-ID: <87ttquskw4.fsf@gmail.com> (raw)
In-Reply-To: <87jzsbv387.fsf@dustycloud.org>
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---
next prev parent reply other threads:[~2023-10-13 13:38 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-27 19:07 Guile outside of Emacs + Geiser Christine Lemmer-Webber
2023-09-27 19:47 ` Ricardo G. Herdt
2023-09-30 12:42 ` Christine Lemmer-Webber
2023-09-30 17:24 ` defn(life()) via General Guile related discussions
2023-09-27 19:48 ` Luis Felipe
2023-09-28 7:20 ` tomas
2023-09-28 12:01 ` Mike Gran
2023-09-28 12:23 ` Maxime Devos
2023-10-13 13:38 ` Simon Tournier [this message]
2023-10-16 19:41 ` Christine Lemmer-Webber
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87ttquskw4.fsf@gmail.com \
--to=zimon.toutoune@gmail.com \
--cc=cwebber@dustycloud.org \
--cc=guile-user@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).