From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Blake Shaw Newsgroups: gmane.lisp.guile.user Subject: Re: Shell commands with output to string Date: Thu, 24 Feb 2022 00:48:56 +0700 Message-ID: <877d9lo4mv.fsf@nonconstructivism.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18613"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Zelphir Kaltstahl , Leo Butler , Olivier Dion To: Olivier Dion via General Guile related discussions Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Wed Feb 23 18:50:06 2022 Return-path: Envelope-to: guile-user@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nMvm8-0004ae-IW for guile-user@m.gmane-mx.org; Wed, 23 Feb 2022 18:50:04 +0100 Original-Received: from localhost ([::1]:54148 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nMvm5-0002vC-JN for guile-user@m.gmane-mx.org; Wed, 23 Feb 2022 12:50:02 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:58214) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nMvlV-0002uz-UE for guile-user@gnu.org; Wed, 23 Feb 2022 12:49:26 -0500 Original-Received: from out0.migadu.com ([94.23.1.103]:27647) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nMvlS-0007fb-Lq for guile-user@gnu.org; Wed, 23 Feb 2022 12:49:25 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nonconstructivism.com; s=key1; t=1645638560; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2HVW8LyWVixkiYL9/QaPUdB0Lc+unOrOGahPh3s3EIA=; b=ey96EhZEslk/WSbfxJ7lAh4IMreMnQ9cRiILY9jTavKPSj875OrFZvwgiOzwQ4g4KCK57N cdN3UA02ngo6p7LxRlfWPDWYSMNX2XlbK71kHaRZkSYaLu4aX+hD+louqB/wyqKApYcd9d R8sAiGwxpMmnwF2ia2+6hcgrzq1eKEk= Gcc: nnimap+imap.migadu.de:sent.2022 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: nonconstructivism.com Received-SPF: pass client-ip=94.23.1.103; envelope-from=blake@nonconstructivism.com; helo=out0.migadu.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.io gmane.lisp.guile.user:18133 Archived-At: Olivier Dion via General Guile related discussions writes: > On Wed, 23 Feb 2022, Zelphir Kaltstahl > wrote: > >>> There's ton of missing stuffs in the standard library IMO. On top >>> of my >>> head, filesystem paths manipulation (e.g. path-join) is also one >>> that is >>> probably getting re-invented a lots. >> Nice work Zelphir! >> I actually made something for that, trying to copy mostly the Python >> behavior for os.path.join: >> >> https://notabug.org/ZelphirKaltstahl/guile-fslib >> >> Also available as a GNU Guix package, but not updated in a while on >> Guix. Repository contains more up to date version. > > This is great and should be merged into the standard library of Guile. > Maybe not at it's (I have not read everything), but this would be trully > benifical to all Guile users. > I very much disagree. While it's a large implementation of Scheme, Guile is still Scheme. This is all really simple stuff, and there are many ways to implement these functions. Do the Guile maintainers really need to be burdened by adding trivial functionality to the core library? This is really simple stuff, but it was nevertheless difficult for me to figure out how to do much of it in Guile. Many things that confused me to death ended up being a big "oh, its just that??" Which seems to indicate that the issue is less with the core library lacking functionality and more with the presentation of Guile itself -- the docs, which in December we heard a large number of complaints about. > By keeping this as an external library such as a Guix package, I fear > we're aiming at the 'nodejs syndrome' where everything -- down to > the simplest hello world -- is a package dependency. > >>> I believe that the successful story of Python is not just about its >>> pretty syntax, but also dues to its very large standard library. >> >> I think so too. Although I sometimes have the feeling, that Guile does >> things in a cleaner way, once one figures out how to do them in the >> first place. One thing I really like are the ports. Stuff like >> call-with-output-string. Takes some twisting of the brain, but once >> one gets it, it becomes very useful and elegant. > I agree, there is just a mental leap getting to there. I think with examples based on the "expressive graduation" strategy I outlined in my Guix Days presentation can lessen that load quite a bit, and get folks moving with the goods they need to build their own tools quickly. > Of course Scheme does things better than Python. I wouldn't be hacking > with it if it was not the case ^^. Not only the syntax, but the > programming paradigms. You want FP, you got it. You want OOP, sure. > You prefer procedural, no problem. With Python it's more like just OOP > although there's been progress on the FP side. > >> But yes, Python is very beginner friendly in terms of batteries >> included. Although I think that its syntax feels a bit ad-hoc. As in >> "Oh we want some syntax for X … lets invent this keyword here. or some >> new operators or things like that." > > Yeah they were late to the FP paradigm so they had to invent something > without breaking their OOP echo chamber I guess. IIRC, there's talks > about adding patterns matching which Lisp has since the begining. So > yeah very late to the game of FP. > >> I like Guile syntax (or Scheme in general) much more. However, it is >> difficult to motivate others in a quick demo to learn the language, >> when you cannot take half an hour time to explain, what that for other >> people weird looking syntax is actually really cool. > > I'm not sure if it's only the syntax. Yes we often see "but the > parentheses burn my eyes" but I believe that things are more complex > than that. What I think is difficult is to explain to someone why they > should try to learn new languages in the first place. On top of my > head, people ask themself the following question before learning a new > language: > > - Profit -> Can I easily find a good paying job by developing in > this language? So why are Haskell and Rust some of the most popular languages today besides the "big names" (which I don't its reasonable to imagine a scheme implementation suddenly breaking the mold and acceding to) > > - Field -> Can I develop in my field (e.g. video game, mathematic) > with this language? Is there a community? Yes and yes to those fields, with great tools! (Haunt, recent vector libs) But the community, like many a scheme, is a bit hermetic, and this is based in practices like mailing lists, which I don't think can/will change. We could start a guile-hackers discourse server, or something else more public-facing, but would any of the current users join? So then we are the Day Zero guile crew, and thats gonna be rough to get going. > > - Support -> Can I find solutions to my problems easily online? > Are there libraries for common problems that I could encounter? This! While I think the Guile website is really nice, I think something like a guile wiki which catalogues everything in one place, with a firm organizational strategy from the outset, could be massively beneficial. Finding whats happening in Guile is labyrinth, and I still discover new stuff every couple weeks. The ecosystem is immensely larger than I imagined a few months ago. And also, lots (maybe half?) of of it isn't even in Guix, and I'm talking about recent projects. Meanwhile much of what is in Guix builds but doesn't work. > > - Prototyping -> How easy is it for me to scratch an idea with > this language? This too! I think that this is what the Guile-Cookbook discussion is hoping to solve > > and probably other reasons. Now, try to explain to someone that does > web developpement in Javascript or Python that Scheme is far more > supperior. That person would just ask: Does Guile has support for > MongoDB? And proceed to dismiss it. > > Of course, some hackers like me just like to learn new stuffs. It took > me about an one hour into Scheme course of the MIT on youtube to > understand that I just found the holy grail of programming language. > And yet, I have not find the answer to the `profit` question. I agree with much of what you're saying, but I disagree with the idea of Guile becoming a "batteries included" Scheme loaded with conveniences. Andy et al have far more important issues to worry about. On the other hand, I would be down to organize and contribute to an effort to create a battery pack, based on a study of the utilities offered by Python. We saw that Guix is picking up in production use and such a library would be very helpful (and I think Tropin's RDE might be trying to accomplish something like this) There is the existing Guile-lib, which seems to have intended something similar in the past. Let me briefly comment on its TOC: > (apicheck) > Describe and verify library programming interfaces So it tells you what a library does? Could be cool, but not what I'm looking for as a newcomer. > (config load) > Loading configuration files of what? where am I getting these configuration files from? > (container async-queue) > A thread-safe message queue Sounds like great, powerful tools... if you have already adjusted to hacking guile > (container nodal-tree) > A tree consisting of nodes with attributes Ditto. > (container delay-tree) > A nodal tree with lazily evaluated fields Ditto. > (debugging assert) > Helpful assert macro This is something I think newcomers should be exposed to early on, > (debugging time) > A simple macro to time the execution of an expression Ditto. >(graph topological-sort) > Routines to perform topological sorts if you came for topological sort, guiles got you covered >(htmlprag) > Neil Van Dyke's permissive ("pragmatic") HTML parser nice, super useful >(io string) > SLIB's IO routines dealing with strings Ditto >(logging logger) > A flexible logging system every guix dream, yet I doubt most know this is here >(logging port-log) > A logger that outputs to a port ditto >(logging rotating-log) > A logger that rotates its output files ditto >(match-bind) > Nifty and concise regular expression routines I wasn looking for such a thing weeks ago... another reason a wiki or some other quick and simple to edit archive of everything in guile would be nice >(math minima) > A golden-section minimum finder sicp vibes over here >(math primes) > Functions related to prime numbers and factorization ditto >(os process) > Spawning processes and capturing their output where has this been my whole guile experience?!? too late, I made one myself (: > (scheme documentation) > Macros to define different kinds of variables with documentation this sounds great! didn't catch it my first few glances through >(scheme kwargs) > Defining functions with flexible keyword arguments how is that different from existing kwargs? >(search basic) > Classic search functions useful but also the kind of thing one typically implements to learn a lang >(string completion) > Building blocks for tab completion thats cool! but why didnt they just go ahead and... complete it? >(string soundex) > The SOUNDEX string categorization algorithm no idea what that is >(string transform) > Beyond SRFI-13 would be nice to have subtext say a bit more >(string wrap) > A versatile string formatter why do I need more than (format ...)? >(term ansi-color) > Generate ANSI color escape sequences nice! >(unit-test) > A JUnit-style unit testing framework nice As you can see, much of this is stuff that won't come in handy until you already feel compfortable with guile. In fact, some of it will just seem like weird alien technology until you've spent some time with scheme. So while I agree that an organized effort to roll-out a battery pack would be hugely beneficial, I think efforts to make the existing knowledge base of guile more accessible/easier to navigate/less messy would get folks moving with the large ecosystem faster, speaking/thinking in guile, and thus would be more rewarding than porting conventional idioms into a box that makes guile more familiar for python and JS developers. -- “In girum imus nocte et consumimur igni”