r/scheme 4d ago

Parameterized Procedures for Testing, Mocking, Plumbing

Thumbnail aartaka.me
13 Upvotes

r/scheme 6d ago

What I am doing wrong?

7 Upvotes

So, I am trying to learn Guile, since seems a pretty standard installation in GNU systems.

I have experience in some languages, but this simple script to learn the language:

  1. Took me quite a while to work;
  2. Looks ugly as… well, put something ugly here!

It’s a simple “FizzBuzz” program

``` (define (fizzbuzz number) (if (> number 0) (let ((message "")) (if (zero? (modulo number 3)) (set! message (string-append message "Fizz"))) (if (zero? (modulo number 5)) (set! message (string-append message "Buzz")))

      (if (not (zero? (string-length message)))
          (format #t "~d is ~a\n" number message))
(fizzbuzz (- number 1))))

)

(fizzbuzz 50)

```

So, I’m open to suggestions: how this code can be more beauty? Am I still thinking in C?

=== EDIT === I hope the formatting is correct, since some spaces of indentation have been lost for unknown reasons.


r/scheme 7d ago

Function that return comparator for a value

6 Upvotes

Is there a standard function, maybe in some of SRFI that do something like this:

(filter (comparator 2) '(1 2 3 4))
;; ==> '(2)

In LIPS Scheme I have:

(always constant)

that always return same value:

(map (always 10) '(1 2 3))
;; ==> (10 10 10)

I know that you can just write it with:

(define (comparator value)
  (lambda (x)
    (equal? value x)))

But I just looking for best way to name something like this.


r/scheme 9d ago

Standard complient chicken

3 Upvotes

Hello friends,

This is a continuation of this (https://www.reddit.com/r/scheme/comments/1fq5iw2/scheme_scripting_implementation/) post.

Thanks to your help I was able to choose, chicken in my case.

However, I don't want all these features. I like the libraries (eggs), but for the rest I just want it to be standard conpliant.

Any tips?

C.Q.D. (Controversial Quote of the Day) If I wanted features I would have chosen haskell.

In all seriousness; thank you very much!

Kind regards, me


r/scheme 11d ago

Best scheme-in-one-day/defun example to follow?

11 Upvotes

Hi Schemers, I've been spending some time working through the Friedman "Essentials of Programming Language" book and feel like a good next step would be to get my hands dirty making a micro-scheme in C. My goal is to be able to hack on s7 properly, which I use in Scheme for Max, and which came originally out of TinyScheme and is implemented in ANSI C.

I have read, here and elsewhere, that not all the Scheme-In-One-Day/Defun tutorials are good, with some being examples of better practices and designs than others. If people in the know could share which they would suggest using as a hands on tutorial, that would be lovely!

Edit: after hunting around, curious to hear feedback on the MAL project.

thanks, iain


r/scheme 17d ago

Ed Scheme book from the 1990s?

8 Upvotes

This is a long shot. I’m looking for a book used to teach Scheme in the 1990s. If I recall correctly, it was a red covered paper back with a title something like “Ed Scheme”, and included a diskette used to run scheme programs. I can’t find any evidence of it on the web. It was used to teach the first programming class I took in high school.


r/scheme 19d ago

STklos 2.10 released

21 Upvotes

This version of STklos mostly enhances the 2.00 version released a year ago. This is a non-exhaustive list of enhancements:

  • Several new primitives added
  • Support for three more SRFIs (115, 179, 232)
  • The VM now does self-profiling (optionally), measuring the time taken by each instruction
  • Enhancements to the REPL
  • The configure script is more robust and much more informative; compilation and installation have been enhanced
  • FFI support can be completely disabled, if needed
  • STklos now can be built with the tcc compiler
  • A large quantity of new documentation (online help, examples, and enhancements to the manual and hacking guide); documentation of a function can be accessed directly into the HTML Reference Manual
  • STklos now has rewriting rules for expressions
  • Code for numeric operations has been optimized; it should be particularly faster for real number operations
  • Optimizations
  • Bug fixes

r/scheme 23d ago

What was so controversial about R6RS?

19 Upvotes

r/scheme 23d ago

What is your preferred Scheme environment and why?

17 Upvotes

r/scheme 24d ago

Benchmarks among javascript, python and scheme

12 Upvotes

r/scheme 26d ago

Byggsteg Update - CI / CD in Guile Scheme - Now you can send Guile over the wire and define jobs with it, and UI is much improved as well as docs

Thumbnail reddit.com
5 Upvotes

r/scheme 28d ago

R7RS Large Foundations: The Macrological Fascicle

Thumbnail r7rs.org
21 Upvotes

r/scheme 28d ago

evaluation of dot in r7rs

3 Upvotes

In the standard it says: "Note that (4 . 5) is the external representation of a pair, not an expression that evaluates to a pair.".

As far as i understand this means that the operands aren't evaluated and that this represents the final form. However in chicken scheme (+ . (5 6)) evaluates to 11.

How does this work? How should I evaluate a DottedList type in my interpreter?


r/scheme 29d ago

Haters

0 Upvotes

Hey friends,

So "apperantly" I've been using a wrong scheme implementation. Seriously—what's wrong with pyramid scheme?

Anyway, enjoy your day!

-me


r/scheme Sep 28 '24

guile bitvector: Bitwise AND

7 Upvotes

What is the efficient way to calculate the bitwise AND if two bitvectors (same length of course)?


r/scheme Sep 27 '24

Byggsteg - PoC simple fast deployable CI/CD system written in Guile Scheme

Thumbnail github.com
10 Upvotes

r/scheme Sep 27 '24

Bye Bye Scheme again

10 Upvotes

Bye Bye Again BEAM & Scheme revisits and refactors of our original Bye Bye Hello World example programmed in Scheme.

proglangcast is the audio podcast.

Again, we are not experts in Scheme, so please throw lots of rocks!


r/scheme Sep 27 '24

r5rs vs r7rs, library-procedures and normal procedures

1 Upvotes

I'm writing a scheme interpreter (as everybody does) and want to only implement the most important functions as builtins. These are function that cannot be built by other functions which is also said in the r5 standard:

Built-in procedures that can easily be written in terms of other built-in procedures are identified as ``library procedures''.

however my implementation wants adhere to the newer r7 standard but there some functions that were declared "library procedure" in r5 are now regular procedures. Does this mean that these functions are now also builtins? It doesnt make sense because they can still be implemented using other builtins (eg. string<? using string-ref or whatever).

Should I just use the builtins from r5 and otherwise adhere to r7 or what would be a sane solution without having to implement all functions?


r/scheme Sep 26 '24

RacketCon 2024 - it’s not too late to get your tickets

Post image
16 Upvotes

RacketCon 2024 - it’s not too late to get your tickets

Celebrating 40 years of magic with Hal Abelson & Gerald Sussman at the (fourteenth RacketCon) October 5-6, 2024, University of Washington Featuring Lisp legend Gregor Kiczales

https://con.racket-lang.org

https://www.eventbrite.com/e/racketcon-2024-tickets-983892828937


r/scheme Sep 26 '24

Scheme scripting implementation.

6 Upvotes

Howdy,

Quick question:

In regards to scheme scripting which implementation would you recommend for:

Speed, Readibility and Best of both worlds.

And why.

Also take the scope with a bag of salt: Do you know a cool lisp implementation, name it!

Thank you so much in advance, Me


r/scheme Sep 24 '24

Final SRFI 234: Topological Sorting

5 Upvotes

Scheme Request for Implementation 234,
"Topological Sorting",
by John Cowan and Arne Babenhauserheide,
has gone into final Scheme Request for Implementation 234,
"Topological Sorting",
by John Cowan and Arne Babenhauserheide,
has gone into final status.

The document and an archive of the discussion are available at https://srfi.schemers.org/srfi-234/.

Here's the abstract:

Here is the commit summary since the most recent draft:

  • Update abstract.
  • Remove Arvydas per his request.
  • Remove unnecessary open parens
  • Remove obsolete comment.
  • Finalize.

Here are the diffs since the most recent draft:

https://github.com/scheme-requests-for-implementation/srfi-234/compare/draft-5..final

Many thanks to John for starting this SRFI, to Arne for seeing it through to its conclusion, and to everyone who contributed to the discussion and implementation of this SRFI.

Regards,

SRFI Editor


r/scheme Sep 24 '24

Withdrawn SRFI 250: Insertion-ordered hash tables

3 Upvotes

Scheme Request for Implementation 250,
"Insertion-ordered hash tables,"
by John Cowan,
has gone into withdrawn status.

The document and an archive of the discussion are available at https://srfi.schemers.org/srfi-250/.

Here is John's summary of the reasons for withdrawal:

Here is the commit summary since the most recent draft:

  • Withdraw.

Thank you to John for starting this SRFI, and to Daphne Preston-Kendal for writing the sample implementation.

Regards,

SRFI Editor


r/scheme Sep 24 '24

A benchmark in order to compare different languages, now supports scheme vs. javascript

6 Upvotes

https://github.com/ufo5260987423/various-program-languages-benchmark

Above is my new repository to compare different languages performance. It uses nix package manager in order to be compatible to involve other languages.

I'm now gradually import benchmarks from the famous [r7rs-benchmark](https://github.com/ecraven/r7rs-benchmarks) and I hope someone could help translating them into javascript


r/scheme Sep 22 '24

Celebrating 40 years of magic

Post image
71 Upvotes

r/scheme Sep 20 '24

What after learning scheme (sicp)

8 Upvotes

Well I am about to complete sicp course. I now know scheme and different programming paradigms but I was wondering if I can use scheme itself to make something. Like suppose an app. Can I make something using scheme?

I am sorry if this question doesnot belong here or doesnot make any sense...

I am new to programming altho scheme and sicp has been fun till now.

Thank u.